public void customizeSearchView()
 {
     mSearchBox = FindViewById<EditText> (Resource.Id.search_box);
     mSearchBox.AddTextChangedListener (this);
     mSearchBox.FocusableInTouchMode = true;
     //mSearchBox.SetBackgroundResource (Resource.Drawable.test);
 }
            public void OnTextChanged(ICharSequence s, int start, int before, int count)
            {
                string value = mEditText.Text.Replace(",", "").Replace("\u20b1", "").Replace(".", "").TrimStart('0');

                if (mIsForPrice & value == "")
                {
                    //disable ok
                    int   colorInt = mContext.GetColor(Resource.Color.jepoyGray);
                    Color color    = new Color(colorInt);
                    mNumpadOk.SetTextColor(color);
                    mNumpadOk.Enabled = false;
                }
                else
                {
                    //enable ok
                    int   colorInt = mContext.GetColor(Resource.Color.colorAccent);
                    Color color    = new Color(colorInt);
                    mNumpadOk.SetTextColor(color);
                    mNumpadOk.Enabled = true;
                }

                decimal ul;

                if (decimal.TryParse(value, out ul))
                {
                    ul /= 100;
                    mEditText.RemoveTextChangedListener(this);
                    mEditText.Text = "\u20b1" + string.Format("{0:n}", ul);
                    mEditText.AddTextChangedListener(this);
                }
            }
Exemplo n.º 3
0
        private void InitComponents()
        {
            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            //Movie RecyclerView
            var mvxRecyclerView = FindViewById <MvxRecyclerView>(Resource.Id.search_layout_recyclerview);
            var layoutManager   = new GridLayoutManager(this, 2);
            var adapter         = new SearchViewRecyclerAdapter((IMvxAndroidBindingContext)BindingContext);

            mvxRecyclerView.AddItemDecoration(new GridSpacingItemDecoration(2, 16, true, 0));

            searchEditText = FindViewById <EditText>(Resource.Id.search_bar_edit_text);
            searchEditText.AddTextChangedListener(this);
            searchEditText.Typeface = FontUtils.GetNormalFont(this);

            //Infinite Scrolling
            var onScrollListener = new EndlessRecyclerOnScrollListener();

            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) =>
            {
                ViewModel.LoadMoreDataCommand.Execute(true);
            };
            mvxRecyclerView.AddOnScrollListener(onScrollListener);
            mvxRecyclerView.SetLayoutManager(layoutManager);
            mvxRecyclerView.Adapter = adapter;

            RecyclerView.ItemAnimator animator = mvxRecyclerView.GetItemAnimator();
            if (animator is DefaultItemAnimator)
            {
                ((DefaultItemAnimator)animator).SupportsChangeAnimations = false;
            }
        }
Exemplo n.º 4
0
        protected override void OnAttached()
        {
            EditText editText = ((EditText)Control);

            editText.AddTextChangedListener(new OnTextChangedListener(editText));
            editText.FocusChange += EditText_FocusChange;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
            SetContentView(Resource.Layout.WorkspaceSchemaEditlayout);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarMain);
            if (null != toolbar)
            {
                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                //SupportActionBar.SetTitle(Resource.String.add_new_database_string);
            }

            database  = FirebaseDatabase.Instance;
            schemaRef = database.GetReferenceFromUrl(Intent.GetStringExtra("selfSchema"));

            schemaRef.AddChildEventListener(schemaListener);

            removeButton = FindViewById <RelativeLayout>(Resource.Id.relativeLayoutDelete);
            removeButton.SetOnClickListener(this);

            nameText = FindViewById <EditText>(Resource.Id.editTextWorkspaceName);
            nameText.AddTextChangedListener(namelistener);
        }
        public void OnTextChanged(ICharSequence s, int start, int before, int count)
        {
            if (!s.ToString().Equals(lastAmount))
            {
                string cleanString = clearCurrencyToNumber(s.ToString());
                try
                {
                    string formattedAmount = transformtocurrency(cleanString);
                    editText.RemoveTextChangedListener(this);
                    editText.Text = formattedAmount;
                    editText.SetSelection(formattedAmount.Length);
                    editText.AddTextChangedListener(this);

                    if (lastCursorPosition != lastAmount.Length && lastCursorPosition != -1)
                    {
                        int lengthDelta     = formattedAmount.Length - lastAmount.Length;
                        int newCursorOffset = Java.Lang.Math.Max(0, Java.Lang.Math.Min(formattedAmount.Length, lastCursorPosition + lengthDelta));
                        editText.SetSelection(newCursorOffset);
                    }
                }
                catch (System.Exception e)
                {
                }
            }
            else if (s.ToString() == "")
            {
                return;
            }
        }
Exemplo n.º 7
0
        private View CreatePickerView()
        {
            var contentView = View.Inflate(Activity, Resource.Layout.cpv_dialog_color_picker, null);

            _colorPicker = contentView.FindViewById <ColorPickerView>(Resource.Id.cpv_color_picker_view);
            var oldColorPanel = contentView.FindViewById <ColorPanelView>(Resource.Id.cpv_color_panel_old);

            _newColorPanel = contentView.FindViewById <ColorPanelView>(Resource.Id.cpv_color_panel_new);
            var arrowRight = contentView.FindViewById <ImageView>(Resource.Id.cpv_arrow_right);

            _hexEditText = contentView.FindViewById <EditText>(Resource.Id.cpv_hex);

            try
            {
                var value      = new TypedValue();
                var typedArray =
                    Activity.ObtainStyledAttributes(value.Data, new[] { Android.Resource.Attribute.TextColorPrimary });
                var arrowColor = typedArray.GetColor(0, Color.Black);
                typedArray.Recycle();
                arrowRight.SetColorFilter(arrowColor);
            }
            catch (Exception)
            {
                // ignored
            }

            _colorPicker.SetAlphaSliderVisible(_showAlphaSlider);
            oldColorPanel.SetColor(new Color(Arguments.GetInt(ARG_COLOR)));
            _colorPicker.SetColor(_color, true);
            _newColorPanel.SetColor(_color);
            SetHex(_color);

            if (!_showAlphaSlider)
            {
                _hexEditText.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(6) });
            }

            _newColorPanel.SetOnClickListener(new OnClickListener(v =>
            {
                if (_newColorPanel.GetColor() == _color)
                {
                    OnColorSelected();
                    Dismiss();
                }
            }));

            contentView.SetOnTouchListener(this);
            _colorPicker.SetOnColorChangedListener(this);
            _hexEditText.AddTextChangedListener(this);

            _hexEditText.OnFocusChangeListener = new OnFocusChangeListener((v, hasFocus) =>
            {
                if (hasFocus)
                {
                    var imm = (InputMethodManager)Activity.GetSystemService(Context.InputMethodService);
                    imm.ShowSoftInput(_hexEditText, ShowFlags.Implicit);
                }
            });
            return(contentView);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view               = inflater.Inflate(Resource.Layout.StatsColumnsAllTable, container, false);
            mListView          = view.FindViewById <ListView>(Resource.Id.listViewStatsColumns);
            mSearch            = view.FindViewById <EditText>(Resource.Id.etSearch);
            mContainerListView = view.FindViewById <LinearLayout>(Resource.Id.containerStatsColumns);
            mDesign            = view.FindViewById <Design>(Resource.Id.HelpEr);

            mContext = container.Context;

            mDesign.Alpha     = 0;
            mDesign.Focusable = false;

            mSearch.Focusable = false;
            mSearch.AddTextChangedListener(this);

            mListStatsColumns = webService.GetAllDataStatsColumns();

            List <StatsColumns> searchedTable = (from table in mListStatsColumns
                                                 where table.LOW_OCCUPANCY.Contains("YES", StringComparison.OrdinalIgnoreCase)
                                                 select table).ToList <StatsColumns>();

            mTableAdapter     = new StatsColumnsAdapter(mContext, Resource.Layout.StatsColumnsRow, searchedTable);
            mListView.Adapter = mTableAdapter;

            return(view);
        }
Exemplo n.º 9
0
        private void PhoneImageViewBtn_Click(object sender, EventArgs e)
        {
            var phoneNumberDialogHandler = new EventHandler <DialogClickEventArgs>((alertDialog, clicked) =>
            {
                var phoneNumberAlertDialog = alertDialog as AlertDialog;
                Button btnClicked          = phoneNumberAlertDialog?.GetButton(clicked.Which);

                if (btnClicked?.Text != GetString(Resource.String.send_code))
                {
                    return;
                }

                var phoneNumber = phoneNumberAlertDialog?.FindViewById <EditText>(Resource.Id.phoneNumber);
                var mCallBacks  = new PhoneAuthVerificationCallbacks();

                mCallBacks.CodeSent += MCallBacks_CodeSent;
                mCallBacks.VerificationCompleted += MCallBacks_VerificationCompleted;
                PhoneAuthProvider.GetInstance(FirebaseAuth).VerifyPhoneNumber(phoneNumber?.Text, VERIFICATION_TIMEOUT, TimeUnit.Seconds, this, mCallBacks);
            });

            AlertDialog phoneNumberAlert = new AlertDialog.Builder(this)
                                           .SetTitle(GetString(Resource.String.input_phone_number))
                                           .SetPositiveButton(GetString(Resource.String.send_code), phoneNumberDialogHandler)
                                           .SetView(LayoutInflater.Inflate(Resource.Layout.PhoneNumberDialog, null))
                                           .Show();

            EditText phoneNumberInput = phoneNumberAlert.FindViewById <EditText>(Resource.Id.phoneNumber);

            //phoneNumberInput.AddTextChangedListener(new PhoneNumberFormattingTextWatcher("NG"));
            phoneNumberInput.AddTextChangedListener(new PhoneTextWatcher(phoneNumberInput));
        }
Exemplo n.º 10
0
 private void FnSetEvents()
 {
     mBtnNext.Click += MBtnNext_Click;
     mEtAmountReceived.AddTextChangedListener(new CurrencyTextWatcher(mEtAmountReceived, this, mPesoSign));
     NumpadClickEvent(mEtAmountReceived);
     mEtAmountReceived.AfterTextChanged += MEtAmountReceived_AfterTextChanged;
 }
Exemplo n.º 11
0
        private void ConfigureControl()
        {
            EditText editText = ((EditText)Control);

            editText.AddTextChangedListener(new OnTextChangedListener(editText));
            editText.FocusChange += EditText_FocusChange;
        }
Exemplo n.º 12
0
        public TableViewOld(Activity context, TableController controller) : this()
        {
            this.controller     = controller;
            this.parentActivity = context;

            table_view = context.LayoutInflater.Inflate(Resource.Layout.TableLayoutOld, null);

            tableView       = table_view.FindViewById <TableLayout>(Resource.Id.table_data);
            column_row_view = table_view.FindViewById <TableRow>(Resource.Id.columnRow);

            deleteButton = table_view.FindViewById <ImageButton>(Resource.Id.deleteButton);
            deleteButton.SetOnClickListener(this);

            tableName    = table_view.FindViewById <EditText>(Resource.Id.nameEdit);
            nameListener = new NameChangeListener(this);
            tableName.AddTextChangedListener(nameListener);

            checkBoxView      = new CheckBox(context);
            onCheckedListener = new OnCheckedListener(this);
            checkBoxView.SetOnCheckedChangeListener(onCheckedListener);
            column_row_view.AddView(checkBoxView);

            View dummy = new View(context);

            column_row_view.AddView(dummy);

            //controller.HookView(this);
        }
Exemplo n.º 13
0
        public override View GetView(Context context, View convertView, ViewGroup parent)
        {
            TextView label;
            var      view = DroidResources.LoadStringEntryLayout(context, convertView, parent, LayoutId, out label, out _entry);

            if (view != null)
            {
                // Warning! Crazy ass hack ahead!
                // since we can't know when out convertedView was was swapped from inside us, we store the
                // old textwatcher in the tag element so it can be removed!!!! (barf, rech, yucky!)
                if (_entry.Tag != null)
                {
                    _entry.RemoveTextChangedListener((ITextWatcher)_entry.Tag);
                }

                _entry.Text = this.Value;
                _entry.Hint = this.Hint;
                //_entry.EditorAction += new EventHandler<TextView.EditorActionEventArgs>(_entry_EditorAction);
                _entry.ImeOptions = ImeAction.Unspecified;

                if (this.Password)
                {
                    _entry.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
                }
                else if (this.Numeric)
                {
                    _entry.InputType = InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned;
                }
                else
                {
                    _entry.InputType = InputTypes.ClassText;
                }

                if (Lines > 1)
                {
                    _entry.InputType |= InputTypes.TextFlagMultiLine;
                    _entry.SetLines(Lines);
                }
                else if (Send != null)
                {
                    _entry.ImeOptions = ImeAction.Go;
                    _entry.SetImeActionLabel("Go", ImeAction.Go);
                    _entry.EditorAction += new EventHandler <TextView.EditorActionEventArgs>(_entry_EditorAction);
                }

                // continuation of crazy ass hack, stash away the listener value so we can look it up later
                _entry.Tag = this;
                _entry.AddTextChangedListener(this);
                if (label == null)
                {
                    _entry.Hint = Caption;
                }
                else
                {
                    label.Text = Caption;
                }
            }

            return(view);
        }
Exemplo n.º 14
0
        //     public void loadXmppConnect()
        //     {
        //ActivityService aa = ActivityService.
        //VisibleProgress(Resource.Id.pbHeaderProgress, VISIBLE);
        //         // this.App.Xmpp = createXmpp();
        //if (!isExistUser())
        //{
        //	this.App.Xmpp.OnConnected += Xmpp_OnConnected;
        //}
        //else {
        //	VisibleProgress(Resource.Id.pbHeaderProgress, INVISIBLE);
        //}
        //         this.App.Xmpp.Connect();
        //     }

        public void loadComponents()
        {
            userName  = (TextView)FindViewById(Resource.Id.userName);
            lastName  = (EditText)FindViewById(Resource.Id.lastName);
            password  = (EditText)FindViewById(Resource.Id.changePassw);
            firstName = (EditText)FindViewById(Resource.Id.firstName);
            imgAvatar = (ImageView)FindViewById(Resource.Id.avatar);
            btnUpdate = (Button)FindViewById(Resource.Id.btnSignOut);
            enable    = (Switch)FindViewById(Resource.Id.btnEnable);
            phone     = (EditText)FindViewById(Resource.Id.phone);

            phone.AddTextChangedListener(new PhoneNumberFormattingTextWatcher());

            imgAvatar.Click += delegate
            {
                var imageIntent = new Intent();
                imageIntent.SetType("image/*");
                imageIntent.SetAction(Intent.ActionGetContent);
                StartActivityForResult(
                    Intent.CreateChooser(imageIntent, "Select photo"), 0);
            };

            btnUpdate.Click += BtnUpdate_Click;

            enable.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs e)
            {
                enableIsChecked = e.IsChecked ? "true" : "false";
            };
        }
 protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
 {
     base.OnElementChanged(e);
     if (EditText != null)
     {
         EditText.AddTextChangedListener(this);
     }
 }
        private void DemoTextInputLayout()
        {
            mTextInputLayout = (TextInputLayout)mParentView.FindViewById(Resource.Id.text_input_layout).JavaCast<TextInputLayout>();
            mEditText = mTextInputLayout.EditText;
            mTextInputLayout.SetHint("请输入4位学号");

            mEditText.AddTextChangedListener(this);
        }
Exemplo n.º 17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _context = this;

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_Change_Number);

            // Set toolbar

            _toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar);
            SetSupportActionBar(_toolbar);
            SupportActionBar.SetTitle(Resource.String.menu_title);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            /// Shared Preference manager
            SharedPreferencesManager _sharedPreferencesManager = UtilityDroid.GetInstance().
                                                                 GetSharedPreferenceManagerWithEncriptionEnabled(_context.ApplicationContext);
            string retreiveVal = _sharedPreferencesManager.GetString(ConstantsDroid.MOBILE_NUMBER_PREFERENCE, "");


            _edtMobNumber = FindViewById <EditText>(Resource.Id.edtMobNumber);
            PhoneNumberFormattingTextWatcher watcher = new PhoneNumberFormattingTextWatcher("US");

            _edtMobNumber.AddTextChangedListener(watcher);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.btn_continue);

            button.TransformationMethod = null;
            button.Click += delegate
            {
                if (!string.IsNullOrEmpty(_edtMobNumber.Text.ToString()))
                {
                    string finalVal = _edtMobNumber.Text.ToString().Replace("(", "").
                                      Replace(")", "").Replace(" ", "").Replace("-", "");

                    if (finalVal.Length == 10)
                    {
                        _sharedPreferencesManager.PutString(
                            ConstantsDroid.MOBILE_NUMBER_PREFERENCE, finalVal);
                        Finish();
                    }

                    else
                    {
                        UtilityDroid.GetInstance().ShowAlertDialog((Activity)_context, "Error", "Please enter valid number.", "Cancel", "Ok");
                    }
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog((Activity)_context, "Error", "Please enter valid number.", "Cancel", "Ok");
                }
            };
        }
Exemplo n.º 18
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.Cadastro, container, false);

            etNome           = view.FindViewById <EditText>(Resource.Id.et_nome);
            etDataNascimento = view.FindViewById <EditText>(Resource.Id.et_data_nascimento);
            etCPF            = view.FindViewById <EditText>(Resource.Id.et_cpf);
            etSenha          = view.FindViewById <EditText>(Resource.Id.et_senha);
            bCadastrar       = view.FindViewById <Button>(Resource.Id.b_cadastrar);

            etCPF.AddTextChangedListener(new MascaraCampo(etCPF, MascaraCampo.CPF));
            etDataNascimento.AddTextChangedListener(new MascaraCampo(etDataNascimento, MascaraCampo.DATA));

            bCadastrar.Click += (object sender, EventArgs eventArgs) =>
            {
                Usuario usuario = new Usuario();
                usuario.Nome  = etNome.Text;
                usuario.CPF   = MascaraCampo.removerMascara(etCPF.Text);
                usuario.Senha = Hash.gerarHash(etSenha.Text);

                ProgressDialog barraProgresso = new ProgressDialog(context);
                barraProgresso.SetMessage("Registrando usuário.");
                barraProgresso.SetProgressStyle(ProgressDialogStyle.Spinner);
                barraProgresso.Show();

                new Thread(new ThreadStart(delegate
                {
                    DatabaseHelper db = new DatabaseHelper();

                    if (db.buscarUsuario(usuario.CPF) == null)
                    {
                        if (db.salvarUsuario(usuario))
                        {
                            MainActivity.usuario = usuario;

                            ISharedPreferences preferencias             = PreferenceManager.GetDefaultSharedPreferences(context);
                            ISharedPreferencesEditor editorPreferencias = preferencias.Edit();
                            editorPreferencias.PutString("CPF", usuario.CPF);
                            editorPreferencias.Apply();

                            ((MainActivity)context).trocarFragment(new HomeFragment(context), "HomeFragment");
                        }
                        else
                        {
                            Toast.MakeText(context, "Erro ao cadastrar usuário. Tente novamente.", ToastLength.Long).Show();
                        }
                    }
                    else
                    {
                        Toast.MakeText(context, "Usuário já registrado", ToastLength.Long).Show();
                    }
                    barraProgresso.Dismiss();
                })).Start();
            };

            return(view);
        }
Exemplo n.º 19
0
        private void FindViews()
        {
            txtCodigoProd     = FindViewById <EditText>(Resource.Id.txtCodigo);
            txtNomeProd       = FindViewById <EditText>(Resource.Id.txtNome);
            txtValorProd      = FindViewById <EditText>(Resource.Id.txtValorProd);
            spinUniMedidaProd = FindViewById <Spinner>(Resource.Id.spinnerUnidadeMedida);
            spinUniMedidaProd.ItemSelected += new EventHandler <ItemSelectedEventArgs>(spinUnidadeMedidadProd_ItemSelected);

            txtValorProd.AddTextChangedListener(new CurrencyConverterHelper(txtValorProd));
        }
Exemplo n.º 20
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            autoFitTextView = FindViewById <AutofitTextView>(Resource.Id.txtView);
            editText        = FindViewById <EditText>(Resource.Id.editText);

            editText.AddTextChangedListener(this);
        }
Exemplo n.º 21
0
        //-----------------------------------------------------------------
        //UI

        private void SetupBottomLayout()
        {
            _SendButton = FindViewById <Button>(Resource.Id.dbl_sendBtn);
            _MsgBox     = FindViewById <EditText>(Resource.Id.dbl_msgBox);
            _AddressBox = FindViewById <EditText>(Resource.Id.cv_searchEditText);

            _SendButton.Click += _SendButton_Click;
            //TODO : 제대로 적용되고, 전송되는지 확인해봐라
            _AddressBox.AddTextChangedListener(new PhoneNumberFormattingTextWatcher("KR"));             //연락처 입력 박스 수정시 바로 하이픈 붙음
        }
Exemplo n.º 22
0
        /// <summary>
        /// Method Name     : UIClickEvent
        /// Author          : Sanket Prajapati
        /// Creation Date   : 23 jan 2018
        /// Purpose         : Set Click delegate for all control
        /// Revision        : By Jitendra Garg On 24 Feb 2018 To Fix Bug 1445
        /// </summary>
        private void UIClickEvent()
        {
            radioButtonSMS.CheckedChange   += RadioButtonSMS_CheckedChange;
            radioButtonEmail.CheckedChange += RadioButtonEmail_CheckedChange;
            radioButtonYes.CheckedChange   += RadiobuttonYes_CheckedChange;
            radioButtonNo.CheckedChange    += RadiobuttonNo_CheckedChange;
            linearLayoutLogout.Click       += LinearLayoutLogout_Click;
            btnClose.Click       += BtnClose_ClickAsync;
            txtphone.TextChanged += Txtphone_TextChanged;

            //Add a format watcher for phone number.
            if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
            {
                txtphone.AddTextChangedListener(new PhoneNumberFormattingTextWatcher("US"));
            }
            else
            {
                txtphone.AddTextChangedListener(new PhoneNumberFormattingTextWatcher());
            }
        }
Exemplo n.º 23
0
        private void FindViews()
        {
            txtCodCli          = FindViewById <EditText>(Resource.Id.txtCodigoCliente);
            txtNomeFantasiaCli = FindViewById <EditText>(Resource.Id.txtNomeFantasia);
            txtRazaoSocialCli  = FindViewById <EditText>(Resource.Id.txtRazaoSocial);
            txtCNPJCli         = FindViewById <EditText>(Resource.Id.txtCNPJ);
            spinnerTabelaPreco = FindViewById <Spinner>(Resource.Id.spinnerTblPrecos);

            txtCNPJCli.AddTextChangedListener(new Mask(txtCNPJCli, "##.###.###/####-##"));

            spinnerTabelaPreco.ItemSelected += new EventHandler <ItemSelectedEventArgs>(spinTblPreco_ItemSelected);
        }
Exemplo n.º 24
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            ISharedPreferences dadosLocais = GetSharedPreferences("arquivo1", Android.Content.FileCreationMode.WorldWriteable);
            var conferelogin = dadosLocais.GetString("login1", "sim");
            var numero1      = dadosLocais.GetString("numero", "");
            var ra1          = dadosLocais.GetString("ra", "");
            var nascimento1  = dadosLocais.GetString("nascimento", "");

            if (dadosLocais.Contains("sim"))
            {
                base.OnCreate(savedInstanceState);
                SetContentView(Resource.Layout.Login);
                StartActivity(typeof(MainActivity));
                Finish();
            }
            else
            {
                var context  = this.ApplicationContext;
                var isOnline = NetworkConnection.IsNetworkConnected(context);
                if (isOnline)
                {
                    DBConnect.Conecta_Banco(this);
                    Toast.MakeText(this, "Conectado com sucesso!", ToastLength.Short).Show();
                }
                else
                {
                    AlertDialog.Builder dialog = new AlertDialog.Builder(this);
                    AlertDialog         alert  = dialog.Create();
                    alert.SetTitle("Status da Conexão");
                    alert.SetMessage("Falha na conexão, cheque sua conexão por favor!");
                    alert.SetButton("OK", (c, ev) =>
                    {
                        Finish();
                    });
                    alert.Show();
                }


                base.OnCreate(savedInstanceState);


                SetContentView(Resource.Layout.Login);
                Button button = FindViewById <Button>(Resource.Id.buttonLogin);
                button.Click += Button_Click;

                EditText login = FindViewById <EditText>(Resource.Id.editTextLogin);

                EditText ra = FindViewById <EditText>(Resource.Id.editTextLogin1);

                EditText nascimento = FindViewById <EditText>(Resource.Id.editTextLogin2);
                nascimento.AddTextChangedListener(new Mask(nascimento, "##/##/####"));
            }
        }
Exemplo n.º 25
0
 /// <summary>
 /// Ons the text changed.
 /// </summary>
 /// <param name="s">S.</param>
 /// <param name="start">Start.</param>
 /// <param name="before">Before.</param>
 /// <param name="count">Count.</param>
 public void OnTextChanged(ICharSequence s, int start, int before, int count)
 {
     if (tipoFormateador == TIPO_PESO_KG)
     {
         textoFormateado = MascarasEditText.formatearMonto(editText.Text);
         editText.RemoveTextChangedListener(this);
         editText.Text = textoFormateado;
         editText.AddTextChangedListener(this);
         editText.SetSelection(editText.Text.Length);
         editText.SetCursorVisible(true);
     }
 }
Exemplo n.º 26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;
            SetContentView(Resource.Layout.AddAMark);
            Button saveButton = FindViewById <Button>(Resource.Id.SaveButton);

            saveButton.Click += SaveButton_Click;
            findComponents();
            m_NumOfLettersTextView.Text = "Letters: " + k_MaxLetters;
            m_MessageEditText.AddTextChangedListener(this);
        }
            public void OnTextChanged(ICharSequence s, int start, int before, int count)
            {
                mIsCashDiscountSelected = GlobalVariables.mIsCashDiscountSelected;

                string value = mIsCashDiscountSelected ? mEditText.Text.Replace(",", "").Replace("\u20b1", "").Replace(".", "").TrimStart('0') :
                               mEditText.Text.Replace(",", "").Replace("%", "").Replace(".", "").TrimStart('0');

                decimal ul;

                if (decimal.TryParse(value, out ul))
                {
                    ul /= 100;
                    mEditText.RemoveTextChangedListener(this);
                    if (mIsCashDiscountSelected)
                    {
                        if (ul >= currentOriginalSubtotal)
                        {
                            ul = currentOriginalSubtotal;
                        }
                        mEditText.Text = "\u20b1" + string.Format("{0:n}", ul);
                    }
                    else
                    {
                        if (ul >= 100)
                        {
                            ul = 100;
                        }
                        mEditText.Text = string.Format("{0:n}", ul) + "%";
                    }

                    mEditText.AddTextChangedListener(this);
                }
                if (ul == 0)
                {
                    mTxtOrigPrice.Visibility = ViewStates.Invisible;
                }
                else
                {
                    mTxtOrigPrice.Visibility = ViewStates.Visible;
                }
                if (mIsCashDiscountSelected)
                {
                    mEtPercentageDiscount.Text = string.Format("{0:n}", GetPercentageDiscount(ul, currentOriginalSubtotal)) + "%";
                    mTxtDiscountedPrice.Text   = "\u20b1" + string.Format("{0:n}", (currentOriginalSubtotal - ul));
                }
                else
                {
                    mEtCashDiscount.Text = "\u20b1" + string.Format("{0:n}", GetCashDiscount(ul, currentOriginalSubtotal));
                    decimal cashDiscountAmtmEtCashDiscount = Convert.ToDecimal(mEtCashDiscount.Text.Replace("\u20b1", ""));
                    mTxtDiscountedPrice.Text = "\u20b1" + string.Format("{0:n}", (currentOriginalSubtotal - cashDiscountAmtmEtCashDiscount));
                }
            }
Exemplo n.º 28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //    SetContentView(Resource.Layout.Instalacao);
            // Create your application here

            spnLocalidade = FindViewById <Spinner>(Resource.Id.spnLocalidade);
            spnGlebaCult  = FindViewById <Spinner>(Resource.Id.spnGlebaCult);
            edNumEstudo   = FindViewById <EditText>(Resource.Id.EDNumEstudo);
            buttonSalvar  = FindViewById <Button>(Resource.Id.BTSalvarInstalacao);
            Button buttonValida = FindViewById <Button>(Resource.Id.BTValidar);
            Button buttonScan   = FindViewById <Button>(Resource.Id.BTScannerAvalia);

            etComprimento  = FindViewById <EditText>(Resource.Id.etComprimento);
            etLargura      = FindViewById <EditText>(Resource.Id.etLargura);
            etCoordenadas1 = FindViewById <EditText>(Resource.Id.etCoordenadas1);
            etCoordenadas2 = FindViewById <EditText>(Resource.Id.etCoordenadas2);
            etAltitude     = FindViewById <EditText>(Resource.Id.etAltitude);
            etObservacoes  = FindViewById <EditText>(Resource.Id.etObservacoes);
            //etData = FindViewById<EditText>(Resource.Id.etData);

            textDate = FindViewById <EditText>(Resource.Id.etData);
            textDate.AddTextChangedListener(new Mask(textDate, "##/##/####"));
            buttonCalendar = FindViewById <ImageButton>(Resource.Id.ibData);



            GetLocPlantio();
            adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Localidades);
            //vincula o adaptador ao controle spinner
            spnLocalidade.Adapter = adapter;

            GlebaCults   = new ArrayList();
            idGlebaCults = new ArrayList();
            GlebaCults.Add("Selecione");
            idGlebaCults.Add(0);

            buttonCalendar.Click += DateSelect_OnClick;

            buttonScan.Click   += BTScanner_Click;
            buttonSalvar.Click += BTSalvar_Click;

            buttonValida.Click += (sender, e) =>
            {
                ValidarEstudo(edNumEstudo.Text);
            };

            spnLocalidade.ItemSelected += SpnLocalidade_ItemSelected;
            spnGlebaCult.ItemSelected  += SpnGlebaCult_ItemSelected;

            Coordenadas();
        }
Exemplo n.º 29
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            //Inflates the layout for this fragment
            View     v       = inflater.Inflate(Resource.Layout.main_fragment, container, false);
            EditText account = (EditText)v.FindViewById(Resource.Id.card_account_field);

            account.SetText(AccountStorage.GetAccount(Activity), TextView.BufferType.Editable);
            account.AddTextChangedListener(new AccountUpdater()
            {
                Activity = this.Activity
            });
            return(v);
        }
Exemplo n.º 30
0
        private void SetListeners()
        {
            //m_oLoginBtn.Click += Login_Listener;
            m_oPreviewBtn.Click  += Preview_Listener;
            m_oRecordBtn.Click   += Record_Listener;
            m_oPlaybackBtn.Click += M_oPlaybackBtn_Click;
            m_oCaptureBtn.Click  += Capture_Listener;

            m_oDate.FocusChange += M_oDate_FocusChange;
            m_oTime.FocusChange += M_oTime_FocusChange;

            m_oCam.AddTextChangedListener(this);
        }
Exemplo n.º 31
0
        protected override void OnElementChanged(ElementChangedEventArgs <RootPage> e)
        {
            base.OnElementChanged(e);
            var activity = (FormsAppCompatActivity)Context;

            if (e.NewElement != null)
            {
                foreach (var item in Element.Children)
                {
                    if (item is HomeTabbedPage)
                    {
                        barPage = item as HomeTabbedPage;
                        barPage.CurrentPageChanged += delegate(object sender, System.EventArgs ev)
                        {
                            if (barPage.CurrentPage is AccountPage)
                            {
                                Element.HasSearchBar = false;
                            }
                            else
                            {
                                Element.HasSearchBar = true;
                            }
                        };
                    }
                    if (item is SearchPage)
                    {
                        searchPage = item as SearchPage;
                    }
                }
                rootView        = activity.LayoutInflater.Inflate(Resource.Layout.RootView, null) as LinearLayout;
                searchContainer = rootView.FindViewById <FrameLayout>(Resource.Id.search_view_container);

                searchEditContent = rootView.FindViewById <EditText>(Resource.Id.search_edit_content);
                searchEditContent.OnFocusChangeListener = this;
                searchEditContent.AddTextChangedListener(this);
                searchEditContent.SetOnEditorActionListener(this);

                searchBackButton = rootView.FindViewById <ImageButton>(Resource.Id.search_back_button);
                searchBackButton.SetOnClickListener(this);

                searchCloseButton = rootView.FindViewById <ImageButton>(Resource.Id.search_close_button);
                searchCloseButton.SetOnClickListener(this);

                rootContainer    = rootView.FindViewById <FrameLayout>(Resource.Id.root_container);
                rootContainer.Id = rootContainer.GetHashCode();

                ViewGroup.AddView(rootView);

                SwitchBarPage();
            }
        }
Exemplo n.º 32
0
        private void Init(Context context)
        {
            Inflate(context, Resource.Layout.view_message_input, this);

            messageInput          = (EditText)FindViewById(Resource.Id.messageInput);
            messageSendButton     = (ImageButton)FindViewById(Resource.Id.messageSendButton);
            attachmentButton      = (ImageButton)FindViewById(Resource.Id.attachmentButton);
            sendButtonSpace       = (Space)FindViewById(Resource.Id.sendButtonSpace);
            attachmentButtonSpace = (Space)FindViewById(Resource.Id.attachmentButtonSpace);
            messageSendButton.SetOnClickListener(this);
            attachmentButton.SetOnClickListener(this);
            messageInput.AddTextChangedListener(this);
            messageInput.Text = "";
        }
Exemplo n.º 33
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
           
            searchQueryEditText = view.FindViewById<EditText>(Resource.Id.searchQueryEditText);
            searchQueryEditText.AddTextChangedListener(this);

            var searchButton = view.FindViewById<Button>(Resource.Id.searchButton);
            searchButton.Click += searchButton_Click;

            var startDateButton = view.FindViewById<Button>(Resource.Id.start_date_button);
            startDateButton.Click += startDateButton_Click;

            var endDateButton = view.FindViewById<Button>(Resource.Id.end_date_button);
            endDateButton.Click += endDateButton_Click;
        }
Exemplo n.º 34
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);
            SetContentView(Resource.Layout.StudyVocab);

            parentView = (LinearLayout)FindViewById (Resource.Id.abc);
            kanjiText = (TextView) FindViewById (Resource.Id.kanji);
            typeText = (TextView) FindViewById (Resource.Id.type);
            guessText = (EditText) FindViewById (Resource.Id.shark);

            guessText.SetRawInputType (InputTypes.TextFlagNoSuggestions);
            guessText.SetOnKeyListener(new MyKeyListener(this));
            guessText.AddTextChangedListener (new MyTextListener (this));

            var button = FindViewById<Button>(Resource.Id.submit);
            button.Click += (sender, e) => {
                SubmitGuess();
            };

            conversion();
            DisplayNewWord ();
        }
Exemplo n.º 35
0
 private EntryElementHelper(EditText entry)
 {
     entry.AddTextChangedListener(this);
     entry.EditorAction += EntryOnEditorAction;
 }
        private void layoutSlidingTop()
        {
            containerSliding = FindViewById<RelativeLayout> (Resource.Id.container);
            searchBox = FindViewById<EditText> (Resource.Id.search_box);
            listViewDrugStores = FindViewById<ListView> (Resource.Id.listview_drugstores);
            listViewDrugStores.OnItemClickListener = this;

            containerSliding.SetOnTouchListener (this);
            searchBox.AddTextChangedListener (this);

            handleSpinner ();

            //			listViewDrugStores.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
            //				googleMap.Clear ();
            //				drugLatitude = viewModel.list_drugstore [e.Position].latitude;
            //				drugLongitude = viewModel.list_drugstore [e.Position].longtitude;
            //				drugstoreMarker ();
            //			};
        }
Exemplo n.º 37
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            editText = FindViewById<EditText>(Resource.Id.MyButton);
            txtLength = FindViewById<EditText>(Resource.Id.txtLength);
            var mTextWatcher = new TextWatcher(editText, txtLength);
            //editText.AddTextChangedListener(mTextWatcher);

            editText.AddTextChangedListener(mTextWatcher);
            editText.SetSelection(editText.Length()); // 将光标移动最后一个字符后面
        }