本文整理汇总了Java中android.support.v4.view.ViewPager.LayoutParams.MATCH_PARENT属性的典型用法代码示例。如果您正苦于以下问题:Java LayoutParams.MATCH_PARENT属性的具体用法?Java LayoutParams.MATCH_PARENT怎么用?Java LayoutParams.MATCH_PARENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.support.v4.view.ViewPager.LayoutParams
的用法示例。
在下文中一共展示了LayoutParams.MATCH_PARENT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
@Override public @Nullable View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewPager view = new ViewPager(getActivity()); // container.getContext() results in white on white text
view.setId(android.R.id.list);
view.setLayoutParams(new MarginLayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
PagerTitleStrip title = new PagerTabStrip(view.getContext());
ViewPager.LayoutParams params = new ViewPager.LayoutParams();
params.width = LayoutParams.MATCH_PARENT;
params.height = LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.TOP;
title.setLayoutParams(params);
view.addView(title);
return view;
}
示例2: showShareByWeixin
/**
* popwd显示 分享
*/
public static PopupWindow showShareByWeixin(final Context ctx, View parent, OnClickListener l) {
LayoutInflater inflater = LayoutInflater.from(ctx);
View view = inflater.inflate(R.layout.share_popwed_show, null);
final PopupWindow sharePopwd = new PopupWindow(view, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
view.findViewById(R.id.sendfrient).setOnClickListener(l);
view.findViewById(R.id.sharefriend).setOnClickListener(l);
view.findViewById(R.id.share_popwd).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
sharePopwd.dismiss();
}
});
sharePopwd.setFocusable(true);
sharePopwd.setOutsideTouchable(true);
sharePopwd.setBackgroundDrawable(new BitmapDrawable()); //
sharePopwd.showAtLocation(parent, Gravity.CENTER, 0, 0);
return sharePopwd;
}
示例3: instantiateItem
@Override
public Object instantiateItem(final ViewGroup container,final int position)
{
TextView textView=new TextView(MainActivity.this);
textView.setText("item"+position);
textView.setBackgroundColor(colors[position]);
textView.setGravity(Gravity.CENTER);
final LayoutParams params=new LayoutParams();
params.height=LayoutParams.MATCH_PARENT;
params.width=LayoutParams.MATCH_PARENT;
params.gravity=Gravity.CENTER;
textView.setLayoutParams(params);
textView.setTextColor(0xff000000);
container.addView(textView);
return textView;
}
示例4: onCreateView
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//Create the AdView fragment container layout
View v = inflater.inflate(R.layout.fragment_ad, container, false);
//Generate the AdView and configure it
mAdView = new AdView(v.getContext());
mAdView.setVisibility(View.GONE);
RelativeLayout.LayoutParams mAdViewLayout = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
mAdView.setLayoutParams(mAdViewLayout);
//...set the Ads info
mAdView.setAdSize(adSize);
mAdView.setAdUnitId(adUnitId);
//Add the AdView to the fragment container layout :)
((RelativeLayout)v).addView(mAdView);
return v;
}
示例5: createButtonLayoutParams
public LinearLayout.LayoutParams createButtonLayoutParams() {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
return params;
}
示例6: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.imgView = (ImageView) findViewById(R.id.imageView1);
containerLayoutFrame = (LinearLayout) findViewById(R.id.layout);
filtersInt = new int[NUMBERS_OF_FILTERS];
imgFilters = new ImageView[filtersInt.length];
lyparams.height = LayoutParams.MATCH_PARENT;
lyparams.width = LayoutParams.WRAP_CONTENT;
onClickListenerImagesFilter=new OnClicListenerImagesFilter();
filtersInt[0]=BitmapFilter.GRAY_STYLE;
filtersInt[1]=BitmapFilter.BLOCK_STYLE;
filtersInt[2]=BitmapFilter.BLUR_STYLE;
filtersInt[3]=BitmapFilter.GAUSSIAN_BLUR_STYLE;
filtersInt[4]=BitmapFilter.HDR_STYLE;
filtersInt[5]=BitmapFilter.INVERT_STYLE;
filtersInt[6]=BitmapFilter.LIGHT_STYLE;
filtersInt[7]=BitmapFilter.LOMO_STYLE;
filtersInt[8]=BitmapFilter.NEON_STYLE;
filtersInt[9]=BitmapFilter.OIL_STYLE;
filtersInt[10]=BitmapFilter.OLD_STYLE;
filtersInt[11]=BitmapFilter.PIXELATE_STYLE;
filtersInt[12]=BitmapFilter.RELIEF_STYLE;
filtersInt[13]=BitmapFilter.SHARPEN_STYLE;
filtersInt[14]=BitmapFilter.SKETCH_STYLE;
filtersInt[15]=BitmapFilter.SOFT_GLOW_STYLE;
filtersInt[16]=BitmapFilter.TOTAL_FILTER_NUM;
filtersInt[17]=BitmapFilter.TV_STYLE;
// we convert the image on imgView to a bitmap
abmp = (BitmapDrawable) imgView.getDrawable();
bmp = abmp.getBitmap();
originalImageSacled=bmp;
myBitmap=bmp;
sacleMainImage();
loadFilters();
}