public void SetMovie(string movie)
        {
            dynamic jsonData = JsonConvert.DeserializeObject(movie);

            TextInputEditText title          = FindViewById <TextInputEditText>(Resource.Id.edit_series_title);
            Button            Submit         = FindViewById <Button>(Resource.Id.submit_edit_movie_btn);
            Button            DeleteMovieBtn = FindViewById <Button>(Resource.Id.delete_movie_btn);

            title.Text = jsonData.title;

            string id = jsonData.id.ToString();

            Submit.Click += delegate(object sender, EventArgs e)
            {
                UpdateSeries(id);
            };

            DeleteMovieBtn.Click += delegate(object sender, EventArgs e)
            {
                ShowConfirmDelete("Confirm delete", "Are you sure you want to delete " + jsonData.title + " ?", id);
            };
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Register3);
            loader        = FindViewById <LoadingView>(Resource.Id.loading_view);
            button_loader = FindViewById <LoadingView>(Resource.Id.loading_view_button);

            ImageView go = (ImageView)FindViewById(Resource.Id.imglogin);

            go.Click += Go_Click;

            RegisterHeading = (TextView)FindViewById(Resource.Id.textView1);
            tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf");
            RegisterHeading.SetTypeface(tf, TypefaceStyle.Bold);

            Passtv = (TextView)FindViewById(Resource.Id.textView2);
            tf     = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf");
            Passtv.SetTypeface(tf, TypefaceStyle.Normal);

            Confirmtv = (TextView)FindViewById(Resource.Id.textView3);
            tf        = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf");
            Confirmtv.SetTypeface(tf, TypefaceStyle.Normal);

            pass = (TextInputEditText)FindViewById(Resource.Id.edtPassreg);
            tf   = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf");
            pass.SetTypeface(tf, TypefaceStyle.Normal);

            confirmPass = (TextInputEditText)FindViewById(Resource.Id.edtConfirmPassreg);
            tf          = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf");
            confirmPass.SetTypeface(tf, TypefaceStyle.Bold);



            login        = (ImageView)FindViewById(Resource.Id.imageView9);
            login.Click += Login_Click;
        }
示例#3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            rootView = FindViewById <View>(Android.Resource.Id.Content);
            SetContentView(Resource.Layout.activity_main);

            passwordView   = FindViewById <TextInputEditText>(Resource.Id.txtPassword);
            passwordLayout = FindViewById <TextInputLayout>(Resource.Id.password_layout);

            btnLogin = FindViewById <Button>(Resource.Id.btnIngresar);

            emailView          = FindViewById <TextInputEditText>(Resource.Id.txtEmail);
            emailLayout        = FindViewById <TextInputLayout>(Resource.Id.email_layout);
            pgrLogin           = FindViewById <ProgressBar>(Resource.Id.pgrLogin);
            btnRegister        = FindViewById <Button>(Resource.Id.btnCrear);
            btnLogin.Click    += BtnLoginClick;
            btnRegister.Click += BtnRegisterClick;

            emailView.Text    = "*****@*****.**";
            passwordView.Text = "abc123++";
            session           = GetSharedPreferences("SessionLogin", FileCreationMode.Private);
        }
        static void UpdatePadding(TextInputEditText textInputEditText)
        {
            Thickness rect = _centeredText;

            if (!String.IsNullOrWhiteSpace(textInputEditText.Text) || textInputEditText.HasFocus)
            {
                rect = _alignedWithUnderlineText;
            }

            Context Context = textInputEditText.Context;
            var     left    = (int)Context.ToPixels(rect.Left);
            var     top     = (int)Context.ToPixels(rect.Top);
            var     right   = (int)Context.ToPixels(rect.Right);
            var     bottom  = (int)Context.ToPixels(rect.Bottom);

            if (textInputEditText.PaddingLeft != left ||
                textInputEditText.PaddingTop != top ||
                textInputEditText.PaddingRight != right ||
                textInputEditText.PaddingBottom != bottom)
            {
                textInputEditText.SetPadding(left, top, right, bottom);
            }
        }
示例#5
0
        /// <summary>
        /// Override OnCreate method
        /// </summary>
        /// <param name="savedInstanceState"></param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_sign_up);

            // Set the activity back button on the actionbar
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            #region Initialization
            mTxtUsername      = FindViewById <TextInputEditText>(Resource.Id.signUpUsername);
            mTxtFullName      = FindViewById <TextInputEditText>(Resource.Id.signUpFullName);
            mTxtEmail         = FindViewById <TextInputEditText>(Resource.Id.signUpEmail);
            mTxtDOB           = FindViewById <TextInputEditText>(Resource.Id.signUpDOB);
            mTxtPwd           = FindViewById <TextInputEditText>(Resource.Id.signUpPassword);
            mTxtConfPwd       = FindViewById <TextInputEditText>(Resource.Id.signUpConfPassword);
            mUserPic          = FindViewById <ImageView>(Resource.Id.userPic);
            mProgressBar      = FindViewById <ProgressBar>(Resource.Id.signUpProgressBar);
            mBtnUserPicBrowse = FindViewById <Button>(Resource.Id.btnUserPicBrowse);
            mBtnSignUp        = FindViewById <Button>(Resource.Id.btnSignUp);
            mSignUpPanel      = FindViewById <LinearLayout>(Resource.Id.signUpPanel);

            mBtnUserPicBrowse.Click += BtnUserPicBrowse_Click;
            mBtnSignUp.Click        += BtnSignUp_Click;
            #endregion

            mSignUpPanel.Click += (o, e) => KeyboardManager.CloseKeyboard(mSignUpPanel, this); // Close soft keyboard when background is clicked

            mTxtDOB.Click += (object sender, EventArgs e) =>
            {
                // Bring up the datepicker dialog
                DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
                {
                    mTxtDOB.Text = time.ToShortDateString();
                });
                frag.Show(FragmentManager, DatePickerFragment.TAG);
            };
        }
示例#6
0
        public static void CreateTextLayoutEdit(View view, ref TextInputLayout textInputLayout,
                                                ref TextInputEditText textInputEditText, int resourceLayoutId,
                                                int resourceEditId, string errorText, LinearLayout linearLayout = null)
        {
            textInputLayout   = view.FindViewById <TextInputLayout>(resourceLayoutId);
            textInputEditText = view.FindViewById <TextInputEditText>(resourceEditId);

            TextInputEditText textInput   = textInputEditText;
            TextInputLayout   inputLayout = textInputLayout;

            textInputEditText.FocusChange += (sender, e) =>
            {
                if (!e.HasFocus)
                {
                    if (linearLayout != null)
                    {
                        linearLayout.Visibility = ViewStates.Gone;
                    }

                    if (string.IsNullOrWhiteSpace(textInput.Text))
                    {
                        inputLayout.ErrorEnabled = true;
                        inputLayout.Error        = errorText;
                    }
                    else
                    {
                        inputLayout.Error        = "";
                        inputLayout.ErrorEnabled = false;
                    }
                }
                else if (linearLayout != null)
                {
                    linearLayout.Visibility = ViewStates.Visible;
                }
            };
        }
示例#7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.registration_extensionofficer);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.Elevation = 0;
            TILFirstName  = FindViewById <TextInputLayout>(Resource.Id.til_fname);
            TILSurname    = FindViewById <TextInputLayout>(Resource.Id.til_sname);
            TILDOB        = FindViewById <TextInputLayout>(Resource.Id.til_dob);
            TILFarmName   = FindViewById <TextInputLayout>(Resource.Id.til_farmname);
            TILMobile     = FindViewById <TextInputLayout>(Resource.Id.til_mobile);
            TILEmail      = FindViewById <TextInputLayout>(Resource.Id.til_email);
            TILNationalID = FindViewById <TextInputLayout>(Resource.Id.til_nationalid);
            TILProvince   = FindViewById <TextInputLayout>(Resource.Id.til_province);
            TILDistrict   = FindViewById <TextInputLayout>(Resource.Id.til_district);
            TILECnumber   = FindViewById <TextInputLayout>(Resource.Id.til_ecnumber);

            TextFirstName   = FindViewById <TextInputEditText>(Resource.Id.text_first_name);
            TextLastName    = FindViewById <TextInputEditText>(Resource.Id.text_surname);
            SpinnerGender   = FindViewById <Spinner>(Resource.Id.spinner_gender);
            TextDateOfBirth = FindViewById <TextInputEditText>(Resource.Id.text_dob);
            TextMobile      = FindViewById <TextInputEditText>(Resource.Id.text_mobile);
            TextEmail       = FindViewById <TextInputEditText>(Resource.Id.text_email);
            TextNationalID  = FindViewById <TextInputEditText>(Resource.Id.text_nationalid);
            TextProvince    = FindViewById <AutoCompleteTextView>(Resource.Id.text_province);
            TextDistrict    = FindViewById <AutoCompleteTextView>(Resource.Id.text_district);
            ProgressBar     = FindViewById <ProgressBar>(Resource.Id.loginProgressBar);
            TextECnumber    = FindViewById <TextInputEditText>(Resource.Id.text_ecnumber);

            BtnLogin = FindViewById <Button>(Resource.Id.btnLogin);
            InitHandlers();
            BtnLogin.Click += (o, e) =>
            {
                Save();
            };
        }
示例#8
0
        private void ShowAddAssetOrPanelDialog()
        {
            var builder = new Android.Support.V7.App.AlertDialog.Builder(this);

            LayoutInflater layoutInflater = this.LayoutInflater;

            View view = layoutInflater.Inflate(Resource.Layout.addassetlayout, null, false);

            Spinner sp = view.FindViewById <Spinner>(Resource.Id.currencySpinner);

            var adapter = new ArrayAdapter(builder.Context, Android.Resource.Layout.SimpleSpinnerItem,
                                           symbolDescriptionListCopy);

            //var adapter = ArrayAdapter.CreateFromResource(
            //      builder.Context, Resource.Array.Currency_Array, Android.Resource.Layout.SimpleSpinnerItem);
            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            sp.Adapter = adapter;

            sp.SetSelection(0);

            TextInputLayout   privateAddressInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.privateAddressLayout);
            TextInputEditText privateAddressInputEdit   = view.FindViewById <TextInputEditText>(Resource.Id.privateAddressEdit);

            TextInputLayout   publicAddressInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.publicAddressLayout);
            TextInputEditText publicAddressInputEdit   = view.FindViewById <TextInputEditText>(Resource.Id.publicAddressEdit);

            Button privateAddressQrButton    = view.FindViewById <Button>(Resource.Id.qrCodePrivateAddressButton);
            Button privateAddressClearButton = view.FindViewById <Button>(Resource.Id.clearPrivateAddressButton);

            Button publicAddressQrButton    = view.FindViewById <Button>(Resource.Id.qrCodePublicAddressButton);
            Button publicAddressClearButton = view.FindViewById <Button>(Resource.Id.clearPublicAddressButton);

            LinearLayout privateAddressLinearLayout = view.FindViewById <LinearLayout>(Resource.Id.privateAddressButtonLayout);
            LinearLayout publicAddressLinearLayout  = view.FindViewById <LinearLayout>(Resource.Id.publicAddressButtonLayout);

            privateAddressQrButton.Click += async(sender, e) =>
            {
                privateAddressInputEdit.Text = await Utilities.AndroidUtility.ReadQRCode(Application);
            };

            privateAddressClearButton.Click += (sender, e) =>
            {
                privateAddressInputEdit.Text = "";
            };

            publicAddressQrButton.Click += async(sender, e) =>
            {
                publicAddressInputEdit.Text = await Utilities.AndroidUtility.ReadQRCode(Application);
            };

            publicAddressClearButton.Click += (sender, e) =>
            {
                publicAddressInputEdit.Text = "";
            };

            privateAddressInputEdit.FocusChange += (sender, e) =>
            {
                if (!e.HasFocus)
                {
                    privateAddressLinearLayout.Visibility = ViewStates.Gone;

                    if (string.IsNullOrWhiteSpace(privateAddressInputEdit.Text))
                    {
                        privateAddressInputLayout.ErrorEnabled = true;
                        privateAddressInputLayout.Error        = "Private address can't be blank!";
                    }
                }
                else
                {
                    privateAddressLinearLayout.Visibility = ViewStates.Visible;

                    privateAddressInputLayout.Error        = "";
                    privateAddressInputLayout.ErrorEnabled = false;
                }
            };

            publicAddressInputEdit.FocusChange += (sender, e) =>
            {
                if (!e.HasFocus)
                {
                    publicAddressLinearLayout.Visibility = ViewStates.Gone;

                    if (string.IsNullOrWhiteSpace(publicAddressInputEdit.Text))
                    {
                        publicAddressInputLayout.ErrorEnabled = true;
                        publicAddressInputLayout.Error        = "Public address can't be blank!";
                    }
                }
                else
                {
                    publicAddressLinearLayout.Visibility = ViewStates.Visible;

                    publicAddressInputLayout.Error        = "";
                    publicAddressInputLayout.ErrorEnabled = false;
                }
            };

            builder.SetTitle("Add coin tile");

            builder.SetView(view);

            builder.SetPositiveButton("Ok", (System.EventHandler <DialogClickEventArgs>)null);
            builder.SetNegativeButton(Resource.String.cancel, (senderAlert, args) => { });

            var dialog = builder.Create();

            dialog.Show();

            var okBtn = dialog.GetButton((int)DialogButtonType.Positive);

            okBtn.Click += (sender, args) =>
            {
                if ((string.IsNullOrWhiteSpace(privateAddressInputEdit.Text)) || (string.IsNullOrWhiteSpace(publicAddressInputEdit.Text)))
                {
                }
                else
                {
                    //Coin coin = new Coin();

                    int      i           = sp.SelectedItemPosition;
                    string   text        = sp.SelectedItem.ToString();
                    string[] strings     = text.Split('-');
                    string   symbol      = strings[0].Trim();
                    string   description = strings[1].Trim();

                    //@@todo add cardview
                    quotePanelFragment.AddCard(symbol, description, privateAddressInputEdit.Text,
                                               publicAddressInputEdit.Text, walletSelected);

                    symbolDescriptionListCopy.RemoveAt(i);

                    dialog.Dismiss();
                }
            };
        }
示例#9
0
        void BuildAddStudentScreen()
        {
            //Defining the parent layout
            OverAllAddStudentLayout             = (LinearLayout)FindViewById(Resource.Id.AddStudentl);
            OverAllAddStudentLayout.Orientation = Orientation.Vertical;
            OverAllAddStudentLayout.SetGravity(GravityFlags.CenterHorizontal);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining the Label AddStudent Layout
            LabelAddStudentLayout = new LinearLayout(this);
            LabelAddStudentLayout.LayoutParameters = WrapContParams;
            LabelAddStudentLayout.Orientation      = Orientation.Vertical;
            LabelAddStudentLayout.SetGravity(Android.Views.GravityFlags.Center);
            //Defining the Label AddStudent TextView
            LabelAddStudentTV = new TextView(this);
            LabelAddStudentTV.LayoutParameters = WrapContParams;
            LabelAddStudentTV.Text             = "New Student";
            LabelAddStudentTV.TextSize         = 60;
            LabelAddStudentTV.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            LabelAddStudentTV.SetTextColor(Android.Graphics.Color.DarkRed);
            LabelAddStudentLayout.AddView(LabelAddStudentTV);
            OverAllAddStudentLayout.AddView(LabelAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining the Name AddStudent layout
            NameAddStudentLayout = new LinearLayout(this);
            NameAddStudentLayout.LayoutParameters = WrapContParams;
            NameAddStudentLayout.Orientation      = Orientation.Horizontal;
            //Defining the Name AddStudent TextView
            NameAddStudentTV = new TextView(this);
            NameAddStudentTV.LayoutParameters = WrapContParams;
            NameAddStudentTV.Text             = "Name: ";
            NameAddStudentTV.TextSize         = 30;
            NameAddStudentTV.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Defining the Name AddStudent TextInputEditText
            TextInputLayout nameLayout = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };

            NameAddStudentET = new TextInputEditText(this);
            NameAddStudentET.SetBackgroundResource(Resource.Drawable.MyBackground);
            NameAddStudentET.LayoutParameters         = OneTwentyParams;
            NameAddStudentET.Hint                     = "Full Name";
            NameAddStudentET.TextSize                 = 30;
            NameAddStudentET.FirstBaselineToTopHeight = 10;
            //Adding views to layout
            NameAddStudentLayout.AddView(NameAddStudentTV);
            nameLayout.AddView(NameAddStudentET);
            NameAddStudentLayout.AddView(nameLayout);
            OverAllAddStudentLayout.AddView(NameAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining PhoneNum AddStudent Layout
            PhoneNumAddStudentLayout = new LinearLayout(this);
            PhoneNumAddStudentLayout.LayoutParameters = WrapContParams;
            PhoneNumAddStudentLayout.Orientation      = Orientation.Horizontal;
            //Defining the PhoneNum AddStudent TextView
            PhoneNumAddStudentTV = new TextView(this);
            PhoneNumAddStudentTV.LayoutParameters = WrapContParams;
            PhoneNumAddStudentTV.Text             = "Phone # ";
            PhoneNumAddStudentTV.TextSize         = 30;
            PhoneNumAddStudentTV.SetForegroundGravity(Android.Views.GravityFlags.Center);
            PhoneNumAddStudentTV.Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Defining the PhoneNum AddStudent TextInputEditText
            TextInputLayout phone = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };

            PhoneNumAddStudentET = new TextInputEditText(this);
            PhoneNumAddStudentET.SetBackgroundResource(Resource.Drawable.MyBackground);
            PhoneNumAddStudentET.LayoutParameters = OneTwentyParams;
            PhoneNumAddStudentET.Text             = "05";
            PhoneNumAddStudentET.TextSize         = 30;
            PhoneNumAddStudentET.SetSingleLine();
            PhoneNumAddStudentET.InputType = InputTypes.ClassPhone;
            //Adding views to layout
            PhoneNumAddStudentLayout.AddView(PhoneNumAddStudentTV);
            phone.AddView(PhoneNumAddStudentET);
            PhoneNumAddStudentLayout.AddView(phone);
            OverAllAddStudentLayout.AddView(PhoneNumAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            // Defining Email AddStudentLayout
            EmailAddStudentLayout = new LinearLayout(this);
            EmailAddStudentLayout.LayoutParameters = WrapContParams;
            EmailAddStudentLayout.Orientation      = Orientation.Horizontal;
            //Defining the Email AddStudent TextView
            EmailAddStudentTV = new TextView(this);
            EmailAddStudentTV.LayoutParameters = WrapContParams;
            EmailAddStudentTV.Text             = "Enter Email: ";
            EmailAddStudentTV.TextSize         = 30;
            EmailAddStudentTV.SetForegroundGravity(Android.Views.GravityFlags.Center);
            EmailAddStudentTV.Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Defining the Email AddStudent TextInputEditText
            TextInputLayout Email = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };

            EmailAddStudentET = new TextInputEditText(this);
            EmailAddStudentET.SetBackgroundResource(Resource.Drawable.MyBackground);
            EmailAddStudentET.LayoutParameters = OneTwentyParams;
            EmailAddStudentET.Hint             = "Email";
            EmailAddStudentET.InputType        = InputTypes.TextVariationEmailAddress;
            EmailAddStudentET.TextSize         = 30;
            EmailAddStudentET.SetSingleLine();
            //Adding views to layout
            EmailAddStudentLayout.AddView(EmailAddStudentTV);
            Email.AddView(EmailAddStudentET);
            EmailAddStudentLayout.AddView(Email);
            OverAllAddStudentLayout.AddView(EmailAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining Parent1NameAddStudentLayout
            Parent1NameAddStudentLayout = new LinearLayout(this);
            Parent1NameAddStudentLayout.LayoutParameters = WrapContParams;
            Parent1NameAddStudentLayout.Orientation      = Orientation.Horizontal;
            //Defining the Parent1Name AddStudent TextView
            Parent1NameAddStudentTV = new TextView(this);
            Parent1NameAddStudentTV.LayoutParameters = WrapContParams;
            Parent1NameAddStudentTV.Text             = "Parent1 Name: ";
            Parent1NameAddStudentTV.TextSize         = 30;
            Parent1NameAddStudentTV.SetForegroundGravity(Android.Views.GravityFlags.Center);
            Parent1NameAddStudentTV.Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Defining the Parent1Name AddStudent TextInputEditText
            TextInputLayout p1 = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };

            Parent1NameAddStudentET = new TextInputEditText(this);
            Parent1NameAddStudentET.SetBackgroundResource(Resource.Drawable.MyBackground);
            Parent1NameAddStudentET.LayoutParameters = OneTwentyParams;
            Parent1NameAddStudentET.Hint             = "Parent1";
            Parent1NameAddStudentET.TextSize         = 30;
            //Adding views to layout
            Parent1NameAddStudentLayout.AddView(Parent1NameAddStudentTV);
            p1.AddView(Parent1NameAddStudentET);
            Parent1NameAddStudentLayout.AddView(p1);
            OverAllAddStudentLayout.AddView(Parent1NameAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining Parent2NameAddStudentLayout
            Parent2NameAddStudentLayout = new LinearLayout(this);
            Parent2NameAddStudentLayout.LayoutParameters = WrapContParams;
            Parent2NameAddStudentLayout.Orientation      = Orientation.Horizontal;
            //Defining the Parent2Name AddStudent TextView
            Parent2NameAddStudentTV = new TextView(this);
            Parent2NameAddStudentTV.LayoutParameters = WrapContParams;
            Parent2NameAddStudentTV.Text             = "Parent2 Name: ";
            Parent2NameAddStudentTV.TextSize         = 30;
            Parent2NameAddStudentTV.SetForegroundGravity(Android.Views.GravityFlags.Center);
            Parent2NameAddStudentTV.Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Defining the Parent2Name AddStudent TextInputEditText
            TextInputLayout p2 = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };

            Parent2NameAddStudentET = new TextInputEditText(this);
            Parent2NameAddStudentET.LayoutParameters = OneTwentyParams;
            Parent2NameAddStudentET.SetBackgroundResource(Resource.Drawable.MyBackground);
            Parent2NameAddStudentET.Hint     = "Parent2";
            Parent2NameAddStudentET.TextSize = 30;
            //Adding views to layout
            Parent2NameAddStudentLayout.AddView(Parent2NameAddStudentTV);
            p2.AddView(Parent2NameAddStudentET);
            Parent2NameAddStudentLayout.AddView(p2);
            OverAllAddStudentLayout.AddView(Parent2NameAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining the AddStudent Explenation layout
            AddStudentExplenationLayout = new LinearLayout(this);
            AddStudentExplenationLayout.LayoutParameters = WrapContParams;
            AddStudentExplenationLayout.Orientation      = Orientation.Vertical;
            //Defining the Explenation AddStudent TextView
            AddStudentExplenationTV = new TextView(this);
            AddStudentExplenationTV.LayoutParameters = WrapContParams;
            AddStudentExplenationTV.Text             = "Student Notes: ";
            AddStudentExplenationTV.TextSize         = 30;
            AddStudentExplenationTV.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Adding views to layout
            AddStudentExplenationLayout.AddView(AddStudentExplenationTV);
            OverAllAddStudentLayout.AddView(AddStudentExplenationLayout);
            //Defining The AddStudent notes ET layout
            AddStudentExplenationETLayout = new LinearLayout(this);
            AddStudentExplenationETLayout.LayoutParameters = new LinearLayout.LayoutParams(1100, 400);
            AddStudentExplenationETLayout.Orientation      = Orientation.Vertical;
            AddStudentExplenationETLayout.SetBackgroundResource(Resource.Drawable.BlackOutLine);
            AddStudentExplenationETLayout.Click += this.AddStudentExplenationETLayout_Click;
            //Defining the Explenation AddStudent TextInputEditText
            AddStudentExplenationET = new TextInputEditText(this);
            AddStudentExplenationET.SetWidth(LinearLayout.LayoutParams.MatchParent);
            AddStudentExplenationET.Hint     = "Notes";
            AddStudentExplenationET.TextSize = 25;
            AddStudentExplenationET.SetTextIsSelectable(true);
            AddStudentExplenationET.InputType = InputTypes.TextFlagMultiLine;
            AddStudentExplenationET.Gravity   = GravityFlags.Top;
            AddStudentExplenationET.SetSingleLine(false);
            AddStudentExplenationET.SetBackgroundColor(Color.Transparent);
            //Adding viwes to overall layout
            AddStudentExplenationETLayout.AddView(AddStudentExplenationET);
            OverAllAddStudentLayout.AddView(AddStudentExplenationETLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Declare Spinner
            spin = new Spinner(this);
            spin.LayoutParameters = OneTwentyParams;
            spin.ItemSelected    += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            var adapter = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleSpinnerItem, groups);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spin.Adapter = adapter;
            //Defining Spinner Layout
            SpinnerLayout = new LinearLayout(this);
            SpinnerLayout.LayoutParameters = WrapContParams;
            SpinnerLayout.Orientation      = Orientation.Horizontal;
            //Adding Views
            SpinnerLayout.AddView(spin);
            OverAllAddStudentLayout.AddView(SpinnerLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining AddStudent Button Layout
            ButtonAddStudentLayout = new LinearLayout(this);
            ButtonAddStudentLayout.LayoutParameters = WrapContParams;
            ButtonAddStudentLayout.Orientation      = Orientation.Horizontal;
            //Defining AddStudent Button
            AddStudentButton = new Button(this);
            AddStudentButton.LayoutParameters = WrapContParams;
            AddStudentButton.Text             = "Add Student";
            AddStudentButton.TextSize         = 40;
            AddStudentButton.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            AddStudentButton.Click           += this.AddStudentButton_Click;
            //Adding views
            ButtonAddStudentLayout.AddView(AddStudentButton);
            OverAllAddStudentLayout.AddView(ButtonAddStudentLayout);
            //=======================================================================================================================================
            //=======================================================================================================================================
            //Defining AddStudent Button Layout
            ButtonSendToMainPageLayout = new LinearLayout(this);
            ButtonSendToMainPageLayout.LayoutParameters = WrapContParams;
            ButtonSendToMainPageLayout.Orientation      = Orientation.Horizontal;
            //Defining AddStudent Button
            SendBackToMainButton = new Button(this);
            SendBackToMainButton.LayoutParameters = WrapContParams;
            SendBackToMainButton.Text             = "Send Back To\nMain Page";
            SendBackToMainButton.TextSize         = 40;
            SendBackToMainButton.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            SendBackToMainButton.SetTextColor(Color.DarkRed);
            SendBackToMainButton.Click += this.SendBackToMainButton_Click;
            //Adding views
            ButtonSendToMainPageLayout.AddView(SendBackToMainButton);
            OverAllAddStudentLayout.AddView(ButtonSendToMainPageLayout);
        }
 public static void Init(TextInputEditText textInputEditText)
 {
 }
 public static void Dispose(TextInputEditText textInputEditText)
 {
 }
示例#12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.FilterByDate_Layout);

            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            im_model = new RecyclerAdapter <TaskInboxModel>();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            FromDate = FindViewById <TextInputEditText>(Resource.Id.fromdate);
            ToDate   = FindViewById <TextInputEditText>(Resource.Id.todate);
            Submit   = FindViewById <Button>(Resource.Id.submit);
            spinner  = FindViewById <Spinner>(Resource.Id.orgspinner);

            geo            = new Geolocation();
            restservice    = new ServiceHelper();
            location       = geo.GetGeoLocation(this);
            orgmodel       = new List <OrgModel>();
            orgname        = new List <OrgModel>();
            markinglist    = new List <MarkingListModel>();
            addmarkinglist = new List <MarkingListModel>();

            getOrgData();

            // spinner.ItemSelected += Selectorg_ItemSelected;

            //var adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.organization_array, Android.Resource.Layout.SimpleSpinnerItem);
            //adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //spinner.Adapter = adapter;


            designationSpinner = FindViewById <Spinner>(Resource.Id.desigspinner);

            // designationSpinner.ItemSelected += spinner_ItemSelected1;

            //spinner1.ItemSelected += Selectorg_ItemSelected;

            // var adapter1 = ArrayAdapter.CreateFromResource(this, Resource.Array.designation_array, Android.Resource.Layout.SimpleSpinnerItem);
            //  adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //  designationSpinner.Adapter = adapter1;

            FromDate.Click += (sender, e) =>
            {
                DateTime         today  = DateTime.Today;
                DatePickerDialog dialog = new DatePickerDialog(this, OnDateSetFrom, today.Year, today.Month - 1, today.Day);

                dialog.DatePicker.MinDate = today.Millisecond;
                dialog.Show();
            };

            ToDate.Click += (sender, e) =>
            {
                DateTime         today  = DateTime.Today;
                DatePickerDialog dialog = new DatePickerDialog(this, OnDateSetTo, today.Year, today.Month - 1, today.Day);

                dialog.DatePicker.MinDate = today.Millisecond;
                dialog.Show();
            };

            Submit.Click += delegate
            {
                Finish();
            };
        }
示例#13
0
 private void ResetColorsOnAccountInfoTextBoxes(View root, TextInputEditText txtemail, TextInputEditText txtnewPwd, TextInputEditText txtoldPwd, TextInputEditText txtPhone, TextInputEditText txtPwdConfirm)
 {
     txtemail.BackgroundTintList      = ContextCompat.GetColorStateList(root.Context, Resource.Color.blueforui);
     txtnewPwd.BackgroundTintList     = ContextCompat.GetColorStateList(root.Context, Resource.Color.blueforui);
     txtoldPwd.BackgroundTintList     = ContextCompat.GetColorStateList(root.Context, Resource.Color.blueforui);
     txtPhone.BackgroundTintList      = ContextCompat.GetColorStateList(root.Context, Resource.Color.blueforui);
     txtPwdConfirm.BackgroundTintList = ContextCompat.GetColorStateList(root.Context, Resource.Color.blueforui);
 }
示例#14
0
 public void Include(TextInputEditText target)
 {
     target.BeforeTextChanged += (d, e) => { target.Text += ""; };
     target.TextChanged       += (d, e) => { target.Text += ""; };
     target.AfterTextChanged  += (d, e) => { target.Text += ""; };
 }
示例#15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Context        mContext = Android.App.Application.Context;
            AppPreferences ap       = new AppPreferences(mContext);
            string         userId   = ap.GetUserId();

            if (Convert.ToInt32(userId) == 0)
            {
                var newIntent = new Intent(this, typeof(LoginActivity));
                StartActivity(newIntent);
            }

            adapter        = new TabsAdapter(this, SupportFragmentManager);
            pager          = FindViewById <ViewPager>(Resource.Id.viewpager);
            searchBar      = FindViewById <TextInputLayout>(Resource.Id.search_textInputLayout);
            searchEditText = FindViewById <TextInputEditText>(Resource.Id.searchedTxt);
            var tabs = FindViewById <TabLayout>(Resource.Id.tabs);

            pager.Adapter = adapter;
            tabs.SetupWithViewPager(pager);
            pager.OffscreenPageLimit = 3;

            searchBar.Visibility = ViewStates.Gone;
            pager.PageSelected  += (sender, args) =>
            {
                var fragment = adapter.InstantiateItem(pager, args.Position) as IFragmentVisible;

                fragment?.BecameVisible();
            };
            searchEditText.Click += (sender, eventArgs) =>
            {
                searchBar.Visibility = ViewStates.Gone;
                Toolbar.Visibility   = ViewStates.Visible;
                InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                imm.HideSoftInputFromWindow(searchEditText.WindowToken, 0);
            };

            searchEditText.TextChanged += (sender, eventArgs) => {
                if (searchEditText.Text.Trim().Length > 1)
                {
                    FacilityFragment fragment = (FacilityFragment)SupportFragmentManager.Fragments[0];
                    if (fragment != null)
                    {
                        fragment.SearchFacilities(searchEditText.Text.Trim());
                    }
                }
            };

            Toolbar.MenuItemClick += (sender, e) =>
            {
                var itemTitle = e.Item.TitleFormatted;

                switch (itemTitle.ToString())
                {
                case "Log Out":
                    var    intent  = new Intent(this, typeof(LoginActivity));
                    string _userId = "0";
                    ap.SaveUserId(_userId);
                    StartActivity(intent);
                    break;

                case "Search":
                    searchBar.Visibility = ViewStates.Visible;
                    Toolbar.Visibility   = ViewStates.Gone;
                    break;
                }
            };

            SupportActionBar.SetDisplayHomeAsUpEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(false);
        }
 public static void Init(TextInputEditText textInputEditText)
 {
     textInputEditText.TextChanged += OnTextChanged;
     textInputEditText.FocusChange += OnFocusChanged;
 }
示例#17
0
 public void Include(TextInputEditText text)
 {
     text.Text         = text.Text;
     text.FocusChange += (sender, args) => { var focus = args.HasFocus; };
     text.TextChanged += (sender, args) => { var changed = args.Text; };
 }
示例#18
0
 public MyTimer(TextInputEditText time)
 {
     this.Time    = time;
     this.counter = 0;
 }
示例#19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            base.OnCreate(savedInstanceState);

            progress = new ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");

            con         = new InternetConnection();
            dba         = new DBHelper();
            restService = new ServiceHelper();
            SetContentView(Resource.Layout.Registration_Layout);
            other_email       = Intent.GetStringExtra("email");
            other_user        = Intent.GetStringExtra("username");
            pref              = GetSharedPreferences("login", FileCreationMode.Private);
            edit              = pref.Edit();
            U_Name            = FindViewById <TextView>(Resource.Id.user);
            M_obile           = FindViewById <TextInputEditText>(Resource.Id.mobile);
            email_add         = FindViewById <TextView>(Resource.Id.email);
            pass_word         = FindViewById <TextInputEditText>(Resource.Id.pass);
            confrirm_password = FindViewById <TextInputEditText>(Resource.Id.confirmpassword);
            Registration      = FindViewById <Button>(Resource.Id.submit);
            U_Name.Text       = other_user;
            email_add.Text    = other_email;
            Dateofbirth       = FindViewById <TextInputEditText>(Resource.Id.birth);
            Gender            = FindViewById <TextInputEditText>(Resource.Id.gender);



            //U_Name.Text = GoogleAuth_Activity.user_Name;
            //U_Name.SetCursorVisible(false);
            //U_Name.SetFadingEdgeLength(10);
            //U_Name.Enabled = false;


            //email_add.Text = GoogleAuth_Activity.alreadyregistered;

            //email_add.SetCursorVisible(false);
            //email_add.SetFadingEdgeLength(10);
            //email_add.Enabled = false;


            Dateofbirth.Click += DateSelect_OnClick;;



            Registration.Click += async delegate
            {
                other_user        = U_Name.Text.ToString();
                other_mobile      = M_obile.Text.ToString();
                other_email       = email_add.Text.ToString();
                other_pass        = pass_word.Text.ToString();
                otherconfirm_pass = confrirm_password.Text.ToString();
                var hasNumber       = new Regex(@"[0-9]+");
                var hasUpperChar    = new Regex(@"[A-Z]+");
                var hasMiniMaxChars = new Regex(@".{6,25}");
                var hasLowerChar    = new Regex(@"[a-z]+");
                var hasSymbols      = new Regex(@"[!@#$%^&*()_+=\[{\]};:<>|./?,-]");
                if (other_user.Equals(""))
                {
                    Toast.MakeText(this, "Please Enter UserName", ToastLength.Short).Show();
                    return;
                }
                if (other_mobile.Equals("") || other_mobile.Length < 10)
                {
                    Toast.MakeText(this, "Please Enter 10 digit Mobile Number", ToastLength.Short).Show();
                    return;
                }
                if (other_email.Equals("") || !other_email.Contains("@"))
                {
                    Toast.MakeText(this, "Please Enter valid email address", ToastLength.Short).Show();
                    return;
                }
                if (other_pass.Equals("") || !hasNumber.IsMatch(other_pass) || !hasUpperChar.IsMatch(other_pass) || !hasMiniMaxChars.IsMatch(other_pass) || !hasLowerChar.IsMatch(other_pass) || !hasSymbols.IsMatch(other_pass))
                {
                    Toast.MakeText(this, "Password Should have minimum 6 character, minumum one special char, one uppercase letter,one lowercase letter", ToastLength.Short).Show();
                    return;
                }
                if (other_mobile.Length < 6)
                {
                    Toast.MakeText(this, "Please Enter minimum 6 digit password", ToastLength.Short).Show();
                    return;
                }
                if (!other_pass.Equals(otherconfirm_pass))
                {
                    Toast.MakeText(this, "Password and confirm password should be same", ToastLength.Short).Show();
                    return;
                }

                //if (con.connectivity())
                //{
                //    RegistrationData();
                //}

                else
                {
                    cpd = new CustomProgressDialog(this);
                    cpd.SetCancelable(false);
                    cpd.Show();
                    DoRegistration(other_user, other_pass, other_mobile, other_email);
                }
            };
        }
示例#20
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.pager_parsingresults, container, false);

            view.FindViewById <TextView>(Resource.Id.titleTextView).Text = title;

            TextInputEditText textField = view.FindViewById <TextInputEditText>(Resource.Id.textTextField);

            textField.Text = text;
            textField.SetOnTouchListener(new EditTextTochListener(textField));

            TextInputEditText latexField = view.FindViewById <TextInputEditText>(Resource.Id.latexTextField);

            latexField.Text = latex;
            latexField.SetOnTouchListener(new EditTextTochListener(latexField));

            view.FindViewById <ImageButton>(Resource.Id.textCopyContent).Click += delegate
            {
                if (textField.Text != "")
                {
                    ClipboardManager clipboard = (ClipboardManager)view.Context.GetSystemService(Context.ClipboardService);
                    ClipData         clip      = ClipData.NewPlainText("text", textField.Text);
                    clipboard.PrimaryClip = clip;
                    Toast.MakeText(view.Context, "Текст скопирован в буфер обмена", ToastLength.Short).Show();
                }
            };
            view.FindViewById <ImageButton>(Resource.Id.textSendContent).Click += delegate
            {
                if (textField.Text != "")
                {
                    Intent shareIntent = new Intent();
                    shareIntent.SetAction(Intent.ActionSend);
                    shareIntent.PutExtra(Intent.ExtraSubject, "Devenir parsing result");
                    shareIntent.PutExtra(Intent.ExtraText, textField.Text);
                    shareIntent.SetType("text/plain");
                    StartActivity(shareIntent);
                }
            };

            view.FindViewById <ImageButton>(Resource.Id.latexCopyContent).Click += delegate
            {
                if (latexField.Text != "")
                {
                    ClipboardManager clipboard = (ClipboardManager)view.Context.GetSystemService(Context.ClipboardService);
                    ClipData         clip      = ClipData.NewPlainText("LaTeX", latexField.Text);
                    clipboard.PrimaryClip = clip;
                    Toast.MakeText(view.Context, "Текст скопирован в буфер обмена", ToastLength.Short).Show();
                }
            };
            view.FindViewById <ImageButton>(Resource.Id.latexSendContent).Click += delegate
            {
                if (latexField.Text != "")
                {
                    Intent shareIntent = new Intent();
                    shareIntent.SetAction(Intent.ActionSend);
                    shareIntent.PutExtra(Intent.ExtraSubject, "Devenir parsing result");
                    shareIntent.PutExtra(Intent.ExtraText, latexField.Text);
                    shareIntent.SetType("text/plain");
                    StartActivity(shareIntent);
                }
            };



            return(view);
        }
示例#21
0
 public EditTextTochListener(TextInputEditText editText)
 {
     this.editText = editText;
 }
示例#22
0
        public void BuildEditGroupDialog(Group group)
        {
            GrouD = new Dialog(this);
            GrouD.SetContentView(Resource.Layout.MyDialog);
            GrouD.SetCancelable(true);
            //
            LinearLayout OAGroupsLayout = GrouD.FindViewById <LinearLayout>(Resource.Id.AbcDEF);

            OAGroupsLayout.Orientation = Orientation.Vertical;

            LinearLayout l2 = new LinearLayout(this);

            l2.LayoutParameters = new LinearLayout.LayoutParams(750, 850);
            l2.Orientation      = Orientation.Vertical;
            l2.SetBackgroundResource(Resource.Drawable.BlackOutLine);
            //
            #region Title
            TitleLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            TitleTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Edit Group ",
                TextSize         = 40,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            TitleLayout.AddView(TitleTV);
            #endregion

            #region Location Defining
            LocationLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            //
            LocTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Location: ",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            LocTV.SetTextColor(Color.DarkRed);
            //
            LocET = new TextInputEditText(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.Location,
                TextSize         = 20,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            TextInputLayout Loc = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            LocationLayout.AddView(LocTV);
            LocationLayout.AddView(LocET);
            #endregion

            #region Age Defining
            AgeLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            //
            AgeTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Age: ",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            AgeTV.SetTextColor(Color.DarkRed);
            //
            AgeET = new TextInputEditText(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.age,
                TextSize         = 20,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            AgeLayout.AddView(AgeTV);
            AgeLayout.AddView(AgeET);
            #endregion

            #region Level Defining
            LVLLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            //
            LVLTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Group Level: ",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            LVLTV.SetTextColor(Color.DarkRed);
            //
            LVLET = new TextInputEditText(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.geoupLevel,
                TextSize         = 20,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            LVLLayout.AddView(LVLTV);
            LVLLayout.AddView(LVLET);
            #endregion

            #region Competetive defining
            CompRG             = new RadioGroup(this);
            CompRG.Orientation = Orientation.Vertical;
            //Defining Competitive group Radio Button
            CompRB = new RadioButton(this)
            {
                Text     = "Competetive",
                TextSize = 25,
                Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            CompRB.SetTextColor(Android.Graphics.Color.DarkBlue);
            CompRB.Click += this.RB_Click;
            //Defining not Competetive group radio Button
            NotCompRB = new RadioButton(this)
            {
                Text     = "Not Competetive",
                TextSize = 25,
                Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            NotCompRB.SetTextColor(Android.Graphics.Color.DarkBlue);
            NotCompRB.Click += this.RB_Click;

            CompRG.AddView(CompRB);
            CompRG.AddView(NotCompRB);
            if (group.competetive)
            {
                CompRG.Check(CompRB.Id);
            }
            else
            {
                CompRG.Check(NotCompRB.Id);
            }
            #endregion

            #region Time And Date
            TimeAndDateLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            TimeButton = new Button(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.time,
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            TimeButton.SetTextColor(Color.Red);
            TimeButton.Click += this.TimeButton_Click;
            TimeAndDateLayout.AddView(TimeButton);
            #endregion

            #region Save Button
            SaveLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            SaveButton = new Button(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Save",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            SaveButton.SetBackgroundColor(Color.BurlyWood);
            SaveButton.Click += this.SaveButton_Click;
            SaveLayout.AddView(SaveButton);
            #endregion

            l2.AddView(TitleLayout);
            l2.AddView(LocationLayout);
            l2.AddView(AgeLayout);
            l2.AddView(LVLLayout);
            l2.AddView(CompRG);
            l2.AddView(TimeAndDateLayout);
            l2.AddView(SaveLayout);
            OAGroupsLayout.AddView(l2);
            //
            GrouD.Show();
        }
示例#23
0
 public void Include(TextInputEditText textInputEditText)
 {
     textInputEditText.Hint  = $"{textInputEditText.Hint}";
     textInputEditText.Error = $"{textInputEditText.Error}";
     textInputEditText.SetAutofillHints("");
 }
示例#24
0
        public void BuildAddTrainingScreen()
        {
            //OverAll Layout
            AddTrainingOverAllLayout             = (LinearLayout)FindViewById(Resource.Id.AddTrainingL);
            AddTrainingOverAllLayout.Orientation = Orientation.Vertical;
            //-------------------------------------
            //Defining Label Layout
            AddTrainingLabelLayout = new LinearLayout(this);
            AddTrainingLabelLayout.LayoutParameters = WrapContParams;
            AddTrainingLabelLayout.Orientation      = Orientation.Vertical;
            AddTrainingLabelLayout.SetGravity(Android.Views.GravityFlags.Center);
            //Defining the Label AddTraining TextView
            AddTrainingLabelTV = new TextView(this);
            AddTrainingLabelTV.LayoutParameters = WrapContParams;
            AddTrainingLabelTV.Text             = "New Exercise";
            AddTrainingLabelTV.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            AddTrainingLabelTV.SetTextColor(Android.Graphics.Color.DarkRed);
            AddTrainingLabelTV.TextSize = 60;
            AddTrainingLabelLayout.AddView(AddTrainingLabelTV);
            AddTrainingOverAllLayout.AddView(AddTrainingLabelLayout);
            //Defining the AddTraining Name layout
            AddTrainingNameLayout = new LinearLayout(this);
            AddTrainingNameLayout.LayoutParameters = WrapContParams;
            AddTrainingNameLayout.Orientation      = Orientation.Horizontal;
            //Defining the Name AddTraining TextView
            AddTrainingNameTV = new TextView(this);
            AddTrainingNameTV.LayoutParameters = WrapContParams;
            AddTrainingNameTV.Text             = "Exercise Name: ";
            AddTrainingNameTV.TextSize         = 30;
            AddTrainingNameTV.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Defining the Name AddTraining TextInputEditText
            TextInputLayout nameLayout = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };

            AddTrainingNameET = new TextInputEditText(this);
            AddTrainingNameET.SetBackgroundResource(Resource.Drawable.MyBackground);
            AddTrainingNameET.LayoutParameters = OneTwentyParams;
            AddTrainingNameET.Hint             = "name";
            AddTrainingNameET.TextSize         = 30;
            //Adding views to layout
            AddTrainingNameLayout.AddView(AddTrainingNameTV);
            nameLayout.AddView(AddTrainingNameET);
            AddTrainingNameLayout.AddView(nameLayout);
            AddTrainingOverAllLayout.AddView(AddTrainingNameLayout);
            //----------------------------------------------------------------------------------
            //----------------------------------------------------------------------------------------
            //Defining the AddTraining Explenation layout
            AddTrainingExplenationLayout = new LinearLayout(this);
            AddTrainingExplenationLayout.LayoutParameters = WrapContParams;
            AddTrainingExplenationLayout.Orientation      = Orientation.Vertical;
            //Defining the Explenation AddTraining TextView
            AddTrainingExplenationTV = new TextView(this);
            AddTrainingExplenationTV.LayoutParameters = WrapContParams;
            AddTrainingExplenationTV.Text             = "Exercise Explenation: ";
            AddTrainingExplenationTV.TextSize         = 30;
            AddTrainingExplenationTV.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            //Adding views to layout
            AddTrainingExplenationLayout.AddView(AddTrainingExplenationTV);
            AddTrainingOverAllLayout.AddView(AddTrainingExplenationLayout);
            //Defining The AddTraining Explenation ET layout
            AddTrainingExplenationETLayout = new LinearLayout(this);
            AddTrainingExplenationETLayout.LayoutParameters = new LinearLayout.LayoutParams(1100, 800);
            AddTrainingExplenationETLayout.Orientation      = Orientation.Vertical;
            AddTrainingExplenationETLayout.SetBackgroundResource(Resource.Drawable.BlackOutLine);
            AddTrainingExplenationETLayout.Click += this.AddTrainingExplenationETLayout_Click;
            //Defining the Explenation AddTraining TextInputEditText
            AddTrainingExplenationET = new TextInputEditText(this);
            AddTrainingExplenationET.SetBackgroundResource(Resource.Drawable.MyBackground);
            AddTrainingExplenationET.SetWidth(LinearLayout.LayoutParams.MatchParent);
            AddTrainingExplenationET.Hint     = "Explenation";
            AddTrainingExplenationET.TextSize = 25;
            AddTrainingExplenationET.SetTextIsSelectable(true);
            AddTrainingExplenationET.InputType = InputTypes.TextFlagMultiLine;
            AddTrainingExplenationET.Gravity   = GravityFlags.Top;
            AddTrainingExplenationET.SetSingleLine(false);
            AddTrainingExplenationET.SetBackgroundColor(Color.Transparent);

            //Adding viwes to overall layout
            AddTrainingExplenationETLayout.AddView(AddTrainingExplenationET);
            AddTrainingOverAllLayout.AddView(AddTrainingExplenationETLayout);
            //---------------------------------------------------------------------------------------------------------
            //Defining AddTraining Button Layout
            ButtonAddTrainingLayout = new LinearLayout(this);
            ButtonAddTrainingLayout.LayoutParameters = WrapContParams;
            ButtonAddTrainingLayout.Orientation      = Orientation.Horizontal;
            //Defining AddTraining Button
            AddTrainingButton = new Button(this);
            AddTrainingButton.LayoutParameters = WrapContParams;
            AddTrainingButton.Text             = "Register";
            AddTrainingButton.TextSize         = 40;
            AddTrainingButton.Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            AddTrainingButton.Click           += this.AddTrainingButton_Click;
            //Adding views
            ButtonAddTrainingLayout.AddView(AddTrainingButton);
            AddTrainingOverAllLayout.AddView(ButtonAddTrainingLayout);
            //Insert Image:

            /*
             *
             *
             *
             *
             *
             *
             *
             */
        }
示例#25
0
        private void btnAccUpdate_Click(object sender, EventArgs e)
        {
            View root                       = (View)((Button)sender).Parent;
            bool updateSuccess              = true;
            TextInputEditText txtoldPwd     = root.FindViewById <TextInputEditText>(Resource.Id.txtaccOldPwd);
            TextInputEditText txtnewPwd     = root.FindViewById <TextInputEditText>(Resource.Id.txtaccPwd);
            TextInputEditText txtPwdConfirm = root.FindViewById <TextInputEditText>(Resource.Id.txtaccPwdConfirm);
            TextInputEditText txtemail      = root.FindViewById <TextInputEditText>(Resource.Id.txtaccEmail);
            TextInputEditText txtPhone      = root.FindViewById <TextInputEditText>(Resource.Id.txtaccPhone);

            ResetColorsOnAccountInfoTextBoxes(root, txtemail, txtnewPwd, txtoldPwd, txtPhone, txtPwdConfirm);
            //check current password
            string currentPwd = txtoldPwd.Text;

            if (currentPwd == GeneralInfo.customerAccount.Password)
            {
                string newPwd = txtnewPwd.Text;
                //if user wants to change pwd so he/she needs to give us valid pwd
                if (newPwd.Length > 0 && Validator.ValidPassWord(newPwd))
                {
                    //if pwd is valid then check confirmation pwd
                    string confirmPwd = txtPwdConfirm.Text;
                    if (newPwd == confirmPwd)
                    {
                        //we can Make password Update here
                        GeneralInfo.customerAccount.Password = newPwd;
                    }
                    else
                    {
                        //confirmation value is not equal to pwd
                        txtPwdConfirm.BackgroundTintList = ContextCompat.GetColorStateList(root.Context, Resource.Color.redfornotvalid);
                        updateSuccess = false;
                        Toast.MakeText(((View)root.Parent).Context, "Password Confirmation is not equal to Password", ToastLength.Short).Show();
                    }
                }
                else if (newPwd.Length > 0 && Validator.ValidPassWord(newPwd) == false)
                {
                    updateSuccess = false;
                    txtnewPwd.BackgroundTintList = ContextCompat.GetColorStateList(root.Context, Resource.Color.redfornotvalid);
                    Toast.MakeText(((View)root.Parent).Context, "New Password is not a valid password.", ToastLength.Short).Show();
                }
                string email = txtemail.Text;
                if (Validator.ValidEmail(email))
                {
                    GeneralInfo.customerAccount.EMail = email;
                }
                else
                {
                    updateSuccess = false;
                    txtemail.BackgroundTintList = ContextCompat.GetColorStateList(root.Context, Resource.Color.redfornotvalid);
                    Toast.MakeText(((View)root.Parent).Context, "New Email is not valid.", ToastLength.Short).Show();
                }
                string phone = root.FindViewById <TextInputEditText>(Resource.Id.txtaccPhone).Text;
                if (Validator.ValidPhone(phone, 11))
                {
                    GeneralInfo.customerAccount.PhoneNumber = phone;
                }
                else
                {
                    updateSuccess = false;
                    txtPhone.BackgroundTintList = ContextCompat.GetColorStateList(root.Context, Resource.Color.redfornotvalid);
                    Toast.MakeText(((View)root.Parent).Context, "New Phone number is not valid.", ToastLength.Short).Show();
                }
            }
            else
            {
                updateSuccess = false;
                txtoldPwd.BackgroundTintList = ContextCompat.GetColorStateList(root.Context, Resource.Color.redfornotvalid);
                Toast.MakeText(((View)root.Parent).Context, "Your password is not correct.", ToastLength.Short).Show();
            }
            if (updateSuccess)
            {
                SQLiteConnection connection = DataBase.CheckConnection();
                connection.Update(GeneralInfo.customerAccount);
                //give a message
                // var runnable = new Java.Lang.Runnable(() =>);
                Toast.MakeText(((View)root.Parent).Context, "Update Successfull", ToastLength.Short).Show();
                //((Android.App.Activity)root.Context).RunOnUiThread(runnable);
                //runnable.Run();

                ResetColorsOnAccountInfoTextBoxes(root, txtemail, txtnewPwd, txtoldPwd, txtPhone, txtPwdConfirm);
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = inflater.Inflate(Resource.Layout.gstn_verification, container, false);

            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());


            con = new InternetConnection();

            searchGST            = (TextInputEditText)rootView.FindViewById(Resource.Id.searchGSTN);
            gstnProgress         = (ProgressBar)rootView.FindViewById(Resource.Id.progressGST);
            tradeName1           = (TextView)rootView.FindViewById(Resource.Id.tradeName);
            gstnIdText1          = (TextView)rootView.FindViewById(Resource.Id.gstnId);
            regDate1             = (TextView)rootView.FindViewById(Resource.Id.regDate);
            mobileNumber1        = (TextView)rootView.FindViewById(Resource.Id.mobileNumberVer);
            linear1              = (LinearLayout)rootView.FindViewById(Resource.Id.linearQuestion1);
            linear2              = (LinearLayout)rootView.FindViewById(Resource.Id.linearQuestion2);
            linear3              = (LinearLayout)rootView.FindViewById(Resource.Id.linearQuestion3);
            gridLayout           = (LinearLayout)rootView.FindViewById(Resource.Id.gridVer);
            submitDataVer        = (Button)rootView.FindViewById(Resource.Id.submitVerification);
            cameraVer            = (ImageButton)rootView.FindViewById(Resource.Id.cameraVer);
            gridViewVer          = (GridView)rootView.FindViewById(Resource.Id.gridViewVer);
            checkValidate        = (CheckBox)rootView.FindViewById(Resource.Id.checkVerification);
            rg1                  = (RadioGroup)rootView.FindViewById(Resource.Id.myRadioGroup1);
            rg2                  = (RadioGroup)rootView.FindViewById(Resource.Id.myRadioGroup2);
            rg3                  = (RadioGroup)rootView.FindViewById(Resource.Id.myRadioGroup3);
            rg4                  = (LinearLayout)rootView.FindViewById(Resource.Id.myRadioGroup4);
            Yes1                 = (RadioButton)rootView.FindViewById(Resource.Id.yes1);
            Yes2                 = (RadioButton)rootView.FindViewById(Resource.Id.yes2);
            Yes3                 = (RadioButton)rootView.FindViewById(Resource.Id.yes3);
            No1                  = (RadioButton)rootView.FindViewById(Resource.Id.no1);
            No2                  = (RadioButton)rootView.FindViewById(Resource.Id.no2);
            No3                  = (RadioButton)rootView.FindViewById(Resource.Id.no3);
            Manufacturer         = (CheckBox)rootView.FindViewById(Resource.Id.manufacturer);
            Trader               = (CheckBox)rootView.FindViewById(Resource.Id.trader);
            ServiceDealer        = (CheckBox)rootView.FindViewById(Resource.Id.serviceDealer);
            turnoverText         = (TextInputEditText)rootView.FindViewById(Resource.Id.turnOver);
            otherText            = (TextInputEditText)rootView.FindViewById(Resource.Id.otherText1);
            areaBusiness         = (TextInputEditText)rootView.FindViewById(Resource.Id.area1);
            businessSelectButton = (Button)rootView.FindViewById(Resource.Id.mySelection);

            grid_adapter        = new GridAdapter(Activity, Utilities.imageList);
            gridViewVer.Adapter = grid_adapter;

            tradeName1.Visibility  = ViewStates.Gone;
            gstnIdText1.Visibility = ViewStates.Gone;
            regDate1.Visibility    = ViewStates.Gone;

            mobileNumber1.Visibility = ViewStates.Gone;

            gridLayout.Visibility = ViewStates.Gone;

            submitDataVer.Visibility = ViewStates.Gone;

            cameraVer.Visibility     = ViewStates.Gone;
            gridViewVer.Visibility   = ViewStates.Gone;
            checkValidate.Visibility = ViewStates.Gone;

            linear1.Visibility = ViewStates.Gone;
            linear2.Visibility = ViewStates.Gone;
            linear3.Visibility = ViewStates.Gone;

            otherText.Visibility            = ViewStates.Gone;
            areaBusiness.Visibility         = ViewStates.Gone;
            turnoverText.Visibility         = ViewStates.Gone;
            rg4.Visibility                  = ViewStates.Gone;
            businessSelectButton.Visibility = ViewStates.Gone;


            Yes1.Click += RadioButtonClick;
            No1.Click  += RadioButtonClick;
            Yes2.Click += RadioButtonClick;
            No2.Click  += RadioButtonClick;
            Yes3.Click += RadioButtonClick;
            No3.Click  += RadioButtonClick;

            businessSelectButton.Click += delegate
            {
                try
                {
                    Intent i = new Intent(Activity, typeof(BusinessTypeFragment));
                    Activity.StartActivity(i);

                    //FragmentTransaction ft = FragmentManager.BeginTransaction();
                    //BusinessTypeFragment f4 = new BusinessTypeFragment();
                    //ft.Replace(Resource.Id.container, f4);
                    //ft.AddToBackStack("BusinessTypeFragment");
                    //ft.Commit();
                    // FragmentManager.BeginTransaction().Add(Resource.Id.container, new BusinessTypeFragment()).Commit();
                }catch (Exception ex)
                {
                }
            };



            mobileNumber1.Click += delegate
            {
                AlertDialog.Builder alertDiag = new AlertDialog.Builder(Activity);
                alertDiag.SetTitle("Call Dialog");
                alertDiag.SetMessage("Do you want to call?");
                alertDiag.SetPositiveButton("Call", (senderAlert, args) => {
                    try
                    {
                        var uri    = Android.Net.Uri.Parse("tel:" + phoneNumber);
                        var intent = new Intent(Intent.ActionDial, uri);
                        StartActivity(intent);
                    }catch (Exception e)
                    {
                    }
                });
                alertDiag.SetNegativeButton("Cancel", (senderAlert, args) => {
                    alertDiag.Dispose();
                });
                Android.App.Dialog diag = alertDiag.Create();
                diag.Show();
            };

            cameraVer.Click += delegate
            {
                CameraPic();
            };

            searchGST.TextChanged += delegate
            {
                if (searchGST.Text.ToString().Length >= 15)
                {
                    string searchText = searchGST.Text.ToString();
                    if (con.connectivity())
                    {
                        GSTNSearch(searchText).Wait();
                    }
                    else
                    {
                        Toast.MakeText(Activity, "Please connect to Internet.", ToastLength.Long).Show();
                    }
                }
                else
                {
                    tradeName1.Visibility    = ViewStates.Gone;
                    gstnIdText1.Visibility   = ViewStates.Gone;
                    regDate1.Visibility      = ViewStates.Gone;
                    mobileNumber1.Visibility = ViewStates.Gone;

                    gridLayout.Visibility    = ViewStates.Gone;
                    checkValidate.Visibility = ViewStates.Gone;
                    submitDataVer.Visibility = ViewStates.Gone;

                    cameraVer.Visibility   = ViewStates.Gone;
                    gridViewVer.Visibility = ViewStates.Gone;
                    linear1.Visibility     = ViewStates.Gone;
                    linear2.Visibility     = ViewStates.Gone;
                    linear3.Visibility     = ViewStates.Gone;

                    otherText.Visibility            = ViewStates.Gone;
                    areaBusiness.Visibility         = ViewStates.Gone;
                    turnoverText.Visibility         = ViewStates.Gone;
                    rg4.Visibility                  = ViewStates.Gone;
                    businessSelectButton.Visibility = ViewStates.Gone;
                }
            };

            submitDataVer.Click += delegate {
                other        = otherText.Text.ToString();
                premisesArea = areaBusiness.Text.ToString();
                if (checkValidate.Selected)
                {
                    compoundingEligible = "Yes";
                }
                else
                {
                    compoundingEligible = "No";
                }

                //if (Manufacturer.Selected)
                //{
                //    manuf = "Manufacturer";
                //}
                //if (Trader.Selected)
                //{
                //    trad = "Trader";
                //}
                //if (ServiceDealer.Selected)
                //{
                //    dealer = "Service Dealer";
                //}

                turnOver = turnoverText.Text.ToString();
                //if (!manuf.Equals(""))
                //{
                //    if (!combine.Equals(""))
                //    {
                //        combine += "," + manuf;
                //    }
                //    else
                //    {
                //        combine += manuf;
                //    }
                //}
                //if (!trad.Equals(""))
                //{
                //    if (!combine.Equals(""))
                //    {
                //        combine += "," + trad;
                //    }
                //    else
                //    {
                //        combine += trad;
                //    }
                //}
                //if (!dealer.Equals(""))
                //{
                //    if (!combine.Equals(""))
                //    {
                //        combine += "," + dealer;
                //    }
                //    else
                //    {
                //        combine += dealer;
                //    }
                //}
                try
                {
                    combine = string.Join(",", Utilities.GlobalBusinessList);
                }catch (Exception ex)
                {
                    combine = "";
                }


                if (address.Equals(""))
                {
                    Toast.MakeText(Activity, "Please Select Address Status", ToastLength.Short).Show();
                    return;
                }
                if (businessStatus.Equals(""))
                {
                    Toast.MakeText(Activity, "Please Select Business Status", ToastLength.Short).Show();
                    return;
                }

                if (registration.Equals(""))
                {
                    Toast.MakeText(Activity, "Please Select Registration Status", ToastLength.Short).Show();
                    return;
                }

                if (Utilities.imageList.Count < 1)
                {
                    Toast.MakeText(Activity, "Please Capture Atleast One Photograph.", ToastLength.Short).Show();
                    return;
                }


                if (con.connectivity())
                {
                    submitDataVer.Enabled = false;
                    try
                    {
                        sendToServer();
                    }catch (Exception ex)
                    {
                        Toast.MakeText(Activity, "Something went wrong. Please try after sometime.", ToastLength.Long).Show();

                        PackageManager manager = Activity.PackageManager;
                        PackageInfo    info    = manager.GetPackageInfo(Activity.PackageName, 0);
                        info.VersionName.ToString();
                        int i = dba.insertGSTINData(geo.GetGeoLocation(Activity), GSTIN, "", DateTime.Now.ToString("yyyy-MM-dd"),
                                                    address, businessStatus, registration, other, compoundingEligible, premisesArea,
                                                    combine, turnOver, info.VersionName.ToString(), "no");

                        for (int j = 0; j < Utilities.imageList.Count; j++)
                        {
                            dba.insertImageDetail(i, Utilities.imageList[j].ImagePath, geo.GetGeoLocation(Activity));
                        }
                    }
                }
                else
                {
                    submitDataVer.Enabled = false;
                    PackageManager manager = Activity.PackageManager;
                    PackageInfo    info    = manager.GetPackageInfo(Activity.PackageName, 0);
                    info.VersionName.ToString();
                    int i = dba.insertGSTINData(geo.GetGeoLocation(Activity), GSTIN, "", DateTime.Now.ToString("yyyy-MM-dd"),
                                                address, businessStatus, registration, other, compoundingEligible, premisesArea,
                                                combine, turnOver, info.VersionName.ToString(), "no");

                    for (int j = 0; j < Utilities.imageList.Count; j++)
                    {
                        dba.insertImageDetail(i, Utilities.imageList[j].ImagePath, geo.GetGeoLocation(Activity));
                    }
                    Toast.MakeText(Activity, "Data Saved in Database.", ToastLength.Long).Show();

                    combine = "";
                    GSTIN   = "";
                    rg1.ClearCheck();
                    address = "";
                    rg2.ClearCheck();
                    businessStatus = "";
                    rg3.ClearCheck();
                    registration          = "";
                    other                 = "";
                    otherText.Text        = "";
                    checkValidate.Checked = false;
                    compoundingEligible   = "";
                    premisesArea          = "";
                    areaBusiness.Text     = "";
                    turnoverText.Text     = "";
                    Utilities.imageList.Clear();
                    turnOver              = "";
                    Manufacturer.Checked  = false;
                    Trader.Checked        = false;
                    ServiceDealer.Checked = false;
                    submitDataVer.Enabled = true;
                    manuf  = "";
                    trad   = "";
                    dealer = "";
                    grid_adapter.NotifyDataSetChanged();
                    Utilities.GlobalBusinessList.Clear();
                }
            };

            return(rootView);
        }
示例#27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Authorization);
            sm           = new ServerManager();
            buttonSignIn = (Button)FindViewById(Resource.Id.authSignInButton);
            buttonSignUp = (Button)FindViewById(Resource.Id.authSignUpButton);
            buttonSkip   = (Button)FindViewById(Resource.Id.authSkipButton);

            emailInputField    = (TextInputEditText)FindViewById(Resource.Id.authEmailField);
            passwordInputField = (TextInputEditText)FindViewById(Resource.Id.authPasswordField);
            passwordInputField.TransformationMethod = new PasswordTransformationMethod();
            passwordInputField.InputType            = Android.Text.InputTypes.ClassText | Android.Text.InputTypes.TextVariationPassword;

            //Debug
            emailInputField.Text    = "*****@*****.**";
            passwordInputField.Text = "testtest";

            buttonSkip.Click   += ButtonSkip_Click;
            buttonSignIn.Click += async delegate {
                sm.SetEmail(emailInputField.Text);
                sm.SetPassword(passwordInputField.Text);
                ServerManager.SignInResponseContainer response = await sm.SignIn();

                switch (response.response.answer)
                {
                case "invalid_email":
                    Toast.MakeText(this, "Неправильно введен email", ToastLength.Short).Show();
                    break;

                case "incorrect_password":
                    Toast.MakeText(this, "Неправильно введен пароль", ToastLength.Short).Show();
                    break;

                case "authorization_completed":
                    Toast.MakeText(this, "Успешная авторизация", ToastLength.Short).Show();
                    Intent i = Intent;
                    i.PutExtra("uid", response.response.uid);
                    SetResult(Result.Ok, i);
                    Finish();
                    break;

                default:
                    break;
                }
            };
            buttonSignUp.Click += async delegate {
                sm.SetEmail(emailInputField.Text);
                sm.SetPassword(passwordInputField.Text);
                ServerManager.SignInResponseContainer response = await sm.SignUp();

                switch (response.response.answer)
                {
                case "bad_email":
                    Toast.MakeText(this, "Неправильно введен email", ToastLength.Short).Show();
                    break;

                case "email_used":
                    Toast.MakeText(this, "Email уже используется", ToastLength.Short).Show();
                    break;

                case "bad_pass":
                    Toast.MakeText(this, "Неподходящий пароль", ToastLength.Short).Show();
                    break;

                case "registration_completed":
                    Toast.MakeText(this, "Успешная регистрация", ToastLength.Short).Show();
                    Intent i = Intent;
                    i.PutExtra("uid", response.response.uid);
                    SetResult(Result.Ok, i);
                    Finish();
                    break;

                default:
                    break;
                }
            };
        }
示例#28
0
        private void CreateTextViewsAndButtons(View view)
        {
            amountLayout  = view.FindViewById <TextInputLayout>(Resource.Id.amountLayoutFrag);
            addressLayout = view.FindViewById <TextInputLayout>(Resource.Id.userNameLayoutFrag);
            labelLayout   = view.FindViewById <TextInputLayout>(Resource.Id.labelLayoutFrag);

            amountEdit           = view.FindViewById <TextInputEditText>(Resource.Id.amountEditFrag);
            addressEdit          = view.FindViewById <TextInputEditText>(Resource.Id.userNameTextEditFrag);
            labelEdit            = view.FindViewById <TextInputEditText>(Resource.Id.labelEditFrag);
            dollarAmountTextView = view.FindViewById <TextView>(Resource.Id.dollarAmountTextViewFrag);

            amountEdit.ClearFocus();

            amountEdit.RequestFocus();

            //@@todo: convert to lambda functions
            amountEdit.FocusChange += AmountTextView_FocusChange;

            dollarAmountTextView.SetTextColor(Color.Red);

            amountEdit.TextChanged += (sender, e) =>
            {
                string amount = amountEdit.Text;

                if (!amount.Any(char.IsDigit))
                {
                    return;
                }

                decimal value = System.Convert.ToDecimal(amount) * coinDollarValue;
                dollarAmountTextView.Text = value.ToString("C");
            };

            addressEdit.FocusChange += AddressTextView_FocusChange;
            addressEdit.TextChanged += (sender, e) =>
            {
                addressBookAdapter.Filter(e.Text.ToString());
            };

            //@@todo: convert to lambda functions
            labelEdit.FocusChange += LabelTextView_FocusChange;

            buttonLayout = view.FindViewById <LinearLayout>(Resource.Id.buttonLayoutFrag);

            addressBookButton = view.FindViewById <Button>(Resource.Id.addressBookFrag);
            qrCodeButton      = view.FindViewById <Button>(Resource.Id.qrCodeFrag);
            clearButton       = view.FindViewById <Button>(Resource.Id.clearFrag);

            clearButton.Click += (sender, e) =>
            {
                addressEdit.Text = null;
            };

            //@@todo: convert to lambda functions
            addressBookButton.Click += AddressBookButton_Click;

            sendButton         = view.FindViewById <Button>(Resource.Id.sendFrag);
            radioGroup         = view.FindViewById <RadioGroup>(Resource.Id.feesRadioGroup);
            topView            = view.FindViewById <View>(Resource.Id.topView);
            transactionFeeText = view.FindViewById <TextView>(Resource.Id.transactionFeeText);
            bottomView         = view.FindViewById <View>(Resource.Id.bottomView);

            //@@todo: convert to lambda functions
            sendButton.Click += async(sender, e) =>
            {
                if (!UserInputsFilled())
                {
                    return;
                }

                switch (transactionState)
                {
                case TransactionEnum.RECEIVE:
                    HandleReceiveTask();
                    break;

                case TransactionEnum.SEND:
                    await HandleSendTaks();

                    break;

                default:
                    break;
                }
            };
        }
示例#29
0
 public static void Dispose(TextInputEditText textInputEditText)
 {
     textInputEditText.TextChanged -= OnTextChanged;
     textInputEditText.FocusChange -= OnFocusChanged;
 }
示例#30
0
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);

                MobileCenter_Helper.InitAndroidAnalytics();

                if (Settings.NightMode)
                {
                    SetTheme(Resource.Style.TrajetTramTheme_nightMode);
                }
                else
                {
                    SetTheme(Resource.Style.TrajetTramTheme_dayMode);
                }

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

                m_toolbar                     = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.dashboardActivity_toolbar);
                m_drawerLayout                = FindViewById <DrawerLayout>(Resource.Id.dashboardActivity_drawerlayout);
                m_navigationView              = FindViewById <NavigationView>(Resource.Id.dashboardActivity_navigationView);
                m_FAB                         = FindViewById <FloatingActionButton>(Resource.Id.dashboardActivity_FAB);
                m_textviewToolbarTitle        = FindViewById <TextView>(Resource.Id.dashboardActivity_toolbar_textviewTitle);
                m_layouttrajetNumber          = FindViewById <LinearLayout>(Resource.Id.dashboardActivity_layout_trajetNumber);
                m_layoutCalendar              = FindViewById <LinearLayout>(Resource.Id.dashboardActivity_layout_calendar);
                m_edittexttrajetNumber        = FindViewById <TextInputEditText>(Resource.Id.dashboardActivity_textInputEditText_trajetNumber);
                m_edittextCalendar            = FindViewById <TextInputEditText>(Resource.Id.dashboardActivity_textInputEditText_calendar);
                m_textinputlayouttrajetNumber = FindViewById <TextInputLayout>(Resource.Id.dashboardActivity_textInputLayout_trajetNumber);
                m_textinputlayoutCalendar     = FindViewById <TextInputLayout>(Resource.Id.dashboardActivity_textInputLayout_calendar);
                m_frameLayout                 = FindViewById <FrameLayout>(Resource.Id.dashboardActivity_frameLayout);

                //Navigation view
                m_navigationView.NavigationItemSelected += M_navigationView_NavigationItemSelected;
                ConfigureNavigationViewHeader();

                //Actionbar
                SetSupportActionBar(m_toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                //FAB action
                m_FAB.Click += M_FAB_Click;

                //Choose date action
                m_edittextCalendar.FocusChange += M_edittextCalendar_FocusChange;
                m_edittextCalendar.Click       += M_edittextCalendar_Click;

                UpdateUIToShowListOrCreateNewtrajet();

                //Error management for EditText during trajet creation
                m_edittextCalendar.TextChanged     += M_edittextCalendar_TextChanged;
                m_edittexttrajetNumber.TextChanged += M_edittexttrajetNumber_TextChanged;

                //Init Light Sensor Manager
                DynamicUIBuild_Utils.InitLightSensorManagers(this, out m_sensorManager, out m_sensorListener);
            }
            catch (Exception e)
            {
                MobileCenter_Helper.ReportError(new FileAccessManager(), e, GetType().Name, MethodBase.GetCurrentMethod().Name);
            }
        }