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


Java LayoutParams.WRAP_CONTENT属性代码示例

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


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

示例1: hideBottomBar

private void hideBottomBar() {
    if (mBottomBarView == null) return;
    ((ViewGroup) mBottomBarView.getParent()).removeView(mBottomBarView);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    lp.gravity = Gravity.BOTTOM;
    final ViewGroup compositorView = mActivity.getCompositorViewHolder();
    compositorView.addView(mBottomBarView, lp);
    compositorView.addOnLayoutChangeListener(new OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom,
                int oldLeft, int oldTop, int oldRight, int oldBottom) {
            compositorView.removeOnLayoutChangeListener(this);
            mBottomBarView.animate().alpha(0f).translationY(mBottomBarView.getHeight())
                    .setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE)
                    .setDuration(SLIDE_ANIMATION_DURATION_MS)
                    .withEndAction(new Runnable() {
                        @Override
                        public void run() {
                            ((ViewGroup) mBottomBarView.getParent()).removeView(mBottomBarView);
                            mBottomBarView = null;
                        }
                    }).start();
        }
    });
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:26,代码来源:CustomTabBottomBarDelegate.java

示例2: BottomProgressView

public BottomProgressView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER);
    setLayoutParams(params);
    setIndicatorColor(getResources().getColor(R.color.Orange));
    setIndicatorId(BallPulse);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:BottomProgressView.java

示例3: initPageView

private void initPageView() {
		flPage = new FrameLayout(getContext());
		flPage.setOnClickListener(this);

		// 宫格列表的容器,为了“下对齐”,在外部包含了一个FrameLayout
		LinearLayout llPage = new LinearLayout(getContext()) {
			public boolean onTouchEvent(MotionEvent event) {
				return true;
			}
		};
		llPage.setOrientation(LinearLayout.VERTICAL);
		int resId = getBitmapRes(getContext(), "share_vp_back");
		if (resId > 0) {
			llPage.setBackgroundResource(resId);
		}
		FrameLayout.LayoutParams lpLl = new FrameLayout.LayoutParams(
				LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
		lpLl.gravity = Gravity.BOTTOM;
		llPage.setLayoutParams(lpLl);
		flPage.addView(llPage);

		// 宫格列表
		grid = new PlatformGridView(getContext());
		grid.setEditPageBackground(bgView);
		LinearLayout.LayoutParams lpWg = new LinearLayout.LayoutParams(
				LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
		grid.setLayoutParams(lpWg);
		llPage.addView(grid);

		// 取消按钮
		btnCancel = new Button(getContext());
		btnCancel.setTextColor(0xffffffff);
		btnCancel.setBackgroundResource(R.drawable.btn_1_selector);
		btnCancel.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
		resId = getStringRes(getContext(), "cancel");
		if (resId > 0) {
			btnCancel.setText(resId);
		}
		btnCancel.setPadding(0, 0, 0, cn.sharesdk.framework.utils.R.dipToPx(getContext(), 5));
		resId = getBitmapRes(getContext(), "btn_cancel_back");
//		if (resId > 0) {
//			btnCancel.setBackgroundResource(resId);
//		}
		LinearLayout.LayoutParams lpBtn = new LinearLayout.LayoutParams(
				LayoutParams.MATCH_PARENT, cn.sharesdk.framework.utils.R.dipToPx(getContext(), 45));
		int dp_10 = cn.sharesdk.framework.utils.R.dipToPx(getContext(), 10);
		lpBtn.setMargins(dp_10, dp_10, dp_10, dp_10);
		btnCancel.setLayoutParams(lpBtn);
		llPage.addView(btnCancel);
	}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:50,代码来源:OnekeyShare.java


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