protected override void OnBindDialogView(View view) { base.OnBindDialogView(view); var currentValue = GetPersistedInt(SettingsScreen.DefaultRadiusValue); if (BuildVersionCodes.Honeycomb > Build.VERSION.SdkInt) { _radioGroup = (RadioGroup)view; foreach (var distance in Constants.AlarmRadiusValues) { var radioButton = new RadioButton(Context); radioButton.SetText(string.Format(Context.GetString(Resource.String.settings_default_radius_sum), distance), TextView.BufferType.Normal); radioButton.Checked = distance == currentValue; radioButton.Id = distance; _radioGroup.AddView(radioButton); } } else { _numberPicker = (NumberPicker)view; SetNumberPickerTextColor(_numberPicker, Context.Resources.GetColor(Resource.Color.dark)); _numberPicker.DescendantFocusability = DescendantFocusability.BlockDescendants; _numberPicker.SetDisplayedValues(Constants.AlarmRadiusValues.Select(v => v.ToString()).ToArray()); _numberPicker.MinValue = 0; _numberPicker.MaxValue = Constants.AlarmRadiusValues.Count() - 1; _numberPicker.WrapSelectorWheel = false; _numberPicker.Value = Constants.AlarmRadiusValues.IndexOf(currentValue); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.RequestWindowFeature(WindowFeatures.IndeterminateProgress); this.SetContentView(Resource.Layout.SimpleItemLayout); this.Prefs = Prefs.From(this); this.payloadRadioGroup = this.FindViewById<RadioGroup>(Resource.Id.group_payload_type); this.itemsListView = this.FindViewById<ListView>(Resource.Id.items_list); this.itemsListView.OnItemClickListener = this; this.scopeParentCheckBox = this.FindViewById<CheckBox>(Resource.Id.checkbox_scope_parent); this.scopeSelfCheckBox = this.FindViewById<CheckBox>(Resource.Id.checkbox_scope_self); this.scopeChildrenCheckBox = this.FindViewById<CheckBox>(Resource.Id.checkbox_scope_children); this.ScopeContainer = this.FindViewById<LinearLayout>(Resource.Id.container_scope); this.FieldNamEditText = this.FindViewById<EditText>(Resource.Id.field_item_field); this.ItemFieldEditText = this.FindViewById<EditText>(Resource.Id.field_item); this.ItemFieldLabel = this.FindViewById<TextView>(Resource.Id.label); this.GetItemsButton = this.FindViewById<Button>(Resource.Id.button_get_item); this.FieldNameContainer = this.FindViewById<LinearLayout>(Resource.Id.container_item_field); this.PayloadContainer = this.FindViewById<LinearLayout>(Resource.Id.container_payload); }
void RadioGroup.IOnCheckedChangeListener.OnCheckedChanged(RadioGroup @group, int checkedId) { if (OnCheckedChanged != null) { OnCheckedChanged(@group, checkedId); } }
public void OnCheckedChanged(RadioGroup group, int checkedId) { for (int i = 0; i < rgs.ChildCount; i++) { if (rgs.GetChildAt(i).Id == checkedId) { Fragment fragment = fragments[i]; FragmentTransaction ft = obtainFragmentTransaction(i); GetCurrentFragment().OnPause(); if (fragment.IsAdded) { fragment.OnResume(); } else { ft.Add(fragmentcontentid, fragment); } showTab(i);// 显示目标tab ft.Commit(); if (null != onRgsExtraCheckedChangedListener) { onRgsExtraCheckedChangedListener.OnRgsExtraCheckedChanged(group, checkedId, i); } } } }
public override Dialog OnCreateDialog (Bundle savedInstanceState) { var view = LayoutInflater.From (Activity) .Inflate (Resource.Layout.ChangeTimeEntryStartTimeDialogFragment, null); tabsRadioButton = view.FindViewById<RadioGroup> (Resource.Id.TabsRadioGroup); timeTabRadioButton = view.FindViewById<RadioButton> (Resource.Id.TimeTabRadioButton).SetFont (Font.Roboto); dateTabRadioButton = view.FindViewById<RadioButton> (Resource.Id.DateTabRadioButton).SetFont (Font.Roboto); timePicker = view.FindViewById<TimePicker> (Resource.Id.TimePicker); datePicker = view.FindViewById<DatePicker> (Resource.Id.DatePicker); // WORKAROUND: Without these two lines the app will crash on rotation. See #258. timePicker.SaveFromParentEnabled = false; timePicker.SaveEnabled = true; tabsRadioButton.CheckedChange += OnTabsRadioGroupCheckedChange; SetupViews (); Rebind (); var dia = new AlertDialog.Builder (Activity) .SetTitle (DialogTitle) .SetView (view) .SetPositiveButton (Resource.String.ChangeTimeEntryStartTimeDialogOk, OnOkButtonClicked) .Create (); return dia; }
internal CustomInfoWindowAdapter (MarkerDemoActivity parent) { this.parent = parent; mWindow = parent.LayoutInflater.Inflate (Resource.Layout.custom_info_window, null); mContents = parent.LayoutInflater.Inflate (Resource.Layout.custom_info_contents, null); mOptions = (RadioGroup) parent.FindViewById (Resource.Id.custom_info_window_options); }
public override void OnActivityCreated (Bundle savedInstanceState) { base.OnActivityCreated (savedInstanceState); //radiogroup radio_advice_Group = View.FindViewById<RadioGroup> (Resource.Id.radio_advice_Group); radio_advice_Group.SetOnCheckedChangeListener (this); //radiobutton rbtn_zixun = View.FindViewById<RadioButton> (Resource.Id.rbtn_zixun); rbtn_zixun.Tag = ((int)AdviceType.Consult).ToString(); //默认咨询选中 rbtn_zixun.Checked = true; rbtn_jianyi = View.FindViewById<RadioButton> (Resource.Id.rbtn_jianyi); rbtn_jianyi.Tag =((int)AdviceType.Suggest).ToString (); rbtn_tousu = View.FindViewById<RadioButton> (Resource.Id.rbtn_tousu); rbtn_tousu.Tag = ((int)AdviceType.Complain).ToString (); rbtn_other = View.FindViewById<RadioButton> (Resource.Id.rbtn_other); rbtn_other.Tag = ((int)AdviceType.Other).ToString(); edit_advice_title = View.FindViewById<EditText> (Resource.Id.edit_advice_title); edit_advice_content = View.FindViewById<EditText> (Resource.Id.edit_advice_content); //发表按钮 btn_Publish = View.FindViewById<Button> (Resource.Id.btn_Publish); btn_Publish.Click += (sender, e) => { PublishAdvice(); }; //初始化view完成 IsPrepared = true; LasyloadData (); }
protected override void OnCreate ( Bundle bundle ) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); _usernameEditText = FindViewById<EditText> (Resource.Id.editTextUsername); _websiteEditText = FindViewById<EditText> (Resource.Id.editTextUploadWebsite); _intervalRadioGroup = FindViewById<RadioGroup> (Resource.Id.radioGroup1); _trackingButton = FindViewById<Button> (Resource.Id.buttonTracking); var radioButton1Menit = FindViewById<RadioButton> (Resource.Id.radioButton1Minute); var radioButton3Menit = FindViewById<RadioButton> (Resource.Id.radioButton3Minute); var radioButton5Menit = FindViewById<RadioButton> (Resource.Id.radioButton5Minute); var prefs = GetSharedPreferences ("lok", 0); _currentlyTracking = prefs.GetBoolean ("currentlyTracking", false); var firstTime = prefs.GetBoolean ("firstTime", true); if (firstTime) { var editor = prefs.Edit (); editor.PutBoolean ("firstTime", false); editor.PutString ("appId", UUID.RandomUUID ().ToString ()); editor.Apply (); } // _intervalRadioGroup.CheckedChange += delegate { }; // Untuk event onchange pada radiobutton interval. radioButton1Menit.Click += SaveIntervalRadioButtonClick; radioButton3Menit.Click += SaveIntervalRadioButtonClick; radioButton5Menit.Click += SaveIntervalRadioButtonClick; // _trackingButton.Click += SaveuserSettings(); _trackingButton.Click += ( sender, e ) => { TrackLocation (); }; }
public void refreshTester( TextView question, List<RadioButton> radioArrey, structQA QA, RadioGroup groupAnswer ) { groupAnswer.ClearCheck (); question.Text = QA.question; for (int counter = 0; counter < radioArrey.Count; counter++) { radioArrey [counter].Text = QA.answer [counter]; } }
public override void OnViewCreated (View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); showNotificationButton = (Button)View.FindViewById (Resource.Id.show_notification_button); showNotificationButton.Click += delegate { var visibility = GetVisibilityFromSelectedRadio(radioGroup); ShowNotificationClicked(visibility); }; radioGroup = (RadioGroup)View.FindViewById (Resource.Id.visibility_radio_group); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.FinalDialog); bSMS = FindViewById<RadioButton> (Resource.Id.radioButtonSMS); bEmail = FindViewById<RadioButton> (Resource.Id.radioButtonEmail); group = FindViewById<RadioGroup> (Resource.Id.radioGroup1); group.ClearCheck (); bSMS.Click += new EventHandler(bSMS_Click); bEmail.Click += new EventHandler (bEmail_Click); }
public override void OnActivityCreated (Bundle savedInstanceState) { base.OnActivityCreated (savedInstanceState); //radiogroup radio_advice_Group = View.FindViewById<RadioGroup> (Resource.Id.radio_advice_Group); radio_advice_Group.SetOnCheckedChangeListener (this); //radiobutton rbtn_all = View.FindViewById<RadioButton>(Resource.Id.rbtn_all); rbtn_all.Tag = ((int)AdviceType.All).ToString(); //默认咨询选中 rbtn_all.Checked = true; rbtn_zixun = View.FindViewById<RadioButton> (Resource.Id.rbtn_zixun); rbtn_zixun.Tag = ((int)AdviceType.Consult).ToString(); rbtn_jianyi = View.FindViewById<RadioButton> (Resource.Id.rbtn_jianyi); rbtn_jianyi.Tag = ((int)AdviceType.Suggest).ToString(); rbtn_tousu = View.FindViewById<RadioButton> (Resource.Id.rbtn_tousu); rbtn_tousu.Tag = ((int)AdviceType.Complain).ToString(); rbtn_other = View.FindViewById<RadioButton> (Resource.Id.rbtn_other); rbtn_other.Tag = ((int)AdviceType.Other).ToString(); tv_recordNum = View.FindViewById<TextView> (Resource.Id.tv_recordNum); //pulltolistview lv_recordAdviceRefreshListView = View.FindViewById<PullToRefreshListView> (Resource.Id.lv_recordAdvice); actualListView = (ListView)lv_recordAdviceRefreshListView.RefreshableView; //设置可以上拉加载。下拉刷新 lv_recordAdviceRefreshListView.Mode = PullToRefreshBase.PullToRefreshMode.Both; //下拉刷新提示文本 lv_recordAdviceRefreshListView.GetLoadingLayoutProxy(true,false).SetPullLabel(GetString(Resource.String.pullDownLbl)); lv_recordAdviceRefreshListView.GetLoadingLayoutProxy (true,false).SetRefreshingLabel(GetString(Resource.String.pullDownRefreshLbl)); lv_recordAdviceRefreshListView.GetLoadingLayoutProxy (true, false).SetReleaseLabel (GetString(Resource.String.pullDownReleaseLbl)); //上拉加载提示文本 lv_recordAdviceRefreshListView.GetLoadingLayoutProxy(false,true).SetPullLabel(GetString(Resource.String.pullUpLbl)); lv_recordAdviceRefreshListView.GetLoadingLayoutProxy (false, true).SetRefreshingLabel (GetString(Resource.String.pullUpRefreshLbl)); lv_recordAdviceRefreshListView.GetLoadingLayoutProxy (false, true).SetReleaseLabel (GetString(Resource.String.pullUpReleaseLbl)); //绑定监听事件 lv_recordAdviceRefreshListView.SetOnRefreshListener (this); //设置adapter adviceRecordListAdapter = new AdviceRecordListAdapter (Activity); actualListView.Adapter = adviceRecordListAdapter; //初始化请求参数信息 adviceRecordInfoListParam = new AdviceRecordInfoListParam () { UId = Global.Guid, AdviceType = _adviceType }; //初始化view完成 IsPrepared = true; LasyloadData (); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetTheme (Android.Resource.Style.ThemeHoloLightNoActionBar); SetContentView (Resource.Layout.frmAggiungiUtente); txtCognome = FindViewById<EditText> (Resource.Id.txtCognome); txtNome = FindViewById<EditText> (Resource.Id.txtNome); txtNumeroTessera = FindViewById<EditText> (Resource.Id.txtNumeroTessera); radioTipo = FindViewById<RadioGroup> (Resource.Id.gruppoTipi); dataIscrizione = FindViewById<DatePicker> (Resource.Id.datePicker1); dataIscrizione.Init (DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,new DateChangedListener((picker, year, month, day) => { valutaScadenza(); })); txtSaldo = FindViewById<EditText> (Resource.Id.txtSaldo); txtDataScadenza = FindViewById<TextView> (Resource.Id.txtScadenza); Button btnSalva = FindViewById<Button> (Resource.Id.btnSalva); Button btnAnnulla = FindViewById<Button> (Resource.Id.btnAnnulla); Button btnElimina = FindViewById<Button> (Resource.Id.btnElimina); btnScade = FindViewById<ToggleButton> (Resource.Id.btnPuoScadere); btnScade.Activated = puoScadere; btnScade.CheckedChange+= BtnScade_CheckedChange; btnElimina.Enabled = false; if (this.Intent.HasExtra("numtessera")) { insertMode = false; numtessera = Intent.GetIntExtra ("numtessera",0).ToString(); btnElimina.Enabled = true; riprendiCliente (numtessera); } btnElimina.Click += BtnElimina_Click; btnSalva.Click+= BtnSalva_Click; btnAnnulla.Click += (sender, e) => { funzioni.MsgBox(this,"Annullare l'inserimento (Tutti i dati non salvati andranno persi!) ?", "Vegetha", "SI", ()=>{SetResult(Result.Ok); Finish(); }, "NO", ()=>{}); }; txtCognome.FocusChange+= txtFocusChange; txtNome.FocusChange += txtFocusChange; radioTipo.CheckedChange += (sender, e) => { valutaScadenza (); }; radioTipo.Check( Resource.Id.radioAnnuale); valutaScadenza (); }
private OnRgsExtraCheckedChangedListener onRgsExtraCheckedChangedListener; // 用于让调用者在切换tab时候增加新的功能 public FragmentTabAdapter(FragmentActivity fragmentActivity, List<Fragment> fragments, int fragmentContentId, RadioGroup rgs) { this.fragments = fragments; this.rgs = rgs; this.fragmentactivity = fragmentActivity; this.fragmentcontentid = fragmentContentId; // 默认显示第一页 FragmentTransaction ft = fragmentActivity.SupportFragmentManager.BeginTransaction(); ft.Add(fragmentContentId, fragments[0]); ft.Commit(); rgs.SetOnCheckedChangeListener(this); }
// Returns a NotificationVisibility depending on which RadioButton is selected. public NotificationVisibility GetVisibilityFromSelectedRadio(RadioGroup r) { switch (radioGroup.CheckedRadioButtonId) { case Resource.Id.visibility_public_radio_button: return NotificationVisibilities.Public; case Resource.Id.visibility_private_radio_button: return NotificationVisibilities.Private; case Resource.Id.visibility_secret_radio_button: return NotificationVisibilities.Secret; default: return NotificationVisibilities.Public; } }
private void InitComponents() { name = FindViewById<TextView>(Resource.Id.textViewNameValue); name.Text = CurrentUser.FirstName + " " + CurrentUser.LastName; country = FindViewById<Spinner>(Resource.Id.country); country.Adapter = GetCountries(); language = FindViewById<Spinner>(Resource.Id.language); language.Adapter = GetLanguages(); date = FindViewById<EditText>(Resource.Id.studentDateDOB); month = FindViewById<EditText>(Resource.Id.studentMonthDOB); year = FindViewById<EditText>(Resource.Id.studentYearDOB); degree = (RadioGroup)FindViewById(Resource.Id.radioGroupDegree); status = (RadioGroup)FindViewById(Resource.Id.radioGroupStatus); viewFlipper = FindViewById<ViewFlipper>(Resource.Id.welcomeviewflipper); Populate(); }
void Select_CheckedChanged(object sender, RadioGroup.CheckedChangeEventArgs e) { switch (e.CheckedId) { case Resource.Id.radio_gcj02: tempcoor="gcj02"; break; case Resource.Id.radio_bd09ll: tempcoor="bd09ll"; break; case Resource.Id.radio_bd09: tempcoor="bd09"; break; default: break; } }
private void RadioGroupCheckedChanged(object sender, RadioGroup.CheckedChangeEventArgs args) { var radioGroup = (MvxAppCompatRadioGroup)this.Target; if (radioGroup == null) { return; } object newValue = null; var r = radioGroup.FindViewById<AppCompatRadioButton>(args.CheckedId); var li = r?.Parent as MvxListItemView; if (li != null) { newValue = li.DataContext; } bool changed = this.CheckValueChanged(newValue); if (!changed) { return; } this._currentValue = newValue; this.FireValueChanged(newValue); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it fragments.Add(new Fragment1()); fragments.Add(new Fragment2()); fragments.Add(new Fragment3()); fragments.Add(new Fragment4()); fragments.Add(new Fragment5()); rgs = FindViewById<RadioGroup>(Resource.Id.tabs_rg); FragmentTabAdapter tabadapter = new FragmentTabAdapter(this, fragments, Resource.Id.tab_content, rgs); tabadapter.SetOnRgsExtraCheckedChangedListener(new FEAGMENT.FragmentTabAdapter.OnRgsExtraCheckedChangedListener()); }
public void OnCheckedChanged (RadioGroup group, int checkedId) { String ModeInformation = null; switch (checkedId) { case Resource.Id.radio_hight: tempMode = LocationClientOption.LocationMode.HightAccuracy; ModeInformation = Resources.GetString(Resource.String.hight_accuracy_desc); break; case Resource.Id.radio_low: tempMode = LocationClientOption.LocationMode.BatterySaving; ModeInformation = Resources.GetString(Resource.String.saving_battery_desc); break; case Resource.Id.radio_device: tempMode = LocationClientOption.LocationMode.DeviceSensors; ModeInformation = Resources.GetString(Resource.String.device_sensor_desc); break; default: break; } ModeInfor.Text=ModeInformation; }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); this.SetContentView (Resource.Layout.Track); _etUserName = FindViewById<EditText>(Resource.Id.editTextUsername); _etWebsite = FindViewById<EditText>(Resource.Id.editTextWebsite); _buttTrack = FindViewById<Button>(Resource.Id.toggleButtonTrack); _radButtInterval = FindViewById<RadioGroup>(Resource.Id.radioGroupInterval); var preferensi = this.GetSharedPreferences("LainLadangLainBelalang.preferensi", 0); _lagiTracking = preferensi.GetBoolean("lagiTracking", false); var iniPertama = preferensi.GetBoolean("pertama", true); if (iniPertama) { var editor = preferensi.Edit(); editor.PutBoolean("pertama", false); editor.PutString("ID", new System.Guid().ToString()); editor.Apply(); } //_radButtInterval.CheckedChange += SaveInterval(); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); mLocationClient = ((LocationApplication)Application).mLocationClient; LocationResult = (TextView)FindViewById(Resource.Id.textView1); ModeInfor= (TextView)FindViewById(Resource.Id.modeinfor); ModeInfor.Text=Resources.GetString(Resource.String.hight_accuracy_desc); ((LocationApplication)Application).mLocationResult = LocationResult; frequence = (EditText)FindViewById(Resource.Id.frequence); checkGeoLocation = (CheckBox)FindViewById(Resource.Id.geolocation); startLocation = (Button)FindViewById(Resource.Id.addfence); startLocation.Click += StartLocation_Clicked; selectMode = (RadioGroup)FindViewById(Resource.Id.selectMode); selectCoordinates= (RadioGroup)FindViewById(Resource.Id.selectCoordinates); selectMode.SetOnCheckedChangeListener (this); selectCoordinates.CheckedChange+= Select_CheckedChanged ; }
protected override void OnCreate ( Bundle savedInstanceState ) { Global.LastActivity = this; base.OnCreate ( savedInstanceState ); SetContentView ( Resource.Layout.Test ); questionNumber = ( TextView ) FindViewById ( Resource.Id.textViewNumberQuestion ); questionText = ( TextView ) FindViewById ( Resource.Id.textQuestion ); radioGroup = ( RadioGroup ) FindViewById ( Resource.Id.radioGroup ); nextButton = ( Button ) FindViewById ( Resource.Id.buttonNext ); test = Global.LastTest; if ( test == null ) { test = Global.Tests [ Intent.GetIntExtra ( TEST_ID_PARAM, -1 ) ]; Global.LastTest = test; } Title = test.Name; radioGroup.CheckedChange += ( sender, e ) => { test.Current.Selected = answers [ e.CheckedId ]; UpdateButtons (); }; nextButton.Click += ( sender, e ) => { if ( CurrentGui < test.Count - 1 ) ++CurrentGui; else { StartActivity ( typeof ( FinishTestingActivity ) ); Finish (); } }; UpdateQuestionGui (); UpdateButtons (); }
// // Other helpers // private static void SetChildrenEnabled(RadioGroup radioGroup, bool enabled) { for (int i = radioGroup.ChildCount - 1; i >= 0; i--) { radioGroup.GetChildAt(i).Enabled = enabled; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.PlayerControls); youTubePlayerView = FindViewById<YouTubePlayerView>(Resource.Id.youtube_view); StateTextView = FindViewById<TextView> (Resource.Id.state_text); videoChooser = FindViewById<Spinner>(Resource.Id.video_chooser); playButton = FindViewById<Button>(Resource.Id.play_button); pauseButton = FindViewById<Button>(Resource.Id.pause_button); skipTo = FindViewById<EditText>(Resource.Id.skip_to_text); EventLogTextView = FindViewById<TextView>(Resource.Id.event_log); styleRadioGroup = FindViewById<RadioGroup>(Resource.Id.style_radio_group); (FindViewById<RadioButton> (Resource.Id.style_default)).CheckedChange += HandleCheckedChange; (FindViewById<RadioButton>(Resource.Id.style_minimal)).CheckedChange += HandleCheckedChange; (FindViewById<RadioButton>(Resource.Id.style_chromeless)).CheckedChange += HandleCheckedChange; // Initialize PlayerHelper - Used by Listeners LogString = new StringBuilder(); videoAdapter = new ArrayAdapter<ListEntry>(this, Android.Resource.Layout.SimpleSpinnerItem, entries); videoAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); videoChooser.Adapter = videoAdapter; videoChooser.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { currentlySelectedPosition = e.Position; PlayVideoAtSelection(); }; playButton.Click += (sender, e) => Player.Play (); pauseButton.Click += (sender, e) => Player.Pause(); skipTo.EditorAction += (sender, e) => { int skipToSecs; int.TryParse(skipTo.Text, out skipToSecs); Player.SeekToMillis(skipToSecs * 1000); InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService); imm.HideSoftInputFromWindow(skipTo.WindowToken, 0); }; youTubePlayerView.Initialize(DeveloperKey.Key, this); playlistEventListener = new MyPlaylistEventListener(); playerStateChangeListener = new MyPlayerStateChangeListener(); playbackEventListener = new MyPlaybackEventListener(); SetControlsEnabled(false); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.fragment_sensors, container, false); mSensorMap = new Dictionary<Switch, TableLayout>(); // // Accelerometer setup // mSwitchAccelerometer = rootView.FindViewById<Switch>(Resource.Id.switchAccelerometer); mTableAccelerometer = rootView.FindViewById<TableLayout>(Resource.Id.tableAccelerometer); mRadioGroupAccelerometer = rootView.FindViewById<RadioGroup>(Resource.Id.rgAccelerometer); mSensorMap[mSwitchAccelerometer] = mTableAccelerometer; mTableAccelerometer.Visibility = ViewStates.Gone; mSwitchAccelerometer.CheckedChange += OnToggleSensorSection; mTextAccX = rootView.FindViewById<TextView>(Resource.Id.textAccX); mTextAccY = rootView.FindViewById<TextView>(Resource.Id.textAccY); mTextAccZ = rootView.FindViewById<TextView>(Resource.Id.textAccZ); mRadioAcc16 = rootView.FindViewById<RadioButton>(Resource.Id.rbAccelerometerRate16ms); mRadioAcc32 = rootView.FindViewById<RadioButton>(Resource.Id.rbAccelerometerRate32ms); // // Gyro setup // mSwitchGyro = rootView.FindViewById<Switch>(Resource.Id.switchGyro); mTableGyro = rootView.FindViewById<TableLayout>(Resource.Id.tableGyro); mRadioGroupGyro = rootView.FindViewById<RadioGroup>(Resource.Id.rgGyro); mSensorMap[mSwitchGyro] = mTableGyro; mTableGyro.Visibility = ViewStates.Gone; mSwitchGyro.CheckedChange += OnToggleSensorSection; mTextGyroAccX = rootView.FindViewById<TextView>(Resource.Id.textGyroAccX); mTextGyroAccY = rootView.FindViewById<TextView>(Resource.Id.textGyroAccY); mTextGyroAccZ = rootView.FindViewById<TextView>(Resource.Id.textGyroAccZ); mTextGyroAngX = rootView.FindViewById<TextView>(Resource.Id.textAngX); mTextGyroAngY = rootView.FindViewById<TextView>(Resource.Id.textAngY); mTextGyroAngZ = rootView.FindViewById<TextView>(Resource.Id.textAngZ); mRadioGyro16 = rootView.FindViewById<RadioButton>(Resource.Id.rbGyroRate16ms); mRadioGyro32 = rootView.FindViewById<RadioButton>(Resource.Id.rbGyroRate32ms); // // Distance setup // mSwitchDistance = rootView.FindViewById<Switch>(Resource.Id.switchDistance); mTableDistance = rootView.FindViewById<TableLayout>(Resource.Id.tableDistance); mSensorMap[mSwitchDistance] = mTableDistance; mTableDistance.Visibility = ViewStates.Gone; mSwitchDistance.CheckedChange += OnToggleSensorSection; mTextTotalDistance = rootView.FindViewById<TextView>(Resource.Id.textTotalDistance); mTextSpeed = rootView.FindViewById<TextView>(Resource.Id.textSpeed); mTextPace = rootView.FindViewById<TextView>(Resource.Id.textPace); mTextPedometerMode = rootView.FindViewById<TextView>(Resource.Id.textPedometerMode); // // Heart rate setup // mSwitchHeartRate = rootView.FindViewById<Switch>(Resource.Id.switchHeartRate); mTableHeartRate = rootView.FindViewById<TableLayout>(Resource.Id.tableHeartRate); mSensorMap[mSwitchHeartRate] = mTableHeartRate; mTableHeartRate.Visibility = ViewStates.Gone; mSwitchHeartRate.CheckedChange += OnToggleSensorSection; mTextHeartRate = rootView.FindViewById<TextView>(Resource.Id.textHeartRate); mTextHeartRateQuality = rootView.FindViewById<TextView>(Resource.Id.textHeartRateQuality); // // Contact setup // mSwitchContact = rootView.FindViewById<Switch>(Resource.Id.switchContact); mTableContact = rootView.FindViewById<TableLayout>(Resource.Id.tableContact); mSensorMap[mSwitchContact] = mTableContact; mTableContact.Visibility = ViewStates.Gone; mSwitchContact.CheckedChange += OnToggleSensorSection; mTextContact = rootView.FindViewById<TextView>(Resource.Id.textContact); // // Skin temperature setup // mSwitchSkinTemperature = rootView.FindViewById<Switch>(Resource.Id.switchSkinTemperature); mTableSkinTemperature = rootView.FindViewById<TableLayout>(Resource.Id.tableSkinTemperature); mSensorMap[mSwitchSkinTemperature] = mTableSkinTemperature; mTableSkinTemperature.Visibility = ViewStates.Gone; mSwitchSkinTemperature.CheckedChange += OnToggleSensorSection; mTextSkinTemperature = rootView.FindViewById<TextView>(Resource.Id.textSkinTemperature); // // Ultraviolet setup // mSwitchUltraviolet = rootView.FindViewById<Switch>(Resource.Id.switchUltraviolet); mTableUltraviolet = rootView.FindViewById<TableLayout>(Resource.Id.tableUltraviolet); mSensorMap[mSwitchUltraviolet] = mTableUltraviolet; mTableUltraviolet.Visibility = ViewStates.Gone; mSwitchUltraviolet.CheckedChange += OnToggleSensorSection; mTextUltraviolet = rootView.FindViewById<TextView>(Resource.Id.textUltraviolet); // // Pedometer setup // mSwitchPedometer = rootView.FindViewById<Switch>(Resource.Id.switchPedometer); mTablePedometer = rootView.FindViewById<TableLayout>(Resource.Id.tablePedometer); mSensorMap[mSwitchPedometer] = mTablePedometer; mTablePedometer.Visibility = ViewStates.Gone; mSwitchPedometer.CheckedChange += OnToggleSensorSection; mTextTotalSteps = rootView.FindViewById<TextView>(Resource.Id.textTotalSteps); return rootView; }
/// <summary> /// radiogroup的选择切换事件 /// </summary> /// <param name="group">Group.</param> /// <param name="checkedId">Checked identifier.</param> public void OnCheckedChanged (RadioGroup group, int checkedId) { _adviceType = View.FindViewById<RadioButton> (checkedId).Tag.ToString(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Second); MilkVROptions = FindViewById<RadioGroup>(Resource.Id.MilkVROptions); AudioOptions = FindViewById<RadioGroup>(Resource.Id.AudioOption); LinkPreview = FindViewById<AutoCompleteTextView>(Resource.Id.LinkPreview); LinkPreview.Text = "MilkVRLauncher"; lblUrl = FindViewById<TextView>(Resource.Id.lblUrl); button1 = FindViewById<Button>(Resource.Id.button1); button1.Click += delegate { string VideoFormat = LaunchExtensions[getSelectedElement(MilkVROptions), 1]; string AudioFormat = AudioFormats[getSelectedElement(AudioOptions), 1]; CreateMVRL(FilePath + LinkPreview.Text + ".mvrl", Url, VideoFormat, AudioFormat); ExecUri(convertMilkVRSideloadURL(Url, VideoFormat, AudioFormat)); }; Url = CheckForEmby(Intent.DataString); button1.Text = Resources.GetText(Resource.String.ButtonStartCaption); lblUrl.Text = Url; //try //{ // string data = new System.Net.WebClient().DownloadString(Url); // if (System.Uri.IsWellFormedUriString(data, UriKind.RelativeOrAbsolute)) // { // Url = data; // lblUrl.Text = data; // }; //} //catch //{ }; InitRadioButtons(LaunchExtensions, Url,"ic_", MilkVROptions); InitRadioButtons(AudioFormats, Url,"", AudioOptions); }
public void OnCheckedChanged(RadioGroup group, int checkedId) { SSlidingMenu sm = getSlidingMenu(); switch (checkedId) { case Resource.Id.left: sm.Mode=SlidingMenuMode.LEFT; sm.setShadowDrawable(Resource.Drawable.shadow); break; case Resource.Id.right: sm.Mode=SlidingMenuMode.RIGHT; sm.setShadowDrawable(Resource.Drawable.shadowright); break; case Resource.Id.left_right: sm.Mode=SlidingMenuMode.LEFT_RIGHT; sm.setSecondaryMenu(Resource.Layout.menu_frame_two); SupportFragmentManager .BeginTransaction() .Replace(R.Id.menu_frame_two, new SampleListFragment()) .Commit(); sm.setSecondaryShadowDrawable(R.Drawable.shadowright); sm.setShadowDrawable(R.Drawable.shadow); break; case R.Id.touch_above_full: sm.setTouchModeAbove(SSlidingMenu.TOUCHMODE_FULLSCREEN); break; case R.Id.touch_above_margin: sm.setTouchModeAbove(SSlidingMenu.TOUCHMODE_MARGIN); break; case R.Id.touch_above_none: sm.setTouchModeAbove(SSlidingMenu.TOUCHMODE_NONE); break; } }
private void OnTabsRadioGroupCheckedChange (object sender, RadioGroup.CheckedChangeEventArgs e) { Rebind (); }