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.hyzs.onekeyhelp.home.adapter.HomeCircleRecyclerViewAdapter.java

@Override
public ImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    createLayoutInflater(parent.getContext());
    return new ImageViewHolder(mLayoutInflater.inflate(R.layout.item_home_recycler_imag, parent, false));
}

From source file:at.alladin.rmbt.android.adapter.result.QoSTestDetailPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    final Context context = container.getContext();
    View view = null;/* ww  w . ja v a 2s.c  o  m*/
    //view = new QoSCategoryView(context, activity, results.getTestDescMap().get(key), resultMap.get(key), descMap.get(key));
    view = new QoSTestDetailView(context, activity, resultList.get(position), descList);
    container.addView(view);
    return view;
}

From source file:com.justplay1.shoppist.features.currency.CurrencyAdapter.java

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_currency, parent, false);
    CurrencyItemViewHolder holder = new CurrencyItemViewHolder(view);
    holder.setClickListener(itemClickListener);
    return holder;
}

From source file:com.roxbyte.formality.adapter.DefaultPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    LayoutInflater layoutInflater = (LayoutInflater) container.getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View view = layoutInflater.inflate(resources[position], null);
    container.addView(view, 0);/*  ww  w.  j  a va 2 s . c  om*/
    return view;
}

From source file:com.flipkart.android.proteus.parser.custom.ViewPagerParser.java

@Override
public ProteusView createView(ViewGroup parent, JsonObject layout, JsonObject data, Styles styles, int index) {
    return new ProteusViewPager(parent.getContext());
}

From source file:com.farukcankaya.rtlviewpagerindicatorsample.ColorPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = LayoutInflater.from(container.getContext()).inflate(R.layout.item_color_pager, container,
            false);/*from ww w  .  java  2s.c  o m*/
    TextView numberTextView = (TextView) view.findViewById(R.id.number);
    TextView titleTextView = (TextView) view.findViewById(R.id.title);

    view.setBackgroundColor(colors[position]);
    numberTextView.setText(String.valueOf(position));
    titleTextView.setText(titles[position]);

    container.addView(view);
    return view;
}

From source file:com.justplay1.shoppist.features.units.UnitsAdapter.java

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_currency, parent, false);
    UnitItemViewHolder holder = new UnitItemViewHolder(view);
    holder.setClickListener(itemClickListener);
    return holder;
}

From source file:com.amazonaws.demo.messageboard.MessageQueueAdapter.java

public View getView(int pos, View convertView, ViewGroup parent) {
    TextView messageText = new TextView(parent.getContext());
    messageText.setText(this.getMessageText(pos));
    messageText.setGravity(Gravity.LEFT);
    messageText.setPadding(10, 10, 10, 10);
    messageText.setMaxWidth(200);//  ww w  . ja  va2  s .c o m
    messageText.setMinWidth(200);
    messageText.setTextSize(16);

    return messageText;
}

From source file:com.savvasdalkitsis.betwixt.demo.InterpolatorsAdapter.java

@Override
public ItemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    InterpolatorView view = (InterpolatorView) from(parent.getContext()).inflate(R.layout.view_interpolator,
            parent, false);/*from ww w.j a v a 2 s.co m*/
    return new ItemHolder(view);
}

From source file:com.example.mayankgupta.todo.RecyclerListFragment.java

@Nullable
@Override//from   w  ww.  j ava  2 s.  c o m
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    return new RecyclerView(container.getContext());

}