Android Utililty Methods View Size Get

List of utility methods to do View Size Get

Description

The list of methods to do View Size Get are organized into topic(s).

Method

voidsetLayoutParams(View cover, Display display)
set Layout Params
Point size = getDisplaySize(display);
int width = size.x;
int height = size.y;
cover.setLayoutParams(new LayoutParams(width, height));
cover.setY((float) width);
voidmeasureView(View v)
measure View
ViewGroup.LayoutParams p = v.getLayoutParams();
if (p == null) {
    p = new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);
int childWidthSpec = ViewGroup.getChildMeasureSpec(0, 0 + 0,
        p.width);
...
voidmeasureView(View v)
measure View
if (v == null) {
    return;
int w = View.MeasureSpec.makeMeasureSpec(0,
        View.MeasureSpec.UNSPECIFIED);
int h = View.MeasureSpec.makeMeasureSpec(0,
        View.MeasureSpec.UNSPECIFIED);
v.measure(w, h);
...