View setTag - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for View setTag method.

This code example shows how to use the following methods:setTag, addView, setOrientation
                      ViewGroup parent) {
    ViewWrapper wrap=null;
    View row=convertView;
                             
    if (convertView==null) {
      LinearLayout layout=new LinearLayout(ctxt);
      RatingBar rate=new RatingBar(ctxt);
       
      rate.setNumStars(3);
      rate.setStepSize(1.0f);
       
      View guts=delegate.getView(position, null, parent);
     
      layout.setOrientation(LinearLayout.HORIZONTAL); 
           
      rate.setLayoutParams(new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.WRAP_CONTENT,
            LinearLayout.LayoutParams.FILL_PARENT));
      guts.setLayoutParams(new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.FILL_PARENT,

8
CodeRank
This code example shows how to use the following methods:setTag, setVisibility, setText
    private HttpImageGetter show(final TextView view, final CharSequence html) {
        if (TextUtils.isEmpty(html))
            return hide(view);
 
        try { 
            view.setText(html);
        } 
        catch (Exception e) {
        } 
        view.setVisibility(VISIBLE);
        view.setTag(null);
        return this;
    } 
 
    private HttpImageGetter hide(final TextView view) {
        view.setText(null);
        view.setVisibility(GONE);
        view.setTag(null);
        return this;
    } 

8
CodeRank
This code example shows how to use the following methods:getTag, setTag, getDrawable, setImageDrawable
    } 
 
    // protected for testing purposes 
    protected void loadBitmapAsynchronously(T octo, ImageView thumbImageView,
        String tempThumbnailImageFileName) {
        if (thumbImageView.getTag() != null
            && thumbImageView.getTag().equals(tempThumbnailImageFileName)) {
            return; 
        } 
 
        if (cancelPotentialWork(tempThumbnailImageFileName, thumbImageView)) {
            final BitmapWorkerTask task = new BitmapWorkerTask(thumbImageView,
                octo);
            task.fileName = tempThumbnailImageFileName;
            final AsyncDrawable asyncDrawable = new AsyncDrawable(getContext()
                .getResources(), task);
            thumbImageView.setImageDrawable(asyncDrawable);
            thumbImageView.setTag(tempThumbnailImageFileName);
            int width = Math.round(convertDpToPixel(IMG_WIDTH, getContext()));
            int height = width;

8
CodeRank
This code example shows how to use the following methods:setId, setTag, setImageDrawable, setScaleType, setVisibility
     * Sets up the status icon, creating it if necessary. 
     */ 
    public void setStatusButton(Drawable icon, int id, long appId) {
        if (icon != null) {
            if (mStatusButton == null) {
                mStatusButton = new ImageView(mContext);
                mStatusButton.setId(id);
                mStatusButton.setScaleType(ScaleType.CENTER);
                addView(mStatusButton);
            } 
            mStatusButton.setImageDrawable(icon);
            mStatusButton.setTag(appId);
            mStatusButton.setVisibility(View.VISIBLE);
        } else { 
            if (mStatusButton != null) {
                mStatusButton.setVisibility(View.GONE);
            } 
        } 
    } 
 
8
CodeRank
This code example shows how to use the following methods:clearAnimation, getAnimation, getContext, getTag, setTag
 
    ImageView view = getView();
    if (view == null)
      return; 
 
    if (!equals(view.getTag()))
      return; 
 
    view.setTag(null);
    if (result != null) {
      if (fadeIn && view.getAnimation() == null)
        view.startAnimation(AnimationUtils.loadAnimation(view.getContext(),
            android.R.anim.fade_in));
      view.setImageBitmap(result);
    } else { 
      view.setImageDrawable(null);
      view.clearAnimation();
    } 
  } 
} 

8
CodeRank
This code example shows how to use the following methods:findViewById, setTag
    public View doGetView(int position, View convertView, ViewGroup parent, boolean dropdown) {
        ViewHolder holder;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.user_list_item, null);
            holder = new ViewHolder();
            holder.gravatar = (ImageView) convertView.findViewById(R.id.iv_user_gravatar);
            holder.login = (TextView) convertView.findViewById(R.id.tv_user_login);
            convertView.setTag(holder);
        } else { 
            holder = (ViewHolder) convertView.getTag();
        } 
 
        final User user = getItem(position);
 
        final String login = user.getLogin();
        final String type = user.getType();
 
        final AQuery aq = new AQuery(convertView);
        aq.id(holder.gravatar)
                .image(user.getAvatarUrl(), true, true, 200, R.drawable.gravatar, null,

8
CodeRank
This code example shows how to use the following methods:setOnClickListener, setTag, setText
                                             LayoutParams.FILL_PARENT,
                                             1.0f); 
    } 
 
    public void addButton(String aText, int aCallback) {
        Button mButton = new Button(mContext);
        mButton.setText(aText);
        mButton.setTag(Integer.toString(aCallback));
        mButton.setOnClickListener(this);
        mChoicesLayout.addView(mButton, mLayoutParams);
    } 
 
    public void onClick(View v) {
        GeckoEvent e = GeckoEvent.createBroadcastEvent("Doorhanger:Reply", v.getTag().toString());
        GeckoAppShell.sendEventToGecko(e);
        mTab.removeDoorHanger(mValue);
 
        // This will hide the doorhanger (and hide the popup if there are no 
        // more doorhangers to show) 
        GeckoApp.mDoorHangerPopup.updatePopup(); 
8
CodeRank
This code example shows how to use the following methods:findViewById, getTag, setTag
This code example shows how to use the following methods:animate, getTag, getVisibility, setAlpha, setTag
         * @param view The view to be faded in 
         */ 
        public static void show(final View view) {
            if (FADE_DBG) log("Fade: SHOW view " + view + "...");
            if (FADE_DBG) log("Fade: - visibility = " + view.getVisibility());
            if ((view.getVisibility() != View.VISIBLE) || isFadingOut(view)) {
                view.animate().cancel();
                // ...and clear the FADE_STATE_KEY tag in case we just 
                // canceled an in-progress fade-out animation. 
                view.setTag(FADE_STATE_KEY, null);
 
                view.setAlpha(0);
                view.setVisibility(View.VISIBLE);
                view.animate().setDuration(ANIMATION_DURATION);
                view.animate().alpha(1);
                if (FADE_DBG) log("Fade: ==> SHOW " + view
                                  + " DONE.  Set visibility = " + View.VISIBLE);
            } else { 
                if (FADE_DBG) log("Fade: ==> Ignoring, already visible AND not fading out.");
            } 

7
CodeRank
This code example shows how to use the following methods:getTag, setTag, setImageDrawable
        if (imageView != null) {
            if (imageUrl == null) {
                // In a ListView views are reused, so we must be sure to remove the tag that could 
                // have been set to the ImageView to prevent that the wrong image is set. 
                imageView.setTag(null);
                imageView.setImageDrawable(dummyDrawable);
                return; 
            } 
            String oldImageUrl = (String) imageView.getTag();
            if (imageUrl.equals(oldImageUrl)) {
                // nothing to do 
                return; 
            } else { 
                // Set the dummy image while waiting for the actual image to be downloaded. 
                imageView.setImageDrawable(dummyDrawable);
                imageView.setTag(imageUrl);
            } 
        } 
 
        if (imageCache.containsKeyInMemory(imageUrl)) {
            // do not go through message passing, handle directly instead 
7
CodeRank

Related View setTag Questions & Answers:

setTag Method Overview
Sets a tag associated with this view and a key.
See Code Examples for other Android View Methods: