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


Java ViewFlipper.addView方法代碼示例

本文整理匯總了Java中android.widget.ViewFlipper.addView方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewFlipper.addView方法的具體用法?Java ViewFlipper.addView怎麽用?Java ViewFlipper.addView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.ViewFlipper的用法示例。


在下文中一共展示了ViewFlipper.addView方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.widget.ViewFlipper; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.category_picker_dialog);
    setTitle(getContext().getResources().getString(R.string.category_picket_dialog_title));
    
    mViewFlipper = (ViewFlipper) findViewById(R.id.categoryPickerViewFlipper);

    mFirstDialogHeight = -1;

    // By default we always have a top-level page.
    Category root = new Category();
    root.setNodeName("root");
    root.setChildCategories(mCategories);

    mViewFlipper.addView(makePage(root));
}
 
開發者ID:Kamshak,項目名稱:foursquared,代碼行數:19,代碼來源:CategoryPickerDialog.java

示例2: onCreate

import android.widget.ViewFlipper; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_band);

        ViewFlipper vf = (ViewFlipper)findViewById(R.id.flipper);
/*        mSearchView = getLayoutInflater().inflate(R.layout.search_scan, null);

        ImageView miliImage = (ImageView)mSearchView.findViewById(R.id.mili_image);
        Animation fadeAnim = new AlphaAnimation(0.5f, 1.0f);
        fadeAnim.setDuration(750);
        fadeAnim.setRepeatMode(Animation.REVERSE);
        fadeAnim.setRepeatCount(Animation.INFINITE);
        miliImage.startAnimation(fadeAnim);

        vf.addView(mSearchView, STATE_SEARCH_DEVICE);
*/

        mConfigView = getLayoutInflater().inflate(R.layout.search_profile, null);

        vf.addView(mConfigView);

        // get the bluetooth manager
        btManager = (BluetoothManager)getSystemService(BLUETOOTH_SERVICE);
        btManager.getAdapter().startLeScan(scanCallback);
    }
 
開發者ID:indrora,項目名稱:jour-et-nuit,代碼行數:27,代碼來源:SearchBandActivity.java

示例3: initComponent

import android.widget.ViewFlipper; //導入方法依賴的package包/類
/**
 * �������� : initComponent �������� : ����������ֵ˵����
 *
 * 
 */
private void initComponent() {

	mViewFilpper = (ViewFlipper) findViewById(R.id.view_flipper);

	// ��̬����ķ�ʽΪViewFlipper������view
	for (int i = 0; i < mFlipperArray.length; i++) {
		mViewFilpper.addView(getView(mFlipperArray[i]));
	}

	// ���ö���Ч��
	mViewFilpper.setInAnimation(this, R.anim.right_in);
	mViewFilpper.setOutAnimation(this, R.anim.right_out);

	// �趨ViewFlipper��ͼ�л�ʱ����
	mViewFilpper.setFlipInterval(4000);

	// ����ViewFlipper����ʼ����
	mViewFilpper.setAutoStart(true);

	if (mViewFilpper.isAutoStart() && !mViewFilpper.isFlipping()) {
		mViewFilpper.startFlipping();
	}

}
 
開發者ID:snsdTJ,項目名稱:order_dish,代碼行數:30,代碼來源:MainActivity.java

示例4: init

import android.widget.ViewFlipper; //導入方法依賴的package包/類
private void init() {
	//設置窗口無標題
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	//得到布局
	setContentView(R.layout.background);
	//實例化手勢對象,用以實現手勢滑動
	detector = new GestureDetector(this);
	//通過findViewById方法得到Flipper控件
	flipper = (ViewFlipper) this.findViewById(R.id.flipper);
	//在flipper中添加四幅圖片
	flipper.addView(getImageView(R.drawable.diary_view_bg));
	flipper.addView(getImageView(R.drawable.spring));
	flipper.addView(getImageView(R.drawable.summer));
	flipper.addView(getImageView(R.drawable.autumn));
	flipper.addView(getImageView(R.drawable.winter));
	//得到設置按鈕
	setBackground = (Button) this.findViewById(R.id.backround_set);
	//得到取消按鈕
	cancel = (Button) this.findViewById(R.id.backround_cancel);
	//設置按鈕監聽器
	setBackground.setOnClickListener(new SetBackgroundListener());
	//取消按鈕監聽器
	cancel.setOnClickListener(new CancelListener());
}
 
開發者ID:RayleighChen,項目名稱:DiaryAndroid,代碼行數:25,代碼來源:SetBackgroundActivity.java

示例5: ensureList

import android.widget.ViewFlipper; //導入方法依賴的package包/類
private synchronized void ensureList() {
    if (mList != null)
        return;

    mList = new ListView(this);
    mList.setId(android.R.id.list);
    ViewFlipper viewFlipper = new ViewFlipper(this);
    viewFlipper.setId(R.id.uv_view_flipper);
    viewFlipper.addView(mList);
    setContentView(viewFlipper);
    mList.setOnItemClickListener(mOnClickListener);
    if (mFinishedStart) {
        setListAdapter(mAdapter);
    }
    mHandler.post(mRequestFocus);
    mFinishedStart = true;
}
 
開發者ID:uservoice,項目名稱:uservoice-android-sdk,代碼行數:18,代碼來源:FragmentListActivity.java

示例6: onCreate

import android.widget.ViewFlipper; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_welcome);

    viewFlipper = (ViewFlipper)findViewById(R.id.viewFlipper);
    detector = new GestureDetector(this);

    //往viewFlipper添加View
    viewFlipper.addView(getImageView(R.drawable.intro1));
    viewFlipper.addView(getImageView(R.drawable.intro2));
    viewFlipper.addView(getImageView(R.drawable.intro3));
    viewFlipper.addView(getImageView(R.drawable.intro4));


    //動畫效果
    leftInAnimation = AnimationUtils.loadAnimation(this, R.anim.left_in);
    leftOutAnimation = AnimationUtils.loadAnimation(this, R.anim.left_out);
    rightInAnimation = AnimationUtils.loadAnimation(this, R.anim.right_in);
    rightOutAnimation = AnimationUtils.loadAnimation(this, R.anim.right_out);
}
 
開發者ID:mingzhou,項目名稱:LogisticsPlatform,代碼行數:23,代碼來源:WelcomeActivity.java

示例7: showLibrary

import android.widget.ViewFlipper; //導入方法依賴的package包/類
void showLibrary(final LibraryAdapter libraryAdapter, final RecentAdapter recentAdapter) {
    if (recentBooksView == null) {
        recentBooksView = new RecentBooksView(getController(), recentAdapter);
        registerForContextMenu(recentBooksView);
    }
    if (libraryView == null) {
        libraryView = new LibraryView(getController(), libraryAdapter);
        registerForContextMenu(libraryView);
    }

    final ViewFlipper vf = getViewflipper();
    vf.removeAllViews();
    vf.addView(recentBooksView, VIEW_RECENT);
    vf.addView(libraryView, VIEW_LIBRARY);

    if (recentAdapter.getCount() == 0) {
        changeLibraryView(VIEW_LIBRARY);
    }
}
 
開發者ID:PrivacyApps,項目名稱:document-viewer,代碼行數:20,代碼來源:RecentActivity.java

示例8: init

import android.widget.ViewFlipper; //導入方法依賴的package包/類
private void init() {
    ViewFlipper contentLayout = (ViewFlipper) findViewById(R.id.content);
    switch (this.index) {
        case 3:
            this.userView = new UserGenderView(this.ctx, this.user);
            break;
        case 4:
            this.userView = new UserBirthdayView(this.ctx, this.user);
            break;
        case 5:
            this.userView = new UserHeightView(this.ctx, this.user);
            break;
        case 6:
            this.userView = new UserWeightView(this.ctx, this.user);
            break;
        case 7:
            this.userView = new UserTargetWeightView(this.ctx, this.user);
            break;
        case 8:
            this.userView = new UserTargetDateView(this.ctx, this.user);
            break;
        case 9:
            this.userView = new UserTargetView(this.ctx, true);
            break;
        case 10:
            this.userView = new UserMcCircleView(this.ctx, 1, this.defaultMc);
            break;
        case 11:
            if (this.defaultMc == 0) {
                this.defaultMc = 5;
            }
            this.userView = new UserMcDaysView(this.ctx, this.defaultMc);
            break;
    }
    contentLayout.addView(this.userView);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:37,代碼來源:ChangeProfileActivity2.java

示例9: setImageTask

import android.widget.ViewFlipper; //導入方法依賴的package包/類
@Override
public void setImageTask(ImageTask imageTask, ViewFlipper viewFlipper) {
    if (imageTask == null) {
        //為空
        iTagImageView.setImageTaskFailed(mContext.getString(R.string.str_unknown_error));
        return;
    }

    //獲得該任務中所有的圖片,然後開始遍曆添加每一頁的圖片和相關數據
    List<Images> imagesList = imageTask.getImages();
    mTaskAmount = imagesList.size();
    for (int index = 0; index < mTaskAmount; index++) {
        //添加每一頁的備選標簽的List
        selectedOptionTagViewList.add(index, new ArrayList<>(imagesList.get(index).getOption_labels()));
        //用戶輸入的Tag的List,設置用戶輸入的標簽(當用戶修改結果的時候會有數據,初次獲取任務不會有數據)
        int ii = 1;
        if ((imagesList.get(index).getManual_labels().size() == 1)
                && (TextUtils.isEmpty(imagesList.get(index).getManual_labels().get(0).getLabel_name())
                || imagesList.get(index).getManual_labels().get(0).getLabel_name().equals("null"))){
            inputedManualTagList.add(index, new ArrayList<Label>());
        }else {
            inputedManualTagList.add(index, new ArrayList<>(imagesList.get(index).getManual_labels()));
        }
        //添加item到viewFlipper
        viewFlipper.addView(addTask(viewFlipper, imagesList.get(index), index + 1, mTaskAmount));
    }
    //添加打標簽結果頁
    viewFlipper.addView(addTagResultView(viewFlipper));
}
 
開發者ID:codekongs,項目名稱:ImageClassify,代碼行數:30,代碼來源:TagImagePresenter.java

示例10: inflateView

import android.widget.ViewFlipper; //導入方法依賴的package包/類
private void inflateView(int index)
{
	// 動態創建新聞視圖,並賦值
	View newsBodyLayout = mNewsBodyInflater.inflate(R.layout.news_body, null);
	// 獲取點擊新聞基本信息
	HashMap<String, Object> hashMap = mNewsData.get(mPosition);
	// 新聞標題
	TextView newsTitle = (TextView) newsBodyLayout.findViewById(R.id.news_body_title);
	newsTitle.setText(hashMap.get("newslist_item_title").toString());
	// 發布時間和出處
	TextView newsPtimeAndSource = (TextView) newsBodyLayout.findViewById(R.id.news_body_ptime_source);
	newsPtimeAndSource.setText(hashMap.get("newslist_item_ptime").toString() + "    " + hashMap.get("newslist_item_source").toString());
	// 新聞編號
	mNid = (Integer) hashMap.get("nid");
	// 新聞回複數
	mNewsdetailsTitlebarComm.setText(hashMap.get("newslist_item_comments") + "跟帖");

	// 把新聞視圖添加到Flipper中
	mNewsBodyFlipper = (ViewFlipper) findViewById(R.id.news_body_flipper);
	mNewsBodyFlipper.addView(newsBodyLayout, index);

	// 給新聞Body添加觸摸事件
	mNewsDetails = (TextView) newsBodyLayout.findViewById(R.id.news_body_details);
	mNewsDetails.setOnTouchListener(new NewsBodyOnTouchListener());

	// 啟動線程
	new UpdateNewsThread().start();
}
 
開發者ID:u014427391,項目名稱:newsapp,代碼行數:29,代碼來源:NewsDetailsActivity.java

示例11: addViews

import android.widget.ViewFlipper; //導入方法依賴的package包/類
@Override
protected void addViews(LayoutInflater inflater, ViewFlipper flipper) {
    for (int i = 0; i < mChooser.mAllRiddlesList.size(); i++) {
        Riddle curr = mChooser.mAllRiddlesList.get(i);
        ImageView icon = (ImageView) inflater.inflate(R.layout.unsolved_riddle, null);
        icon.setImageDrawable(curr.getSnapshot(getResources()));
        flipper.addView(icon);
    }
}
 
開發者ID:DanDits,項目名稱:WhatsThat,代碼行數:10,代碼來源:UnsolvedRiddlesChooser.java

示例12: addViews

import android.widget.ViewFlipper; //導入方法依賴的package包/類
@Override
protected void addViews(LayoutInflater inflater, ViewFlipper flipper) {
    for (int i = 0; i < mType.getTotalAvailableHintsCount(); i++) {
        if (mTestSubject.hasAvailableHint(mType, i)) {
            TextView hint = (TextView) inflater.inflate(R.layout.hints_view_hint, null);
            hint.setText(mType.getRiddleHint(getResources(), i));
            flipper.addView(hint);
        }
    }
}
 
開發者ID:DanDits,項目名稱:WhatsThat,代碼行數:11,代碼來源:HintsView.java

示例13: initLayout

import android.widget.ViewFlipper; //導入方法依賴的package包/類
protected void initLayout() {
	setContentView(R.layout.game_wrapper);
	flipper = (ViewFlipper) findViewById(R.id.flipper);
	flipper.setClipToPadding(true);
	flipper.addView(gameContent());
	if (isRealGame()) {
		flipper.addView(getLayoutInflater().inflate(R.layout.game_review,
				null));
		initReview();
	}
	WordwiseUtils.updateGameTopPanel(this);
	this.onGameInit();
}
 
開發者ID:adiguzel,項目名稱:wordwise,代碼行數:14,代碼來源:WordwiseGameActivity.java

示例14: showOverlay

import android.widget.ViewFlipper; //導入方法依賴的package包/類
public void showOverlay(OverlayController controller, View overlay) {
    if(m_overlayController != null) {
        evictOverlay();
    }
    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.overlay_flipper);
    flipper.addView(overlay);
    flipper.setDisplayedChild(1);
    m_overlayController = controller;
    setUiFlags();
}
 
開發者ID:erincandescent,項目名稱:Impeller,代碼行數:11,代碼來源:MainActivity.java

示例15: onCreate

import android.widget.ViewFlipper; //導入方法依賴的package包/類
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_guide);


flipper = (ViewFlipper)findViewById(R.id.viewFlipper1);
flipper.setOnTouchListener(this);

RelativeLayout g1 = (RelativeLayout) View.inflate(this, R.layout.guideview_1, null);
RelativeLayout g2 = (RelativeLayout) View.inflate(this, R.layout.guideview_2, null);
RelativeLayout g3 = (RelativeLayout) View.inflate(this, R.layout.guideview_3, null);
RelativeLayout g4 = (RelativeLayout) View.inflate(this, R.layout.guideview_4, null);
RelativeLayout g5 = (RelativeLayout) View.inflate(this, R.layout.guideview_5, null);
RelativeLayout g6 = (RelativeLayout) View.inflate(this, R.layout.guideview_6, null);

flipper.addView(g1);
flipper.addView(g2);
flipper.addView(g3);
flipper.addView(g4);
flipper.addView(g5);
flipper.addView(g6);

Button a=(Button)findViewById(R.id.button1);
a.setOnClickListener(this);
}
 
開發者ID:sukso96100,項目名稱:SidePanel,代碼行數:28,代碼來源:Guide.java


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