internal static void UpdateBorderDrawable(this AppCompatRadioButton platformView, IRadioButton radioButton) { BorderDrawable?mauiDrawable = platformView.Background as BorderDrawable; if (mauiDrawable == null) { mauiDrawable = new BorderDrawable(platformView.Context); platformView.Background = mauiDrawable; } mauiDrawable.SetBackground(radioButton.Background); if (radioButton.StrokeColor != null) { mauiDrawable.SetBorderBrush(new SolidPaint { Color = radioButton.StrokeColor }); } if (radioButton.StrokeThickness > 0) { mauiDrawable.SetBorderWidth(radioButton.StrokeThickness); } if (radioButton.CornerRadius > 0) { mauiDrawable.SetCornerRadius(radioButton.CornerRadius); } }
void InitStatusPhotoDialog(View rootView) { TextView StatusIndicator1 = rootView.FindViewById <TextView>(Resource.Id.txtStatusIndicator); TextView txtStatusExplain = rootView.FindViewById <TextView>(Resource.Id.txtStatusExplain); AppCompatRadioButton radioEveryOne = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioEveryOne); AppCompatRadioButton radioMyContacts = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioMyContacts); radioEveryOne.Tag = 0; radioMyContacts.Tag = 1; var ActivityTitles = MyApplication.CurrentLangSetting.GetStringResourceContents(); var showStatusUpdate = MyApplication.CurrentLangSetting.GetShareStatus_Resource(); StatusIndicator1.Text = ActivityTitles.GetValueOrDefault("whostatusupdate"); txtStatusExplain.Text = ActivityTitles.GetValueOrDefault("statusexplain"); radioEveryOne.Text = showStatusUpdate[0]; radioMyContacts.Text = showStatusUpdate[1]; switch (MyProfileViewModel.ME.SHOW_STATUS_TO) { case 0: radioEveryOne.Checked = true; break; case 1: radioMyContacts.Checked = true; break; } radioEveryOne.Click += StatusShare_RadioChanged; radioMyContacts.Click += StatusShare_RadioChanged; }
protected override void OnCreate(Bundle savedInstanceState) { Log.Debug(TAG, "OnCreate"); if (savedInstanceState != null) { isStarted = savedInstanceState.GetBoolean(Constants.SERVICE_STARTED_KEY, false); } base.OnCreate(savedInstanceState); OnNewIntent(this.Intent); use_http_radio_button = FindViewById <AppCompatRadioButton>(Resource.Id.radioButtonUseHtttpProtocol); use_mqtt_radio_button = FindViewById <AppCompatRadioButton>(Resource.Id.radioButtonUseMqttProtocol); string use_protocol = Preferences.Get("protocol", "http"); if (use_protocol == use_mqtt_radio_button.Text.ToLower()) { use_mqtt_radio_button.Checked = true; } else { use_http_radio_button.Checked = true; } service_tcp_port = FindViewById <AppCompatEditText>(Resource.Id.service_port); service_tcp_port.Text = Preferences.Get(Resources.GetResourceEntryName(Resource.Id.service_port), 8080).ToString(); telegram_bot_interval = FindViewById <AppCompatEditText>(Resource.Id.telegram_bot_interval); telegram_bot_interval.Text = Preferences.Get(Resources.GetResourceEntryName(Resource.Id.telegram_bot_interval), 0).ToString(); service_start_button = FindViewById <AppCompatButton>(Resource.Id.service_start_button); service_stop_button = FindViewById <AppCompatButton>(Resource.Id.service_stop_button); }
protected void UseProtocolRadioButton_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { AppCompatRadioButton radioButton = (AppCompatRadioButton)sender; Log.Debug(TAG, $"UseProtocolRadioButton_CheckedChange: { radioButton.Text} - {e.IsChecked}"); if (e.IsChecked) { Preferences.Set("protocol", radioButton.Text.ToLower()); } switch (radioButton.Id) { case Resource.Id.radioButtonUseHtttpProtocol: if (use_mqtt_radio_button.Checked == e.IsChecked) { use_mqtt_radio_button.Checked = !e.IsChecked; } break; case Resource.Id.radioButtonUseMqttProtocol: if (use_http_radio_button.Checked == e.IsChecked) { use_http_radio_button.Checked = !e.IsChecked; } if (e.IsChecked) { RunOnUiThread(() => { Toast.MakeText(this, Resource.String.mqtt_protocol_is_not_supported, ToastLength.Long); }); } break; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var rootView = inflater.Inflate(Resource.Layout.fragment_register_langsetting, container, false); radioEng = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioEng); radioChinese = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioChinese); btNext = rootView.FindViewById <Button>(Resource.Id.btNext); txtTitle = rootView.FindViewById <TextView>(Resource.Id.txtTitle); radioEng.CheckedChange += RadioEng_CheckedChange; radioChinese.CheckedChange += RadioChinese_CheckedChange; btNext.Click += BtNext_Click; return(rootView); }
void InitProfilePhotoDialog(View rootView) { TextView txtProfilePhotoIndicator1 = rootView.FindViewById <TextView>(Resource.Id.txtProfilePhotoIndicator); AppCompatRadioButton radioEveryOne = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioEveryOne); AppCompatRadioButton radioMyContacts = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioMyContacts); AppCompatRadioButton radioNobody = rootView.FindViewById <AppCompatRadioButton>(Resource.Id.radioNobody); radioEveryOne.Tag = 0; radioMyContacts.Tag = 1; radioNobody.Tag = 2; radioEveryOne.Click += ProfilePhoto_RadioChecked; radioMyContacts.Click += ProfilePhoto_RadioChecked; radioNobody.Click += ProfilePhoto_RadioChecked; var ActivityTitles = MyApplication.CurrentLangSetting.GetStringResourceContents(); var showProfileTitles = MyApplication.CurrentLangSetting.GetShareProfilePhoto_Resource(); txtProfilePhotoIndicator1.Text = ActivityTitles.GetValueOrDefault("profile_photo"); radioEveryOne.Text = showProfileTitles[0]; radioMyContacts.Text = showProfileTitles[1]; radioNobody.Text = showProfileTitles[2]; switch (MyProfileViewModel.ME.SHOW_PROFILE_TO) { case 0: radioEveryOne.Checked = true; break; case 1: radioMyContacts.Checked = true; break; case 2: radioNobody.Checked = true; break; } }
public static void UpdateBackground(this AppCompatRadioButton platformRadioButton, IRadioButton radioButton) { platformRadioButton.UpdateBorderDrawable(radioButton); }
public static void UpdateCornerRadius(this AppCompatRadioButton platformRadioButton, IRadioButton radioButton) { platformRadioButton.UpdateBorderDrawable(radioButton); }
public static void UpdateStrokeThickness(this AppCompatRadioButton platformRadioButton, IRadioButton radioButton) { platformRadioButton.UpdateBorderDrawable(radioButton); }
public static void UpdateContent(this AppCompatRadioButton platformRadioButton, IRadioButton radioButton) { platformRadioButton.Text = $"{radioButton.Content}"; }
public static void UpdateIsChecked(this AppCompatRadioButton platformRadioButton, IRadioButton radioButton) { platformRadioButton.Checked = radioButton.IsChecked; }
public static void UpdateIsChecked(this AppCompatRadioButton nativeRadioButton, IRadioButton radioButton) { nativeRadioButton.Checked = radioButton.IsChecked; }
public static void UpdateContent(this AppCompatRadioButton nativeRadioButton, IRadioButton radioButton) { nativeRadioButton.Text = $"{radioButton.Content}"; }