本文整理汇总了Java中android.widget.RelativeLayout.setAlpha方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeLayout.setAlpha方法的具体用法?Java RelativeLayout.setAlpha怎么用?Java RelativeLayout.setAlpha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.RelativeLayout
的用法示例。
在下文中一共展示了RelativeLayout.setAlpha方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
public View getItemView(int position, View convertView, ViewHolder holder) {
Boolean isEdit = CartActivity.isEdit;
CartGoods goods = (CartGoods) this.goodsList.get(position);
RelativeLayout rl_title = (RelativeLayout) holder.getView(R.id.rl_title);
LinearLayout ll_edit = (LinearLayout) holder.getView(R.id.ll_edit);
TextView tv_goods_state = (TextView) holder.getView(R.id.tv_goods_state);
ToggleButton checkBox = (ToggleButton) holder.getView(R.id.tb_cart);
ImageView iv_goods = (ImageView) holder.getView(R.id.iv_goods);
TextView tv_goods_title = (TextView) holder.getView(R.id.tv_goods_title);
TextView tv_price_value = (TextView) holder.getView(R.id.tv_price_value);
Button btn_decrease = (Button) holder.getView(R.id.btn_decrease);
Button btn_increase = (Button) holder.getView(R.id.btn_increase);
TextView tv_goods_num = (TextView) holder.getView(R.id.tv_goods_num);
checkBox.setChecked(goods.isChecked.booleanValue());
this.loader.displayImage(goods.thumb_photo_url, iv_goods, this.options);
if (TextUtils.equals(goods_type.SpecGoods.name(), goods.type)) {
tv_goods_title.setText(goods.title);
} else {
tv_goods_title.setText(goods.title + ShopUtils.getFormatInfo(goods.chosen_specs));
}
tv_price_value.setText(this.ctx.getString(R.string.a04) + " " + this.ctx.getString(R
.string.ae4) + TextUtil.m2(goods.base_price));
tv_goods_num.setText(String.valueOf(goods.quantity));
btn_decrease.setOnClickListener(new onCreaseClickListener(tv_goods_num, btn_decrease,
goods));
btn_increase.setOnClickListener(new onCreaseClickListener(tv_goods_num, btn_increase,
goods));
if (goods.quantity > 1) {
btn_decrease.setEnabled(true);
btn_decrease.setBackgroundResource(R.drawable.ij);
} else {
btn_decrease.setEnabled(false);
}
if (isEdit.booleanValue()) {
checkBox.setVisibility(0);
btn_decrease.setVisibility(8);
btn_increase.setVisibility(8);
} else {
checkBox.setVisibility(8);
btn_decrease.setVisibility(0);
btn_increase.setVisibility(0);
}
if (goods.can_sale) {
tv_price_value.setVisibility(0);
tv_goods_state.setVisibility(8);
ll_edit.setVisibility(0);
rl_title.setAlpha(1.0f);
} else {
if (!TextUtils.isEmpty(goods.msg)) {
tv_goods_state.setText(goods.msg);
}
tv_price_value.setVisibility(8);
tv_goods_state.setVisibility(0);
ll_edit.setVisibility(8);
rl_title.setAlpha(0.5f);
}
return convertView;
}