本文整理汇总了Java中android.widget.ViewFlipper类的典型用法代码示例。如果您正苦于以下问题:Java ViewFlipper类的具体用法?Java ViewFlipper怎么用?Java ViewFlipper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewFlipper类属于android.widget包,在下文中一共展示了ViewFlipper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findViewIds
import android.widget.ViewFlipper; //导入依赖的package包/类
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);
}
示例2: onViewCreated
import android.widget.ViewFlipper; //导入依赖的package包/类
@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);
}
}
示例3: onCreateView
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, inflater, container, savedInstanceState);
View view = inflater.inflate(R.layout.fragment_book, container, false);
final ListView listView = (ListView) view.findViewById(android.R.id.list);
// setupGestureDetector(listView);
mHeader = inflater.inflate(R.layout.item_head_book_preface, listView, false);
mPrefaceText = (TextView) mHeader.findViewById(R.id.fragment_book_header_text);
if (getActivity() != null && AppPreferences.isFontMonospaced(getContext())) {
mPrefaceText.setTypeface(Typeface.MONOSPACE);
}
mViewFlipper = (ViewFlipper) view.findViewById(R.id.fragment_book_view_flipper);
/* Big new note button when there are no notes. */
mNoNotesText = view.findViewById(R.id.fragment_book_no_notes);
return view;
}
示例4: onCreateView
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_repos, container, false);
mViewFlipper = (ViewFlipper) view.findViewById(R.id.fragment_repos_flipper);
/* Hide or setup new Dropbox repo button. */
View newDropboxRepoButton = view.findViewById(R.id.fragment_repos_dropbox);
if (BuildConfig.IS_DROPBOX_ENABLED) {
newDropboxRepoButton.setOnClickListener(v -> mListener.onRepoNewRequest(R.id.repos_options_menu_item_new_dropbox));
} else {
newDropboxRepoButton.setVisibility(View.GONE);
}
view.findViewById(R.id.fragment_repos_directory).setOnClickListener(v ->
mListener.onRepoNewRequest(R.id.repos_options_menu_item_new_external_storage_directory));
return view;
}
示例5: updateView
import android.widget.ViewFlipper; //导入依赖的package包/类
public void updateView(ViewGroup menuContainer, ViewFlipper menuFlipper) {
/* Update current menu views for the item. */
containerView = menuContainer;
flipperView = menuFlipper;
/* Update container. */
switch (containerState) {
case OPENED:
/* Update flipper. */
// menu.flipperView.setInAnimation(null);
// menu.flipperView.setOutAnimation(null);
flipIfNeeded(flipperDisplayedChild);
containerView.setVisibility(View.VISIBLE);
break;
case OPENING:
break;
case CLOSED:
containerView.setVisibility(View.GONE);
break;
case CLOSING:
break;
}
}
示例6: updateView
import android.widget.ViewFlipper; //导入依赖的package包/类
/**
* Called when binding views from the adapter.
*/
public void updateView(View view, long noteId, ViewGroup menuContainer, ViewFlipper menuFlipper) {
GesturedListViewItemMenu menu = openedMenus.get(noteId);
if (menu == null) {
menuContainer.setVisibility(View.GONE);
} else {
if (menu.isClosed()) {
openedMenus.delete(noteId);
} else {
menu.updateView(menuContainer, menuFlipper);
// view.setBackgroundResource(R.color.item_head_menu_opened);
setItemMenuButtonOnClickListeners(view, noteId);
}
}
}
示例7: CardViewHolder
import android.widget.ViewFlipper; //导入依赖的package包/类
CardViewHolder(View view) {
super(view);
mUpFlipper = (ViewFlipper) view.findViewById(R.id.mUpFlipper);
mDownFlipper = (ViewFlipper) view.findViewById(R.id.mDownFlipper);
user_name = (TextView) view.findViewById(R.id.review_user_name);
review_date = (TextView) view.findViewById(R.id.review_date);
review_summary = (TextView) view.findViewById(R.id.review_summary);
review_up_score = (TextView) view.findViewById(R.id.review_up_score);
review_down_score = (TextView) view.findViewById(R.id.review_down_score);
review_rating = (RatingBar) view.findViewById(R.id.review_rating);
user_image = (CircleImageView) view.findViewById(R.id.review_user_image);
review_card = (CardView) view.findViewById(R.id.card_review);
review_read_more = (TextView) view.findViewById(R.id.review_read_more);
/*onClickListeners*/
user_image.setOnClickListener(this);
review_read_more.setOnClickListener(this);
review_card.setOnClickListener(this);
mUpFlipper.setOnClickListener(this);
mDownFlipper.setOnClickListener(this);
}
示例8: ViewHolder
import android.widget.ViewFlipper; //导入依赖的package包/类
ViewHolder(View view) {
super(view);
mLikesViewer = view.findViewById(R.id.likes_viewer);
mPostContainer = view.findViewById(R.id.post_extra_holder);
mFlipper = (ViewFlipper) view.findViewById(R.id.mFlipper);
mAvatar = (ImageView) view.findViewById(R.id.post_avatar);
mPostExtra = (ImageView) view.findViewById(R.id.post_extra_img);
mTime = (TextView) view.findViewById(R.id.post_time);
mUsername = (TextView) view.findViewById(R.id.post_user_name);
mContent = (TextView) view.findViewById(R.id.post_text);
mLike = (TextView) view.findViewById(R.id.post_like);
mReply = (TextView) view.findViewById(R.id.post_reply);
mEdit = (TextView) view.findViewById(R.id.post_edit);
mDelete = (TextView) view.findViewById(R.id.post_delete);
mGallery = (TextView) view.findViewById(R.id.post_extra_img_gallery) ;
mContent.setMovementMethod(LinkMovementMethod.getInstance());
mContent.setFocusable(false);
mLikesViewer.setOnClickListener(this);
mFlipper.setOnClickListener(this);
mReply.setOnClickListener(this);
mEdit.setOnClickListener(this);
mDelete.setOnClickListener(this);
mAvatar.setOnClickListener(this);
mPostExtra.setOnClickListener(this);
mGallery.setOnClickListener(this);
}
示例9: inject
import android.widget.ViewFlipper; //导入依赖的package包/类
public void inject(Finder finder, final T target, Object source) {
target.frameContent = (FrameLayout) finder.castView((View) finder.findRequiredView
(source, R.id.frame_content, "field 'frameContent'"), R.id.frame_content, "field " +
"'frameContent'");
target.ivTop = (ImageView) finder.castView((View) finder.findRequiredView(source, R.id
.iv_top, "field 'ivTop'"), R.id.iv_top, "field 'ivTop'");
target.viewTabs = (TabLayout) finder.castView((View) finder.findRequiredView(source, R.id
.view_tabs, "field 'viewTabs'"), R.id.view_tabs, "field 'viewTabs'");
target.headerLayout = (LinearLayout) finder.castView((View) finder.findRequiredView
(source, R.id.header_layout, "field 'headerLayout'"), R.id.header_layout, "field " +
"'headerLayout'");
target.layout = (TouchCallbackLayout) finder.castView((View) finder.findRequiredView
(source, R.id.layout, "field 'layout'"), R.id.layout, "field 'layout'");
View view = (View) finder.findRequiredView(source, R.id.fab_button, "field 'fabButton' " +
"and method 'onClick'");
target.fabButton = (FloatingActionButton) finder.castView(view, R.id.fab_button, "field " +
"'fabButton'");
view.setOnClickListener(new DebouncingOnClickListener() {
public void doClick(View p0) {
target.onClick(p0);
}
});
target.vfNotice = (ViewFlipper) finder.castView((View) finder.findRequiredView(source, R
.id.vf_notice, "field 'vfNotice'"), R.id.vf_notice, "field 'vfNotice'");
}
示例10: init
import android.widget.ViewFlipper; //导入依赖的package包/类
private void init() {
this.passcodeView1 = (PasscodeView) findViewById(R.id.passcode_view1);
this.passcodeView2 = (PasscodeView) findViewById(R.id.passcode_view2);
this.viewFlipper = (ViewFlipper) findViewById(R.id.view_flipper);
this.passcodeView1.setOnPasswordCompleteListener(new OnPasswordCompleteListener() {
public void onPasswordComplete(String password) {
if (PasscodeActivity.ACTION_PASSWORD_OPEN.equals(PasscodeActivity.this.action)) {
PasscodeActivity.this.setPasswordOpen(password);
} else if (PasscodeActivity.ACTION_PASSWORD_CLOSE.equals(PasscodeActivity.this
.action)) {
PasscodeActivity.this.setPasswordClose(password);
} else if (PasscodeActivity.ACTION_PASSWORD_INPUT.equals(PasscodeActivity.this
.action)) {
PasscodeActivity.this.setPasswordInput(password);
}
}
});
}
示例11: onCreate
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setContentView(R.layout.layout_base);
setVolumeControlStream(AudioManager.STREAM_MUSIC);// 使得音量键控制媒体声音
mContext = this;
// 初始化公共头部
mContentView = (ViewFlipper) super.findViewById(R.id.layout_container);
mHeadLayout = (LinearLayout) super.findViewById(R.id.layout_head);
mHeadRightText = (TextView) findViewById(R.id.text_right);
mBtnLeft = (Button) super.findViewById(R.id.btn_left);
mBtnRight = (Button) super.findViewById(R.id.btn_right);
mTitle = (TextView) super.findViewById(R.id.tv_title);
mBtnBackDrawable = getResources().getDrawable(R.drawable.ac_back_icon);
mBtnBackDrawable.setBounds(0, 0, mBtnBackDrawable.getMinimumWidth(),
mBtnBackDrawable.getMinimumHeight());
mAsyncTaskManager = AsyncTaskManager.getInstance(getApplicationContext());
// Activity管理
action = new SealAction(mContext);
}
示例12: onCreate
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome_activity);
setupActivity();
viewFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);
viewFlipper.setInAnimation(this, R.anim.slide_in_left);
viewFlipper.setOutAnimation(this, R.anim.slide_out_right);
mNextStepButton = (Button) findViewById(R.id.next_step_button);
mNextStepButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
goToStep(mNextStep);
}
});
mLoading = (LinearLayout) findViewById(R.id.loading);
goToStep(STEP_WELCOME);
}
示例13: onCreate
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setContentView(R.layout.layout_base);
setVolumeControlStream(AudioManager.STREAM_MUSIC);// 使得音量键控制媒体声音
mContext = this;
// 初始化公共头部
mContentView = (ViewFlipper) super.findViewById(R.id.layout_container);
mHeadLayout = (LinearLayout) super.findViewById(R.id.layout_head);
mHeadRightText = (TextView) findViewById(R.id.text_right);
mBtnLeft = (Button) super.findViewById(R.id.btn_left);
mBtnRight = (Button) super.findViewById(R.id.btn_right);
mTitle = (TextView) super.findViewById(R.id.tv_title);
mBtnBackDrawable = getResources().getDrawable(R.drawable.ac_back_icon);
mBtnBackDrawable.setBounds(0, 0, mBtnBackDrawable.getMinimumWidth(),
mBtnBackDrawable.getMinimumHeight());
mAsyncTaskManager = AsyncTaskManager.getInstance(getApplicationContext());
// Activity管理
action = new SealAction(mContext);
}
示例14: prevView
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
public void prevView(ViewFlipper taskViewFlipper, TextView prevImgBtn, TextView nextImgBtn) {
taskViewFlipper.setInAnimation(mContext, R.anim.left_in);
taskViewFlipper.setOutAnimation(mContext, R.anim.left_out);
if (taskViewFlipper.getDisplayedChild() != 0) {
//上一张图
taskViewFlipper.showPrevious();
if (taskViewFlipper.getDisplayedChild() == 0) {
prevImgBtn.setText(R.string.str_no);
nextImgBtn.setText(R.string.str_next_ques);
} else {
prevImgBtn.setText(R.string.str_previous_ques);
nextImgBtn.setText(R.string.str_next_ques);
}
} else {
prevImgBtn.setText(R.string.str_no);
nextImgBtn.setText(R.string.str_next_ques);
}
}
示例15: nextView
import android.widget.ViewFlipper; //导入依赖的package包/类
@Override
public void nextView(ViewFlipper taskViewFlipper, TextView prevImgBtn, TextView nextImgBtn) {
taskViewFlipper.setInAnimation(mContext, R.anim.right_in);
taskViewFlipper.setOutAnimation(mContext, R.anim.right_out);
if (taskViewFlipper.getDisplayedChild() != mTaskAmount) {
taskViewFlipper.showNext();
if (taskViewFlipper.getDisplayedChild() == mTaskAmount) {
//最后一页结果页
updateTagResult(taskViewFlipper, mTagResultGridView, mFinishProgressTv, getFinishedAmount());
} else {
prevImgBtn.setText(R.string.str_previous_ques);
nextImgBtn.setText(R.string.str_next_ques);
}
} else {
Log.d(TAG, "nextView: 结果页 " + getFinishedAmount());
//最后一页结果页
updateTagResult(taskViewFlipper, mTagResultGridView, mFinishProgressTv, getFinishedAmount());
}
}