Android Utililty Methods ViewGroup Set

List of utility methods to do ViewGroup Set


The list of methods to do ViewGroup Set are organized into topic(s).


voidlayoutChildAbsoluteCenter(ViewGroup parent, View child, int tWidth, int tHeight)
layout Child Absolute Center
int w, h, x, y;
w = child.getMeasuredWidth();
h = child.getMeasuredHeight();
x = centerSize(tWidth, w);
y = centerSize(tHeight, h);
child.layout(x, y, x + w, y + h);
voidsetReadingFontOnChildren(ViewGroup container)
set Reading Font On Children
Typeface font = Typeface.createFromAsset(container.getContext()
        .getAssets(), "Palatino.ttc");
View this_view;
for (int x = 0; x < container.getChildCount(); x++) {
    this_view = container.getChildAt(x);
    if (this_view.getTag() != null) {
        if (this_view.getTag().toString().compareTo("custom_font") == 0) {
            ((TextView) this_view).setTypeface(font,
voidsetSelected(ViewGroup viewGroup, boolean selected)
set Selected
for (int i = 0; i < viewGroup.getChildCount(); i++) {
voiddisableView(ViewGroup rootView, float alpha)
Disable all the childs of the selected root view
int count = rootView.getChildCount();
View v;
for (int i = 0; i < count; i++) {
    v = rootView.getChildAt(i);
    if (v != null) {
        if (v instanceof ViewGroup)
            disableView((ViewGroup) v, alpha);