当前位置: 首页>>代码示例>>Java>>正文


Java View.getTag方法代码示例

本文整理汇总了Java中android.view.View.getTag方法的典型用法代码示例。如果您正苦于以下问题:Java View.getTag方法的具体用法?Java View.getTag怎么用?Java View.getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.getTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getView

import android.view.View; //导入方法依赖的package包/类
public View getView(final int position, View convertView,
		final ViewGroup parent) {
	final Holder holder;
	if (convertView == null) {
		holder = new Holder();
		convertView = context.getLayoutInflater().inflate(
				R.layout.item_cinemalist, null);
		holder.tvCinemaName = (TextView) convertView
				.findViewById(R.id.tvCinemaName);
		holder.tvCinemaId = (TextView) convertView
				.findViewById(R.id.tvCinemaId);
		convertView.setTag(holder);
	} else {
		holder = (Holder) convertView.getTag();
	}

	CinemaBean cinema = cinemaList.get(position);
	holder.tvCinemaName.setText(cinema.getCinemaName());
	holder.tvCinemaId.setText(cinema.getCinemaId());
	return convertView;
}
 
开发者ID:BaoBaoJianqiang,项目名称:AndroidNetwork,代码行数:22,代码来源:CinemaAdapter.java

示例2: getView

import android.view.View; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
        holder = new ViewHolder();
        convertView = View.inflate(cxt, R.layout.list_cell_diary_detail,
                null);
        holder.week = (TextView) convertView
                .findViewById(R.id.item_diary_detail_week);
        holder.content = (TextView) convertView
                .findViewById(R.id.item_diary_detail_content);
        holder.imageWeek = (ImageView) convertView
                .findViewById(R.id.item_diary_detail_img);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    holder.week.setText(getWeek(position, holder.imageWeek));
    holder.content.setText(stripTags(datas.get(position).toString()));
    return convertView;
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:22,代码来源:TeamDiaryDetailAdapter.java

示例3: getView

import android.view.View; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup viewGroup) {
    View v = convertView;
    if (v == null) {
        CardAdapter cardAdapter = mCardAbles.get(position).onCreateAdapter();
        if (cardAdapter != null) {
            if (cardAdapter instanceof BaseViewModel)
                ((BaseViewModel) cardAdapter).setContext(mContext);

            v = cardAdapter.getItemView();
            if (v != null) {
                v.setTag(cardAdapter);
            }
        }
    }
    if (v != null) {
        Object tagValue = v.getTag();
        if (tagValue != null && tagValue instanceof CardAdapter) {
            CardAdapter adapter = (CardAdapter) tagValue;
            adapter.bindView(v, getItem(position));
        }
    }
    return v;
}
 
开发者ID:8luerain,项目名称:AutoCar,代码行数:25,代码来源:CardListAdapter.java

示例4: getView

import android.view.View; //导入方法依赖的package包/类
@SuppressLint({"ResourceAsColor"})
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder vh;
    if (convertView == null) {
        convertView = UIs.inflate(this.mContext, R.layout.point_item, null);
        vh = new ViewHolder(this);
        vh.title = (TextView) convertView.findViewById(R.id.point_title);
        vh.point = (TextView) convertView.findViewById(R.id.points_letv);
        vh.state = (TextView) convertView.findViewById(R.id.point_state);
        convertView.setTag(vh);
    } else {
        vh = (ViewHolder) convertView.getTag();
    }
    vh.title.setText(((PointBean) this.list.get(position)).rname);
    vh.point.setText("+" + ((PointBean) this.list.get(position)).credit);
    if (((PointBean) this.list.get(position)).state < ((PointBean) this.list.get(position)).rewardnum) {
        vh.state.setText((Integer.parseInt(((PointBean) this.list.get(position)).credit) * ((PointBean) this.list.get(position)).state) + "/" + (Integer.parseInt(((PointBean) this.list.get(position)).credit) * ((PointBean) this.list.get(position)).rewardnum));
    } else {
        vh.state.setTextColor(2131493377);
        vh.state.setText(this.mContext.getString(2131100064));
    }
    return convertView;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:24,代码来源:PointItemAdapter.java

示例5: getView

import android.view.View; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ItemViewDelegate itemViewDelegate = mItemViewDelegateManager.getItemViewDelegate(mDatas.get(position), position);
    int layoutId = itemViewDelegate.getItemViewLayoutId();
    ViewHolder viewHolder = null ;
    if (convertView == null)
    {
        View itemView = LayoutInflater.from(mContext).inflate(layoutId, parent,
                false);
        viewHolder = new ViewHolder(mContext, itemView, parent, position);
        viewHolder.mLayoutId = layoutId;
        onViewHolderCreated(viewHolder,viewHolder.getConvertView());
    } else
    {
        viewHolder = (ViewHolder) convertView.getTag();
        viewHolder.mPosition = position;
    }


    convert(viewHolder, getItem(position), position);
    return viewHolder.getConvertView();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:MultiItemTypeAdapter.java

示例6: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
    String nbr = (String) view.getTag();
    if (!TextUtils.isEmpty(nbr)) {
        SipProfile acc = mAccountChooserButton.getSelectedAccount();
        Intent it = new Intent(Intent.ACTION_CALL);
        it.setData(SipUri.forgeSipUri(SipManager.PROTOCOL_CSIP, nbr));
        it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        it.putExtra(SipProfile.FIELD_ACC_ID, acc.id);
        startActivity(it);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:CallLogDetailsFragment.java

示例7: getViewHolderFromView

import android.view.View; //导入方法依赖的package包/类
public static ViewHolderCreator.ViewHolder getViewHolderFromView(@NonNull View view) {
    Object holder = view.getTag(R.id.TANGRAM_VIEW_HOLDER_TAG);
    if (holder instanceof ViewHolder) {
        return (ViewHolder) holder;
    }
    return null;
}
 
开发者ID:alibaba,项目名称:Tangram-Android,代码行数:8,代码来源:ViewHolderCreator.java

示例8: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    try {
        String url = (String) v.getTag();
        if (url != null) {
            Uri uri = Uri.parse(url);
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            startActivity(intent);
        }
    } catch (Exception e) {
        Toast.makeText(this, e.getLocalizedMessage(), Toast.LENGTH_LONG).show();
        Log.e("Webs", e.getMessage(), e);
    }
}
 
开发者ID:quaap,项目名称:BookyMcBookface,代码行数:15,代码来源:GetBooksActivity.java

示例9: messageWithTextReceive

import android.view.View; //导入方法依赖的package包/类
/**
 * 消息类型之接收的文本消息
 *
 * @param position
 * @param convertView
 * @param parent
 * @param message
 * @return
 */
private View messageWithTextReceive(int position, View convertView, ViewGroup parent, IMMessage message) {

    TextReceiveHolder holder;
    if (convertView == null) {
        convertView = inflateLayout(R.layout.kf5_message_item_with_text_left, parent);
        holder = new TextReceiveHolder(convertView);
    } else {
        holder = (TextReceiveHolder) convertView.getTag();
    }
    holder.bindData(message, position, getItem(position - 1));
    return convertView;
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:22,代码来源:MessageAdapter.java

示例10: addMarginTopEqualStatusBarHeight

import android.view.View; //导入方法依赖的package包/类
/**
 * 为view增加MarginTop为状态栏高度
 *
 * @param view view
 */
public static void addMarginTopEqualStatusBarHeight(@NonNull View view) {
    Object haveSetOffset = view.getTag(TAG_OFFSET);
    if (haveSetOffset != null && (Boolean) haveSetOffset) return;
    ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
    layoutParams.setMargins(layoutParams.leftMargin,
            layoutParams.topMargin + getStatusBarHeight(),
            layoutParams.rightMargin,
            layoutParams.bottomMargin);
    view.setTag(TAG_OFFSET, true);
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:16,代码来源:BarUtils.java

示例11: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.btn_message_activity:

            if (listener != null && view.getTag() instanceof Routine.Type) {
                Routine.Type type = (Routine.Type) view.getTag();
                Routine routine = new Routine(type);
                listener.onStartRoutine(routine);
            }

            dismissAllowingStateLoss();
            break;
    }
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:16,代码来源:DCMessageFragment.java

示例12: getView

import android.view.View; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View item = convertView;
    Holder holder;
    if (item == null) {
        item = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_logcat, parent, false);
        holder = new Holder(item);
    } else {
        holder = (Holder) item.getTag();
    }
    holder.parse(getItem(position));
    return item;
}
 
开发者ID:kyze8439690,项目名称:logcatviewer,代码行数:14,代码来源:LogcatAdapter.java

示例13: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    int position=(int)v.getTag();
    Log.d("已被点击","位置:"+position);
    Toast.makeText(mContext,"点击了第"+position+"项",Toast.LENGTH_LONG).show();
    Intent intent=new Intent(mContext, RecommendInfoActivity.class);
  mContext.startActivity(intent);
}
 
开发者ID:fikyair,项目名称:musicplayer,代码行数:9,代码来源:MyGridAdapter.java

示例14: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    MediaItemLayout itemLayout = (MediaItemLayout) v.getTag(R.id.media_layout);
    BaseMedia media = (BaseMedia) v.getTag();
    if (mMediaConfig.getMode() == BoxingConfig.Mode.MULTI_IMG) {
        if (mOnCheckedListener != null) {
            mOnCheckedListener.onChecked(itemLayout, media);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:BoxingMediaAdapter.java

示例15: processExposureParams

import android.view.View; //导入方法依赖的package包/类
public static void processExposureParams(HashMap<String, Object> commonInfo, View exposureView, long exposureData, HashMap<String, Object> exposureIndex) {
    try {
        HashMap<String, Object> viewData = (HashMap<String, Object>) exposureView.getTag(TrackerConstants.VIEW_TAG_PARAM);
        String viewName = TrackerUtil.getClickViewName(exposureView);
        if (TextUtils.isEmpty(viewName)) {
            TrackerLog.d("processExposureParams viewName is null");
            return;
        }

        commitExposureParams(commonInfo, viewName, viewData, exposureData, exposureIndex);
    } catch (Throwable th) {
        TrackerLog.e("processExposureParams fail," + th.getMessage());
    }
}
 
开发者ID:alibaba,项目名称:android_viewtracker,代码行数:15,代码来源:DataProcess.java


注:本文中的android.view.View.getTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。