public static void UpdateForeground(this AppCompatCheckBox platformCheckBox, ICheckBox check) { var mode = PorterDuff.Mode.SrcIn; CompoundButtonCompat.SetButtonTintList(platformCheckBox, platformCheckBox.GetColorStateList(check)); CompoundButtonCompat.SetButtonTintMode(platformCheckBox, mode); }
private void CheckBoxTracView_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { AppCompatCheckBox checkBox = sender as AppCompatCheckBox; Preferences.Set(Resources.GetResourceEntryName(checkBox.Id), e.IsChecked); RefreshLogButton_Click(null, null); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); _email = FindViewById <AppCompatEditText>(Resource.Id.email); _password = FindViewById <AppCompatEditText>(Resource.Id.password); _autoEmail = FindViewById <AppCompatCheckBox>(Resource.Id.auto_email); string email = Storage.ReadEmail(); if (!(email is null)) { _email.Text = email; _autoEmail.Checked = true; } AppCompatButton loginButton = FindViewById <AppCompatButton>(Resource.Id.login_button); AppCompatButton registerButton = FindViewById <AppCompatButton>(Resource.Id.register_button); loginButton.Click += async delegate { loginButton.Enabled = false; registerButton.Enabled = false; string status = await OnLoginPressedAsync(_email.Text, _password.Text); if (status == "Success") { Intent dashboardActivity = new Intent(this, typeof(DashboardActivity)); StartActivity(dashboardActivity); Finish(); } else { loginButton.Enabled = true; registerButton.Enabled = true; RunOnUiThread(() => { Toast.MakeText(this, status, ToastLength.Long).Show(); }); } }; registerButton.Click += async delegate { loginButton.Enabled = false; registerButton.Enabled = false; await Task.Run(OnRegisterPressed); loginButton.Enabled = true; registerButton.Enabled = true; }; Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); toolbar.Title = "Login to Glucose Tracker"; SetSupportActionBar(toolbar); }
public static void UpdateForeground(this AppCompatCheckBox nativeCheckBox, ICheckBox check) { // TODO: Delete when implementing the logic to set the system accent color. Graphics.Color accent = Graphics.Color.FromArgb("#ff33b5e5"); var targetColor = accent; // For the moment, we're only supporting solid color Paint for the Android Checkbox if (check.Foreground is SolidPaint solid) { targetColor = solid.Color; } var tintColor = targetColor.ToNative(); var tintList = new ColorStateList( CheckedStates, new int[] { tintColor, tintColor, tintColor, tintColor }); var tintMode = PorterDuff.Mode.SrcIn; CompoundButtonCompat.SetButtonTintList(nativeCheckBox, tintList); CompoundButtonCompat.SetButtonTintMode(nativeCheckBox, tintMode); }
private static View CreateCheckBox(Android.Support.V7.App.AppCompatActivity activity) { var checkbox = new AppCompatCheckBox(activity); checkbox.Text = "Check Box!"; return(checkbox); }
public RecyclerViewHolder(View itemView) : base(itemView) { Container = itemView.FindViewById <View>(Resource.Id.item_row_label_container); Label = itemView.FindViewById <TextView>(Resource.Id.item_row_label); SubLabel = itemView.FindViewById <TextView>(Resource.Id.item_row_sub_label); Progress = itemView.FindViewById <ProgressBar>(Resource.Id.item_row_progress); CheckBox = itemView.FindViewById <AppCompatCheckBox>(Resource.Id.item_row_check); }
/// <summary> /// Dispose the specified disposing. /// </summary> /// <returns>The dispose.</returns> /// <param name="disposing">If set to <c>true</c> disposing.</param> protected override void Dispose(bool disposing) { if (disposing) { _checkbox.SetOnCheckedChangeListener(null); _checkbox.Dispose(); _checkbox = null; } base.Dispose(disposing); }
public static void UpdateBackgroundColor(this AppCompatCheckBox nativeCheckBox, ICheckBox check) { if (check.BackgroundColor == null) { nativeCheckBox.SetBackgroundColor(AColor.Transparent); } else { nativeCheckBox.SetBackgroundColor(check.BackgroundColor.ToNative()); } }
public static void UpdateBackground(this AppCompatCheckBox nativeCheckBox, ICheckBox check) { var paint = check.Background; if (paint.IsNullOrEmpty()) { nativeCheckBox.SetBackgroundColor(AColor.Transparent); } else { nativeCheckBox.UpdateBackground((IView)check); } }
public LaborViewHolder(View itemView, Action <int> listener) : base(itemView) { LaborDescription = itemView.FindViewById <TextView>(Resource.Id.labor_description); LaborCheckBox = itemView.FindViewById <AppCompatCheckBox>(Resource.Id.labor_checkbox); LaborCheckBox.Click += (s, e) => { listener(AdapterPosition); }; itemView.Click += (s, e) => { LaborCheckBox.Checked = !LaborCheckBox.Checked; listener(AdapterPosition); }; }
protected override void OnCreate(Bundle savedInstanceState) { Log.Debug(TAG, "OnCreate"); base.OnCreate(savedInstanceState); ScriptId = Intent.Extras.GetInt(nameof(ScriptModel.Id), 0); CardTitle = FindViewById <AppCompatTextView>(Resource.Id.command_card_title); CardSubtitle = FindViewById <AppCompatTextView>(Resource.Id.command_card_subtitle); HiddenCommandCheckBox = FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxHiddenCommand); PauseSecondsBeforeStarting = FindViewById <AppCompatEditText>(Resource.Id.editTextPauseSecBeforeExecuting); FooterLayout = FindViewById <LinearLayoutCompat>(Resource.Id.command_footer_layout); RequiredCondition = FindViewById <SwitchCompat>(Resource.Id.switchCondition); HardwareCondition = FindViewById <AppCompatSpinner>(Resource.Id.spinnerCommandHardwareCondition); PortCondition = FindViewById <AppCompatSpinner>(Resource.Id.spinnerCommandPortCondition); StateCondition = FindViewById <AppCompatSpinner>(Resource.Id.spinnerCommandStateCondition); RequiredCondition.Checked = false; // HardwareCondition.Enabled = false; PortCondition.Enabled = false; StateCondition.Enabled = false; TypesCommand = FindViewById <AppCompatSpinner>(Resource.Id.spinnerTypeCommand); about_selected_command = FindViewById <AppCompatTextView>(Resource.Id.about_selected_command); CommandConfigForm = FindViewById <LinearLayoutCompat>(Resource.Id.command_config_form); ButtonOk = FindViewById <AppCompatButton>(Resource.Id.command_button_ok); HardwaresListSpinnerLoad(ref HardwareCondition); ArrayAdapter adapterPortStatusesCondition = ArrayAdapter <string> .CreateFromResource(this, Resource.Array.required_condition_port_states_array, Android.Resource.Layout.SimpleSpinnerItem); adapterPortStatusesCondition.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); StateCondition.Adapter = adapterPortStatusesCondition; ArrayAdapter adapterTypesCommands = ArrayAdapter <string> .CreateFromResource(this, Resource.Array.commands_types_array, Android.Resource.Layout.SimpleSpinnerItem); adapterTypesCommands.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); TypesCommand.Adapter = adapterTypesCommands; }
private void Init(Context context, IAttributeSet attrs, int defStyleAttr, int defStyleRes) { Inflate(context, GetLayoutResourceId(), this); viewTitle = FindViewById <TextView>(Resource.Id.listItemTitle); viewSubtitle = FindViewById <TextView>(Resource.Id.listItemSubtitle); viewIcon = FindViewById <ImageView>(Resource.Id.listItemIcon); viewAvatar = FindViewById <AvatarImageView>(Resource.Id.listItemAvatar); viewCheckBox = FindViewById <AppCompatCheckBox>(Resource.Id.listItemCheckbox); TypedArray ta = context.ObtainStyledAttributes(attrs, GetStyleAttributeIds(), defStyleAttr, defStyleRes); UseStyleAttributes(ta); viewTitle.SetSingleLine(true); PrepareChildViews(); }
internal static ColorStateList GetColorStateList(this AppCompatCheckBox platformCheckBox, ICheckBox check) { AColor tintColor; // For the moment, we're only supporting solid color Paint for the Android Checkbox if (check.Foreground is SolidPaint solid) { var color = solid.Color; tintColor = color.ToPlatform(); } else { Graphics.Color accent = platformCheckBox.Context?.GetAccentColor() ?? Graphics.Color.FromArgb("#ff33b5e5"); tintColor = accent.ToPlatform(); } return(ColorStateListExtensions.CreateCheckBox(tintColor)); }
private void SettingsLogButton_Click(object sender, EventArgs e) { bool LOG_SETTINGS_FORM_VISIBLE = SettingsLogViewForm == null; Preferences.Set(Constants.LOG_SETTINGS_FORM_VISIBLE, LOG_SETTINGS_FORM_VISIBLE); // if (LOG_SETTINGS_FORM_VISIBLE) { SettingsLogViewForm = LayoutInflater.Inflate(Resource.Layout.FormSettingsLogView, SettingsLogViewArea, false) as LinearLayoutCompat; // checkBoxTracView = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxTracView); checkBoxTracView.Checked = Preferences.Get(Resources.GetResourceEntryName(checkBoxTracView.Id), true); checkBoxTracView.CheckedChange += CheckBoxTracView_CheckedChange; checkBoxInfoView = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxInfoView); checkBoxInfoView.Checked = Preferences.Get(Resources.GetResourceEntryName(checkBoxInfoView.Id), true); checkBoxInfoView.CheckedChange += CheckBoxTracView_CheckedChange; checkBoxWarnView = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxWarnView); checkBoxWarnView.Checked = Preferences.Get(Resources.GetResourceEntryName(checkBoxWarnView.Id), true); checkBoxWarnView.CheckedChange += CheckBoxTracView_CheckedChange; checkBoxErrView = SettingsLogViewForm.FindViewById <AppCompatCheckBox>(Resource.Id.checkBoxErrView); checkBoxErrView.Checked = Preferences.Get(Resources.GetResourceEntryName(checkBoxErrView.Id), true); checkBoxErrView.CheckedChange += CheckBoxTracView_CheckedChange; // SettingsLogViewArea.AddView(SettingsLogViewForm); } else { checkBoxTracView.CheckedChange -= CheckBoxTracView_CheckedChange; checkBoxInfoView.CheckedChange -= CheckBoxTracView_CheckedChange; checkBoxWarnView.CheckedChange -= CheckBoxTracView_CheckedChange; checkBoxErrView.CheckedChange -= CheckBoxTracView_CheckedChange; // checkBoxTracView = null; checkBoxInfoView = null; checkBoxWarnView = null; checkBoxErrView = null; // SettingsLogViewArea.RemoveAllViews(); SettingsLogViewForm = null; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.VideoCall); Window.AddFlags(WindowManagerFlags.KeepScreenOn); _btnEndCall = FindViewById <AppCompatImageView>(Resource.VideoCall.btnEndCall); _cbMute = FindViewById <AppCompatCheckBox>(Resource.VideoCall.cbMute); _btnFlip = FindViewById <AppCompatCheckBox>(Resource.VideoCall.btnFlip); _lblUserName = FindViewById <TextView>(Resource.VideoCall.lblUserName); _lblStatus = FindViewById <TextView>(Resource.VideoCall.lblDuration); _primaryVideo = FindViewById <TwilioVideo.VideoView>(Resource.VideoCall.primaryVideo); _spinner = FindViewById <View>(Resource.VideoCall.pgLoading); _thumbnailVideo = FindViewById <TwilioVideo.VideoView>(Resource.VideoCall.thumbnailVideo); _root = FindViewById <ViewGroup>(Resource.VideoCall.root); _thumbnailContainer = FindViewById <ViewGroup>(Resource.VideoCall.thumbnailContainer); _primaryVideo.Visibility = ViewStates.Invisible; _thumbnailVideo.Visibility = ViewStates.Invisible; _btnFlip.Click += OnFlipButtonClick; _btnEndCall.Click += OnCancelButtonClick; bool twoOrMoreCameras = Cameras.Count() > 1; _btnFlip.Enabled = twoOrMoreCameras; _btnFlip.Visibility = twoOrMoreCameras ? ViewStates.Visible : ViewStates.Gone; VolumeControlStream = Stream.VoiceCall; bool granted = ContextCompat.CheckSelfPermission(ApplicationContext, Manifest.Permission.Camera) == Permission.Granted && ContextCompat.CheckSelfPermission(ApplicationContext, Manifest.Permission.RecordAudio) == Permission.Granted; CheckVideoCallPermissions(granted); TwilioVideo = TwilioVideoHelper.GetOrCreate(ApplicationContext); UpdateState(); ConnectToRoom(); }
public MakeOrderPartLaborViewHolder(View itemView, Action <int> listener, Action <int> laborListener) : base(itemView) { PartLaborDescription = itemView.FindViewById <TextView>(Resource.Id.part_description); PartLaborCheckBox = itemView.FindViewById <AppCompatCheckBox>(Resource.Id.part_checkbox); LaborButton = itemView.FindViewById <ImageButton>(Resource.Id.part_laborbutton); PartLaborCheckBox.Click += (s, e) => { listener(AdapterPosition); }; itemView.Click += (s, e) => { PartLaborCheckBox.Checked = !PartLaborCheckBox.Checked; listener(AdapterPosition); }; LaborButton.Click += (s, e) => { laborListener(AdapterPosition); }; }
/// <summary> /// Initializes a new instance of the <see cref="T:AiForms.Renderers.Droid.CheckboxCellView"/> class. /// </summary> /// <param name="context">Context.</param> /// <param name="cell">Cell.</param> public CheckboxCellView(Context context, Cell cell) : base(context, cell) { _checkbox = new AppCompatCheckBox(context); _checkbox.SetOnCheckedChangeListener(this); _checkbox.Gravity = Android.Views.GravityFlags.Right; var lparam = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Width = (int)context.ToPixels(30), Height = (int)context.ToPixels(30) }; using (lparam) { AccessoryStack.AddView(_checkbox, lparam); } _checkbox.Focusable = false; Focusable = false; DescendantFocusability = Android.Views.DescendantFocusability.AfterDescendants; }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); _appBar = view.FindViewById <AppBarLayout>(Resource.Id.login_AppBar); _loginInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.login_text_input); _passwordInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.password_text_input); _loginEditText = view.FindViewById <AppCompatEditText>(Resource.Id.login_edit_text); _passwordEditText = view.FindViewById <AppCompatEditText>(Resource.Id.password_edit_text); _saveCheckBox = view.FindViewById <AppCompatCheckBox>(Resource.Id.login_save_checkbox); _restPassButton = view.FindViewById <TextView>(Resource.Id.login_reset_password); _langSpinnerLabel = view.FindViewById <TextView>(Resource.Id.login_lang_spinner_label); _langSpinner = view.FindViewById <AppCompatSpinner>(Resource.Id.login_lang_spinner); _guestLoginButton = view.FindViewById <MaterialButton>(Resource.Id.login_guest_button); _loginButton = view.FindViewById <TextView>(Resource.Id.login_button); _loginStatus = view.FindViewById <TextView>(Resource.Id.login_status); _progressBarContainer = view.FindViewById <FrameLayout>(Resource.Id.login_progress_container); _loginEditText.FocusChange += (sender, args) => { if (args.HasFocus) { _appBar.SetExpanded(false, true); } }; _passwordEditText.FocusChange += (sender, args) => { if (args.HasFocus) { _appBar.SetExpanded(false, true); } }; _passwordEditText.EditorAction += (sender, args) => OnLoginClick(); _loginButton.Click += (sender, args) => OnLoginClick(); _restPassButton.Click += (sender, args) => ShowResetPasswordDialog(); }
public RecyclerViewHolder(View itemView) : base(itemView) { Container = itemView.FindViewById <View>(Resource.Id.purge_row_label_container); Label = itemView.FindViewById <TextView>(Resource.Id.purge_row_label); CheckBox = itemView.FindViewById <AppCompatCheckBox>(Resource.Id.purge_row_check); }
public static void UpdateIsChecked(this AppCompatCheckBox nativeCheckBox, ICheckBox check) { nativeCheckBox.Checked = check.IsChecked; }
public static void UpdateIsChecked(this AppCompatCheckBox platformCheckBox, ICheckBox check) { platformCheckBox.Checked = check.IsChecked; }