Пример #1
0
        protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
        {
            base.OnElementPropertyChanged(args);

            try
            {
                if (args.PropertyName == "IsFocused")
                {
                    Android.Graphics.Drawables.ColorDrawable controlBackground = Control.Background as Android.Graphics.Drawables.ColorDrawable;
                    if (controlBackground.Color == backgroundColor)
                    {
                        Control.SetBackgroundColor(Android.Graphics.Color.Wheat);
                        EditText nativeEditText = Control as global::Android.Widget.EditText;
                        nativeEditText.SetSelectAllOnFocus(true);
                    }
                    else
                    {
                        Control.SetBackgroundColor(backgroundColor);
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #2
0
        public CameraViewElement(Context context) : base(context)
        {
            Visibility = ViewStates.Visible;
            Activated  = true;
            Background = new Android.Graphics.Drawables.ColorDrawable(Color.Transparent);
            Rect r = new Rect();

            GetWindowVisibleDisplayFrame(r);
            Size = (int)(r.Width() * 0.555);
            bm   = Bitmap.CreateBitmap(r.Width(), r.Height(), Bitmap.Config.Argb8888);
            SetFitsSystemWindows(true);
        }
Пример #3
0
        private void GetAttrs(Context context, AttributeSet attrs)
        {
            TypedArray a = context.ObtainStyledAttributes(attrs, Resource.Styleable.AlphaMaskLayout);

            alphaFrom = a.GetInt(Resource.Styleable.AlphaMaskLayout_aml_alpha_from, DEFAULT_ALPHA_FROM);
            alphaTo   = a.GetInt(Resource.Styleable.AlphaMaskLayout_aml_alpha_to, DEFAULT_ALPHA_TO);
            duration  = a.GetInt(Resource.Styleable.AlphaMaskLayout_aml_duration, DEFAULT_DURATION);
            a.Recycle();

            //init foreground alpha
            if (Foreground == null)
            {
                Foreground = new ColorDrawable(Color.ParseColor(DEFAULT_COLOR));
            }
            Foreground.Alpha = 0;

            CheckAttrsValues();
        }
        protected override void OnSaveInstanceState(Bundle outState)
        {
            base.OnSaveInstanceState(outState);
            // save data from TableLayout
            string[] temp       = new string[36];
            int[]    tempColors = new int[36];
            for (int d = 35; d >= 0; d--)
            {
                temp[d] = textViewArray[d].Text;
                Android.Graphics.Drawables.ColorDrawable backgroundColor = textViewArray[d].Background as Android.Graphics.Drawables.ColorDrawable;
                if (backgroundColor != null)
                {
                    int colorCode = backgroundColor.Color.ToArgb();
                    tempColors[d] = colorCode;
                }
            }
            // save selected sorting method button id
            int radioId = selectedSorting;

            outState.PutStringArray("savedArray", temp);
            outState.PutIntArray("savedColors", tempColors);
            outState.PutInt("savedSorting", radioId);
        }
Пример #5
0
 public void UpdateRelativeLayoutColorBox()
 {
     Android.Graphics.Drawables.Drawable color = new Android.Graphics.Drawables.ColorDrawable(new Android.Graphics.Color(seekBarRed.Progress, seekBarGreen.Progress, seekBarBlue.Progress, 255));
     relativeLayoutColorBox.Background = color;
 }
Пример #6
0
 /*
  * float[][] lines;
  * int size = 600;
  * Point uprightcorner;
  * int check = 0;
  * public Activity a { get; set; }
  *
  *
  */
 public CameraViewOutput(Context context) : base(context)
 {
     Visibility = ViewStates.Visible;
     Activated  = true;
     Background = new Android.Graphics.Drawables.ColorDrawable(Color.Aqua);
 }