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


Java RadioButton.setTag方法代碼示例

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


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

示例1: bindType

import android.widget.RadioButton; //導入方法依賴的package包/類
private void bindType(int id, RuleInfo ri) {
    final RadioButton rb = (RadioButton) mTypes.findViewById(id);
    if (ri == null) {
        rb.setVisibility(View.GONE);
        return;
    }
    rb.setVisibility(View.VISIBLE);
    if (ri.caption != null) {
        rb.setText(ri.caption);
    }
    rb.setTag(ri);
}
 
開發者ID:ric96,項目名稱:lineagex86,代碼行數:13,代碼來源:ZenRuleNameDialog.java

示例2: newRadioButton

import android.widget.RadioButton; //導入方法依賴的package包/類
private RadioButton newRadioButton(Condition condition) {
    final RadioButton button = new RadioButton(mContext);
    button.setTag(condition);
    button.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                setCondition((Condition) button.getTag());
            }
        }
    });
    addView(button);
    return button;
}
 
開發者ID:ric96,項目名稱:lineagex86,代碼行數:15,代碼來源:ZenModeConditionSelection.java

示例3: initCheckGroup

import android.widget.RadioButton; //導入方法依賴的package包/類
private void initCheckGroup(final OrderTestModel.OrderItemCheckListBean model, LayoutInflater inflater) {
        for (int z = 0; z < model.checkItemSuggestions.size(); z++) {
            final OrderTestModel.OrderItemCheckListBean.CheckItemSuggestionsBean item = model.checkItemSuggestions.get(z);
//            final RadioButton ckview = (RadioButton)inflater.inflate(R.layout.fragment_test_item_ck, null);
            final RadioButton ckview = new RadioButton(activity);
            ckview.setText(item.suggestionOption);
            if (item.isChecked.equals("1")) {
                checkId = item.checkItemSuggestionsId;
                ckview.setChecked(true);
            } else {
                ckview.setChecked(false);
            }
            ckview.setTag(item.checkItemSuggestionsId);
            ckview.setTextColor(this.getResources().getColor(R.color.gray_text));
            ckview.setButtonDrawable(new ColorDrawable(Color.TRANSPARENT));
            ckview.setTextSize(18);
            ckview.setId(z);
            ckview.setPadding(2, 0, 12, 0);
            ckview.setGravity(Gravity.CENTER | left);
            Drawable drawable = getResources().getDrawable(
                    R.drawable.checkbox_selector_circle_bac);
            // 這一步必須要做,否則不會顯示.
            drawable.setBounds(0, 0, drawable.getMinimumWidth(),
                    drawable.getMinimumHeight());
            ckview.setCompoundDrawables(drawable, null, null, null);
            ckview.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    checkId = (String) ckview.getTag();
                }
            });
            llsugestcontain.addView(ckview);
        }
    }
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:35,代碼來源:TestItemView.java

示例4: fillHarmonic

import android.widget.RadioButton; //導入方法依賴的package包/類
public void fillHarmonic(final View view, final int id, final int value, int selection, boolean enabled) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setTag(Integer.valueOf(value));
	radioButton.setChecked(value == selection);
	radioButton.setEnabled(enabled);
	radioButton.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
			fillData(view, value, 0);
		}
	});
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:12,代碼來源:TGHarmonicDialog.java

示例5: initView

import android.widget.RadioButton; //導入方法依賴的package包/類
private void initView() {
    final RadioGroup group = (RadioGroup) getView().findViewById(
            R.id.ringtoneGroup);

    RingtoneManager manager = new RingtoneManager(getActivity());
    manager.setType(RingtoneManager.TYPE_RINGTONE);
    int pdng = (int) (5 * getResources().getDisplayMetrics().density + .5f);
    final String[] columns = {MediaStore.Images.Media.DATA,
            MediaStore.Audio.Media._ID};
    final String orderBy = MediaStore.Images.Media._ID;
    Cursor imagecursor = getActivity().getContentResolver().query(
            MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, columns, null,
            null, orderBy);
    int dataColumnIndex = imagecursor
            .getColumnIndex(MediaStore.Audio.Media.DATA);
    for (int i = 0; i < imagecursor.getCount(); i++) {
        imagecursor.moveToPosition(i);
        final String uri = imagecursor.getString(dataColumnIndex);
        final String title = uri.substring(uri.lastIndexOf("/") + 1);
        RadioButton rb = new RadioButton(getActivity());
        rb.setLayoutParams(new RadioGroup.LayoutParams(
                RadioGroup.LayoutParams.MATCH_PARENT,
                RadioGroup.LayoutParams.WRAP_CONTENT));
        rb.setText(title);
        rb.setTypeface(((OneSheeldApplication) getActivity()
                .getApplication()).appFont);
        rb.setGravity(Gravity.CENTER);
        rb.setPadding(pdng, pdng, pdng, pdng);
        rb.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
        rb.setTextColor(getResources().getColor(R.color.textColorOnDark));
        rb.setBackgroundResource(R.drawable.devices_list_item_selector);
        rb.setTag(uri);
        rb.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                ((OneSheeldApplication) getActivity().getApplication())
                        .setBuzzerSound(uri);
            }
        });
        group.addView(rb);
    }
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:44,代碼來源:BuzzerShieldSettings.java

示例6: fillDuration

import android.widget.RadioButton; //導入方法依賴的package包/類
public void fillDuration(View view, int id, int value, int selection) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setTag(Integer.valueOf(value));
	radioButton.setChecked(value == selection);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:6,代碼來源:TGStrokeDialog.java

示例7: fillOption

import android.widget.RadioButton; //導入方法依賴的package包/類
public void fillOption(View view, int id, Integer value, boolean selected) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setTag(Integer.valueOf(value));
	radioButton.setChecked(selected);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:6,代碼來源:TGMeasureAddDialog.java

示例8: fillOnBeatOption

import android.widget.RadioButton; //導入方法依賴的package包/類
public void fillOnBeatOption(View view, int id, boolean value, boolean selection) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setTag(Boolean.valueOf(value));
	radioButton.setChecked(value == selection);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:6,代碼來源:TGGraceDialog.java

示例9: fillDynamic

import android.widget.RadioButton; //導入方法依賴的package包/類
public void fillDynamic(View view, int id, int value, int selection) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setTag(Integer.valueOf(value));
	radioButton.setChecked(value == selection);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:6,代碼來源:TGGraceDialog.java

示例10: fillTransition

import android.widget.RadioButton; //導入方法依賴的package包/類
public void fillTransition(View view, int id, int value, int selection) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setTag(Integer.valueOf(value));
	radioButton.setChecked(value == selection);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:6,代碼來源:TGGraceDialog.java

示例11: updateRadio

import android.widget.RadioButton; //導入方法依賴的package包/類
public void updateRadio(RadioButton button, Integer value, Integer selection) {
	button.setTag(Integer.valueOf(value));
	button.setChecked(selection != null && selection.equals(value));
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:5,代碼來源:TGTempoDialog.java

示例12: initView

import android.widget.RadioButton; //導入方法依賴的package包/類
private void initView() {
    String[] btnNameArr = groupBtnName.split("#");
    String[] btnCodeArr = groupBtnCode.split("#");

    Log.d("gyw", btnNameArr.length + "   length  :" + btnCodeArr.length);

    if ((btnNameArr.length < 2) || (btnCodeArr.length < 2)) {
        throw new RuntimeException("names和codes的格式不正確...");
    }

    for (int i = 0; i < btnCodeArr.length; i++) {

        //使用布局文件寫方便
        RadioButton rb = (RadioButton) View.inflate(mContext, R.layout.view_item_group_radio_button, null);

        if (btnCodeArr.length == 2) {
            if (i == 0) {
                rb.setBackgroundResource(R.drawable.left_button_selector);
                rb.setChecked(true);
            } else if (i == 1) {
                rb.setBackgroundResource(R.drawable.right_button_selector);
            }
        } else {
            if (i == 0) {
                rb.setBackgroundResource(R.drawable.left_button_selector);
                rb.setChecked(true);
            } else if (i == btnCodeArr.length - 1) {
                rb.setBackgroundResource(R.drawable.right_button_selector);
            } else {

                rb.setBackgroundResource(R.drawable.mid_button_selector);
            }
        }

        rb.setId(i);
        rb.setTag(btnCodeArr[i]);
        rb.setText(btnNameArr[i]);

        mRg.addView(rb);
    }
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:42,代碼來源:GroupButtonView.java


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