本文整理汇总了Java中android.widget.ViewFlipper.getDisplayedChild方法的典型用法代码示例。如果您正苦于以下问题:Java ViewFlipper.getDisplayedChild方法的具体用法?Java ViewFlipper.getDisplayedChild怎么用?Java ViewFlipper.getDisplayedChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ViewFlipper
的用法示例。
在下文中一共展示了ViewFlipper.getDisplayedChild方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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());
}
}
示例3: updateInputedTags
import android.widget.ViewFlipper; //导入方法依赖的package包/类
/**
* 更新用户设置的标签
*
* @param viewFlipper
* @param manualTagGridView
*/
private void updateInputedTags(final ViewFlipper viewFlipper, final GridView manualTagGridView, int index) {
Log.d(TAG, "updateInputedTags: ");
for (List<Label> li : inputedManualTagList) {
Log.d(TAG, "updateInputedTags: li " + li.size());
}
List<Label> labelList = new ArrayList<>(inputedManualTagList.get(index));
final CommonAdapter<Label> adapter = new CommonAdapter<Label>(mContext, R.layout.category_textview_item, labelList) {
@Override
protected void convert(ViewHolder viewHolder, final Label item, int position) {
if (viewFlipper.getDisplayedChild() == mTaskAmount) {
return;
}
if (!TextUtils.isEmpty(item.getLabel_name())){
viewHolder.setText(R.id.id_label_name_tv, item.getLabel_name());
viewHolder.setOnLongClickListener(R.id.id_label_name_tv, new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
inputedManualTagList.get(viewFlipper.getDisplayedChild()).remove(item);
updateInputedTags(viewFlipper, manualTagGridView, viewFlipper.getDisplayedChild());
//只执行长按动作
return true;
}
});
}
}
};
//设置用户输入的标签
manualTagGridView.setAdapter(adapter);
}
示例4: onCreateView
import android.widget.ViewFlipper; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_profile, container,
false);
context = getActivity();
mAvatar = (ImageView) rootView.findViewById(R.id.profile_avatar);
mUsername = (TextView) rootView.findViewById(R.id.profile_username);
mTitle = (TextView) rootView.findViewById(R.id.profile_title);
mLevel = (TextView) rootView.findViewById(R.id.profile_level);
mTopicsCount = (TextView) rootView.findViewById(R.id.profile_topics_count);
mPostsCount = (TextView) rootView.findViewById(R.id.profile_posts_count);
mCreationDate = (TextView) rootView.findViewById(R.id.profile_creation_date);
mAbout = (TextView) rootView.findViewById(R.id.profile_about);
mWebsite = (TextView) rootView.findViewById(R.id.profile_website);
mTwitter = (TextView) rootView.findViewById(R.id.profile_twitter);
mAboutCard = (CardView) rootView.findViewById(R.id.profile_about_card);
mWebsiteHolder = (RelativeLayout) rootView.findViewById(R.id.profile_website_holder);
mTwitterHolder = (RelativeLayout) rootView.findViewById(R.id.profile_twitter_holder);
mViewFlipper = (ViewFlipper) rootView.findViewById(R.id.profile_view_flipper);
if (PrefManager.isProfileFirstTime()) {
if (mViewFlipper.getDisplayedChild() == 0) {
mViewFlipper.showNext();
}
}
if (!MainActivity.isFirstSyncProfileDone) {
fetchData();
MainActivity.isFirstSyncProfileDone = true;
} else {
fetchData();
}
return rootView;
}
示例5: getViewMode
import android.widget.ViewFlipper; //导入方法依赖的package包/类
int getViewMode() {
final ViewFlipper vf = getViewflipper();
return vf != null ? vf.getDisplayedChild() : VIEW_RECENT;
}