當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。