Java Code Examples for android.widget.RelativeLayout.setAlpha()

The following are Jave code examples for showing how to use setAlpha() of the android.widget.RelativeLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: boohee_v5.6   File: CartListAdapter.java   Source Code and License Vote up 4 votes
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;
}