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


Java RadioButton.setEnabled方法代码示例

本文整理汇总了Java中android.widget.RadioButton.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java RadioButton.setEnabled方法的具体用法?Java RadioButton.setEnabled怎么用?Java RadioButton.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.RadioButton的用法示例。


在下文中一共展示了RadioButton.setEnabled方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onViewCreated

import android.widget.RadioButton; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mRadioGroup = (RadioGroup) view.findViewById(R.id.radio_group);
    mShowAllButton = (RadioButton) view.findViewById(R.id.show_all);
    mRedactSensitiveButton = (RadioButton) view.findViewById(R.id.redact_sensitive);

    mRadioGroup.setOnCheckedChangeListener(this);

    // Disable buttons according to policy.
    if (isSecureNotificationsDisabled(getActivity())) {
        mShowAllButton.setEnabled(false);
        mRedactSensitiveButton.setEnabled(false);
    } else if (isUnredactedNotificationsDisabled(getActivity())) {
        mShowAllButton.setEnabled(false);
    }
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:18,代码来源:RedactionInterstitial.java

示例2: handleCondition

import android.widget.RadioButton; //导入方法依赖的package包/类
protected void handleCondition(Condition c) {
    if (mConditions.contains(c)) return;
    RadioButton v = (RadioButton) findViewWithTag(c.id);
    if (c.state == Condition.STATE_TRUE || c.state == Condition.STATE_UNKNOWN) {
        if (v == null) {
            v = newRadioButton(c);
        }
    }
    if (v != null) {
        v.setText(computeConditionText(c));
        v.setEnabled(c.state == Condition.STATE_TRUE);
    }
    mConditions.add(c);
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:15,代码来源:ZenModeConditionSelection.java

示例3: onCreateView

import android.widget.RadioButton; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View myInflater = inflater.inflate(R.layout.fragment_setup_step1, container, false);


    RadioButton keepRadioButton = (RadioButton) myInflater.findViewById(R.id.keepRadio);

    if(getArguments().getBoolean("oldData")){
        keepRadioButton.setEnabled(true);
    }

    final Button next = (Button) myInflater.findViewById(R.id.nextButton);

    RadioGroup radioGroup = (RadioGroup) myInflater.findViewById(R.id.firstSelectionRadioGroup);

    radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()
    {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            if(checkedId == R.id.keepRadio){
                next.setText(getString(R.string.setup_finish));
            } else {
                next.setText(getString(R.string.setup_next));
            }
        }
    });

    return myInflater;
}
 
开发者ID:michaelachmann,项目名称:LnkShortener,代码行数:32,代码来源:SetupStep1Fragment.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: addIndex

import android.widget.RadioButton; //导入方法依赖的package包/类
/**
 * 添加指示器
 */
private void addIndex(){
    RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParams.setMargins(10,0,10,0);
    RadioButton radioButton = new RadioButton(getContext());
    radioButton.setLayoutParams(layoutParams);
    radioButton.setButtonDrawable(indicatorResId);
    radioButton.setEnabled(false);
    buttons.add(radioButton);
}
 
开发者ID:Militch,项目名称:banner-holder,代码行数:13,代码来源:BannerHolderView.java

示例6: setEnabled

import android.widget.RadioButton; //导入方法依赖的package包/类
/**
 * 不可编辑
 *
 * @param radioButtons
 */
public static void setEnabled(boolean enabled, RadioButton... radioButtons) {
    for (RadioButton e : radioButtons) {
        e.setEnabled(enabled);
    }
}
 
开发者ID:abook23,项目名称:godlibrary,代码行数:11,代码来源:CheckUtils.java

示例7: getRadios

import android.widget.RadioButton; //导入方法依赖的package包/类
private static View getRadios(Activity activity, LayoutInflater inflater, final SignUpEventOptions options) {
    View view = inflater.inflate(R.layout.event_sign_up_radios, null);
    ((TextView) view.findViewById(R.id.tv_label)).setText(options.getLabel() + (options.isRequired() ? "" : "(选填)") + ":");
    RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.rg_options);
    RadioGroup.LayoutParams params = new RadioGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);
    params.setMarginEnd(100);
    if (!TextUtils.isEmpty(options.getOption())) {
        String[] list = options.getOption().split(";");
        String[] status = null;
        if (!TextUtils.isEmpty(options.getOptionStatus()))
            status = options.getOptionStatus().split(";");
        for (int i = 0; i < list.length; i++) {
            RadioButton button = new RadioButton(activity);
            button.setLayoutParams(params);
            button.setText(list[i]);
            if (!TextUtils.isEmpty(options.getDefaultValue())) {
                button.setChecked(list[0].equals(options.getDefaultValue()));
                options.setValue(options.getDefaultValue());
            } else {
                button.setChecked(i == 0);
                options.setValue(list[0]);
            }
            boolean enable;
            if (status == null)
                enable = true;
            else if (status.length <= i)
                enable = true;
            else
                enable = "0".equals(status[0]);
            button.setId(i);
            button.setEnabled(enable);
            radioGroup.addView(button);
        }
    }
    radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            String s[] = options.getOption().split(";");
            if (s != null)
                options.setValue(s[checkedId]);
        }
    });
    return view;
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:47,代码来源:ViewFactory.java

示例8: updateDurationsState

import android.widget.RadioButton; //导入方法依赖的package包/类
public void updateDurationsState(View view, int id, boolean enabled) {
	RadioButton radioButton = (RadioButton)view.findViewById(id);
	radioButton.setEnabled(enabled);
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:5,代码来源:TGStrokeDialog.java


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