Example usage for android.view View setTag

List of usage examples for android.view View setTag

Introduction

In this page you can find the example usage for android.view View setTag.

Prototype

public void setTag(final Object tag) 

Source Link

Document

Sets the tag associated with this view.

Usage

From source file:com.instagram.igdiskcache.demo.ui.ImageListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.recycler_view_frag, container, false);
    rootView.setTag(TAG);
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView);
    mAdapter = new ImageListAdapter(DATASET);
    mRecyclerView.setAdapter(mAdapter);// ww  w. j av a  2 s .  c  o m
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    return rootView;
}

From source file:com.doctoror.rxcursorloader.demo.ArtistsCursorAdapter.java

@Override
public View newView(final Context context, final Cursor cursor, final ViewGroup viewGroup) {
    final View view = mInflater.inflate(R.layout.list_item_two_line, viewGroup, false);
    view.setTag(new ViewHolder(view));
    return view;/*  w w w  .ja v a2s. c  om*/
}

From source file:com.emetophobe.permissionviewer.adapters.PermissionListAdapter.java

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = LayoutInflater.from(context).inflate(R.layout.adapter_simple_list_item, parent, false);
    view.setTag(new ViewHolder(view));
    return view;//from   w  w  w .ja  v  a  2s .  com
}

From source file:com.nickandjerry.dynamiclayoutinflator.DynamicLayoutInflator.java

public static void setDelegate(View root, Object delegate) {
    DynamicLayoutInfo info;/*from   ww  w . j a  va  2s  . c om*/
    if (root.getTag() == null || !(root.getTag() instanceof DynamicLayoutInfo)) {
        info = new DynamicLayoutInfo();
        root.setTag(info);
    } else {
        info = (DynamicLayoutInfo) root.getTag();
    }
    info.delegate = delegate;
}

From source file:com.emetophobe.permissionviewer.adapters.AppListAdapter.java

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = LayoutInflater.from(context).inflate(R.layout.adapter_applist_item, parent, false);
    view.setTag(new ViewHolder(view));
    return view;//  w  w w.  j  a  va  2s  .c  om
}

From source file:com.fullmeadalchemist.mustwatch.ui.recipe.RecipeListFragment.java

@Nullable
@Override// w ww  .j  a  va  2  s  .  com
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.recipe_list, container, false);
    rootView.setTag(TAG);

    mAdapter = new RecipeListViewAdapter(null, recipe -> {
        navigationController.navigateToRecipeDetail(recipe.id);
    });

    viewModel = ViewModelProviders.of(this, viewModelFactory).get(RecipeViewModel.class);
    viewModel.getCurrentUserId().observe(this, userId -> {
        viewModel.getRecipes(userId).observe(this, recipes -> {
            // update UI
            mAdapter.dataSet = recipes;
            mAdapter.notifyDataSetChanged();
        });
    });

    mRecyclerView = rootView.findViewById(R.id.recipe_list);

    mRecyclerView.setHasFixedSize(true);

    LinearLayoutManager llm = new LinearLayoutManager(getContext());
    llm.setOrientation(LinearLayoutManager.VERTICAL);

    mRecyclerView.setLayoutManager(llm);
    mRecyclerView.setAdapter(mAdapter);

    return rootView;
}

From source file:com.mario22gmail.license.nfc_project.FragmentSecureNotes.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View rootView = inflater.inflate(R.layout.fragment_secure_notes, container, false);
    rootView.setTag(TAG);
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_viewSecureNotes);

    mLayoutManager = new LinearLayoutManager(getActivity());
    mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER;

    if (savedInstanceState != null) {
        // Restore saved layout manager type.
        mCurrentLayoutManagerType = (LayoutManagerType) savedInstanceState.getSerializable(KEY_LAYOUT_MANAGER);
    }// ww w .  j  ava  2s . c  om
    setRecyclerViewLayoutManager(mCurrentLayoutManagerType);

    secureNotesAdapter = new SecureNotesAdapter(secureNotesDataSet);
    mRecyclerView.setAdapter(secureNotesAdapter);

    Intent setTitleIntent = new Intent("fragment.setTitle");
    setTitleIntent.putExtra("Title", "Continut card");
    NavigationDrawerActivity.getAppContext().sendBroadcast(setTitleIntent);

    return rootView;
}

From source file:brazole.com.secondtask.TabFragmentListView.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.tab_fragment_list_view, container, false);
    rootView.setTag(TAG);
    ListView mListView = (ListView) rootView.findViewById(R.id.lvMain);
    ListViewAdapter mListViewAdapter = new ListViewAdapter(getActivity(), mIssueList);
    mListView.setAdapter(mListViewAdapter);

    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override//from w w w .  j a  v a  2 s .c  o  m
        public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
            // Get Clicked item value and open detail activity
            mIntent = new Intent(getActivity(), SavedProblemActivity.class);
            mIntent.putExtra("issueId", mIssueList.get(position).getId());
            startActivity(mIntent);
        }
    });

    // fab show / hide
    final FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
    fab.attachToListView(mListView, new ScrollDirectionListener() {
        @Override
        public void onScrollDown() {
            fab.show();
        }

        @Override
        public void onScrollUp() {
            fab.hide();
        }
    });

    return rootView;
}

From source file:com.appjma.appdeployer.adapter.ShareAdapter.java

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = mInflater.inflate(R.layout.app_edit_share_item, parent, false);
    ViewHolder holder = new ViewHolder();
    view.setTag(holder);
    holder.mText1 = (TextView) view.findViewById(android.R.id.text1);
    View button = (View) view.findViewById(android.R.id.button1);
    button.setOnClickListener(this);
    button.setTag(holder);//  w w  w. j a v a  2  s.c  o  m
    return view;
}

From source file:com.enadein.carlogbook.adapter.DataValueAdapter.java

@Override
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
    DataValueHolder holder = new DataValueHolder();
    LayoutInflater inflater = LayoutInflater.from(context);
    View listItem = inflater.inflate(R.layout.data_value_item, null);

    holder.nameView = (TextView) listItem.findViewById(R.id.name);
    listItem.setTag(holder);

    return listItem;
}