setVisibility ( )源码实例Demo

android.widget.RadioGroup#setVisibility ( )源码实例Demo

下面列出了android.widget.RadioGroup#setVisibility ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TraceByAmap   文件: CustomLocationActivity.java
/**
 * 初始化
 */
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);
}
 
源代码2 项目: UPMiss   文件: RelationView.java
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();
}
 
源代码3 项目: AndroidAPS   文件: SWPlugin.java
@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);
}