Example usage for android.view ViewGroup getContext

List of usage examples for android.view ViewGroup getContext

Introduction

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

Prototype

@ViewDebug.CapturedViewProperty
public final Context getContext() 

Source Link

Document

Returns the context the view is running in, through which it can access the current theme, resources, etc.

Usage

From source file:com.xamoom.android.xamoomcontentblocks.Adapters.ContentBlock7Adapter.java

@NonNull
@Override/*from w  ww . j a  v  a  2 s.  c o  m*/
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, Fragment fragment, EnduserApi enduserApi,
        String youtubeApiKey, LruCache bitmapCache, LruCache contentCache, boolean showContentLinks,
        ContentBlock3ViewHolder.OnContentBlock3ViewHolderInteractionListener onContentBlock3ViewHolderInteractionListener,
        XamoomContentFragment.OnXamoomContentFragmentInteractionListener onXamoomContentFragmentInteractionListener) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_block_7_layout, parent,
            false);
    return new ContentBlock7ViewHolder(view);
}

From source file:com.xamoom.android.xamoomcontentblocks.Adapters.ContentBlock9Adapter.java

@NonNull
@Override/*from   ww  w .jav  a  2s.  com*/
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, Fragment fragment, EnduserApi enduserApi,
        String youtubeApiKey, LruCache bitmapCache, LruCache contentCache, boolean showContentLinks,
        ContentBlock3ViewHolder.OnContentBlock3ViewHolderInteractionListener onContentBlock3ViewHolderInteractionListener,
        XamoomContentFragment.OnXamoomContentFragmentInteractionListener onXamoomContentFragmentInteractionListener) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_block_9_layout, parent,
            false);
    return new ContentBlock9ViewHolder(view, fragment, enduserApi);
}

From source file:com.xamoom.android.xamoomcontentblocks.Adapters.ContentBlock0Adapter.java

@NonNull
@Override// w ww  . j ava 2  s.  c  om
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, Fragment fragment, EnduserApi enduserApi,
        String youtubeApiKey, LruCache bitmapCache, LruCache contentCache, boolean showContentLinks,
        ContentBlock3ViewHolder.OnContentBlock3ViewHolderInteractionListener onContentBlock3ViewHolderInteractionListener,
        XamoomContentFragment.OnXamoomContentFragmentInteractionListener onXamoomContentFragmentInteractionListener) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_block_0_layout, parent,
            false);
    return new ContentBlock0ViewHolder(view);
}

From source file:com.xamoom.android.xamoomcontentblocks.Adapters.ContentBlock3Adapter.java

@NonNull
@Override/*from   w w w.j  a v  a  2s.c  o  m*/
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, Fragment fragment, EnduserApi enduserApi,
        String youtubeApiKey, LruCache bitmapCache, LruCache contentCache, boolean showContentLinks,
        ContentBlock3ViewHolder.OnContentBlock3ViewHolderInteractionListener onContentBlock3ViewHolderInteractionListener,
        XamoomContentFragment.OnXamoomContentFragmentInteractionListener onXamoomContentFragmentInteractionListener) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_block_3_layout, parent,
            false);
    return new ContentBlock3ViewHolder(view, fragment.getContext(),
            onContentBlock3ViewHolderInteractionListener);
}

From source file:com.xamoom.android.xamoomcontentblocks.Adapters.ContentBlock6Adapter.java

@NonNull
@Override/*from   w  w  w.  ja va2s  .  c  om*/
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, Fragment fragment, EnduserApi enduserApi,
        String youtubeApiKey, LruCache bitmapCache, LruCache contentCache, boolean showContentLinks,
        ContentBlock3ViewHolder.OnContentBlock3ViewHolderInteractionListener onContentBlock3ViewHolderInteractionListener,
        XamoomContentFragment.OnXamoomContentFragmentInteractionListener onXamoomContentFragmentInteractionListener) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_block_6_layout, parent,
            false);
    return new ContentBlock6ViewHolder(view, fragment.getContext(), enduserApi, contentCache,
            onXamoomContentFragmentInteractionListener);
}

From source file:de.Maxr1998.xposed.maxlock.ui.settings.appslist.AppListAdapter.java

@Override
public AppsListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_apps_item, parent, false);
    return new AppsListViewHolder(v);
}

From source file:com.lloydtorres.stately.census.CensusRecyclerAdapter.java

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    RecyclerView.ViewHolder viewHolder;// w w w.  j ava 2s .co m
    LayoutInflater inflater = LayoutInflater.from(parent.getContext());

    switch (viewType) {
    case CARD_BUTTON:
        View buttonCard = inflater.inflate(R.layout.card_button, parent, false);
        viewHolder = new SortButtonCard(buttonCard);
        break;
    default:
        View censusCard = inflater.inflate(R.layout.card_census_delta, parent, false);
        viewHolder = new CensusCard(censusCard);
        break;
    }

    return viewHolder;
}

From source file:com.h6ah4i.android.example.advrecyclerview.demo_ed_with_section.ExpandableDraggableWithSectionExampleAdapter.java

@Override
public MyGroupViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(parent.getContext());

    final View v;
    switch (viewType) {
    case GROUP_ITEM_VIEW_TYPE_SECTION_HEADER:
        v = inflater.inflate(R.layout.list_section_header, parent, false);
        break;//from   www . j  av a2 s. com
    case GROUP_ITEM_VIEW_TYPE_SECTION_ITEM:
        v = inflater.inflate(R.layout.list_group_item_draggable, parent, false);
        break;
    default:
        throw new IllegalStateException("Unexpected viewType (= " + viewType + ")");
    }

    return new MyGroupViewHolder(v);
}

From source file:com.andremion.louvre.home.GalleryAdapter.java

@Override
public GalleryAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, @ViewType int viewType) {
    if (VIEW_TYPE_MEDIA == viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_gallery_media, parent,
                false);//from w  w w. ja  v a2 s  .  c o  m
        return new MediaViewHolder(view);
    } else {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_gallery_bucket, parent,
                false);
        return new BucketViewHolder(view);
    }
}

From source file:com.hippo.widget.Snackbar.java

private Snackbar(ViewGroup parent) {
    mParent = parent;/*from   w  w  w .j av a2 s .  c o m*/
    mContext = parent.getContext();

    LayoutInflater inflater = LayoutInflater.from(mContext);
    mView = ((SnackbarLayout) inflater.inflate(R.layout.design_layout_snackbar, mParent, false));
}