當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewFlipper.getDisplayedChild方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:codekongs,項目名稱:ImageClassify,代碼行數:20,代碼來源:TagImagePresenter.java

示例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());
    }
}
 
開發者ID:codekongs,項目名稱:ImageClassify,代碼行數:20,代碼來源:TagImagePresenter.java

示例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);
}
 
開發者ID:codekongs,項目名稱:ImageClassify,代碼行數:38,代碼來源:TagImagePresenter.java

示例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;
}
 
開發者ID:xiprox,項目名稱:WaniKani-for-Android,代碼行數:44,代碼來源:ProfileFragment.java

示例5: getViewMode

import android.widget.ViewFlipper; //導入方法依賴的package包/類
int getViewMode() {
    final ViewFlipper vf = getViewflipper();
    return vf != null ? vf.getDisplayedChild() : VIEW_RECENT;
}
 
開發者ID:PrivacyApps,項目名稱:document-viewer,代碼行數:5,代碼來源:RecentActivity.java


注:本文中的android.widget.ViewFlipper.getDisplayedChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。