List of usage examples for android.view View getTag
@ViewDebug.ExportedProperty
public Object getTag()
From source file:beihua.example.com.kouding_app.MainActivity.java
public void onColorClicked(View v) { int color = Color.parseColor(v.getTag().toString()); changeColor(color); }
From source file:com.anysoftkeyboard.ui.dev.DeveloperToolsFragment.java
private void onUserClickedShareMemoryDump(View v) { File memDump = (File) v.getTag(); StringBuilder sb = new StringBuilder("Hi! Here is a memory dump file for "); sb.append(DeveloperUtils.getAppDetails(getActivity().getApplicationContext())); sb.append(DeveloperUtils.NEW_LINE);//from w ww .j a va 2 s . com sb.append(DeveloperUtils.getSysInfo()); shareFile(memDump, "AnySoftKeyboard Memory Dump File", sb.toString()); }
From source file:com.cn.pppcar.UserBaseInformationAct.java
/** * xml ?/* w w w. j a v a2 s . c om*/ * @param view */ public void uploadHeadPortrait(View view) { PictureSelecctDialog pictureSelecctDialog = new PictureSelecctDialog(this, new View.OnClickListener() { @Override public void onClick(View v) { int tag = (Integer) v.getTag(); switch (tag) { case PictureSelecctDialog.FROM_ALBUM: imageHandler.openGalary(UserBaseInformationAct.this, Constants.REQUEST_OPEN_GALARY_FOR_HEAD_PORTRAIT); break; case PictureSelecctDialog.TAKE_PICTURE: imageHandler.openCamera(UserBaseInformationAct.this, Constants.REQUEST_OPEN_CAMERA_FOR_HEAD_PORTRAIT); break; default: break; } } }); pictureSelecctDialog.show(); }
From source file:com.cn.pppcar.UserBaseInformationAct.java
/** * xml?//ww w . ja v a2 s. c o m * @param view */ public void uploadLicenseImage(View view) { PictureSelecctDialog pictureSelecctDialog = new PictureSelecctDialog(this, new View.OnClickListener() { @Override public void onClick(View v) { int tag = (Integer) v.getTag(); switch (tag) { case PictureSelecctDialog.FROM_ALBUM: imageHandler.openGalary(UserBaseInformationAct.this, Constants.REQUEST_OPEN_GALARY_FOR_BUSINESS_LICENSE); break; case PictureSelecctDialog.TAKE_PICTURE: imageHandler.openCamera(UserBaseInformationAct.this, Constants.REQUEST_OPEN_CAMERA_FOR_BUSINESS_LICENSE); break; default: break; } } }); pictureSelecctDialog.show(); }
From source file:ac.robinson.mediaphone.provider.NarrativeAdapter.java
public void bindView(View view, Context context, Cursor cursor) { NarrativeViewHolder holder = (NarrativeViewHolder) view.getTag(); // only load column indices once if (mInternalIdIndex < 0) { mInternalIdIndex = cursor.getColumnIndexOrThrow(NarrativeItem.INTERNAL_ID); mCreationDateIndex = cursor.getColumnIndexOrThrow(NarrativeItem.DATE_CREATED); mSequenceIdIndex = cursor.getColumnIndexOrThrow(NarrativeItem.SEQUENCE_ID); }/*from w w w . j av a 2 s . com*/ holder.narrativeInternalId = cursor.getString(mInternalIdIndex); holder.narrativeDateCreated = cursor.getLong(mCreationDateIndex); holder.narrativeSequenceId = cursor.getInt(mSequenceIdIndex); final BrowserActivity activity = mActivity; if (activity.getScrollState() == AbsListView.OnScrollListener.SCROLL_STATE_FLING || activity.isPendingIconsUpdate()) { holder.queryIcons = true; holder.frameList.setAdapter(mEmptyAdapter); } else { attachAdapter(holder); holder.queryIcons = false; } // alternating row colours int cursorPosition = cursor.getPosition(); if ((cursor.getCount() - cursorPosition) % 2 == 0) { // so the colour stays the same when adding a new narrative holder.frameList.setBackgroundResource( mIsTemplateView ? R.color.template_list_dark : R.color.narrative_list_dark); } else { holder.frameList.setBackgroundResource( mIsTemplateView ? R.color.template_list_light : R.color.narrative_list_light); } }
From source file:edu.rit.csh.androidwebnews.PostSwipeableActivity.java
public void markUnread(View view) { int threadId = Integer.parseInt((String) view.getTag()); findThisThread(rootThread, threadId).setUnread("manual"); hc.markUnread(newsgroupName, threadId); Toast.makeText(getApplicationContext(), "Marking post as unread", Toast.LENGTH_LONG).show(); }
From source file:edu.rit.csh.androidwebnews.PostSwipeableActivity.java
public void postReply(View view) { String threadInfo = (String) view.getTag(); int threadId = Integer.parseInt(threadInfo.substring(0, threadInfo.indexOf("|"))); PostThread thread = findThisThread(rootThread, threadId); String subject = thread.getSubject(); String body = threadInfo.substring(threadInfo.indexOf("|") + 1, threadInfo.length()); String newBody = ""; String[] lines = body.split("\n"); for (String line : lines) newBody += ">" + line + "\n"; newBody = "On " + thread.getDate() + ", " + thread.getAuthorName() + " wrote:\n" + newBody; if (!subject.substring(0, 3).equals("Re:")) subject = "Re: " + subject; Intent myIntent = new Intent(this, ComposeActivity.class); myIntent.putExtra("NEWSGROUP", newsgroupName); myIntent.putExtra("SUBJECT", subject); myIntent.putExtra("QUOTED_TEXT", newBody); myIntent.putExtra("PARENT", thread.getNumber()); startActivity(myIntent);// ww w.j a va 2 s . com }
From source file:cnc.cad.mypicassso.SampleContactsAdapter.java
@Override public void bindView(View view, Context context, Cursor cursor) { Uri contactUri = Contacts.getLookupUri(cursor.getLong(ContactsQuery.ID), cursor.getString(ContactsQuery.LOOKUP_KEY)); ViewHolder holder = (ViewHolder) view.getTag(); holder.text1.setText(cursor.getString(ContactsQuery.DISPLAY_NAME)); holder.icon.assignContactUri(contactUri); Picasso.with(context).load(contactUri).placeholder(R.mipmap.contact_picture_placeholder).tag(context) .into(holder.icon);/* www . ja va 2 s.co m*/ }
From source file:com.android.picasso.sample.SampleContactsAdapter.java
@Override public void bindView(View view, Context context, Cursor cursor) { Uri contactUri = Contacts.getLookupUri(cursor.getLong(ContactsQuery.ID), cursor.getString(ContactsQuery.LOOKUP_KEY)); ViewHolder holder = (ViewHolder) view.getTag(); holder.text1.setText(cursor.getString(ContactsQuery.DISPLAY_NAME)); holder.icon.assignContactUri(contactUri); Picasso.with(context).load(contactUri).placeholder(R.drawable.contact_picture_placeholder).tag(context) .into(holder.icon);/*from w w w. j a va 2s. c o m*/ }
From source file:at.ac.tuwien.detlef.fragments.PodListFragment.java
@Override public void onListItemClick(ListView l, View v, int position, long id) { Podcast podcast = (Podcast) v.getTag(); listener.onPodcastSelected(podcast); }