本文整理匯總了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;
}