当前位置: 首页>>代码示例>>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;未经允许,请勿转载。