コード例 #1
0
 public void OnDataEntered(Pinview p0, bool p1)
 {
     if (p0.Value == Utils.GetDefaults("UserPin"))
     {
         StartActivity(typeof(MainActivity));
         Utils.HideKeyboard(this);
         Finish();
     }
     else
     {
         _textViewError.Text = "Pin incorect";
         ClearPin();
     }
 }
コード例 #2
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.activity_pin_lockscreen);
     _pin           = new Pinview(this);
     _pin           = FindViewById <Pinview>(Resource.Id.pinview);
     _textViewError = FindViewById <TextView>(Resource.Id.textview_error);
     _pin.SetPinViewEventListener(this);
     //pin.SetPinBackgroundRes(R.drawable.sample_background);
     //pin.PinHeight = 40;
     //pin.PinWidth = 40;
     //pin.SetInputType(Pinview.InputType.Number);
     //pin.Value = "1234";
     //myLayout.addView(pin);
     // Create your application here
 }
コード例 #3
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            otpView    = view.FindViewById <Pinview>(Resource.Id.otp_tv);
            verifiyBtn = view.FindViewById <FloatingActionButton>(Resource.Id.verify_otp_fab);
            resendBtn  = view.FindViewById <MaterialButton>(Resource.Id.resend_code_btn);
            var numTv = view.FindViewById <TextView>(Resource.Id.get_sms_sub2);

            new Spanner(Activity, false).SetSpan(numTv, new string[] { "Enter OTP code sent on ", phone });
            verifiyBtn.Click += VerifyBtn_Click;
            resendBtn.Click  += ResendBtn_Click;
            otpView.SetPinViewEventListener(this);

            cdTimer = new CountdownTimer(40000, 1000, () =>
            {
                resendBtn.Enabled = true;
                resendBtn.Text    = "resend otp";
            }, (millisUntilFinished) =>
            {
                resendBtn.Text = "Resend OTP in " + millisUntilFinished / 1000;
            }).Start();
        }
コード例 #4
0
        private void InitControls()
        {
            //Toolbar props
            VeriToolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.prim_toolbar1);
            if (VeriToolbar != null)
            {
                SetSupportActionBar(VeriToolbar);
            }
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            //Views
            CodePinView = (Pinview)FindViewById(Resource.Id.phone_pinView);
            CodePinView.SetPinViewEventListener(this);
            EnterCodeTV = (TextView)FindViewById(Resource.Id.enter_code_tv);

            TimerTV        = (TextView)FindViewById(Resource.Id.timer_tv);
            TimerTV.Click += (s2, e2) =>
            {
                //
            };

            NextButton        = (Button)FindViewById(Resource.Id.prim_btn1);
            NextButton.Click += NextButton_Click;

            var first = "Text message sent to ";

            SpannableString str = new SpannableString(first + int_format);

            str.SetSpan(new StyleSpan(TypefaceStyle.Bold), first.Length, first.Length + int_format.Length, SpanTypes.ExclusiveExclusive);
            //str.SetSpan(new ForegroundColorSpan(Color.Rgb(88, 96, 240)), first.Length, first.Length + int_format.Length, SpanTypes.ExclusiveExclusive);

            EnterCodeTV.TextFormatted = str;

            SessionManager sessionManager = SessionManager.GetInstance();

            sessionManager.SendVerificationCode(int_format, Instance);
        }
コード例 #5
0
        public void OnDataEntered(Pinview p0, bool p1)
        {
            if (string.IsNullOrEmpty(_newPin))
            {
                _newPin = p0.Value;
                ClearPin();
            }

            else
            {
                if (_newPin == p0.Value)
                {
                    Utils.SetDefaults("UserPin", p0.Value);
                    ClearPin();
                    Utils.HideKeyboard(this);
                    Finish();
                }
                else
                {
                    _textViewError.Text = "Pin incorect";
                    ClearPin();
                }
            }
        }
コード例 #6
0
 public void OnDataEntered(Pinview p0, bool p1)
 {
     verifiyBtn.Post(() => { verifiyBtn.Enabled = p0.Value.Length == 6; });
 }
コード例 #7
0
 public void OnDataEntered(Pinview otpView, bool textFromUSer)
 {
     NextButton.Enabled = CodePinView.Value.Length == 6;
 }