Java Code Examples for android.widget.RadioGroup#setVisibility()

The following examples show how to use android.widget.RadioGroup#setVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomLocationActivity.java    From TraceByAmap with MIT License 5 votes vote down vote up
/**
 * 初始化
 */
private void init() {
	if (aMap == null) {
		aMap = mapView.getMap();
		setUpMap();
	}
	mGPSModeGroup = (RadioGroup) findViewById(R.id.gps_radio_group);
	mGPSModeGroup.setVisibility(View.GONE);
	mLocationErrText = (TextView)findViewById(R.id.location_errInfo_text);
	mLocationErrText.setVisibility(View.GONE);
}
 
Example 2
Source File: RelationView.java    From UPMiss with GNU General Public License v3.0 5 votes vote down vote up
public RelationView(Context context, AttributeSet attrs) {
    super(context, attrs);
    LayoutInflater.from(context).inflate(R.layout.relation_view, this);
    mRdoGroupGender = (RadioGroup) findViewById(R.id.relation_radioGroup_gender);
    mRelations = getResources().getStringArray(R.array.array_contacts_relations);
    mRdoGroupGender.setVisibility(GONE);
    setChangeListener();
    onInitViewsTxt();
}
 
Example 3
Source File: SWPlugin.java    From AndroidAPS with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void generateDialog(LinearLayout layout) {

    Context context = layout.getContext();
    radioGroup = new RadioGroup(context);
    radioGroup.clearCheck();

    ArrayList<PluginBase> pluginsInCategory = MainApp.getSpecificPluginsList(pType);

    radioGroup.setOrientation(LinearLayout.VERTICAL);
    radioGroup.setVisibility(View.VISIBLE);

    TextView pdesc = new TextView(context);
    pdesc.setText(pluginDescription);
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.setMargins(0, 0, 0, 40);
    pdesc.setLayoutParams(params);
    layout.addView(pdesc);

    for (int i = 0; i < pluginsInCategory.size(); i++) {
        RadioButton rdbtn = new RadioButton(context);
        PluginBase p = pluginsInCategory.get(i);
        rdbtn.setId(View.generateViewId());
        rdbtn.setText(p.getName());
        if (p.isEnabled(pType))
            rdbtn.setChecked(true);
        rdbtn.setTag(p);
        radioGroup.addView(rdbtn);
        params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.setMargins(80, 0, 0, 0);
        TextView desc = new TextView(context);
        desc.setText(p.getDescription());
        desc.setLayoutParams(params);
        radioGroup.addView(desc);
    }

    radioGroup.setOnCheckedChangeListener((group, checkedId) -> {
        RadioButton rb = group.findViewById(checkedId);
        PluginBase plugin = (PluginBase) rb.getTag();
        plugin.setPluginEnabled(pType, rb.isChecked());
        plugin.setFragmentVisible(pType, rb.isChecked() && makeVisible);
        ConfigBuilderPlugin.getPlugin().processOnEnabledCategoryChanged(plugin, pType);
        ConfigBuilderPlugin.getPlugin().storeSettings("SetupWizard");
        RxBus.INSTANCE.send(new EventConfigBuilderChange());
        RxBus.INSTANCE.send(new EventSWUpdate(false));
    });
    layout.addView(radioGroup);
    super.generateDialog(layout);
}