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


Java RelativeLayout.setAlpha方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:59,代码来源:CartListAdapter.java


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