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.example.facebookfriendviewer.adapters.ViewCursorAdapter.java

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    final ViewHolder holder;
    LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    View view = inflater.inflate(viewLayout, null, false);

    holder = new ViewHolder();
    holder.image = (ImageView) view.findViewById(R.id.picture);
    holder.name = (TextView) view.findViewById(R.id.name);
    view.setTag(holder);//from w  ww.j a v a2 s  .com
    return view;
}

From source file:butter.droid.tv.presenters.showdetail.EpisodeCardPresenter.java

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
    mContext = parent.getContext();

    ImageCardView cardView = new ImageCardView(mContext);
    cardView.setCardType(BaseCardView.CARD_TYPE_INFO_UNDER);
    cardView.setInfoVisibility(BaseCardView.CARD_REGION_VISIBLE_ALWAYS);
    cardView.setFocusable(true);/*from   w w w  . jav a  2 s.  co m*/
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(ActivityCompat.getColor(mContext, R.color.default_background));

    return new ViewHolder(cardView);
}

From source file:app.webelement.com.employeetracker.rd.RecyclerListAdapter.java

@Override
public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_main, parent, false);
    ItemViewHolder itemViewHolder = new ItemViewHolder(view);
    return itemViewHolder;
}

From source file:com.albedinsky.android.setting.SettingEmptyPreference.java

/**
 *///w  w w  . j ava 2 s.c om
@Override
@SuppressLint("MissingSuperCall")
protected View onCreateView(ViewGroup parent) {
    final Space space = new Space(parent.getContext());
    space.setVisibility(View.GONE);
    return space;
}

From source file:com.coincollection.ReorderAdapter.java

@Override
public ReorderViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_element, parent, false);

    return new ReorderViewHolder(view);
}

From source file:com.amazonaws.devicefarm.android.referenceapp.Adapaters.DrawerAdapter.java

@Override
/**//from  w ww  .j  a  v a2s. c  o  m
 * Creates the view holder for the row
 */
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.drawer_row, parent, false);
    return new ViewHolder(view, viewType);
}

From source file:com.goforer.base.ui.adapter.BaseAdapter.java

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int type) {
    View view = LayoutInflater.from(viewGroup.getContext()).inflate(mLayoutResId, viewGroup, false);
    return createViewHolder(view, type);
}

From source file:com.andyiac.arch.adapter.ListAdapterHolder.java

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater mInflater = LayoutInflater.from(parent.getContext());
    final View sView = mInflater.inflate(R.layout.course_single_list_item, parent, false);
    return new ViewHolder(sView);
}

From source file:com.andyiac.arch.adapter.CourseDetailsListAdapterHolder.java

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater mInflater = LayoutInflater.from(parent.getContext());
    final View sView = mInflater.inflate(R.layout.course_details_single_list_item, parent, false);
    return new ViewHolder(sView);
}

From source file:com.aptoide.amethyst.ui.ViewPagerAdapterScreenshots.java

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

    @SuppressLint("InflateParams")
    final View v = LayoutInflater.from(container.getContext()).inflate(R.layout.row_item_screenshots_big, null);
    Glide.with(container.getContext()).load(urls.get(position))
            .placeholder(getPlaceholder(container.getContext()))
            .into((ImageView) v.findViewById(R.id.screenshot_image_big));
    container.addView(v);/*w ww .ja  v a2  s  .  c o  m*/
    return v;
}