当前位置: 首页>>代码示例>>Java>>正文


Java ViewPager.setLayoutParams方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewPager.setLayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java ViewPager.setLayoutParams方法的具体用法?Java ViewPager.setLayoutParams怎么用?Java ViewPager.setLayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewPager的用法示例。


在下文中一共展示了ViewPager.setLayoutParams方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initViewPage

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initViewPage() {
    setOrientation(VERTICAL);
    _viewPager = new ViewPager(_context);
    _llDot = new LinearLayout(_context);

    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
            CommonUtil.getDefaultPannelHeight(_context));
    params.gravity=Gravity.BOTTOM;
    _viewPager.setLayoutParams(params);
    _llDot.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.WRAP_CONTENT));
    _llDot.setGravity(Gravity.CENTER);
    _llDot.setOrientation(HORIZONTAL);
    addView(_viewPager);
    addView(_llDot);
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:17,代码来源:YayaEmoGridView.java

示例2: initViews

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initViews() {
    //initialize the viewpager
    mViewPager = new ViewPager(mContext);
    ViewPager.LayoutParams lp = new ViewPager.LayoutParams();
    lp.width = ViewPager.LayoutParams.MATCH_PARENT;
    lp.height = ViewPager.LayoutParams.MATCH_PARENT;
    mViewPager.setLayoutParams(lp);

    //initialize the indicator
    mIndicator = new ViewPagerIndicator(mContext);
    LayoutParams indicatorlp = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    indicatorlp.gravity = Gravity.BOTTOM | Gravity.CENTER;
    indicatorlp.bottomMargin = 20;
    mIndicator.setLayoutParams(indicatorlp);
}
 
开发者ID:popo1379,项目名称:popomusic,代码行数:16,代码来源:BannerViewPager.java

示例3: initControl

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initControl(){
    /*set it to be no title*/
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    /*set it to be full screen*/
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.activity_image_show);

    iamgeViewPager = (ViewPager) findViewById(R.id.image_pager);
    LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    iamgeViewPager.setLayoutParams(params);
    iamgeViewPager.setOnPageChangeListener(pageChangeListener);

    guidPview = (ViewGroup) findViewById(R.id.guid_point);
    setImageViewPager(false);

    delButton = (Button) findViewById(R.id.b_right_id);
    if (getIntent().getStringExtra("delete").equals("delete")) {
        delButton.setVisibility(View.GONE);
    }
    delButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mImages.size() > 1) {
                mImages.remove(cus);
                GlobalData.setImagesList(mImages);
                setImageViewPager(false);
            } else {
                mImages.remove(0);
                GlobalData.setImagesList(mImages);
                Intent intent = new Intent();
                setResult(CodeDefine.IMAGE_SHOW_RESULT, intent);
                finish();
            }
        }
    });
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:39,代码来源:ImageShowActivity.java

示例4: initViews

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initViews() {
    //initialize the viewpager
    mViewPager = new ViewPager(mContext);
    ViewPager.LayoutParams lp = new ViewPager.LayoutParams();
    lp.width = ViewPager.LayoutParams.MATCH_PARENT;
    lp.height = ViewPager.LayoutParams.MATCH_PARENT;
    mViewPager.setLayoutParams(lp);

    //initialize the indicator
    mIndicator = new ViewPagerIndicator(mContext);
    FrameLayout.LayoutParams indicatorlp = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    indicatorlp.gravity = Gravity.BOTTOM | Gravity.CENTER;
    indicatorlp.bottomMargin = 20;
    mIndicator.setLayoutParams(indicatorlp);
}
 
开发者ID:yuhodev,项目名称:login,代码行数:16,代码来源:BannerViewPager.java

示例5: initViewPage

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initViewPage() {
    setOrientation(VERTICAL);
    _viewPager = new ViewPager(_context);
    _llDot = new LinearLayout(_context);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
            CommonUtil.getDefaultPannelHeight(_context));
    params.gravity=Gravity.BOTTOM;
    _viewPager.setLayoutParams(params);
    _llDot.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.WRAP_CONTENT));
    _llDot.setGravity(Gravity.CENTER);
    _llDot.setOrientation(HORIZONTAL);
    addView(_viewPager);
    addView(_llDot);
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:16,代码来源:EmoGridView.java

示例6: initChild

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initChild() {
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.MATCH_PARENT);
    viewPager = new ViewPager(context);
    viewPager.setLayoutParams(params);

    //viewpager初始化
    setScrollTime(Default_scrollTime);
    //触摸时停止轮播
    viewPager.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            switch (motionEvent.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    stopAutoPlay();
                    break;
                case MotionEvent.ACTION_UP:
                    startAutoPlay();
                    break;
            }
            return false;
        }
    });

    //指示器初始化
    llIndicators = new LinearLayout(context);
    LayoutParams layoutParams1 = new LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT);
    layoutParams1.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    switch (indicator_gravity) {
        case 1:
            layoutParams1.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
            break;
        case 2:
            layoutParams1.addRule(RelativeLayout.CENTER_HORIZONTAL);
            break;
        case 3:
            layoutParams1.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
            break;
    }
    llIndicators.setLayoutParams(layoutParams1);

    this.addView(viewPager);
    this.addView(llIndicators);
}
 
开发者ID:BittleDragon,项目名称:ImageLooper,代码行数:46,代码来源:ImageLooper.java

示例7: initChild

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
private void initChild() {
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.MATCH_PARENT);
    viewPager = new ViewPager(context);
    viewPager.setLayoutParams(params);

    //viewpager初始化
    setScrollTime(Default_scrollTime);
    //触摸时停止轮播
    viewPager.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            switch (motionEvent.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    handler.removeMessages(0);
                    break;
                case MotionEvent.ACTION_MOVE:
                    handler.removeMessages(0);
                    break;
                case MotionEvent.ACTION_UP:
                    handler.sendEmptyMessageDelayed(0, 3000);
                    break;
            }
            return false;
        }
    });

    //指示器初始化
    llIndicators = new LinearLayout(context);
    LayoutParams layoutParams1 = new LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT);
    layoutParams1.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    switch (indicator_gravity) {
        case 1:
            layoutParams1.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
            break;
        case 2:
            layoutParams1.addRule(RelativeLayout.CENTER_HORIZONTAL);
            break;
        case 3:
            layoutParams1.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
            break;
    }
    llIndicators.setLayoutParams(layoutParams1);

    this.addView(viewPager);
    this.addView(llIndicators);
}
 
开发者ID:BittleDragon,项目名称:MyRepository,代码行数:49,代码来源:ImageLooper.java

示例8: setPagerProperties

import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public void setPagerProperties(final ViewPager vp) {
    final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) vp.getLayoutParams();
    lp.height = mEmojiKeyboardHeight;
    lp.bottomMargin = mEmojiPagerBottomMargin;
    vp.setLayoutParams(lp);
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:7,代码来源:EmojiLayoutParams.java


注:本文中的android.support.v4.view.ViewPager.setLayoutParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。