Esempio n. 1
0
        private void FillGoodKoan()
        {
            // clear current koan
            m_pImageRowGood.RemoveAllViews();
            m_pGoodKoan.SetBackgroundColor(Android.Graphics.Color.DarkGray);

            string sKoan = "T" + m_pGoodKoan.Text;

            // get the list of pieces and for each one insert the image into the layout
            List <string> lPieces = Master.GetPieceParts(sKoan);

            foreach (string sPiece in lPieces)
            {
                int iRes = Master.GetPieceImage(sPiece);
                if (iRes == 0)
                {
                    m_pGoodKoan.SetBackgroundColor(Android.Graphics.Color.Red);
                    continue;
                }

                ImageView pView = new ImageView(this);
                pView.SetImageResource(iRes);
                m_pImageRowGood.AddView(pView);
            }
        }
        private void FillKoan()
        {
            m_pKoanDisplay.RemoveAllViews();
            m_pKoanTextEditor.SetBackgroundColor(Android.Graphics.Color.DarkGray);

            string sKoan  = m_pKoanTextEditor.Text;
            bool   bValid = Master.FillKoanDisplay(this, m_pKoanDisplay, sKoan.ToUpper());

            if (!bValid)
            {
                m_pKoanTextEditor.SetBackgroundColor(Android.Graphics.Color.Red);
            }

            // get list of pieces and insert image into layout for each one

            /*List<string> lPieces = Master.GetPieceParts(sKoan);
             * foreach (string sPiece in lPieces)
             * {
             *      int iRes = Master.GetPieceImage(sPiece);
             *      if (iRes == 0)
             *      {
             *              m_pKoanTextEditor.SetBackgroundColor(Android.Graphics.Color.Red);
             *              continue;
             *      }
             *
             *      ImageView pView = new ImageView(this);
             *      pView.SetImageResource(iRes);
             *      m_pKoanDisplay.AddView(pView);
             * }*/
        }
        private void Utils_OnColorPickerChanged(Android.Graphics.Color colorPicked)
        {
            string colorStr = colorPicked.ToArgb().ToString();


            txtDetailsDescription.SetBackgroundColor(colorPicked);
            txtDetailsDescription.DrawingCacheBackgroundColor = colorPicked;
        }
Esempio n. 4
0
        private void client_UploadValuesCompleted2(object sender, UploadValuesCompletedEventArgs e)
        {
            //lDialog.View.FindFocus();
            //color to sign wrong wrote filed
            Color colorWrong   = Color.ParseColor("#FFCDD2");           //red
            Color colorGood    = Color.ParseColor("#ffffff");           //white
            Color colorAllGood = Color.ParseColor("#64FFDA");           //Green

            try
            {
                //login
                EditText    mtxtusername = signInDialog.View.FindViewById <EditText>(Resource.Id.txtLogin);
                EditText    mtxtpassword = signInDialog.View.FindViewById <EditText>(Resource.Id.txtPassowrd);
                RadioButton rbRememberMe = signInDialog.View.FindViewById <RadioButton>(Resource.Id.rb_rememberMe);

                string result = System.Text.Encoding.UTF8.GetString(e.Result);

                if (result.Contains("Wrong data") && mtxtpassword.Length() < 1)
                {
                    //nie działa czemu ?:(
                    Toast.MakeText(ApplicationContext, GetString(Resource.String.AllfieldsmustBefilledIn), ToastLength.Long).Show();
                    mtxtusername.SetBackgroundColor(colorWrong);
                    mtxtpassword.SetBackgroundColor(colorWrong);
                }
                else if (result.Contains("Wrong data") && !(mtxtpassword.Length() > 1))
                {
                    Toast.MakeText(ApplicationContext, GetString(Resource.String.AllfieldsmustBefilledIn), ToastLength.Long).Show();
                    mtxtusername.SetBackgroundColor(colorWrong);
                    mtxtpassword.SetBackgroundColor(colorWrong);
                }
                else
                {
                    mtxtusername.SetBackgroundColor(colorGood);
                    mtxtpassword.SetBackgroundColor(colorGood);
                }
                if (result.Contains("Success"))
                {
                    Toast.MakeText(ApplicationContext, GetString(Resource.String.logInSuccess), ToastLength.Long).Show();
                    mtxtusername.SetBackgroundColor(colorAllGood);
                    mtxtpassword.SetBackgroundColor(colorAllGood);

                    mProgressBar.Visibility = Android.Views.ViewStates.Visible;
                    LogInModule lg = new LogInModule();
                    lg.AddUserParams(mtxtusername.ToString(), mtxtpassword.ToString(), rbRememberMe.Checked);
                    lg.saveLoginData();
                    //don't knwo why colors not set at #64FFDA after all good field
                    Thread.Sleep(1000);
                    signInDialog.Dismiss();
                    Thread thread = new Thread(logInSuccessProcess);
                    thread.Start();
                }
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.ToString());
            }
        }
Esempio n. 5
0
        // TRG ボタン押した時
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    if (carLabelInputMode == false) // 出荷ラベル
                    {
                        // 出荷ラベル確認処理
                        Thread.Sleep(1500);

                        Dictionary <string, string> param = GetProcParam(barcodeData.Data);
                        try
                        {
                            MTumikomiProc result = WebService.CallTumiKomiProc(kansen_kbn == "0" ? "060" : "310", param);

                            if (result.poMsg != "")
                            {
                                ShowDialog("エラー", result.poMsg, () => { });
                                return;
                            }

                            matehan     = result.poMatehan;
                            etKosu.Text = result.poKosuCnt;

                            //	正常登録
                            carLabelInputMode   = true;
                            _IdouButton.Enabled = false;
                            etCarLabel.SetBackgroundColor(Android.Graphics.Color.Yellow);
                            etKosu.SetBackgroundColor(Android.Graphics.Color.White);
                        }
                        catch
                        {
                            ShowDialog("エラー", "更新出来ませんでした。\n再度商品をスキャンして下さい。", () => { });
                            return;
                        }
                    }
                    else // 車両ラベル
                    {
                        // 作業ステータス更新・積込処理
                        etCarLabel.Text = barcodeData.Data;
                        UpdateSagyoStatus(barcodeData.Data);
                    }
                });
            }
        }
Esempio n. 6
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            cs = new ClientSocket(this);

            _smsSentBroadcastReceiver = new SMSSentReceiver();
            _smsDeliveredBroadcastReceiver = new SMSDeliveredReceiver();
            _smsSentBroadcastReceiver.sentErrorReSendEvent += reSend;
            _smsDeliveredBroadcastReceiver.deliverErrorReSendEvent += reSend;

            ipText = FindViewById<EditText>(Resource.Id.IPText);
            connectButton = FindViewById<ImageButton>(Resource.Id.connectImageButton);

            connectButton.Click += delegate
            {
                if (ipText.Text != "") {
                    cs.Connect(ipText.Text);
                }
                else {
                    ipText.SetBackgroundColor(Android.Graphics.Color.Red);
                    ipText.Error = "Enter IP address!";
                }
            };
        }
Esempio n. 7
0
    protected override void OnCreate(Bundle b)
    {
        base.OnCreate(b);

        TextView Tekst;

        Tekst          = new TextView(this);
        Tekst.Text     = "Hoe heet je?";
        Tekst.TextSize = 30;
        Tekst.SetBackgroundColor(Color.White);
        Tekst.SetTextColor(Color.Green);

        Edit          = new EditText(this);
        Edit.TextSize = 40;
        Edit.SetBackgroundColor(Color.Black);
        Edit.SetTextColor(Color.White);

        Knop          = new Button(this);
        Knop.Text     = "Bevestig";
        Knop.TextSize = 40;
        Knop.Click   += klik;

        LinearLayout stapel;

        stapel             = new LinearLayout(this);
        stapel.Orientation = Orientation.Vertical;

        stapel.AddView(Tekst);
        stapel.AddView(Edit);
        stapel.AddView(Knop);

        this.SetContentView(stapel);
    }
Esempio n. 8
0
        protected override void OnElementChanged(ElementChangedEventArgs <SearchBar> e)
        {
            base.OnElementChanged(e);
            if (Control != null)
            {
                Control.SetBackgroundColor(G.Color.Rgb(255, 255, 255));
            }
            SearchView searchView = (Control as SearchView);

            searchView.SetInputType(InputTypes.ClassText | InputTypes.TextVariationNormal);

            int      textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
            EditText textView   = (searchView.FindViewById(textViewId) as EditText);

            // Set custom colors
            textView.SetBackgroundColor(G.Color.Rgb(255, 255, 255));
            textView.SetTextColor(G.Color.Rgb(0, 0, 0));
            textView.SetHintTextColor(G.Color.Rgb(128, 128, 128));

            // Customize frame color
            int frameId = searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null);

            Android.Views.View frameView = (searchView.FindViewById(frameId) as Android.Views.View);
            frameView.SetBackgroundColor(G.Color.Rgb(255, 255, 255));
        }
        /// <summary>
        /// Sets the background color to the edit text view, according to entered value.
        /// </summary>
        private void ColorEdtiText_TextChanged(object sender, EventArgs e)
        {
            // get edit text view
            EditText colorEditText = (EditText)sender;

            try
            {
                // get color
                Color backgroundColor = Color.ParseColor(colorEditText.Text);
                // set background color
                colorEditText.SetBackgroundColor(backgroundColor);

                // get RGB average value
                double rgbAverage = (backgroundColor.R + backgroundColor.G + backgroundColor.B) / 3.0;
                if (rgbAverage > 128)
                {
                    // set font color
                    colorEditText.SetTextColor(Color.Black);
                }
                else
                {
                    // set font color
                    colorEditText.SetTextColor(Color.White);
                }
            }
            catch
            { }
        }
Esempio n. 10
0
        protected override void OnElementChanged(ElementChangedEventArgs <SearchBar> args)
        {
            base.OnElementChanged(args);
            // Get native control (background set in shared code, but can use SetBackgroundColor here)
            SearchView searchView = (base.Control as SearchView);

            searchView.SetInputType(InputTypes.ClassText | InputTypes.TextVariationNormal);
            if (Settings.TapjackProtectionSearch)
            {
                searchView.FilterTouchesWhenObscured = true;
            }

            // Access search textview within control
            int      textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
            EditText textView   = (searchView.FindViewById(textViewId) as EditText);

            if (args.NewElement.FontFamily == null)
            {
                args.NewElement.FontFamily = CloudStreamForms.Settings.CurrentFont.FontStyle;
            }
            // Set custom colors
            // textView.SetBackgroundColor(G.Color.Rgb(25, 25, 25));
            int color = Settings.BlackColor - 5;

            if (color < 0)
            {
                color = -color * 2;
            }
            textView.SetBackgroundColor(G.Color.Rgb(color, color, color));//Settings.BlackBg ? G.Color.Rgb(12, 12, 12) : G.Color.Rgb(25, 25, 25));

            textView.SetHintTextColor(G.Color.Rgb(64, 64, 64));
            textView.SetTextColor(G.Color.Rgb(200, 200, 200));

            /*
             * textView.SetTextColor(G.Color.Rgb(32, 32, 32));
             * textView.SetHintTextColor(G.Color.Rgb(128, 128, 128));*/


            // Customize frame color
            int frameId = searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null);

            Android.Views.View frameView = (searchView.FindViewById(frameId) as Android.Views.View);
            frameView.SetBackgroundColor(G.Color.Transparent);//G.Color.ParseColor(CloudStreamForms.Settings.MainBackgroundColor));


            var searchIconId = searchView.Resources.GetIdentifier("android:id/search_mag_icon", null, null);

            if (searchIconId > 0)
            {
                var searchPlateIcon = searchView.FindViewById(searchIconId);
                searchPlateIcon.ScaleX       = 0.75f;
                searchPlateIcon.ScaleY       = 0.75f;
                searchPlateIcon.TranslationX = -5;

                (searchPlateIcon as ImageView).SetImageDrawable(context.GetDrawable(Resource.Drawable.MainSearchIcon));
                (searchPlateIcon as ImageView).SetColorFilter(G.Color.Rgb(190, 190, 190));
            }
        }
Esempio n. 11
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView (inflater, container, savedInstanceState);

            var view = inflater.Inflate (Resource.Layout.QuoteLayout, container, false);

            quoteLocation = view.FindViewById<EditText> (Resource.Id.quoteLocation);
            quoteModel = view.FindViewById<EditText> (Resource.Id.quoteModel);
            quotePrice = view.FindViewById<EditText> (Resource.Id.quotePrice);
            quotePosition = view.FindViewById<EditText> (Resource.Id.quotePosition);
            quoteButton = view.FindViewById<Button> (Resource.Id.quoteButton);

            quoteLocation.Text = location;
            quoteModel.Text = model;

            quotePrice.RequestFocus ();

            quoteButton.Click += delegate {

                double price;
                bool isDouble = Double.TryParse(quotePrice.Text, out price);
                if(isDouble) {
                    if (price > minPrice) {
                        if (price < minPrice * 1.6) {

                            position = quotePosition.Text;

                            if (position.Length < 15) {
                                Thread thread = new Thread(() => { Database.quote(location, model, quotePrice.Text, position); });
                                thread.Start();
                            }
                            else {
                                Thread thread = new Thread(() => { Database.quote(location, model, quotePrice.Text, ""); });
                                thread.Start();
                            }
                        }
                        quotePrice.SetBackgroundColor(Android.Graphics.Color.Lime);

                        Toast.MakeText(Application.Context, "成功報價!更新中...", ToastLength.Short).Show();

                        var activity = (MainActivity)Activity;

                        Thread thread2 = new Thread(() => { activity.FragmentManager.PopBackStack(); Thread.Sleep(1000); activity.updateGUI(Database.select(location));
                            activity.RunOnUiThread(() => {
                                Toast.MakeText(Application.Context, "更新成功!", ToastLength.Short).Show();
                            });
                        });
                        thread2.Start();

                    }
                    else { quotePrice.SetBackgroundColor(Android.Graphics.Color.Red); quotePrice.Error = "有幾多我同你買幾多!"; }
                }
                else { quotePrice.SetBackgroundColor(Android.Graphics.Color.Red); quotePrice.Error = "Enter number!"; }

            };

            return view;
        }
Esempio n. 12
0
        private void client_UploadValuesCompleted(object sender, UploadValuesCompletedEventArgs e)
        {
            //lDialog.View.FindFocus();

            //Android.Views.View sign = sign.viewsFindViewById<Android.Views.View>(Resource.Layout.dialog_sign_in);
            try
            {
                //login
                EditText    mtxtusername = lDialog.View.FindViewById <EditText>(Resource.Id.txtLogin);
                EditText    mtxtpassword = lDialog.View.FindViewById <EditText>(Resource.Id.txtPassowrd);
                RadioButton rbRememberMe = lDialog.View.FindViewById <RadioButton>(Resource.Id.rb_rememberMe);

                string result = System.Text.Encoding.UTF8.GetString(e.Result);

                if (result.Contains("Wrong data"))
                {
                    //nie działa czemu ?:(
                    //Toast.MakeText(ApplicationContext, GetString(Resource.String.AllfieldsmustBefilledIn), ToastLength.Long).Show();
                    mtxtusername.SetBackgroundColor(colorWrong);
                    mtxtpassword.SetBackgroundColor(colorWrong);
                }
                else
                {
                    mtxtusername.SetBackgroundColor(colorGood);
                    mtxtpassword.SetBackgroundColor(colorGood);
                }


                //at least
                if (result.Contains("Success"))
                {
                    //Toast.MakeText(ApplicationContext, GetString(Resource.String.AccountWasCreated), ToastLength.Long).Show();
                    mtxtusername.SetBackgroundColor(colorAllGood);
                    mtxtpassword.SetBackgroundColor(colorAllGood);

                    //don't knwo why colors not set at #64FFDA after all good field
                    Thread.Sleep(1000);
                    lDialog.Dismiss();
                }
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.ToString());
            }
        }
Esempio n. 13
0
 private void SetBorder(ref EditText control, BorderType borderType)
 {
     switch (borderType)
     {
     case BorderType.None:
         control.SetBackgroundColor(Android.Graphics.Color.Transparent);
         break;
     }
 }
Esempio n. 14
0
        private bool _valideazaEmail(string _email)
        {
            _email = emailEdit.Text;
            var _valid = _esteEmailValid(_email);

            if (_valid && _email != "")
            {
                emailEdit.SetTextColor(Color.DarkGreen);
                emailEdit.SetBackgroundColor(Color.White);
                emailEdit.SetBackgroundResource(Resource.Drawable.StyleEditText);
                return(true);
            }
            else
            {
                emailEdit.SetTextColor(Color.Black);
                emailEdit.SetBackgroundColor(Color.IndianRed);
                return(false);
            }
        }
Esempio n. 15
0
 public static void RemoveBottomLine(this EditText control)
 {
     try
     {
         control?.SetBackgroundColor(Color.Transparent);
     }
     catch
     {
     }
 }
Esempio n. 16
0
        private void SetTxtAmountReceived()
        {
            int characterCount = mEtAmountReceived.Text.Count();

            TOTAL_SALE_AMOUNT_TEXT_SIZE_SP = characterCount > 13 ? 35 : 50;
            mEtAmountReceived.SetTextSize(Android.Util.ComplexUnitType.Sp, TOTAL_SALE_AMOUNT_TEXT_SIZE_SP);
            mEtAmountReceived.InputType = Android.Text.InputTypes.Null;
            mEtAmountReceived.SetSelection(mEtAmountReceived.Text.Length);
            mEtAmountReceived.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(MAX_AMOUNT_RECEIVED_LENGTH) });//set max length
            mEtAmountReceived.SetBackgroundColor(ColorHelper.ResourceIdToColor(Android.Resource.Color.Transparent, this));
        }
        protected override void OnElementChanged(ElementChangedEventArgs <SearchBar> args)
        {
            base.OnElementChanged(args);
            // Get native control (background set in shared code, but can use SetBackgroundColor here)
            SearchView searchView = (base.Control as SearchView);

            searchView.SetInputType(InputTypes.ClassText | InputTypes.TextVariationNormal);

            // Access search textview within control
            int      textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
            EditText textView   = (searchView.FindViewById(textViewId) as EditText);

            // Set custom colors
            // textView.SetBackgroundColor(G.Color.Rgb(25, 25, 25));
            textView.SetBackgroundColor(Settings.BlackBg ? G.Color.Rgb(12, 12, 12) : G.Color.Rgb(25, 25, 25));

            textView.SetHintTextColor(G.Color.Rgb(64, 64, 64));
            textView.SetTextColor(G.Color.Rgb(200, 200, 200));

            /*
             * textView.SetTextColor(G.Color.Rgb(32, 32, 32));
             * textView.SetHintTextColor(G.Color.Rgb(128, 128, 128));*/


            // Customize frame color
            int frameId = searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null);

            Android.Views.View frameView = (searchView.FindViewById(frameId) as Android.Views.View);
            frameView.SetBackgroundColor(G.Color.ParseColor(CloudStreamForms.Settings.MainBackgroundColor));
            //frameView.SetBackgroundColor(G.Color.Rgb(96, 96, 96));

            /*
             * // Get native control (background set in shared code, but can use SetBackgroundColor here)
             * SearchView searchView = (base.Control as SearchView);
             * //  searchView.SetBackgroundColor(new G.Color() { A = 1, R = 1, B = 255, G = 1 });
             * searchView.SetInputType(InputTypes.ClassText | InputTypes.TextVariationNormal);
             *
             * // Access search textview within control
             * int textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
             * EditText textView = (searchView.FindViewById(textViewId) as EditText);
             *
             * // Set custom colors
             * //textView.SetBackgroundColor(G.Color.Rgb(225, 225, 225));
             * textView.SetHintTextColor(G.Color.Rgb(64, 64, 64));
             * textView.SetTextColor(G.Color.Rgb(200, 200, 200));
             * textView.SetBackgroundColor(new G.Color() { A = 1, R = 1, B = 255, G = 1 });
             *
             *
             * // Customize frame color
             * int frameId = searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null);
             * Android.Views.View frameView = (searchView.FindViewById(frameId) as Android.Views.View);
             * Main.print(CloudStreamForms.Settings.MainBackgroundColor);
             * //  frameView.SetBackgroundColor(G.Color.ParseColor(CloudStreamForms.Settings.MainBackgroundColor));*/
        }
Esempio n. 18
0
        private bool _valideazaParola(string _parol)
        {
            const string _parola = @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,50}$";

            _parol = passEdit.Text;
            bool _valid = false;

            if (_valid = Regex.IsMatch(_parol, _parola) && _parol != "")
            {
                passEdit.SetTextColor(Color.DarkGreen);
                passEdit.SetBackgroundColor(Color.White);
                passEdit.SetBackgroundResource(Resource.Drawable.StyleEditText);
                return(true);
            }
            else
            {
                passEdit.SetTextColor(Color.Black);
                passEdit.SetBackgroundColor(Color.IndianRed);
                return(false);
            }
        }
Esempio n. 19
0
        private bool _valideazaUsername(string _user)
        {
            const string _username = @"^[A-Za-z]+$";

            _user = userEdit.Text;
            bool _valid = false;

            if (_valid = Regex.IsMatch(_user, _username) && _user != "")
            {
                userEdit.SetTextColor(Color.DarkGreen);
                userEdit.SetBackgroundColor(Color.White);
                userEdit.SetBackgroundResource(Resource.Drawable.StyleEditText);
                return(true);
            }
            else
            {
                userEdit.SetTextColor(Color.Black);
                userEdit.SetBackgroundColor(Color.IndianRed);
                return(false);
            }
        }
Esempio n. 20
0
        void singInDialog_mOnSingInComplete(object sender, OnSignInEvenArgs e)
        {
            EditText    mtxtusername = signInDialog.View.FindViewById <EditText>(Resource.Id.txtLogin);
            EditText    mtxtpassword = signInDialog.View.FindViewById <EditText>(Resource.Id.txtPassowrd);
            RadioButton rbRememberMe = signInDialog.View.FindViewById <RadioButton>(Resource.Id.rb_rememberMe);

            LogInModule lg = new LogInModule();

            lg.AddUserParams(mtxtusername.Text.ToString(), mtxtpassword.Text.ToString(), rbRememberMe.Checked);
            //login

            string txtpasswd = mtxtpassword.Text;
            string txtname   = mtxtusername.Text;

            // set color if someting wrong
            if (txtname.Count() < 1 && txtpasswd.Count() < 1)
            {
                mtxtusername.SetBackgroundColor(lg.colorWrong);
                mtxtpassword.SetBackgroundColor(lg.colorWrong);
                Toast.MakeText(ApplicationContext, GetString(Resource.String.AllfieldsmustBefilledIn), ToastLength.Long).Show();
            }
            else if (txtname.Count() < 1)
            {
                mtxtusername.SetBackgroundColor(lg.colorWrong);
                mtxtpassword.SetBackgroundColor(lg.colorGood);
                Toast.MakeText(ApplicationContext, GetString(Resource.String.NeedLogin), ToastLength.Long).Show();
            }
            else if (txtpasswd.Count() < 1)
            {
                mtxtpassword.SetBackgroundColor(lg.colorWrong);
                mtxtusername.SetBackgroundColor(lg.colorGood);
                Toast.MakeText(ApplicationContext, GetString(Resource.String.NeedPassword), ToastLength.Long).Show();
            }
            else
            {
                mtxtusername.SetBackgroundColor(lg.colorGood);
                mtxtpassword.SetBackgroundColor(lg.colorGood);
                logiInRequest(txtname, txtpasswd);
            }
        }
Esempio n. 21
0
        void cambiarColorControles(string color, Color color1)
        {
            //Colores del layout
            nuevaNota.SetBackgroundColor(color1);
            nuevaNotaLinear.SetBackgroundColor(color1);
            linearTituloNota.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
            //Colores de los Linear y Toolbar
            colorBackground = new ColorDrawable(Color.ParseColor(color));
            ActionBar.SetBackgroundDrawable(colorBackground);

            //Cambiar el color de la barra de estado
            Window.SetStatusBarColor(Android.Graphics.Color.ParseColor(color));
        }
Esempio n. 22
0
        private int ValidateInputFromScoreEditText(EditText editText)
        {
            var input = int.Parse(string.IsNullOrEmpty(editText.Text)
                    ? "0"
                    : editText.Text);

            if (input < 0 || input > 27)
            {
                editText.SetBackgroundColor(_invalidScoreColour);
            }

            return(input);
        }
Esempio n. 23
0
 private void setBackground(string color, bool selected)
 {
     Lenght.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     Lenght.Enabled = selected;
     Width.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     Width.Enabled = selected;
     Weight.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     Weight.Enabled = selected;
     Height.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     Height.Enabled   = selected;
     isDanger.Enabled = selected;
     isDanger.SetTextColor(Android.Graphics.Color.ParseColor(color));
 }
Esempio n. 24
0
 private void InitializeVariables()
 {
     this.ActionBar.SetBackgroundDrawable (Resources.GetDrawable (Resource.Drawable.Black));
     this.ActionBar.SetTitle (Resource.String.application);
     loginButton = FindViewById<Button> (Resource.Id.logInButton);
     username = FindViewById<EditText> (Resource.Id.usernameEntry);
     password = FindViewById<EditText> (Resource.Id.passwordEntry);
     username.SetBackgroundColor (Android.Graphics.Color.Orange);
     username.SetTextColor (Android.Graphics.Color.White);
     username.SetHintTextColor (Android.Graphics.Color.White);
     password.SetBackgroundColor (Android.Graphics.Color.Orange);
     password.SetTextColor (Android.Graphics.Color.White);
     password.SetHintTextColor (Android.Graphics.Color.White);
 }
Esempio n. 25
0
 public void OnLocationChanged(Location location)
 {
     currentLocation = location;
     if (currentLocation == null)
     {
         TrackingScan.SetBackgroundColor(Android.Graphics.Color.LightPink);
         coordinates.Text = "No GPS fix yet ";
         //Error Message
     }
     else
     {
         coordinates.Text = "Lat:" + currentLocation.Latitude.ToString(("#.00000")) + " / Long:" + currentLocation.Longitude.ToString(("#.00000"));
     }
 }
        private void FillKoan()
        {
            m_pKoanDisplay.RemoveAllViews();
            m_pKoanTextEditor.SetBackgroundColor(Android.Graphics.Color.DarkGray);

            string sKoan = m_pKoanTextEditor.Text;

            // get list of pieces and insert image into layout for each one
            List <string> lPieces = Master.GetPieceParts(sKoan);

            foreach (string sPiece in lPieces)
            {
                int iRes = Master.GetPieceImage(sPiece);
                if (iRes == 0)
                {
                    m_pKoanTextEditor.SetBackgroundColor(Android.Graphics.Color.Red);
                    continue;
                }

                ImageView pView = new ImageView(this);
                pView.SetImageResource(iRes);
                m_pKoanDisplay.AddView(pView);
            }
        }
Esempio n. 27
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view   = inflater.Inflate(Resource.Layout.fragment_tsumikomi_work, container, false);
            prefs  = PreferenceManager.GetDefaultSharedPreferences(Context);
            editor = prefs.Edit();

            SetTitle("積込検品");

            view.FindViewById <TextView>(Resource.Id.txt_tsumikomiWork_tokuisakiNm).Text = prefs.GetString("tokuisaki_nm", "");
            etKosu     = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_kosu);
            etCarLabel = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_carLabel);
            etCarry    = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_carry);
            etKargo    = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_kargoCar);
            etCard     = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_card);
            etBara     = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_bara);
            etSonata   = view.FindViewById <EditText>(Resource.Id.et_tsumikomiWork_sonota);

            _CompleteButton         = view.FindViewById <BootstrapButton>(Resource.Id.completeButton);
            _CompleteButton.Click  += delegate { StartFragment(FragmentManager, typeof(TsumikomiPassFragment)); };
            _CompleteButton.Enabled = false;

            _IdouButton        = view.FindViewById <BootstrapButton>(Resource.Id.idouButton);
            _IdouButton.Click += delegate { StartFragment(FragmentManager, typeof(TsumikomiIdouMenuFragment)); };

            souko_cd      = prefs.GetString("souko_cd", "");
            kitaku_cd     = prefs.GetString("kitaku_cd", "");
            syuka_date    = prefs.GetString("syuka_date", "");
            tokuisaki_cd  = prefs.GetString("tokuisaki_cd", "");
            todokesaki_cd = prefs.GetString("todokesaki_cd", "");
            bin_no        = prefs.GetString("bin_no", "");
            course        = prefs.GetString("course", "");

            zoubin_flg = prefs.GetInt("zoubin_flg", 1);
            kansen_kbn = prefs.GetString("kansen_kbn", "1");

            etKosu.SetBackgroundColor(Android.Graphics.Color.Yellow);

            if (zoubin_flg == 1)
            {
                GetTenpoMatehanInfo();  // 作業5, 6 定番コース단골코스(zoubin_flg = 1)
            }
            else
            {
                GetCountSouko(); // 作業7, 8 増便コース증편코스(zoubin_flg >= 2)
            }

            return(view);
        }
Esempio n. 28
0
 private void UpdateLineColor()
 {
     try
     {
         if (control != null)
         {
             var color = LineColorEffect.GetLineColor(Element).ToAndroid();
             control.Background.SetColorFilter(color, Android.Graphics.PorterDuff.Mode.SrcAtop);
             control.SetBackgroundColor(color);
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
Esempio n. 29
0
 private void editableEditTexts(string color, bool value)
 {
     name.FocusableInTouchMode = value;
     name.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     lastName.FocusableInTouchMode = value;
     lastName.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     passsportNumber.FocusableInTouchMode = value;
     passsportNumber.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     nationality.FocusableInTouchMode = value;
     nationality.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     city.FocusableInTouchMode = value;
     city.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     street.FocusableInTouchMode = value;
     street.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
     postCode.FocusableInTouchMode = value;
     postCode.SetBackgroundColor(Android.Graphics.Color.ParseColor(color));
 }
        public GeocodingView(Context context) : base(context)
        {
            Field = new EditText(context);
            Field.SetTextColor(Color.White);
            Field.SetBackgroundColor(Colors.DarkTransparentNavy);
            AddView(Field);

            ResultTable = new ListView(context);
            ResultTable.SetBackgroundColor(Colors.LightTransparentNavy);
            AddView(ResultTable);

            Adapter             = new ResultTableAdapter(context);
            ResultTable.Adapter = Adapter;

            Frame = new CGRect(0, 0, Metrics.WidthPixels, UsableHeight);

            HideTable();
        }
Esempio n. 31
0
        protected override Android.Views.View CreateCellEditor(GridRow row)
        {
            if (DataType == typeof(DateTime))
            {
                var original = (DateTime)GetCellValue(GridCellType.Cell, row);
                var entry    = new EditText(Grid.Context);
                entry.Focusable = false;                                         //Avoids keyboard from appearing.
                entry.SetPadding((int)Grid.CellPadding.Left, (int)Grid.CellPadding.Top, (int)Grid.CellPadding.Right, (int)Grid.CellPadding.Bottom);
                entry.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 14); //This matches the default TextView.FontSize
                entry.Text = original.ToString(Format);
                entry.SetBackgroundColor(Grid.EditorBackgroundColor.Value);
                entry.SetTextColor(Grid.EditorTextColor.Value);

                Dialog dialog;
                if (Mode == GridDateTimeColumnMode.Date)
                {
                    dialog = new DatePickerDialog(Grid.Context, new EventHandler <DatePickerDialog.DateSetEventArgs>((s, e) =>
                    {
                        entry.Text = new DateTime(e.Year, e.Month + 1, e.DayOfMonth, original.Hour, original.Minute, original.Second).ToString(Format);
                        Grid.FinishEditing();
                    }), original.Year, original.Month - 1, original.Day);
                }
                else
                {
                    dialog = new TimePickerDialog(Grid.Context, new EventHandler <TimePickerDialog.TimeSetEventArgs>((s, e) =>
                    {
                        entry.Text = new DateTime(original.Year, original.Month, original.Day, e.HourOfDay, e.Minute, 0).ToString(Format);
                        Grid.FinishEditing();
                    }), original.Hour, original.Minute, DateFormat.Is24HourFormat(Grid.Context));
                }
                dialog.CancelEvent += (s, e) =>
                {
                    Grid.FinishEditing();
                };
                dialog.Show();

                return(entry);
            }
            else
            {
                return(base.CreateCellEditor(row));
            }
        }
Esempio n. 32
0
        private void DisplayInfo(Node node)
        {
            AlertDialog.Builder alertBuilder = new AlertDialog.Builder(diagram.Context);
            var      employee = (node.Content as DiagramEmployee);
            EditText editText = new EditText(diagram.Context);

            editText.Text = "Name : " + employee.Name + "\n\n" + "Designation : " + employee.Designation + "\n\n" + "ID : " + employee.ID + "\n\n" + "DOJ : " + employee.DOJ;
            editText.SetBackgroundColor(Color.WhiteSmoke);
            editText.SetTextColor(Color.Black);
            editText.Enabled = false;
            alertBuilder.SetView(editText);
            alertBuilder.SetCancelable(false);

            alertBuilder.SetPositiveButton("OK", (senderAlert, args) =>
            {
                diagram.NodeClicked += Diagram_NodeClicked;
            });
            alertBuilder.Show();
        }
        private void FindViews()
        {
            txtid_Codigo    = FindViewById <EditText>(Resource.Id.txtCodigoPedido);
            spinnerClientes = FindViewById <Spinner>(Resource.Id.spinnerIdCliente);
            txtDataEmissao  = FindViewById <EditText>(Resource.Id.txtDataEmissao);
            txtValor_Total  = FindViewById <TextView>(Resource.Id.txtValorTotal);
            txtMsgPedido    = FindViewById <EditText>(Resource.Id.txtMsgPedido);
            txtMsgNF        = FindViewById <EditText>(Resource.Id.txtMsgNF);
            lblStatusPedido = FindViewById <TextView>(Resource.Id.lblStatusPedido);
            txtStatusPedido = FindViewById <TextView>(Resource.Id.txtStatusPedido);
            btnAdicionar    = FindViewById <Button>(Resource.Id.btnAdicionar);
            btnItensPedido  = FindViewById <Button>(Resource.Id.btnItensPedido);
            btnGerarPDF     = FindViewById <Button>(Resource.Id.btnGerarPDF);
            btnFinalizar    = FindViewById <Button>(Resource.Id.btnFinalizar);

            txtDataEmissao.SetBackgroundColor(Android.Graphics.Color.LightGray);

            spinnerClientes.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(TblClientes_ItemSelected);
        }
        public void AddFixedText(string text)
        {
            EditText fixedText = new EditText(Context);
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            layoutParams.Gravity = GravityFlags.CenterVertical;
            fixedText.SetTextAppearance(Context, Resource.Style.judo_payments_CardText);
            fixedText.LayoutParameters = layoutParams;
            fixedText.Enabled = false;
            fixedText.Focusable = false;
            fixedText.Text = text;
            fixedText.SetBackgroundColor(Resources.GetColor(Android.Resource.Color.Transparent));
            fixedText.SetPadding(0,0,0,0);
            Typeface type = Typefaces.LoadTypefaceFromRaw(Context, Resource.Raw.courier);
            fixedText.Typeface = type;

            if (linearLayout.ChildCount > 1)
            {
                linearLayout.RemoveViewAt(0);
            }
            linearLayout.AddView(fixedText, 0);
        }
        private void Init()
        {
            base.RemoveAllViews();

            hintTextView = new EditText(Context);
            textTextView = new NoCursorMovingEditText(Context, BackKeyPressed);

            linearLayout = new LinearLayout(Context);
            linearLayout.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, (int)GetContainerHeight());

            textLayout = new RelativeLayout(Context);
            textLayout.LayoutParameters = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MatchParent, 1);
            textLayout.SetGravity(GravityFlags.Center);

            linearLayout.AddView(textLayout);

            textTextView.SetTextAppearance(Context, Resource.Style.judo_payments_CardText);
            hintTextView.SetTextAppearance(Context, Resource.Style.judo_payments_HintText);

            LayoutParams lp = new LayoutParams(LinearLayout.LayoutParams.MatchParent,
                LinearLayout.LayoutParams.WrapContent);
            lp.AddRule(LayoutRules.CenterVertical);

            hintTextView.LayoutParameters = lp;
            textTextView.LayoutParameters = lp;
            hintTextView.Enabled = false;
            hintTextView.Focusable = false;

            textTextView.InputType = InputTypes.ClassNumber | InputTypes.TextFlagNoSuggestions;
            hintTextView.InputType = InputTypes.ClassNumber | InputTypes.TextFlagNoSuggestions;

            hintTextView.SetBackgroundColor(Resources.GetColor(Android.Resource.Color.Transparent));
            textTextView.SetBackgroundColor(Resources.GetColor(Android.Resource.Color.Transparent));
            int horizontalPadding =
                Resources.GetDimensionPixelOffset(Resource.Dimension.backgroundhinttextview_horizontal_padding);
            hintTextView.SetPadding(horizontalPadding, 0 , horizontalPadding, 0);
            textTextView.SetPadding(horizontalPadding, 0, horizontalPadding, 0);

            textErrorView = new EditText(Context);
            RelativeLayout.LayoutParams errorLP = new RelativeLayout.LayoutParams(LayoutParams.MatchParent,
                LayoutParams.WrapContent);
            errorLP.AddRule(LayoutRules.CenterVertical);

            int margin = UiUtils.ToPixels(Context, 2);
            errorLP.SetMargins(margin, 0, margin, 0);

            textErrorView.LayoutParameters = errorLP;
            textErrorView.Enabled = false;
            textErrorView.Focusable = false;
            textErrorView.Visibility = ViewStates.Gone;
            textErrorView.SetBackgroundColor(Color.Red);
            int errorVerticalPadding =
                Context.Resources.GetDimensionPixelOffset(
                    Resource.Dimension.backgroundhinttextview_error_vertical_padding);
            textErrorView.SetPadding(horizontalPadding, errorVerticalPadding, horizontalPadding, errorVerticalPadding);
            textErrorView.Text = errorText;
            textErrorView.SetSingleLine(true);
            textErrorView.Gravity = GravityFlags.Center;
            textErrorView.SetTextAppearance(Context, Resource.Style.judo_payments_ErrorText);

            //set courier font
            Typeface type = Typefaces.LoadTypefaceFromRaw(Context, Resource.Raw.courier);
            //hintTextView.Typeface = type;
            hintTextView.SetTypeface(Typeface.Monospace, TypefaceStyle.Normal);
            //textTextView.Typeface = type;
            textTextView.SetTypeface(Typeface.Monospace, TypefaceStyle.Normal);
            textErrorView.Typeface = type;


            textLayout.AddView(hintTextView);
            textLayout.AddView(textTextView);

            AddView(linearLayout);

            IEnumerable<char> previousCharSequence;
            EventHandler<TextChangedEventArgs> beforeTextChanged = (sender, args) =>
                                                                    {
                                                                        previousCharSequence = args.Text;
                                                                    };

            EventHandler<TextChangedEventArgs> textChanged = (sender, args) =>
                                                            {
                                                                beforeTextSize = args.BeforeCount;
                                                            };

            EventHandler<AfterTextChangedEventArgs> afterTextChanged = null;

            
            Action<string> updateTextView = newText =>
            {
                textTextView.TextChanged -= textChanged;
                textTextView.BeforeTextChanged -= beforeTextChanged;
                textTextView.AfterTextChanged -= afterTextChanged;

                textTextView.Text = newText;

                textTextView.TextChanged += textChanged;
                textTextView.BeforeTextChanged += beforeTextChanged;
                textTextView.AfterTextChanged += afterTextChanged;
            };

            afterTextChanged = (sender, args) =>
            {
                var length = args.Editable.ToString().Length;
                var deleting = beforeTextSize == 1;

                if (deleting)
                {
                    nextMustBeDeleted = false;
                }
                else
                {
                    if (nextMustBeDeleted && length > 0)
                    {
                        updateTextView(args.Editable.SubSequence(0, length - 1));
                        UpdateHintTextForCurrentTextEntry();
                        return;
                    }
                }

                // If we are deleting (we've just removed a space char, so delete another char please:
                // Or if we've pressed space don't allow it!
                if ((deleting && skipCharsAtPositions.Contains(length)) ||
                    (length > 0 && IsCharInFilter(args.Editable.CharAt(length - 1)) &&
                     !skipCharsAtPositions.Contains(length - 1)))
                {
                    updateTextView(length == 0 ? "" : args.Editable.SubSequence(0, length - 1));
                    textTextView.SetSelection(length == 0 ? 0 : length - 1);
                    UpdateHintTextForCurrentTextEntry();
                    return;
                }

                // Adds a non numeric char at positions needed
                for (int i = 0; i < skipCharsAtPositions.Count; ++i)
                {
                    // We rescan all letters recursively to catch when a users pastes into the edittext
                    int charPosition = skipCharsAtPositions[i];
                    if (length > charPosition)
                    {
                        if (hintText[charPosition] != args.Editable.ToString()[charPosition])
                        {
                            updateTextView(args.Editable.SubSequence(0, charPosition) + "" + hintText[charPosition] +
                                           args.Editable.SubSequence(charPosition, args.Editable.Length()));
                            UpdateHintTextForCurrentTextEntry();
                            return;
                        }
                    }
                    else
                    {
                        if (length == charPosition)
                        {
                            updateTextView(textTextView.Text + "" + hintText[charPosition]);
                        }
                    }
                }

                UpdateHintTextForCurrentTextEntry();

                // We've got all the chars we need, fire off our listener
                if (length >= LengthToStartValidation())
                {
                    try
                    {
                        ValidateInput(args.Editable.ToString());
                        if (OnEntryComplete != null)
                        {
                            OnEntryComplete(args.Editable.ToString());
                        } 
                        return;
                    }
                    catch (Exception exception)
                    {
                        Log.Error(JudoSDKManager.DEBUG_TAG, exception.Message, exception);
                    }

                    ShowInvalid();
                }
                else
                {
                    if (OnProgress != null)
                    {
                        OnProgress(length);
                    }
                }
            };

            textTextView.BeforeTextChanged += beforeTextChanged;

            textTextView.TextChanged += textChanged;

            textTextView.AfterTextChanged += afterTextChanged;
        }
Esempio n. 36
0
        private Spinner sp_subcomLocal; //开卡店

        #endregion Fields

        #region Methods

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.OutOne);

            IntentName = Intent.GetStringExtra("cardno");//卡号
            #region 初始化控件
            ibtn_cancel = FindViewById<ImageButton>(Resource.Id.OutOne_cancel);
            btn_save = FindViewById<Button>(Resource.Id.OutOne_save);
            sp_subcom = FindViewById<Spinner>(Resource.Id.OutOne_SubCom);//选择分店
            et_search = FindViewById<EditText>(Resource.Id.OutOne_Search);//搜索
            et_cusname = FindViewById<EditText>(Resource.Id.OutOne_CusName);//姓名
            sp_sex = FindViewById<Spinner>(Resource.Id.OutOne_Sex);//性别
            sp_subcomLocal = FindViewById<Spinner>(Resource.Id.OutOne_CusTypeLocal);//开卡店
            et_balance = FindViewById<EditText>(Resource.Id.OutOne_Balance);//充值余额
            sp_custype = FindViewById<Spinner>(Resource.Id.OutOne_CusType);//会员级别
            et_laststore = FindViewById<EditText>(Resource.Id.OutOne_Lastdate);//最后充值
            et_integral = FindViewById<EditText>(Resource.Id.OutOne_Integral);//现有积分
            et_discount = FindViewById<EditText>(Resource.Id.OutOne_Discount);//服务折扣
            et_memcard = FindViewById<EditText>(Resource.Id.OutOne_MemCard);//会员卡扣款
            et_customercard = FindViewById<EditText>(Resource.Id.OutOne_CustomerCard);//会员卡号
            et_ysmoney = FindViewById<EditText>(Resource.Id.OutOne_YsMoney);//应收金额
            et_ticketmoneybefore = FindViewById<EditText>(Resource.Id.OutOne_TicketMoneyBefore);//抵扣金额
            et_factmoney = FindViewById<EditText>(Resource.Id.OutOne_FactMoney);//实际应收
            et_carsh = FindViewById<EditText>(Resource.Id.OutOne_Crash);//补现金
            et_selfno = FindViewById<EditText>(Resource.Id.OutOne_Selfno);//手工单号
            et_memo = FindViewById<EditText>(Resource.Id.OutOne_Momo);//备注
            btn_Clean = FindViewById<Button>(Resource.Id.OutOne_Clean);//清除信息
            #endregion

            #region 指定不可编辑项
            et_cusname.Enabled = false;
            et_cusname.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            sp_sex.Enabled = false;
            sp_sex.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            sp_subcomLocal.Enabled = false;
            sp_subcomLocal.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            et_balance.Enabled = false;
            et_balance.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            sp_custype.Enabled = false;
            sp_custype.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            et_laststore.Enabled = false;
            et_laststore.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            et_integral.Enabled = false;
            et_integral.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            et_memcard.Enabled = false;
            et_memcard.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            et_customercard.Enabled = false;
            et_customercard.SetBackgroundColor(Android.Graphics.Color.ParseColor("#A9A9A9"));
            #endregion

            et_cusname.Text = "散客";

            #region Spinner控件赋值
            //性别
            Java.Lang.Object[] sex = { "请选择", "先生", "女士" };
            var adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, sex);
            sp_sex.Adapter = adapter;
            sp_sex.SetSelection(2, true);
            //所属分店
            string[] subcom = SysVisitor.GetArryList("select subno,comname from subcom");
            adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, subcom);
            sp_subcom.Adapter = adapter;
            //开卡店sp_subcomLocal
            adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, subcom);
            sp_subcomLocal.Adapter = adapter;
            //会员级别
            string[] custype = SysVisitor.GetArryList("select cardlevel, carcname from cardtype");
            adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, custype);
            sp_custype.Adapter = adapter;
            #endregion
            if (!string.IsNullOrEmpty(IntentName))
            {
                Onbind(IntentName);
            }
            et_search.FocusChange += delegate
            {
                if (!et_search.HasFocus)
                {
                    string ls_search = et_search.Text.Trim();
                    if (!string.IsNullOrEmpty(ls_search))
                    {
                        Onbind(ls_search);
                    }

                }
            };
            //应收金额
            et_ysmoney.FocusChange += delegate
            {
                if (!et_ysmoney.HasFocus)
                {
                    if (et_ysmoney.Text.Trim() != "")
                    { CountMoney(); }
                }
            };
            //抵扣金额
            et_ticketmoneybefore.FocusChange += delegate
            {
                if (!et_ticketmoneybefore.HasFocus)
                {
                    if (et_ticketmoneybefore.Text.Trim() != "")
                    { CountMoney(); }
                }
            };
            //实际应收
            et_factmoney.FocusChange += delegate
            {
                if (!et_factmoney.HasFocus)
                {
                    if (et_factmoney.Text.Trim() != "")
                    { CountMoney(); }
                }
            };
            //补现金
            et_carsh.FocusChange += delegate
            {
                if (!et_carsh.HasFocus)
                {
                    if (et_carsh.Text.Trim() != "")
                    { CountMoney(); }
                }
            };

            btn_Clean.Click += delegate
            {
                IntentName = "";
                refresh();
            };
            //保存
            btn_save.Click += delegate
            {
                string ls_subcom = sp_subcom.SelectedItem == null ? "" : sp_subcom.SelectedItem.ToString();//所属分店
                if (ls_subcom == "请选择")
                    ls_subcom = "";
                else
                    ls_subcom = SqliteHelper.ExecuteScalar("select subno from subcom where comname='" + ls_subcom + "'");

                string ls_sex = sp_sex.SelectedItem.ToString();//性别
                if (ls_sex == "请选择")
                    ls_sex = "";
                if (ls_sex == "先生")
                    ls_sex = "Y";
                if (ls_sex == "女士")
                    ls_sex = "N";

                string ls_subcomLocal = sp_subcomLocal.SelectedItem == null ? "" : sp_subcomLocal.SelectedItem.ToString();//开卡店
                if (ls_subcomLocal == "请选择")
                    ls_subcomLocal = "";
                else
                    ls_subcomLocal = SqliteHelper.ExecuteScalar("select subno from subcom where comname='" + sp_subcomLocal + "'");

                string ls_custype = sp_custype.SelectedItem == null ? "" : sp_custype.SelectedItem.ToString();//会员级别
                if (ls_custype == "请选择")
                    ls_custype = "";
                else
                    ls_custype = SqliteHelper.ExecuteScalar("select cardlevel from cardtype where carcname='" + ls_custype + "'");

                string ls_et_cusname = et_cusname.Text;//姓名
                string ls_et_cardno = et_customercard.Text;//卡号
                string ls_et_discount = et_discount.Text;//服务折扣
                string ls_et_integral = et_integral.Text;//现有积分
                string ls_et_memcard = et_memcard.Text;//会员卡扣款
                string ls_et_ysmoney = et_ysmoney.Text;//应收金额
                string ls_et_ticketmoneybefore = et_ticketmoneybefore.Text;//抵扣金额
                string ls_et_factmoney = et_factmoney.Text;//实际应收
                string ls_et_carsh = et_carsh.Text;//补现金
                string ls_et_selfno = et_selfno.Text;//手工单号
                string ls_et_memo = et_memo.Text;//备注

                n_create_sql lnv_sql = new n_create_sql();
                lnv_sql.of_SetTable("outone");
                lnv_sql.of_AddCol("subno", ls_subcom);
                lnv_sql.of_AddCol("salecusname", ls_et_cusname);
                lnv_sql.of_AddCol("sex", ls_sex);
                lnv_sql.of_AddCol("subcom", ls_subcomLocal);
                lnv_sql.of_AddCol("ysmoney", ls_et_ysmoney);
                lnv_sql.of_AddCol("ticketmoney_before", ls_et_ticketmoneybefore);
                lnv_sql.of_AddCol("subno", ls_subcom);
                lnv_sql.of_AddCol("selfno", ls_et_selfno);
                lnv_sql.of_AddCol("factmoney", ls_et_factmoney);
                lnv_sql.of_AddCol("carsh", et_carsh);
                lnv_sql.of_AddCol("discount", ls_et_discount);
                lnv_sql.of_AddCol("memcard", ls_et_memcard);
                lnv_sql.of_AddCol("customer_card", ls_et_cardno);
                lnv_sql.of_AddCol("memo", ls_et_memo);
                bool lb_ok = false;
                lb_ok = lnv_sql.of_execute();
                if(lb_ok)
                {

                }
            };
        }
Esempio n. 37
0
        private void updateTextAttributes(EditText title, EditText content)
        {
            float baseSize = Float.parseFloat(Preferences.GetString(Preferences.Key.BASE_TEXT_SIZE));
            content.SetTextSize(baseSize);
            title.SetTextSize(baseSize*1.3f);

            title.SetTextColor(Color.Blue);
            title.PaintFlags = title.PaintFlags | PaintFlags.UnderlineText;
            title.SetBackgroundColor(0xffffffff);

            content.SetBackgroundColor(0xffffffff);
            content.SetTextColor(Color.DarkGray);
        }
Esempio n. 38
0
		void BuildUI (Bundle savedInstanceState)
		{
			var hMargin = 20;

			RequestWindowFeature (WindowFeatures.NoTitle);

			Title = state.Service.ShareTitle;

			layout = new LinearLayout (this) {
				Orientation = Orientation.Vertical,
			};
			layout.SetBackgroundColor (Color.White);
			SetContentView (layout);

			//
			// Toolbar
			//
			toolbar = new ToolbarView (this, Title);
			toolbar.IsProgressing = state.IsSending;
			toolbar.Clicked += (sender, args) => StartSending();
			layout.AddView (toolbar);

			//
			// Scroll content
			//
			var scroller = new ScrollView (this) {
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) {
				},
			};
			var scrollContent = new LinearLayout (this) {
				Orientation = Orientation.Vertical,
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) {
				},
			};
			scroller.ScrollbarFadingEnabled = true;
			scroller.AddView (scrollContent);
			layout.AddView (scroller);

			//
			// Account
			//
			var acctLabel = new TextView (this) {
				Text = "From",
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) {
					RightMargin = 12,
				},
			};
			acctLabel.SetTextColor (Color.DarkGray);
			acctLabel.SetTextSize (ComplexUnitType.Sp, LabelTextSize);

			acctPicker = new TextView (this) {
				Typeface = Typeface.DefaultFromStyle (TypefaceStyle.Bold),
				Clickable = true,
			};
			acctPicker.SetTextColor (Color.Black);
			acctPicker.SetTextSize (ComplexUnitType.Sp, LabelTextSize);
			acctPicker.Click += PickAccount;
			UpdateAccountUI ();

			var acctLayout = new LinearLayout (this) {
				Orientation = Orientation.Horizontal,
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) {
					TopMargin = 24,
					LeftMargin = hMargin,
					RightMargin = hMargin,
				},
			};
			acctLayout.SetGravity (GravityFlags.Left);
			acctLayout.AddView (acctLabel);
			acctLayout.AddView (acctPicker);

			scrollContent.AddView (acctLayout);

			//
			// Attachments
			//
			var attachLayout = new LinearLayout (this) {
				Orientation = Orientation.Vertical,
				Visibility = state.Item.HasAttachments ? ViewStates.Visible : ViewStates.Gone,
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) {
					TopMargin = 30,
					LeftMargin = hMargin,
					RightMargin = hMargin,
				},
			};

			foreach (var x in state.Item.Links) {
				attachLayout.AddView (new AttachmentView (this, x.AbsoluteUri));
			}
			foreach (var x in state.Item.Images) {
				attachLayout.AddView (new AttachmentView (this, x.Filename, x.Length));
			}
			foreach (var x in state.Item.Files) {
				attachLayout.AddView (new AttachmentView (this, x.Filename, x.Length));
			}

			scrollContent.AddView (attachLayout);

			//
			// Composer
			//
			composer = new EditText (this) {
				Id = 301,
				Text = savedInstanceState != null ? savedInstanceState.GetString ("ComposerText") : state.Item.Text,
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) {
					TopMargin = 24,
					LeftMargin = hMargin - 14,
					RightMargin = hMargin - 14,
				},
			};
			composer.SetTextSize (ComplexUnitType.Sp, ComposeTextSize);
			composer.SetTextColor (Color.Black);
			composer.SetBackgroundColor (Color.White);
			composer.AfterTextChanged += delegate {
				UpdateRemainingTextUI ();
			};
			scrollContent.AddView (composer);

			remaining = new TextView (this) {
				LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) {
					TopMargin = 2,
					LeftMargin = hMargin,
					RightMargin = hMargin,
				},
			};
			remaining.SetTextSize (ComplexUnitType.Sp, ComposeTextSize);
			UpdateRemainingTextUI ();
			scrollContent.AddView (remaining);
		}