/** * create ViewPager view</br> * * @return */ private ViewPager createVIewpager() { ViewPager viewPager = new ViewPager(getContext()); ViewPager.LayoutParams params = new ViewPager.LayoutParams(); params.width = android.support.v4.view.ViewPager.LayoutParams.MATCH_PARENT; params.height = BOARD_HEIGHT; viewPager.setLayoutParams(params); viewPager.setPadding(0, 15, 0, 0); return viewPager; }
private PagerTitleStrip getPagerTitle() { PagerTabStrip pagerTabStrip = (PagerTabStrip) View.inflate(this, R.layout.pager_tab_title, null); android.support.v4.view.ViewPager.LayoutParams lp = new ViewPager.LayoutParams(); lp.width = LayoutParams.MATCH_PARENT; lp.height = LayoutParams.WRAP_CONTENT; lp.gravity = Gravity.TOP; pagerTabStrip.setLayoutParams(lp); return pagerTabStrip; }
private View getVpView(Bitmap bmp) { if (null != bmp && null != getActivity()) { ImageView imageView = new ImageView(getActivity()); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setImageBitmap(bmp); if (lp == null) { lp = new ViewPager.LayoutParams(); lp.width = ViewPager.LayoutParams.MATCH_PARENT; lp.height = ViewPager.LayoutParams.MATCH_PARENT; } imageView.setLayoutParams(lp); return imageView; } return null; }