Example usage for android.view ViewGroup getId

List of usage examples for android.view ViewGroup getId

Introduction

In this page you can find the example usage for android.view ViewGroup getId.

Prototype

@IdRes
@ViewDebug.CapturedViewProperty
public int getId() 

Source Link

Document

Returns this view's identifier.

Usage

From source file:Main.java

public static void setFitsSystemWindows(Activity activity, boolean values) {
    ViewGroup rootView = (ViewGroup) ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0);
    Log.d("statusbar", "rootViewid  " + rootView.getId());
    rootView.setFitsSystemWindows(values);
    rootView.setClipToPadding(true);//w  ww.j  a v  a2  s.c o  m
}

From source file:Main.java

public static ViewGroup getParent(View v, int parentId) {
    ViewGroup p = (ViewGroup) v.getParent();
    while (true) {
        if (p == null) {
            return null;
        }// w w w . ja  va2 s .co m
        if (p.getId() == parentId) {
            return p;
        }
        p = (ViewGroup) p.getParent();
    }
}

From source file:com.androidinspain.deskclock.FragmentTabPagerAdapter.java

@Override
public void startUpdate(ViewGroup container) {
    if (container.getId() == View.NO_ID) {
        throw new IllegalStateException("ViewPager with adapter " + this + " has no id");
    }//from   w  w  w  .j av a2  s. co m
}

From source file:cn.youngkaaa.yviewpager.YFragmentPagerAdapter.java

@Override
public void startUpdate(ViewGroup container) {
    if (container.getId() == View.NO_ID) {
        throw new IllegalStateException("ViewPager with adapter " + this + " requires a view id");
    }/*from  www.j ava 2s.  c  o  m*/
}

From source file:forms.formtemplates.Login.FacebookTypeLoginFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    mContainerId = container.getId();
    // Added Code CustomScreen

    loginView = inflater.inflate(R.layout.login_facebook_type_layout, container, false);
    /*setActionBarTitle(
    getResources().getString(R.string.login_title));*/
    label1val = (EditText) loginView.findViewById(R.id.txtUserName);
    label2val = (EditText) loginView.findViewById(R.id.txtPassword);
    submit = (Button) loginView.findViewById(R.id.buttonSignIn);
    submit.setOnClickListener(FacebookTypeLoginFragment.this);

    return loginView;
}

From source file:fr.julienvermet.bugdroid.ui.phone.BugActivity.java

/**
 * Searches the view hierarchy excluding the content view for a possible
 * Spinner in the ActionBar./*from   w w w  .  ja  v a  2  s  . c  o m*/
 * 
 * @param root
 *            The parent of the content view
 * @param position
 *            The position that should be selected
 * @return if the spinner was found and adjusted
 */
private boolean findAndUpdateSpinner(Object root, int position) {
    if (root instanceof android.widget.Spinner) {
        // Found the Spinner
        Spinner spinner = (Spinner) root;
        spinner.setSelection(position);
        return true;
    } else if (root instanceof ViewGroup) {
        ViewGroup group = (ViewGroup) root;
        if (group.getId() != android.R.id.content) {
            // Found a container that isn't the container holding our screen
            // layout
            for (int i = 0; i < group.getChildCount(); i++) {
                if (findAndUpdateSpinner(group.getChildAt(i), position)) {
                    // Found and done searching the View tree
                    return true;
                }
            }
        }
    }
    // Nothing found
    return false;
}

From source file:org.enbyted.android.zseinfo.view.section.SectionsPagerAdapter.java

@Override
public BaseSection instantiateItem(ViewGroup container, int position) {
    startUpdate(container);/*  w w w .  j ava 2s  .  c o  m*/

    String name = makeFragmentName(container.getId(), position);
    BaseSection section = (BaseSection) fragmentManager.findFragmentByTag(name);
    if (section != null && section.isValid()) {
        Log.v(TAG, "Attaching item #" + position + ": f=" + section);
        currentTransaction.attach(section);
    } else {
        section = getSection(position);
        Log.v(TAG, "Adding item #" + position + ": f=" + section);
        currentTransaction.add(container.getId(), section, makeFragmentName(container.getId(), position));
        section.validate();
    }
    return section;
}

From source file:com.github.pockethub.ui.FragmentPagerAdapter.java

public Object instantiateItem(ViewGroup container, int position) {
    Object fragment = super.instantiateItem(container, position);
    containerId = container.getId();
    if (fragment instanceof Fragment) {
        tags.add(((Fragment) fragment).getTag());
    }//ww  w  .j a va 2 s .  co  m

    return fragment;
}

From source file:com.github.pockethub.android.ui.FragmentPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    Object fragment = super.instantiateItem(container, position);
    containerId = container.getId();
    if (fragment instanceof Fragment) {
        tags.add(((Fragment) fragment).getTag());
    }//from  w  w w. j  a  v a 2 s. c  o m

    return fragment;
}

From source file:com.chess.genesis.activity.BaseContentFrag.java

protected void initBaseContentFrag(final ViewGroup container) {
    act = (BaseActivity) getActivity();//from w  w w  . j a va 2 s.  com
    fragMan = getFragmentManager();

    // set the current view id that the fragment lives in
    containerId = container.getId();

    // set what layout we're in
    final View itab = act.findViewById(R.id.panel01);
    isTablet = itab != null;
}