Exemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var ignore = base.OnCreateView(inflater, container, savedInstanceState);

            var view = this.BindingInflate(FragmentId, null);

            _toolbar = view.FindViewById <Toolbar>(Resource.Id.toolbar);
            //_toolbar.SetTitleTextColor(Resource.Color.white);
            if (_toolbar != null)
            {
                ((MainActivity)Activity).SetSupportActionBar(_toolbar);
                ((MainActivity)Activity).SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                _drawerToggle = new MvxActionBarDrawerToggle(
                    Activity,                                                   // host Activity
                    ((MainActivity)Activity).DrawerLayout,                      // DrawerLayout object
                    _toolbar,                                                   // nav drawer icon to replace 'Up' caret
                    Resource.String.drawer_open,                                // "open drawer" description
                    Resource.String.drawer_close                                // "close drawer" description
                    );
                _drawerToggle.DrawerOpened += (sender, e) => ((MainActivity)Activity).HideSoftKeyboard();
                ((MainActivity)Activity).DrawerLayout.SetDrawerListener(_drawerToggle);
            }
            _actionBar = ((MainActivity)Activity).SupportActionBar;
            _actionBar.SetCustomView(Resource.Layout.toolbar_search);
            _edtSearch = (AppCompatEditText)_actionBar.CustomView.FindViewById(Resource.Id.edtSearch);
            _edtSearch.AddTextChangedListener(this);

            Messenger = Mvx.Resolve <IMvxMessenger>();
            Messenger.Subscribe <ToastMessage>(DisplayToast);


            return(view);
        }
Exemplo n.º 2
0
        public static void UpdateMaxLength(this AppCompatEditText editText, int maxLength)
        {
            var currentFilters = new List <IInputFilter>(editText.GetFilters() ?? new IInputFilter[0]);
            var changed        = false;

            for (var i = 0; i < currentFilters.Count; i++)
            {
                if (currentFilters[i] is InputFilterLengthFilter)
                {
                    currentFilters.RemoveAt(i);
                    changed = true;
                    break;
                }
            }

            if (maxLength > 0)
            {
                currentFilters.Add(new InputFilterLengthFilter(maxLength));
                changed = true;
            }

            if (changed)
            {
                editText.SetFilters(currentFilters.ToArray());
            }

            var newText = editText.Text.TrimToMaxLength(maxLength);

            if (editText.Text != newText)
            {
                editText.Text = newText;
            }
        }
Exemplo n.º 3
0
        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);
        }
        private void BindResources()
        {
            var toolbar = FindViewById <CenteredToolbar>(Resource.Id.toolbar);

            toolbar.SetTitle(Resource.String.edison_device_setup_message);

            var layout = FindViewById <LinearLayout>(Resource.Id.instruction);

            var instructionNumber = layout.FindViewById <AppCompatTextView>(Resource.Id.instruction_number);
            var instructionText   = layout.FindViewById <AppCompatTextView>(Resource.Id.instruction_text);

            instructionNumber.Text = "5";
            instructionText.SetText(Resource.String.enter_password_instruction_label);

            TextView labelView = FindViewById <TextView>(Resource.Id.enter_password_for_network_ssid);

            labelView.Text = _ssid;

            SetSupportActionBar(toolbar);

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            this.BackPressed += SelectWifiOnDeviceActivity_BackPressed;

            _editText              = (AppCompatEditText)FindViewById(Resource.Id.wifiPasswordEditText);
            _editText.TextChanged += EditText_TextChanged;

            _connectButton         = (AppCompatButton)FindViewById(Resource.Id.connect_button);
            _connectButton.Enabled = false;
            _connectButton.Click  += _connectButton_Click;

            _showPasswordTextView        = (AppCompatTextView)FindViewById(Resource.Id.show_password_textview);
            _showPasswordTextView.Click += _showPasswordTextView_Click;
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_query_food);

            _mealName = FindViewById <AppCompatEditText>(Resource.Id.food_name);
            AppCompatButton queryFoodButton = FindViewById <AppCompatButton>(Resource.Id.query_food_button);

            queryFoodButton.Click += delegate
            {
                queryFoodButton.Enabled = false;
                OnQueryFoodButtonPressed();
            };

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_query_food);
            toolbar.Title = "Find a Food";
            SetSupportActionBar(toolbar);

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view_query_food);

            navigationView.SetNavigationItemSelectedListener(this);
        }
Exemplo n.º 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Log.Debug(TAG, "OnCreate");
            base.OnCreate(savedInstanceState);

            CardTitle    = FindViewById <AppCompatTextView>(Resource.Id.script_card_title);
            CardSubtitle = FindViewById <AppCompatTextView>(Resource.Id.script_card_subtitle);

            ScriptName = FindViewById <AppCompatEditText>(Resource.Id.editTextScriptName);

            AutorunTrigger = FindViewById <SwitchCompat>(Resource.Id.switchAutorunTriggerScript);
            //
            HardwareTrigger = FindViewById <AppCompatSpinner>(Resource.Id.spinnerScriptTriggerHardware);
            PortTrigger     = FindViewById <AppCompatSpinner>(Resource.Id.spinnerScriptTriggerPort);
            StateTrigger    = FindViewById <AppCompatSpinner>(Resource.Id.spinnerScriptTriggerState);

            AutorunTrigger.Checked = false;
            //
            HardwareTrigger.Enabled = false;
            PortTrigger.Enabled     = false;
            StateTrigger.Enabled    = false;

            ButtonOk = FindViewById <AppCompatButton>(Resource.Id.script_button_ok);

            HardwaresListSpinnerLoad(ref HardwareTrigger);
            //
            ArrayAdapter adapterPortStatuses = ArrayAdapter <string> .CreateFromResource(this, Resource.Array.script_trigger_port_states_array, Android.Resource.Layout.SimpleSpinnerItem);

            adapterPortStatuses.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            StateTrigger.Adapter = adapterPortStatuses;
        }
 public static void UpdateSelectionLength(this AppCompatEditText editText, IEntry entry)
 {
     if ((editText.SelectionEnd - editText.SelectionStart) != entry.SelectionLength)
     {
         UpdateCursorSelection(editText, entry);
     }
 }
        internal static void SetInputType(this AppCompatEditText editText, IEditor editor)
        {
            if (editor.IsReadOnly)
            {
                editText.InputType = InputTypes.Null;
            }
            else
            {
                var keyboard = editor.Keyboard;
                var nativeInputTypeToUpdate = keyboard.ToInputType();

                if (keyboard is not CustomKeyboard)
                {
                    // TODO: IsSpellCheckEnabled handling must be here.

                    if ((nativeInputTypeToUpdate & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions)
                    {
                        if (!editor.IsTextPredictionEnabled)
                        {
                            nativeInputTypeToUpdate |= InputTypes.TextFlagNoSuggestions;
                        }
                    }
                }

                if (keyboard == Keyboard.Numeric)
                {
                    editText.KeyListener = LocalizedDigitsKeyListener.Create(editText.InputType);
                }

                editText.InputType = nativeInputTypeToUpdate;
            }
        }
Exemplo n.º 10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.dialog_reset_pass);

            Window.SetLayout(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            Window.SetGravity(GravityFlags.Center);

            _header               = FindViewById <TextView>(Resource.Id.reset_pass_header);
            _loginInputLayout     = FindViewById <TextInputLayout>(Resource.Id.reset_pass_login_input);
            _emailInputLayout     = FindViewById <TextInputLayout>(Resource.Id.reset_pass_email_input);
            _loginEditText        = FindViewById <AppCompatEditText>(Resource.Id.reset_pass_login_edit_text);
            _emailEditText        = FindViewById <AppCompatEditText>(Resource.Id.reset_pass_email_edit_text);
            _progressBarContainer = FindViewById <FrameLayout>(Resource.Id.reset_pass_progress_container);
            _resetPassButton      = FindViewById <TextView>(Resource.Id.reset_pass_button);

            FindViewById <ImageView>(Resource.Id.reset_pass_close).Click += (sender, args) => Dismiss();

            _loginEditText.TextChanged += (sender, args) => Validate();
            _emailEditText.TextChanged += (sender, args) => Validate();

            _emailEditText.EditorAction += (sender, args) => OnPassResetClick();
            _resetPassButton.Click      += (sender, args) => OnPassResetClick();

            ApplyI18N();

            if (savedInstanceState != null)
            {
                return;
            }

            _viewModel.PasswordResetLiveData.Observe(LifecycleManager, OnPasswordReset,
                                                     e => Log.Error("ResetPassDialog", "Error observing PasswordResetLiveData", e));
        }
Exemplo n.º 11
0
 public static void UpdateCursorPosition(this AppCompatEditText editText, IEntry entry)
 {
     if (editText.SelectionStart != entry.CursorPosition)
     {
         UpdateCursorSelection(editText, entry);
     }
 }
        //Uncomment this later if an options menu is added
        //public override bool OnCreateOptionsMenu(IMenu menu)
        //{
        //    MenuInflater.Inflate(Resource.Menu.menu_main, menu);
        //    return true;
        //}
        //
        //public override bool OnOptionsItemSelected(IMenuItem item)
        //{
        //    int id = item.ItemId;
        //    if (id == Resource.Id.action_settings)
        //    {
        //        return true;
        //    }
        //
        //    return base.OnOptionsItemSelected(item);
        //}

        private void MulticastListener()
        {
            UdpClient  mcastClient      = new UdpClient();
            IPAddress  multicastaddress = IPAddress.Parse("224.0.0.69");
            IPEndPoint remoteep         = new IPEndPoint(IPAddress.Any, 11000);

            mcastClient.Client.Bind(remoteep);
            mcastClient.JoinMulticastGroup(multicastaddress);

            new Thread(() =>
            {
                while (true)
                {
                    byte[] resp = mcastClient.Receive(ref remoteep);
                    var str     = Encoding.ASCII.GetString(resp);
                    if (str == "DecaMoveAndroidEmulator")
                    {
                        AppCompatEditText ipaddr = FindViewById <AppCompatEditText>(Resource.Id.textInputEditText1);
                        RunOnUiThread(() =>
                        {
                            ipaddr.Text = remoteep.Address.ToString();
                        });
                        break;
                    }
                }
            }).Start();
        }
Exemplo n.º 13
0
        private void BindViews(View root)
        {
            _quick_chat_holder  = root.FindViewById <LinearLayout>(Resource.Id.quick_chat_holder);
            _chat_layout_holder = root.FindViewById <ConstraintLayout>(Resource.Id.chat_layout_holder);

            QuickButtons.Add(new Tuple <CircularImageButton, AppCompatTextView>(root.FindViewById <CircularImageButton>(Resource.Id.qc_emergency), root.FindViewById <AppCompatTextView>(Resource.Id.qc_emergency_name)));
            QuickButtons.Add(new Tuple <CircularImageButton, AppCompatTextView>(root.FindViewById <CircularImageButton>(Resource.Id.qc_activity), root.FindViewById <AppCompatTextView>(Resource.Id.qc_activity_name)));
            QuickButtons.Add(new Tuple <CircularImageButton, AppCompatTextView>(root.FindViewById <CircularImageButton>(Resource.Id.qc_safe), root.FindViewById <AppCompatTextView>(Resource.Id.qc_safe_name)));
            _safeButtonHolder = root.FindViewById <LinearLayout>(Resource.Id.qc_safe_holder);
            // if the fragment is contained in an EventDetailActivity, initially make labels invisible by setting alpha to 0
            if (_parentId == Resource.Layout.event_detail_activity)
            {
                foreach (var button in QuickButtons)
                {
                    button.Item2.Alpha = 0;
                }
            }

            _chatInputHolder       = root.FindViewById <ConstraintLayout>(Resource.Id.chat_input_holder);
            _chatMessageInput      = root.FindViewById <AppCompatEditText>(Resource.Id.chat_input);
            _chatMessageSendButton = root.FindViewById <CircularImageButton>(Resource.Id.send_button);

            _eventButtons = root.FindViewById <RecyclerView>(Resource.Id.chat_button_list);
            _chatMessages = root.FindViewById <RecyclerView>(Resource.Id.chat_area);
        }
Exemplo n.º 14
0
        internal static void SetInputType(this AppCompatEditText editText, IEntry entry)
        {
            editText.InputType  = InputTypes.ClassText;
            editText.InputType |= InputTypes.TextFlagMultiLine;

            if (entry.IsPassword && ((editText.InputType & InputTypes.ClassText) == InputTypes.ClassText))
            {
                editText.InputType |= InputTypes.TextVariationPassword;
            }

            if (entry.IsPassword && ((editText.InputType & InputTypes.ClassNumber) == InputTypes.ClassNumber))
            {
                editText.InputType |= InputTypes.NumberVariationPassword;
            }

            if (!entry.IsTextPredictionEnabled && ((editText.InputType & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions))
            {
                editText.InputType |= InputTypes.TextFlagNoSuggestions;
            }

            if (entry.IsReadOnly)
            {
                editText.InputType = InputTypes.Null;
            }
        }
        private SearchToolbarBinding(LayoutInflater inflater, int layoutId, SearchToolbar view, bool attachToRoot)
        {
            Root = inflater.Inflate(layoutId, view, attachToRoot);
            toolbar = Root.FindViewById<Toolbar>(Resource.Id.toolbar);
            editSearch = Root.FindViewById<AppCompatEditText>(Resource.Id.edit_search);

            //            coverGithub = Root.FindViewById<View>(Resource.Id.cover_github);
        }
        private SearchToolbarBinding(LayoutInflater inflater, int layoutId, SearchToolbar view, bool attachToRoot)
        {
            Root       = inflater.Inflate(layoutId, view, attachToRoot);
            toolbar    = Root.FindViewById <Toolbar>(Resource.Id.toolbar);
            editSearch = Root.FindViewById <AppCompatEditText>(Resource.Id.edit_search);

//            coverGithub = Root.FindViewById<View>(Resource.Id.cover_github);
        }
Exemplo n.º 17
0
        public static void UpdateIsReadOnly(this AppCompatEditText editText, IEditor editor)
        {
            bool isReadOnly = !editor.IsReadOnly;

            editText.FocusableInTouchMode = isReadOnly;
            editText.Focusable            = isReadOnly;
            editText.SetCursorVisible(isReadOnly);
        }
    protected override TextInputLayout CreateNativeControl()
    {
        var textInputLayout = new TextInputLayout(Context);
        var editText        = new AppCompatEditText(Context);

        editText.SetTextSize(ComplexUnitType.Sp, (float)Element.FontSize);
        textInputLayout.AddView(editText);
        return(textInputLayout);
    }
Exemplo n.º 19
0
        public static void UpdatePlaceholder(this AppCompatEditText editText, IPlaceholder textInput)
        {
            if (editText.Hint == textInput.Placeholder)
            {
                return;
            }

            editText.Hint = textInput.Placeholder;
        }
Exemplo n.º 20
0
        public static void UpdateIsTextPredictionEnabled(this AppCompatEditText editText, IEditor editor)
        {
            if (editor.IsTextPredictionEnabled)
            {
                return;
            }

            editText.InputType |= InputTypes.TextFlagNoSuggestions;
        }
Exemplo n.º 21
0
        public static void UpdateIsReadOnly(this AppCompatEditText editText, IEntry entry)
        {
            bool isEditable = !entry.IsReadOnly;

            editText.SetInputType(entry);

            editText.FocusableInTouchMode = isEditable;
            editText.Focusable            = isEditable;
        }
Exemplo n.º 22
0
        public static void AddTextChangedAction(this AppCompatEditText self,
                                                Action <ICharSequence, int, int, int> onTextChangedHandler)

        {
            self.AddTextChangedActions(
                (s, start, count, after) => {},
                (s) => {},
                onTextChangedHandler);
        }
Exemplo n.º 23
0
        public static void UpdatePlaceholder(this AppCompatEditText editText, IEntry entry)
        {
            if (editText.Hint == entry.Placeholder)
            {
                return;
            }

            editText.Hint = entry.Placeholder;
        }
Exemplo n.º 24
0
        private void ReconcileEditText(Func <DeviceModel, string> prop, AppCompatEditText editText)
        {
            string value = prop(this.ViewModel.CurrentDeviceModel);

            if (value != default(string))
            {
                editText.Text = value;
            }
        }
Exemplo n.º 25
0
        public static void UpdateText(this AppCompatEditText editText, IEntry entry)
        {
            var newText = entry.Text ?? string.Empty;
            var oldText = editText.Text ?? string.Empty;

            if (oldText != newText)
            {
                editText.Text = newText;
            }
        }
Exemplo n.º 26
0
 private void ReferencesViews(View view)
 {
     EtPlate            = (AppCompatEditText)view.FindViewById(Resource.Id.et_plate);
     EtCylinderCapacity = (AppCompatEditText)view.FindViewById(Resource.Id.et_cylinder_capacity);
     EtDateAdd          = (AppCompatTextView)view.FindViewById(Resource.Id.et_date_add);
     EtTimeAdd          = (AppCompatTextView)view.FindViewById(Resource.Id.et_time_add);
     AddVehicle         = (AppCompatButton)view.FindViewById(Resource.Id.mb_add_vehicle);
     RbCar  = (RadioButton)view.FindViewById(Resource.Id.rb_car);
     Loader = (FrameLayout)view.FindViewById(Resource.Id.loader_add_vehicle);
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_blood_sugar_add);

            _level       = FindViewById <AppCompatEditText>(Resource.Id.blood_sugar_add_reading);
            _mealName    = FindViewById <AppCompatEditText>(Resource.Id.blood_sugar_add_meal_name);
            _readingType = FindViewById <AppCompatSpinner>(Resource.Id.blood_sugar_reading_type);
            _mealType    = FindViewById <AppCompatSpinner>(Resource.Id.meal_type);
            _carbs       = FindViewById <AppCompatEditText>(Resource.Id.blood_sugar_add_carbs);

            _carbs.Visibility    = ViewStates.Gone;
            _mealName.Visibility = ViewStates.Gone;
            _mealType.Visibility = ViewStates.Gone;

            ArrayAdapter <ReadingType> adapter = new ArrayAdapter <ReadingType>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, (ReadingType[])Enum.GetValues(typeof(ReadingType)));

            _readingType.Adapter = adapter;

            AppCompatButton bloodSugarAddButton = FindViewById <AppCompatButton>(Resource.Id.blood_sugar_add_button);

            bloodSugarAddButton.Click += async delegate
            {
                bloodSugarAddButton.Enabled = false;

                string status = await OnBloodSugarAddButtonPressed();

                if (status == "Success")
                {
                    Finish();
                }
                else
                {
                    bloodSugarAddButton.Enabled = true;
                    RunOnUiThread(() =>
                    {
                        Toast.MakeText(this, status, ToastLength.Long).Show();
                    });
                }
            };

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_blood_sugar_add);
            toolbar.Title = "Add A Blood Sugar Reading";
            SetSupportActionBar(toolbar);

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view_blood_sugar_add);

            navigationView.SetNavigationItemSelectedListener(this);
        }
Exemplo n.º 28
0
        public static void AddTextChangedActions(this AppCompatEditText self,
                                                 Action <ICharSequence, int, int, int> beforeTextChangedHandler,
                                                 Action <IEditable> afterTextChangedHandler,
                                                 Action <ICharSequence, int, int, int> onTextChangedHandler)

        {
            self.AddTextChangedListener(new DelegateTextWatcher(
                                            beforeTextChangedHandler,
                                            afterTextChangedHandler,
                                            onTextChangedHandler));
        }
Exemplo n.º 29
0
 private void InitalizeViews()
 {
     Car      = FindViewById <AppCompatEditText>(Resource.Id.car);
     Model    = FindViewById <AppCompatEditText>(Resource.Id.model);
     Mileage  = FindViewById <AppCompatEditText>(Resource.Id.mileage);
     FuelType = FindViewById <AppCompatEditText>(Resource.Id.fuelType);
     Year     = FindViewById <AppCompatEditText>(Resource.Id.year);
     Price    = FindViewById <AppCompatEditText>(Resource.Id.price);
     Attached = FindViewById <ImageView>(Resource.Id.attached);
     AddBtn   = FindViewById <MaterialButton>(Resource.Id.addBtn);
 }
Exemplo n.º 30
0
        public static void UpdateMaxLength(this AppCompatEditText editText, int maxLength)
        {
            editText.SetLengthFilter(maxLength);

            var newText = editText.Text.TrimToMaxLength(maxLength);

            if (editText.Text != newText)
            {
                editText.Text = newText;
            }
        }
Exemplo n.º 31
0
        public static void UpdateText(this AppCompatEditText editText, IEntry entry)
        {
            var newText = entry.Text ?? string.Empty;
            var oldText = editText.Text ?? string.Empty;

            if (oldText != newText)
            {
                editText.Text = newText;
            }

            // TODO ezhart The renderer sets the text to selected and shows the keyboard if the EditText is focused
        }