本文整理了Java中android.widget.ViewFlipper.setDisplayedChild()
方法的一些代码示例,展示了ViewFlipper.setDisplayedChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewFlipper.setDisplayedChild()
方法的具体详情如下:
包路径:android.widget.ViewFlipper
类名称:ViewFlipper
方法名:setDisplayedChild
暂无
代码示例来源:origin: stackoverflow.com
ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.myViewFlipper);
// you can switch between next and previous layout and display it
viewFlipper.showNext();
viewFlipper.showPrevious();
// or you can switch selecting the layout that you want to display
viewFlipper.setDisplayedChild(1);
viewFlipper.setDisplayedChild(viewFlipper.indexOfChild(findViewById(R.id.secondLayout)
代码示例来源:origin: PrivacyApps/document-viewer
void changeLibraryView(final int view) {
final ViewFlipper vf = getViewflipper();
if (view == VIEW_LIBRARY) {
vf.setDisplayedChild(VIEW_LIBRARY);
} else {
vf.setDisplayedChild(VIEW_RECENT);
}
}
代码示例来源:origin: MoMoWait/LeanbackLauncher
public void flipToView(int view) {
switch (view) {
case android.support.v7.preference.R.styleable.Preference_android_icon /*0*/:
super.setDisplayedChild(0);
case android.support.v7.recyclerview.R.styleable.RecyclerView_android_descendantFocusability /*1*/:
super.setDisplayedChild(2);
case android.support.v7.recyclerview.R.styleable.RecyclerView_layoutManager /*2*/:
super.setDisplayedChild(3);
this.mErrorMessageText.setText(this.mErrorRecsDisabled);
case android.support.v7.preference.R.styleable.Preference_android_layout /*3*/:
super.setDisplayedChild(3);
this.mErrorMessageText.setText(this.mErrorNoRecs);
case android.support.v7.preference.R.styleable.Preference_android_title /*4*/:
super.setDisplayedChild(3);
this.mErrorMessageText.setText(this.mErrorNoConnection);
default:
}
}
代码示例来源:origin: kevalpatel2106/android-ringtone-picker
@Override
public void onLoadComplete(@NonNull HashMap<String, Uri> ringtone) {
mViewFlipper.setDisplayedChild(1);
mRingTones.putAll(ringtone);
final String[] itemTitles = mRingTones.keySet().toArray(new String[mRingTones.size()]);
int currentSelectionPos = getUriPosition(mRingTones, mCurrentRingTone.second);
mListView.setAdapter(new ArrayAdapter<>(mContext,
android.R.layout.select_dialog_singlechoice,
itemTitles));
mListView.setSelection(currentSelectionPos);
mListView.setItemChecked(currentSelectionPos, true);
}
代码示例来源:origin: stackoverflow.com
ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.myViewFlipper);
// you can switch between next and previous layout and display it
viewFlipper.showNext();
viewFlipper.showPrevious();
// or you can switch selecting the layout that you want to display
viewFlipper.setDisplayedChild(1);
viewFlipper.setDisplayedChild(viewFlipper.indexOfChild(findViewById(R.id.secondLayout)
代码示例来源:origin: stackoverflow.com
ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.myViewFlipper);
// you can switch between next and previous layout and display it
viewFlipper.showNext();
viewFlipper.showPrevious();
// or you can switch selecting the layout that you want to display
viewFlipper.setDisplayedChild(1);
viewFlipper.setDisplayedChild(viewFlipper.indexOfChild(findViewById(R.id.secondLayout)
代码示例来源:origin: stackoverflow.com
viewFlipper.setDisplayedChild(1);
代码示例来源:origin: nvllsvm/Audinaut
private void toggleFullscreenAlbumArt() {
if (playlistFlipper.getDisplayedChild() == 1) {
playlistFlipper.setInAnimation(AnimationUtils.loadAnimation(context, R.anim.push_down_in));
playlistFlipper.setOutAnimation(AnimationUtils.loadAnimation(context, R.anim.push_down_out));
playlistFlipper.setDisplayedChild(0);
} else {
scrollToCurrent();
playlistFlipper.setInAnimation(AnimationUtils.loadAnimation(context, R.anim.push_up_in));
playlistFlipper.setOutAnimation(AnimationUtils.loadAnimation(context, R.anim.push_up_out));
playlistFlipper.setDisplayedChild(1);
UpdateView.triggerUpdate();
}
}
代码示例来源:origin: ianhanniballake/TripleSolitaire
@Override
public void onComplete(@NonNull final Task<GoogleSignInAccount> signInAccountTask) {
if (signInAccountTask.isSuccessful()) {
onConnected(signInAccountTask.getResult());
} else {
invalidateOptionsMenu();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && isAccountAccessRestricted()) {
googlePlayGamesViewFlipper.setDisplayedChild(0);
} else {
googlePlayGamesViewFlipper.setDisplayedChild(1);
}
}
}
代码示例来源:origin: kevalpatel2106/android-ringtone-picker
mViewFlipper.setDisplayedChild(0);
代码示例来源:origin: ianhanniballake/TripleSolitaire
/**
* Called to handle when options menu / action bar buttons are tapped
*
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
*/
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.settings:
startActivity(new Intent(this, Preferences.class));
return true;
case R.id.sign_out:
mGoogleSignInClient.signOut();
googlePlayGamesViewFlipper.setDisplayedChild(1);
return true;
case R.id.about:
final AboutDialogFragment aboutDialogFragment = new AboutDialogFragment();
aboutDialogFragment.show(getFragmentManager(), "about");
return true;
default:
return super.onOptionsItemSelected(item);
}
}
代码示例来源:origin: stackoverflow.com
mViewFlipper.setDisplayedChild(0);
initAnimations();
代码示例来源:origin: wasdennnoch/AndroidN-ify
private void maybeHideTabs() {
// Show a TextView with "No information provided" if there are no fragments.
if (getNumberFragments() == 0) {
mViewFlipper.setDisplayedChild(
mViewFlipper.indexOfChild(findViewById(R.id.no_info_text_view)));
} else {
mViewFlipper.setDisplayedChild(mViewFlipper.indexOfChild(findViewById(R.id.tabs)));
}
TabLayout tabLayout = getTabLayout();
if (getNumberFragments() <= 1) {
tabLayout.setVisibility(View.GONE);
} else {
tabLayout.setVisibility(View.VISIBLE);
}
}
@Override
代码示例来源:origin: ianhanniballake/TripleSolitaire
public void onConnected(@NonNull GoogleSignInAccount googleSignInAccount) {
mGoogleSignInAccount = googleSignInAccount;
if (BuildConfig.DEBUG)
Log.d(TripleSolitaireActivity.TAG, "onSignInSucceeded");
final View title = findViewById(R.id.title);
Games.getGamesClient(this, mGoogleSignInAccount).setViewForPopups(title);
invalidateOptionsMenu();
googlePlayGamesViewFlipper.setDisplayedChild(2);
if (!mAlreadyLoadedState)
Games.getSnapshotsClient(this, mGoogleSignInAccount)
.open(OUR_SNAPSHOT_ID, false)
.addOnSuccessListener(this, this);
else if (mPendingUpdateState)
saveToCloud();
}
代码示例来源:origin: davideas/FlipView
/**
* Shows a specific View immediately, no animation will be performed.
* <p>Command is always performed even if the view is disabled.</p>
*
* @param whichChild the index of the child view to display (first View has {@code index=0}).
*/
public final void flipSilently(int whichChild) {
if (DEBUG) Log.d(TAG, "flipSilently whichChild=" + whichChild);
whichChild = checkIndex(whichChild);
Animation inAnimation = super.getInAnimation();
Animation outAnimation = super.getOutAnimation();
super.setInAnimation(null);
super.setOutAnimation(null);
super.setDisplayedChild(whichChild);
super.setInAnimation(inAnimation);
super.setOutAnimation(outAnimation);
}
代码示例来源:origin: ymback/NGA-CLIENT-VER-OPEN-SOURCE
@Override
public void updateHeaderView() {
mHeaderView.removeAllViews();
UserManager um = UserManagerImpl.getInstance();
final List<User> userList = um.getUserList();
if (userList.isEmpty()) {
mHeaderView.addView(getUserView(null, 0));
} else {
for (int i = 0; i < userList.size(); i++) {
mHeaderView.addView(getUserView(userList, i));
}
mHeaderView.setDisplayedChild(um.getActiveUserIndex());
}
mHeaderView.setOnClickListener(v -> mPresenter.toggleUser(userList));
mHeaderView.setInAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.right_in));
mHeaderView.setOutAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.right_out));
}
代码示例来源:origin: nvllsvm/Audinaut
private void onResumeHandlers() {
executorService = Executors.newSingleThreadScheduledExecutor();
setControlsVisible(true);
final DownloadService downloadService = getDownloadService();
if (downloadService == null || downloadService.getCurrentPlaying() == null || startFlipped) {
playlistFlipper.setDisplayedChild(1);
startFlipped = false;
}
if (currentPlaying == null && downloadService != null && null == downloadService.getCurrentPlaying()) {
setAlbumArt(null, false);
}
context.runWhenServiceAvailable(() -> {
if (primaryFragment) {
DownloadService downloadService1 = getDownloadService();
downloadService1.addOnSongChangedListener(NowPlayingFragment.this);
}
updateRepeatButton();
updateTitle();
});
}
代码示例来源:origin: clemensbartz/essential-launcher
/**
* Switch to a layout.
*
* @param id the id of the layout
*/
public void switchTo(final int id) {
final ActionBar actionBar = getActionBar();
switch (id) {
case HOME_ID:
if (actionBar != null && actionBar.isShowing()) {
actionBar.hide();
}
break;
default:
if (actionBar != null && !actionBar.isShowing()) {
actionBar.show();
}
break;
}
// Show grid as fall-back if somebody hacked our config
if (id < 0 || id > vsLauncher.getChildCount()) {
switchTo(HomeModel.GRID_ID);
} else {
vsLauncher.setDisplayedChild(id);
}
}
内容来源于网络,如有侵权,请联系作者删除!