當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。