android.widget.ViewFlipper Java Examples

The following examples show how to use android.widget.ViewFlipper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecentActivity.java    From document-viewer with GNU General Public License v3.0 6 votes vote down vote up
void showLibrary(final LibraryAdapter libraryAdapter, final RecentAdapter recentAdapter) {
    if (recentBooksView == null) {
        recentBooksView = new RecentBooksView(getController(), recentAdapter);
        registerForContextMenu(recentBooksView);
    }
    if (libraryView == null) {
        libraryView = new LibraryView(getController(), libraryAdapter);
        registerForContextMenu(libraryView);
    }

    final ViewFlipper vf = getViewflipper();
    vf.removeAllViews();
    vf.addView(recentBooksView, VIEW_RECENT);
    vf.addView(libraryView, VIEW_LIBRARY);

    if (recentAdapter.getCount() == 0) {
        changeLibraryView(VIEW_LIBRARY);
    }
}
 
Example #2
Source File: MainActivity.java    From wear-notify-for-reddit with Apache License 2.0 6 votes vote down vote up
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.main_flipper_benefits);
    flipper.startFlipping();

    registerReceiver(mForceFinishMainActivity,
            new IntentFilter(getString(R.string.force_finish_main_activity)));
    mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
            .addApi(Wearable.API)
            .build();

    mGoogleApiClient.connect();
}
 
Example #3
Source File: AddNewGroup.java    From XERUNG with Apache License 2.0 6 votes vote down vote up
private void findViewIds(){
	mLayback = (RelativeLayout)findViewById(R.id.layBack);
	mTxtHead = (TextView)findViewById(R.id.txtHead);
	mTxtHead.setTypeface(android);
	mTxtNote = (TextView)findViewById(R.id.txtNote);
	mTxtNote.setTypeface(roboto);
	mBtnNext = (ButtonFlat)findViewById(R.id.btnNextOk);
	mBtnDone = (TextView)findViewById(R.id.btnDone);
	mBtnDone.setTypeface(roboto);
	mEdtGroupName = (MaterialEditText)findViewById(R.id.edtGroupName);
	mEdtGroupName.setTypeface(roboto);
	mEdtTagLine = (MaterialEditText)findViewById(R.id.edtTagName);
	mEdtTagLine.setTypeface(roboto);
	mEdtGroupDesc = (MaterialEditText)findViewById(R.id.edtDescName);
	mEdtGroupDesc.setTypeface(roboto);
	mImgGroupPhoto = (CircleImageView)findViewById(R.id.imgProfilePicSet);
	mEdtSerachContact = (MaterialEditText)findViewById(R.id.edtContactSearch);
	mEdtSerachContact.setTypeface(roboto);
	mListSearch = (ListView)findViewById(R.id.lvContactListSearch);
	vw1 = (ViewFlipper)findViewById(R.id.vw1);
	vw2 = (ViewFlipper)findViewById(R.id.vw2);
	txtNoData = (TextView)findViewById(R.id.txtNoSearchresult);
	txtNoData.setTypeface(roboto);
}
 
Example #4
Source File: AddNewGroup.java    From XERUNG with Apache License 2.0 6 votes vote down vote up
private void findViewIds(){
	mLayback = (RelativeLayout)findViewById(R.id.layBack);
	mTxtHead = (TextView)findViewById(R.id.txtHead);
	mTxtHead.setTypeface(android);
	mTxtNote = (TextView)findViewById(R.id.txtNote);
	mTxtNote.setTypeface(roboto);
	mBtnNext = (ButtonFlat)findViewById(R.id.btnNextOk);
	mBtnDone = (TextView)findViewById(R.id.btnDone);
	mBtnDone.setTypeface(roboto);
	mEdtGroupName = (MaterialEditText)findViewById(R.id.edtGroupName);
	mEdtGroupName.setTypeface(roboto);
	mEdtTagLine = (MaterialEditText)findViewById(R.id.edtTagName);
	mEdtTagLine.setTypeface(roboto);
	mEdtGroupDesc = (MaterialEditText)findViewById(R.id.edtDescName);
	mEdtGroupDesc.setTypeface(roboto);
	mImgGroupPhoto = (CircleImageView)findViewById(R.id.imgProfilePicSet);
	mEdtSerachContact = (MaterialEditText)findViewById(R.id.edtContactSearch);
	mEdtSerachContact.setTypeface(roboto);
	mListSearch = (ListView)findViewById(R.id.lvContactListSearch);
	vw1 = (ViewFlipper)findViewById(R.id.vw1);
	vw2 = (ViewFlipper)findViewById(R.id.vw2);
	txtNoData = (TextView)findViewById(R.id.txtNoSearchresult);
	txtNoData.setTypeface(roboto);
}
 
Example #5
Source File: EmoticonGridFragment.java    From EmoticonGIFKeyboard with Apache License 2.0 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ViewFlipper mainViewFlipper = view.findViewById(R.id.recent_emoticon_flipper);

    List<Emoticon> emoticonList = getEmoticonsList(getArguments().getInt(ARG_CATEGORY_ID, -1));

    if (emoticonList.isEmpty()) {
        mainViewFlipper.setDisplayedChild(1);
    } else {
        mainViewFlipper.setDisplayedChild(0);

        GridView emoticonGrid = view.findViewById(R.id.emoticon_list_grid);
        emoticonGrid.setNumColumns(getResources().getInteger(R.integer.emoticon_recycler_view_span_size));
        emoticonGrid.setOnItemClickListener(this);

        //Bind the adapter
        //noinspection WrongConstant
        EmoticonGridAdapter emoticonGridAdapter = new EmoticonGridAdapter(getActivity(),
                mEmoticonProvider, emoticonList);
        emoticonGrid.setAdapter(emoticonGridAdapter);
    }
}
 
Example #6
Source File: Ps3KeypadUiControls.java    From BluetoothHidEmu with Apache License 2.0 6 votes vote down vote up
/**
 * setupTabs()
 */
private void setupTabs() {
    mTabsRadioGroup = (RadioGroup) mControlsLayout.findViewById(R.id.NavRadioGroup);
    mViewFlipper = (ViewFlipper) mControlsLayout.findViewById(R.id.MainViewFlipper);
    
    mTabsRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            
            switch (checkedId) {
            case R.id.TouchpadRadioButton:
                mViewFlipper.setDisplayedChild(0);
                break;
            case R.id.NavKeysRadioButton:
                mViewFlipper.setDisplayedChild(1);
                break;
            }
            
        }
    });
}
 
Example #7
Source File: GenericUiControls.java    From BluetoothHidEmu with Apache License 2.0 6 votes vote down vote up
/**
 * setupTabs()
 */
private void setupTabs() {
    mTabsRadioGroup = (RadioGroup) mControlsLayout.findViewById(R.id.NavRadioGroup);
    mGenericHidViewFlipper = (ViewFlipper) mControlsLayout.findViewById(R.id.MainViewFlipper);
    
    mTabsRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            
            switch (checkedId) {
            case R.id.TouchpadRadioButton:
                mGenericHidViewFlipper.setDisplayedChild(0);
                break;
            case R.id.NavKeysRadioButton:
                mGenericHidViewFlipper.setDisplayedChild(1);
                break;
            case R.id.MediaKeysRadioButton:
                mGenericHidViewFlipper.setDisplayedChild(2);
                break;
            }
            
        }
    });
}
 
Example #8
Source File: SwipeTest.java    From codeexamples-android with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);
	viewFlipper = (ViewFlipper) findViewById(R.id.flipper);
	slideLeftIn = AnimationUtils.loadAnimation(this, R.anim.slide_left_in);
	slideLeftOut = AnimationUtils
			.loadAnimation(this, R.anim.slide_left_out);
	slideRightIn = AnimationUtils
			.loadAnimation(this, R.anim.slide_right_in);
	slideRightOut = AnimationUtils.loadAnimation(this,
			R.anim.slide_right_out);

	gestureDetector = new GestureDetector(new MyGestureDetector());
	gestureListener = new View.OnTouchListener() {
		public boolean onTouch(View v, MotionEvent event) {
			if (gestureDetector.onTouchEvent(event)) {
				return true;
			}
			return false;
		}
	};
}
 
Example #9
Source File: AlarmDismissActivity.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
protected void initViews(Context context)
{
    alarmTitle = (TextView)findViewById(R.id.txt_alarm_label);
    alarmSubtitle = (TextView)findViewById(R.id.txt_alarm_label2);
    alarmText = (TextView)findViewById(R.id.txt_alarm_time);
    clockText = (TextView)findViewById(R.id.txt_clock_time);
    offsetText = (TextView)findViewById(R.id.txt_alarm_offset);
    infoText = (TextView)findViewById(R.id.txt_snooze);

    icon = (ViewFlipper)findViewById(R.id.icon_alarm);
    iconSounding = (ImageView)findViewById(R.id.icon_alarm_sounding);
    iconSnoozing = (ImageView)findViewById(R.id.icon_alarm_snooze);

    dismissButton = (Button) findViewById(R.id.btn_dismiss);
    dismissButton.setOnClickListener(onDismissClicked);

    snoozeButton = (Button) findViewById(R.id.btn_snooze);
    snoozeButton.setOnClickListener(onSnoozeClicked);

    buttons = new Button[] {snoozeButton, dismissButton};
    labels = new TextView[] {alarmSubtitle, offsetText};
    if (Build.VERSION.SDK_INT >= 12) {
        stopAnimateColors(labels, buttons);
    }
}
 
Example #10
Source File: LockScreenActivity.java    From CameraV with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_lock_screen);
   
    mViewCreatePassphrase = findViewById(R.id.llCreatePassphrase);
    mViewEnterPassphrase = findViewById(R.id.llEnterPassphrase);

    mEnterPassphrase = (EditText) findViewById(R.id.editEnterPassphrase);
    mNewPassphrase = (EditText) findViewById(R.id.editNewPassphrase);
    mConfirmNewPassphrase = (EditText) findViewById(R.id.editConfirmNewPassphrase);
    ViewFlipper vf = (ViewFlipper) findViewById(R.id.viewFlipper1);
    LinearLayout flipView1 = (LinearLayout) findViewById(R.id.flipView1);
    LinearLayout flipView2 = (LinearLayout) findViewById(R.id.flipView2);

    mSlider = new TwoViewSlider(vf, flipView1, flipView2, mNewPassphrase, mConfirmNewPassphrase);
    
    mCacheWord = new CacheWordHandler(this, this);
    mCacheWord.connectToService(); 
}
 
Example #11
Source File: BaseGameActivity.java    From gdk-charades-sample with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_gameplay);
    setGesturesEnabled(true);

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    mGestureDetector = new GestureDetector(this).setBaseListener(mBaseListener);
    mPhraseFlipper = (ViewFlipper) findViewById(R.id.phrase_flipper);
    mGameState = (TextView) findViewById(R.id.game_state);
    mTugRightAnimation = AnimationUtils.loadAnimation(this, R.anim.tug_right);

    mModel = createCharadesModel();
    updateDisplay();
}
 
Example #12
Source File: BrowserActivity.java    From document-viewer with GNU General Public License v3.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see org.emdev.ui.AbstractActionActivity#onCreateImpl(android.os.Bundle)
 */
@Override
protected void onCreateImpl(final Bundle savedInstanceState) {
    setContentView(R.layout.browser);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final BrowserActivityController c = getController();

    viewflipper = (ViewFlipper) findViewById(R.id.browserflip);
    viewflipper.addView(LayoutUtils.fillInParent(viewflipper, new FileBrowserView(c, c.adapter)));
}
 
Example #13
Source File: RecentActivity.java    From document-viewer with GNU General Public License v3.0 5 votes vote down vote up
void showBookcase(final BooksAdapter bookshelfAdapter, final RecentAdapter recentAdapter) {
    final ViewFlipper vf = getViewflipper();
    vf.removeAllViews();
    if (bookcaseView == null) {
        bookcaseView = (BookcaseView) LayoutInflater.from(this).inflate(R.layout.bookcase_view, vf, false);
        bookcaseView.init(bookshelfAdapter, recentAdapter);
    }
    vf.addView(bookcaseView, 0);
}
 
Example #14
Source File: ViewFlipperTestActivity.java    From coursera-android with MIT License 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);

	mCurrentLayoutState = 0;

	mFlipper = (ViewFlipper) findViewById(R.id.view_flipper);
	mTextView1 = (TextView) findViewById(R.id.textView1);
	mTextView2 = (TextView) findViewById(R.id.textView2);

	mTextView1.setText(String.valueOf(mCount));

	mGestureDetector = new GestureDetector(this,
			new GestureDetector.SimpleOnGestureListener() {
				@Override
				public boolean onFling(MotionEvent e1, MotionEvent e2,
						float velocityX, float velocityY) {
					if (velocityX < -10.0f) {
						mCurrentLayoutState = mCurrentLayoutState == 0 ? 1
								: 0;
						switchLayoutStateTo(mCurrentLayoutState);
					}
					return true;
				}
			});
}
 
Example #15
Source File: RecentActivity.java    From document-viewer with GNU General Public License v3.0 5 votes vote down vote up
void changeLibraryView(final int view) {
    final ViewFlipper vf = getViewflipper();
    if (view == VIEW_LIBRARY) {
        vf.setDisplayedChild(VIEW_LIBRARY);
    } else {
        vf.setDisplayedChild(VIEW_RECENT);
    }
}
 
Example #16
Source File: AddCameraActivity.java    From evercam-android with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_camera);

    setUpDefaultToolbar();
    setHomeIconAsCancel();

    initDiscoveredCamera();

    /*EvercamPlayApplication.sendScreenAnalytics(this, getString(R.string.screen_add_camera));*/

    mViewFlipper = (ViewFlipper) findViewById(R.id.add_camera_view_flipper);
    mProgressBar = (ProgressBar) findViewById(R.id.add_camera_progress_bar);
    mProgressBar.setProgress(33);

    if (savedInstanceState != null) {
        mSelectedModel = (SelectedModel) savedInstanceState.get(KEY_SELECTED_MODEL);
    }

    mHandler = new Handler();

    /** Init UI for model selector screen */
    initModelSelectorUI();

    /** Init UI for connect camera screen */
    initConnectCameraUI();

    /** Init UI for camera name view */
    initCameraNameView();

    fillDiscoveredCameraDetails(mDiscoveredCamera);

    if (savedInstanceState != null) {
        int flipperPosition = savedInstanceState.getInt(KEY_FLIPPER_POSITION);
        showPageAtPosition(flipperPosition);
    }
}
 
Example #17
Source File: LockScreenActivity.java    From zom-android-matrix with Apache License 2.0 5 votes vote down vote up
public TwoViewSlider(ViewFlipper flipper, LinearLayout container1, LinearLayout container2,
        View view1, View view2) {
    this.flipper = flipper;
    this.container1 = container1;
    this.container2 = container2;
    this.firstView = view1;
    this.secondView = view2;

    pushRightIn = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_right_in);
    pushRightOut = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_right_out);
    pushLeftIn = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_left_in);
    pushLeftOut = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_left_out);

}
 
Example #18
Source File: RecentUnlocksCard.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.card_recent_unlocks, null);

    mCardTitle = (TextView) rootView.findViewById(R.id.card_recent_unlocks_title);
    mRecentUnlocksList = (ListView) rootView.findViewById(R.id.card_recent_unlocks_list);

    mMoreItemsButton = (RelativeLayout) rootView.findViewById(R.id.card_recent_unlocks_more_button);

    mViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_recent_unlocks_view_flipper);
    mViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mMessageViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_recent_unlocks_connection_view_flipper);
    mMessageViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mMessageViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mRecentUnlocksList.setOnItemClickListener(new recentUnlocksListItemClickListener());

    mCard = (LinearLayout) rootView.findViewById(R.id.card_recent_unlocks_card);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.card_recent_unlocks_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.card_recent_unlocks_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.card_recent_unlocks_message_summary);

    mMoreItemsButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(mContext, RecentUnlocksActivity.class));
        }
    });

    return rootView;
}
 
Example #19
Source File: CriticalItemsCard.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.card_critical_items, null);

    mCardTitle = (TextView) rootView.findViewById(R.id.card_critical_items_title);
    mCriticalItemsList = (ListView) rootView.findViewById(R.id.card_critical_items_list);

    mViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_critical_items_view_flipper);
    mViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mMessageViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_critical_items_connection_view_flipper);
    mMessageViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mMessageViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mCard = (LinearLayout) rootView.findViewById(R.id.card_critical_items_card);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.card_critical_items_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.card_critical_items_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.card_critical_items_message_summary);

    mCriticalItemsList.setOnItemClickListener(new criticalItemListItemClickListener());

    mMoreButton = (RelativeLayout) rootView.findViewById(R.id.card_critical_items_more_button);
    mMoreButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(getActivity(), CriticalItemsActivity.class));
        }
    });

    return rootView;
}
 
Example #20
Source File: RadicalsFragment.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
    rootView = layoutInflater.inflate(R.layout.fragment_radicals, viewGroup, false);

    mMessageSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.radicals_message_swipe_refresh);
    mMessageSwipeRefreshLayout.setOnRefreshListener(this);
    mMessageSwipeRefreshLayout.setColorSchemeResources(R.color.swipe_refresh);

    mGrid = (StickyGridHeadersGridView) rootView.findViewById(R.id.radicals_grid);
    mGrid.setOnItemClickListener(new gridItemClickListener());

    mListFlipper = (ViewFlipper) rootView.findViewById(R.id.radicals_list_flipper);
    mMessageFlipper = (ViewFlipper) rootView.findViewById(R.id.radicals_message_flipper);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.radicals_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.radicals_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.radicals_message_summary);

    if (!PrefManager.isLegendLearned()) {
        showLegend();
    }

    fetchLevelAndData();

    setHasOptionsMenu(true);

    return rootView;
}
 
Example #21
Source File: KanjiFragment.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
    rootView = layoutInflater.inflate(R.layout.fragment_kanji, viewGroup, false);

    mMessageSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.kanji_message_swipe_refresh);
    mMessageSwipeRefreshLayout.setOnRefreshListener(this);
    mMessageSwipeRefreshLayout.setColorSchemeResources(R.color.swipe_refresh);

    mGrid = (StickyGridHeadersGridView) rootView.findViewById(R.id.kanji_grid);
    mGrid.setOnItemClickListener(new gridItemClickListener());

    mListFlipper = (ViewFlipper) rootView.findViewById(R.id.kanji_list_flipper);
    mMessageFlipper = (ViewFlipper) rootView.findViewById(R.id.kanji_message_flipper);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.kanji_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.kanji_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.kanji_message_summary);

    if (!PrefManager.isLegendLearned()) {
        showLegend();
    }

    fetchLevelAndData();

    setHasOptionsMenu(true);

    return rootView;
}
 
Example #22
Source File: VocabularyFragment.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
    rootView = layoutInflater.inflate(R.layout.fragment_vocabulary, viewGroup, false);

    mMessageSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.vocabulary_message_swipe_refresh);
    mMessageSwipeRefreshLayout.setOnRefreshListener(this);
    mMessageSwipeRefreshLayout.setColorSchemeResources(R.color.swipe_refresh);

    mGrid = (StickyGridHeadersGridView) rootView.findViewById(R.id.vocabulary_grid);
    mGrid.setOnItemClickListener(new gridItemClickListener());

    mListFlipper = (ViewFlipper) rootView.findViewById(R.id.vocabulary_list_flipper);
    mMessageFlipper = (ViewFlipper) rootView.findViewById(R.id.vocabulary_message_flipper);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.vocabulary_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.vocabulary_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.vocabulary_message_summary);

    if (!PrefManager.isLegendLearned()) {
        showLegend();
    }

    fetchLevelAndData();

    setHasOptionsMenu(true);

    return rootView;
}
 
Example #23
Source File: ProgressDetailsActivity.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_progress_details);

    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(mToolbar);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    mRadicalsGrid = (GridView) findViewById(R.id.progress_details_radicals_grid);
    mKanjiGrid = (GridView) findViewById(R.id.progress_details_kanji_grid);

    mRadicalsFlipper = (ViewFlipper) findViewById(R.id.progress_details_radicals_flipper);
    mKanjiFlipper = (ViewFlipper) findViewById(R.id.progress_details_kanji_flipper);

    mRadicalsMessageFlipper = (ViewFlipper) findViewById(R.id.progress_details_radicals_message_flipper);
    mKanjiMessageFlipper = (ViewFlipper) findViewById(R.id.progress_details_kanji_message_flipper);

    mRadicalsMessageText = (TextView) findViewById(R.id.progress_details_radicals_message_text);
    mKanjiMessageText = (TextView) findViewById(R.id.progress_details_kanji_message_text);

    mRadicalsGrid.setOnItemClickListener(new RadicalsItemClickListener());
    mKanjiGrid.setOnItemClickListener(new KanjiItemClickListener());

    mRadicalsCard = (CardView) findViewById(R.id.progress_details_radicals_card);
    mKanjiCard = (CardView) findViewById(R.id.progress_details_kanji_card);

    Fragment mProgressCard = getSupportFragmentManager().
            findFragmentById(R.id.progress_details_progress_card);

    ((ProgressCardNoTitle) mProgressCard).load();
    ((ProgressCardNoTitle) mProgressCard).setListener(this, this);

    loadData();
}
 
Example #24
Source File: BaseActivity.java    From android-discourse with Apache License 2.0 5 votes vote down vote up
@SuppressLint("NewApi")
public void hideSearch() {
    ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.uv_view_flipper);
    viewFlipper.setDisplayedChild(0);
    if (hasActionBar()) {
        getActionBar().setNavigationMode(originalNavigationMode == -1 ? ActionBar.NAVIGATION_MODE_STANDARD : originalNavigationMode);
    }
}
 
Example #25
Source File: SearchActivity.java    From uservoice-android-sdk with MIT License 5 votes vote down vote up
public void hideSearch() {
    ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.uv_view_flipper);
    viewFlipper.setDisplayedChild(0);
    if (hasActionBar()) {
        actionBar.setNavigationMode(originalNavigationMode == -1 ? ActionBar.NAVIGATION_MODE_STANDARD : originalNavigationMode);
    }
}
 
Example #26
Source File: RecyclerViewScrollActivity.java    From AndroidDemo with MIT License 5 votes vote down vote up
@Override
protected void init() {
    viewFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);
    et_position = (EditText) findViewById(R.id.et_position);
    rg_tab = (RadioGroup) findViewById(R.id.rg_tab);

    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);

    linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    gridLayoutManager = new GridLayoutManager(this, 4);
    gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            return position % 5 == 0 ? 4 : 1;
        }
    });

    recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    recyclerView.setLayoutManager(linearLayoutManager);
    SimpleRecyclerAdapter simpleRecyclerAdapter = new SimpleRecyclerAdapter(this, data);
    recyclerView.setAdapter(simpleRecyclerAdapter);
    recyclerView.setOnScrollListener(onScrollListener);

    imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

    for (int i = 0; i < 100; i++) {
        data.add("Simple item " + i);
    }
    simpleRecyclerAdapter.notifyDataSetChanged();

    initTab();
}
 
Example #27
Source File: WeekCalendar.java    From WeekCalendar with Apache License 2.0 5 votes vote down vote up
/**
 * 初始化View
 */
private void init(Context context, AttributeSet attrs) {
    this.context = context;
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.view_calender, this, true);
    mIvPrevious = (RelativeLayout) findViewById(R.id.iv_previous);
    preBtn = (ImageView) findViewById(R.id.pre_btn);
    nextBtn = (ImageView) findViewById(R.id.next_btn);
    mTvYearMouth = (TextView) findViewById(R.id.tv_year_mouth);
    month_layout = (RelativeLayout) findViewById(R.id.month_layout);
    mIvNext = (RelativeLayout) findViewById(R.id.iv_next);
    mRvDay = (ViewFlipper) findViewById(R.id.rv_day);
    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.WeekCalendar);
    daysSelectedTextColor = typedArray.getColor(R.styleable
            .WeekCalendar_daysSelectedTextColor, Color.WHITE);
    todayTextColor = typedArray.getColor(R.styleable
            .WeekCalendar_todayTextColor, Color.GRAY);
    weekTextColor = typedArray.getColor(R.styleable
            .WeekCalendar_weekTextColor, Color.GRAY);
    weekBackgroundColor = typedArray.getColor(R.styleable
            .WeekCalendar_weekBackgroundColor, Color.WHITE);
    monthBackgroundColor = typedArray.getColor(R.styleable.WeekCalendar_monthBackgroundColor, Color.LTGRAY);
    monthTextColor = typedArray.getColor(R.styleable.WeekCalendar_monthTextColor, Color.WHITE);
    daysTextColor = typedArray.getColor(R.styleable.WeekCalendar_daysTextColor, Color.GRAY);
    nextArrowBg = typedArray.getDrawable(R.styleable.WeekCalendar_nextArrowBg);
    preArrowBg = typedArray.getDrawable(R.styleable.WeekCalendar_preArrowBg);
    daysSelectedBackground = typedArray.getDrawable(R.styleable.WeekCalendar_daysSelectedBackground);
    cornerMarkBg = typedArray.getDrawable(R.styleable.WeekCalendar_cornerMarkBg);
    hideTodayName = typedArray.getBoolean(R.styleable.WeekCalendar_hideTodayName, false);
    isCornerMark = typedArray.getBoolean(R.styleable.WeekCalendar_isCornerMark, false);
    daysTextSize = typedArray.getDimension(R.styleable.WeekCalendar_daysTextSize, 16f);
    weekTextSize = typedArray.getDimension(R.styleable.WeekCalendar_weekTextSize, 16f);
    isShowMonth = typedArray.getBoolean(R.styleable.WeekCalendar_isShowMonth, true);
    initDatas();
    initView();
    typedArray.recycle();
}
 
Example #28
Source File: PushLeftPushRightAnimation.java    From KickAssSlidingMenu with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.push_left_push_right_animation);

    mFlipper = (ViewFlipper) findViewById(R.id.flipper);

    findViewById(R.id.BtnSlide).setOnClickListener(new ClickListener());
}
 
Example #29
Source File: SearchActivity.java    From uservoice-android-sdk with MIT License 5 votes vote down vote up
public void showSearch() {
    ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.uv_view_flipper);
    viewFlipper.setDisplayedChild(1);
    if (hasActionBar()) {
        if (originalNavigationMode == -1)
            originalNavigationMode = actionBar.getNavigationMode();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    }
}
 
Example #30
Source File: LockScreenActivity.java    From Zom-Android-XMPP with GNU General Public License v3.0 5 votes vote down vote up
public TwoViewSlider(ViewFlipper flipper, LinearLayout container1, LinearLayout container2,
        View view1, View view2) {
    this.flipper = flipper;
    this.container1 = container1;
    this.container2 = container2;
    this.firstView = view1;
    this.secondView = view2;

    pushRightIn = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_right_in);
    pushRightOut = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_right_out);
    pushLeftIn = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_left_in);
    pushLeftOut = AnimationUtils.loadAnimation(LockScreenActivity.this, R.anim.push_left_out);

}