當前位置: 首頁>>代碼示例>>Java>>正文


Java LinearLayout.setEnabled方法代碼示例

本文整理匯總了Java中android.widget.LinearLayout.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java LinearLayout.setEnabled方法的具體用法?Java LinearLayout.setEnabled怎麽用?Java LinearLayout.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.LinearLayout的用法示例。


在下文中一共展示了LinearLayout.setEnabled方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getView

import android.widget.LinearLayout; //導入方法依賴的package包/類
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
        convertView = mInflater.inflate(ResourceUtils
                .getIdByName(context, "layout", "sobot_list_item_skill"), null);
    }
    sobot_ll_skill = (LinearLayout) convertView.findViewById(ResourceUtils
            .getIdByName(context, "id", "sobot_ll_skill"));
    sobot_tv_skill_name = (TextView) convertView.findViewById(ResourceUtils
            .getIdByName(context, "id", "sobot_tv_skill_name"));
    sobot_tv_status = (TextView) convertView.findViewById(ResourceUtils
            .getIdByName(context, "id", "sobot_tv_status"));
    ZhiChiGroupBase zhiChiSkillIModel = (ZhiChiGroupBase) list.get(position);
    if (zhiChiSkillIModel != null && !TextUtils.isEmpty(zhiChiSkillIModel.getGroupName())) {
        sobot_ll_skill.setVisibility(View.VISIBLE);
        sobot_tv_skill_name.setText(zhiChiSkillIModel.getGroupName());
        if (zhiChiSkillIModel.isOnline().equals("true")) {
            sobot_ll_skill.setEnabled(true);
            sobot_tv_skill_name.setTextColor(Color.parseColor("#000000"));
            sobot_tv_status.setVisibility(View.GONE);
        } else {
            sobot_tv_status.setVisibility(View.VISIBLE);
            if (msgFlag == ZhiChiConstant.sobot_msg_flag_open) {
                sobot_tv_skill_name.setTextColor(Color.parseColor("#000000"));
                sobot_ll_skill.setEnabled(true);
                sobot_tv_status.setText(getResString("sobot_str_bottom_message"));
            } else {
                sobot_tv_skill_name.setTextColor(context.getResources().getColor(ResourceUtils.getIdByName(context, "color", "sobot_color_item_skill_offline")));
                sobot_ll_skill.setEnabled(false);
                sobot_tv_status.setText(getResString("sobot_str_bottom_offline"));
            }
        }
    } else {
        sobot_ll_skill.setVisibility(View.INVISIBLE);
        sobot_tv_skill_name.setText("");
        sobot_tv_status.setText("");
        sobot_tv_status.setCompoundDrawables(null, null, null, null);
    }
    return convertView;
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:41,代碼來源:SobotSikllAdapter.java


注:本文中的android.widget.LinearLayout.setEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。