@Override public void setMinimumHeight(int minHeight) { minimumHeight = minHeight; viewportView.setMinimumHeight(minimumHeight); }
public FunGameBase(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final View thisView = this; thisView.setMinimumHeight(DensityUtil.dp2px(100)); mScreenHeightPixels = thisView.getResources().getDisplayMetrics().heightPixels; mSpinnerStyle = SpinnerStyle.MatchLayout; }
Activity activity = ...; AlertDialog dialog = ...; // retrieve display dimensions Rect displayRectangle = new Rect(); Window window = activity.getWindow(); window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle); // inflate and adjust layout LayoutInflater inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.your_dialog_layout, null); layout.setMinimumWidth((int)(displayRectangle.width() * 0.9f)); layout.setMinimumHeight((int)(displayRectangle.height() * 0.9f)); dialog.setView(layout);
public BezierCircleHeader(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mSpinnerStyle = SpinnerStyle.Scale; final View thisView = this; thisView.setMinimumHeight(DensityUtil.dp2px(100)); mBackPaint = new Paint(); mBackPaint.setColor(0xff11bbff); mBackPaint.setAntiAlias(true); mFrontPaint = new Paint(); mFrontPaint.setColor(0xffffffff); mFrontPaint.setAntiAlias(true); mOuterPaint = new Paint(); mOuterPaint.setAntiAlias(true); mOuterPaint.setColor(0xffffffff); mOuterPaint.setStyle(Paint.Style.STROKE); mOuterPaint.setStrokeWidth(DensityUtil.dp2px(2f)); mPath = new Path(); }
protected void freeResources() { viewportView.setMinimumHeight(minimumHeight); if (measureTask != null) { measureTask.cancel(true); measureTask = null; measureState = MeasureTaskState.START; } destroyCache(); }
thisView.setMinimumHeight(DensityUtil.dp2px(60));
final View thisView = this; final ViewGroup thisGroup = this; thisView.setMinimumHeight(DensityUtil.dp2px(100));
public BezierRadarHeader(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mSpinnerStyle = SpinnerStyle.Scale; final View thisView = this; final DensityUtil density = new DensityUtil(); mPath = new Path(); mPaint = new Paint(); mPaint.setAntiAlias(true); mDotRadius = density.dip2px(7); mRadarRadius = density.dip2px(20); mRadarCircle = density.dip2px(7); mPaint.setStrokeWidth(density.dip2px(3)); thisView.setMinimumHeight(density.dip2px(100)); if (thisView.isInEditMode()) { mWaveTop = 1000; mRadarScale = 1; mRadarAngle = 270; } else { mRadarScale = 0; } TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BezierRadarHeader); mEnableHorizontalDrag = ta.getBoolean(R.styleable.BezierRadarHeader_srlEnableHorizontalDrag, mEnableHorizontalDrag); setAccentColor(ta.getColor(R.styleable.BezierRadarHeader_srlAccentColor, 0xFFffffff)); setPrimaryColor(ta.getColor(R.styleable.BezierRadarHeader_srlPrimaryColor, 0xFF222222)); mManualAccentColor = ta.hasValue(R.styleable.BezierRadarHeader_srlAccentColor); mManualPrimaryColor = ta.hasValue(R.styleable.BezierRadarHeader_srlPrimaryColor); ta.recycle(); }
@Override public void bindView(ViewHolder viewHolder, List payloads) { super.bindView(viewHolder, payloads); Context ctx = viewHolder.itemView.getContext(); //set the identifier from the drawerItem here. It can be used to run tests viewHolder.itemView.setId(hashCode()); //define how the divider should look like viewHolder.view.setClickable(false); viewHolder.view.setEnabled(false); viewHolder.view.setMinimumHeight(1); ViewCompat.setImportantForAccessibility(viewHolder.view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO); //set the color for the divider viewHolder.divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, com.mikepenz.materialdrawer.R.attr.material_drawer_divider, com.mikepenz.materialdrawer.R.color.material_drawer_divider)); //call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required) onPostBindView(this, viewHolder.itemView); }
divider.setMinimumHeight(dividerHeight); divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_divider, R.color.material_drawer_divider));
@Override public void bindView(ViewHolder viewHolder, List payloads) { super.bindView(viewHolder, payloads); Context ctx = viewHolder.itemView.getContext(); //set the identifier from the drawerItem here. It can be used to run tests viewHolder.itemView.setId(hashCode()); //define how the divider should look like viewHolder.view.setClickable(false); viewHolder.view.setEnabled(false); viewHolder.view.setMinimumHeight(1); ViewCompat.setImportantForAccessibility(viewHolder.view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO); //set the color for the divider viewHolder.divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_divider, R.color.material_drawer_divider)); //call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required) onPostBindView(this, viewHolder.itemView); }
public StoreHouseHeader(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); DensityUtil density = new DensityUtil(); mLineWidth = density.dip2px(1); mDropHeight = density.dip2px(40); mHorizontalRandomness = Resources.getSystem().getDisplayMetrics().widthPixels / 2; mBackgroundColor = 0xff333333; setTextColor(0xffcccccc); TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.StoreHouseHeader); mLineWidth = ta.getDimensionPixelOffset(R.styleable.StoreHouseHeader_shhLineWidth, mLineWidth); mDropHeight = ta.getDimensionPixelOffset(R.styleable.StoreHouseHeader_shhDropHeight, mDropHeight); mEnableFadeAnimation = ta.getBoolean(R.styleable.StoreHouseHeader_shhEnableFadeAnimation, mEnableFadeAnimation); if (ta.hasValue(R.styleable.StoreHouseHeader_shhText)) { initWithString(ta.getString(R.styleable.StoreHouseHeader_shhText)); } else { initWithString("StoreHouse"); } ta.recycle(); final View thisView = this; thisView.setMinimumHeight(mDrawZoneHeight + DensityUtil.dp2px(40)); }
public NormalAlertDialog(Builder builder) { this.mBuilder = builder; mDialog = new Dialog(mContext, R.style.NormalDialogStyle); mDialogView = View.inflate(mContext, R.layout.widget_dialog_normal, null); mTitle = (TextView) mDialogView.findViewById(R.id.dialog_normal_title); mContent = (TextView) mDialogView.findViewById(R.id.dialog_normal_content); mLeftBtn = (Button) mDialogView.findViewById(R.id.dialog_normal_leftbtn); mRightBtn = (Button) mDialogView.findViewById(R.id.dialog_normal_rightbtn); mSingleBtn = (Button) mDialogView.findViewById(R.id.dialog_normal_midbtn); mLine = (TextView) mDialogView.findViewById(R.id.dialog_normal_line); mDialogView.setMinimumHeight((int) (ScreenSizeUtils.getInstance(mContext).getScreenHeight () * builder.getHeight())); mDialog.setContentView(mDialogView); Window dialogWindow = mDialog.getWindow(); WindowManager.LayoutParams lp = dialogWindow.getAttributes(); lp.width = (int) (ScreenSizeUtils.getInstance(mContext).getScreenWidth() * builder.getWidth()); lp.height = WindowManager.LayoutParams.WRAP_CONTENT; lp.gravity = Gravity.CENTER; dialogWindow.setAttributes(lp); initDialog(builder); }
public MDEditDialog(Builder builder) { mBuilder = builder; mDialog = new Dialog(mContext, R.style.MyDialogStyle); mDialogView = View.inflate(mContext, R.layout.widget_edit_dialog, null); mTitle = (TextView) mDialogView.findViewById(R.id.edit_dialog_title); mEdit = (EditText) mDialogView.findViewById(R.id.edit_dialog_exittext); mLeftBtn = (TextView) mDialogView.findViewById(R.id.edit_dialog_leftbtn); mRightBtn = (TextView) mDialogView.findViewById(R.id.edit_dialog_rightbtn); lineView = (View) mDialogView.findViewById(R.id.edit_dialog_line); mDialogView.setMinimumHeight((int) (ScreenSizeUtils.getInstance(mContext).getScreenHeight () * builder.getMinHeight())); mDialog.setContentView(mDialogView); Window dialogWindow = mDialog.getWindow(); WindowManager.LayoutParams lp = dialogWindow.getAttributes(); lp.width = (int) (ScreenSizeUtils.getInstance(mContext).getScreenWidth() * builder .getWidth()); lp.height = WindowManager.LayoutParams.WRAP_CONTENT; lp.gravity = Gravity.CENTER; dialogWindow.setAttributes(lp); initDialog(); }
public MDAlertDialog(Builder builder) { mBuilder = builder; mDialog = new Dialog(mContext, R.style.MyDialogStyle); mDialogView = View.inflate(mContext, R.layout.widget_md_dialog, null); mTitle = (TextView) mDialogView.findViewById(R.id.md_dialog_title); mContent = (TextView) mDialogView.findViewById(R.id.md_dialog_content); mLeftBtn = (TextView) mDialogView.findViewById(R.id.md_dialog_leftbtn); mRightBtn = (TextView) mDialogView.findViewById(R.id.md_dialog_rightbtn); mDialogView.setMinimumHeight((int) (ScreenSizeUtils.getInstance(mContext).getScreenHeight () * builder.getHeight())); mDialog.setContentView(mDialogView); Window dialogWindow = mDialog.getWindow(); WindowManager.LayoutParams lp = dialogWindow.getAttributes(); lp.width = (int) (ScreenSizeUtils.getInstance(mContext).getScreenWidth() * builder.getWidth()); lp.height = WindowManager.LayoutParams.WRAP_CONTENT; lp.gravity = Gravity.CENTER; dialogWindow.setAttributes(lp); initDialog(); }
final View thisView = this; thisView.setBackgroundColor(0xff283645); thisView.setMinimumHeight(DensityUtil.dp2px(150));
final DensityUtil density = new DensityUtil(); thisView.setMinimumHeight(density.dip2px(100));
playerImpl.getLoadingPanel().setMinimumHeight(popupLayoutParams.height); windowManager.addView(rootView, popupLayoutParams);
mSunSize = density.dip2px(40); final View thisView = this; thisView.setMinimumHeight(density.dip2px(100));
thisView.setMinimumHeight(DensityUtil.dp2px(150));