Example usage for android.view ViewGroup addView

List of usage examples for android.view ViewGroup addView

Introduction

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

Prototype

public void addView(View child) 

Source Link

Document

Adds a child view.

Usage

From source file:com.fjoglar.etsitnoticias.view.adapter.AboutViewPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup collection, int position) {
    View layout = getPage(position, collection);
    collection.addView(layout);
    return layout;
}

From source file:com.oguzbabaoglu.cardpager.example.ColorAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {

    View view = new View(context);
    view.setBackgroundColor(generateRandomColor());
    container.addView(view);

    return view;/*from   ww w.ja  v a  2  s .c om*/
}

From source file:com.mikimedia.android.view.ObjectPageAdapter.java

@Override
public Object instantiateItem(ViewGroup parent, int position) {
    View view = recycler.isEmpty() ? null : recycler.remove(0);
    view = getView(position, view, parent);
    parent.addView(view);
    return view;//from  w w  w . ja  v a2s. c  o m
}

From source file:com.tcl.lzhang1.mymusic.ui.apdater.MyPageAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    // TODO Auto-generated method stub
    // return super.instantiateItem(container, position);
    container.addView(mViews.get(position));
    return mViews.get(position);
}

From source file:com.nextgis.maplibui.control.PhotoGallery.java

@Override
public void addToLayout(ViewGroup layout) {
    layout.addView(this);
}

From source file:com.jtechme.apphub.privileged.views.TabsAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = mTabs.get(position);
    container.addView(view);
    return view;/*from   ww  w  .  ja va 2  s .  c  o  m*/
}

From source file:com.inno.wang.view.smartlayout.v4.ViewPagerItemAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = getPagerItem(position).initiate(inflater, container);
    setBitmap(view, position);//from  w w w .j  av  a  2s.c o m
    container.addView(view);
    holder.put(position, new WeakReference<View>(view));
    return view;
}

From source file:de.aw.monma.snippets.SnippetTemplate.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    if (headerView() != 0) {
        View header = inflater.inflate(headerView(), container, false);
        ViewGroup vg = view.findViewById(R.id.snippetHeader);
        vg.addView(header);
    }/*ww  w. j  a  v  a 2 s .  co  m*/
    mContainer = view.findViewById(R.id.snippetDetails);
    mContainer.setOnClickListener(this);
    return view;
}

From source file:com.android.packageinstaller.TabsAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = mTabs.get(position).view;
    container.addView(view);
    return view;/*from ww w  .  j  a v  a 2s .  c o m*/
}

From source file:com.android.talkbacktests.testsession.TestSessionFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
    final View view = inflater.inflate(R.layout.fragment_test_content, container, false);

    final BaseTestContent content = TestController.getInstance().getSessionById(mSessionId)
            .getTestContent(mContentIndex);

    final TextView description = (TextView) (view.findViewById(R.id.contentContainer)
            .findViewById(R.id.description));
    description.setText(Html.fromHtml(content.getDescription()));
    description.setMovementMethod(LinkMovementMethod.getInstance());

    final TextView subtitle = (TextView) (view.findViewById(R.id.contentContainer).findViewById(R.id.title));
    subtitle.setText(content.getSubtitle());

    final Button previous = (Button) view.findViewById(R.id.previous);
    previous.setOnClickListener(this);

    final Button next = (Button) view.findViewById(R.id.next);
    next.setOnClickListener(this);

    assignButtonText(previous, next);//from  w  w  w .ja va  2s  . c om

    final ViewGroup contentArea = (ViewGroup) view.findViewById(R.id.content_area);
    contentArea.addView(content.getView(inflater, contentArea, getContext()));

    return view;
}