예제 #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <FormsBlurView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                var context  = Context;
                var activity = context as Activity;

                var rootView         = (ViewGroup)activity.Window.DecorView.FindViewById(Android.Resource.Id.Content);
                var windowBackground = activity.Window.DecorView.Background;

                var blurView = new BlurView(context);

                blurView.SetBackgroundColor(Color.White.MultiplyAlpha(.75).ToAndroid());

                blurView.SetupWith(rootView)
                .WindowBackground(windowBackground)
                .BlurAlgorithm(new RenderScriptBlur(context))
                .BlurRadius(25f)

                //.SetHasFixedTransformationMatrix(true)
                ;
                SetNativeControl(blurView);
            }
        }
예제 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            var dialogView = inflater.Inflate(Resource.Layout.dialog_alert, null);

            _blurView = dialogView.FindViewById <BlurView>(Resource.Id.dialog_alert_blur_background);
            _blurView.SetBlurredView(Activity.Window.DecorView);
            _blurView.Click += OnBackgroundClick;

            _titleView            = dialogView.FindViewById <TextView>(Resource.Id.dialog_alert_title);
            _titleView.Visibility = Arguments.ContainsKey(TITLE_ARG) ? ViewStates.Visible : ViewStates.Gone;
            _titleView.Text       = Arguments.GetString(TITLE_ARG, string.Empty);

            _messageView            = dialogView.FindViewById <TextView>(Resource.Id.dialog_alert_message);
            _messageView.Visibility = Arguments.ContainsKey(MESSAGE_ARG) ? ViewStates.Visible : ViewStates.Gone;
            _messageView.Text       = Arguments.GetString(MESSAGE_ARG, string.Empty);

            _positiveButton        = dialogView.FindViewById <Android.Widget.Button>(Resource.Id.dialog_alert_positive_button);
            _positiveButton.Text   = Core.Properties.Resources.Ok;
            _positiveButton.Click += OnPositiveClick;

            _negativeButton            = dialogView.FindViewById <Android.Widget.Button>(Resource.Id.dialog_alert_negative_button);
            _negativeButton.Visibility = Arguments.ContainsKey(NEGATIVE_LABEL_ARG) ? ViewStates.Visible : ViewStates.Gone;
            _negativeButton.Text       = Arguments.GetString(NEGATIVE_LABEL_ARG, string.Empty);
            _negativeButton.Click     += OnNegativeClick;

            return(dialogView);
        }
        private void BlurBackground(BlurView blurView, float radius)
        {
            try
            {
                //float radius = 10f;
                View decorView = Window.DecorView;
                //ViewGroup you want to start blur from. Choose root as close to BlurView in hierarchy as possible.
                ViewGroup rootView = decorView.FindViewById <ViewGroup>(Android.Resource.Id.Content);
                //Set drawable to draw in the beginning of each blurred frame (Optional).
                //Can be used in case your layout has a lot of transparent space and your content
                //gets kinda lost after after blur is applied.
                Drawable windowBackground = decorView.Background;

                blurView.SetupWith(rootView)
                .SetFrameClearDrawable(windowBackground)
                .SetBlurAlgorithm(new RenderScriptBlur(this))
                .SetBlurRadius(radius)
                .SetBlurAutoUpdate(true)
                .SetHasFixedTransformationMatrix(true);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
예제 #4
0
        public SquareContentView(Album album)
        {
            artView = new AlbumArtView
            {
                BindingContext = album
            };
            artView.UpdateArtwork(album);
            Children.Add(artView);

            blurView = new BlurView();
            Children.Add(blurView);

            grid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition(),
                    new ColumnDefinition {
                        Width = 30
                    },
                },
                Children =
                {
                    new StackLayout
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children    =
                        {
                            new Image          {
                                Source = Images.Menu.SongsIcon
                            },
                            new Label          {
                                Text = $"{album.TrackCount} {Strings.Songs}"
                            }
                        },
                    },
                    new ImageColorToggleButton {
                        Source   = Images.MoreDetails,
                        OnColor  = Styles.Styles.CurrentStyle.DisabledColor,
                        OffColor = Styles.Styles.CurrentStyle.AccentColor,
                        Padding  = new Thickness(6),
                        Tapped   = async(b) => {
                            var item       = album;
                            var popupItems = PopupManager.Shared.CreatePopoptions(item);
                            var task       = App.Current.MainPage.DisplayActionSheet(item.Name, Strings.Cancel, null, popupItems.Select(x => x.Title).ToArray());
                            await Task.Delay(100);
                            b.Toggled = false;
                            var result       = await task;
                            var selectedItem = popupItems.FirstOrDefault(x => x.Title == result);
                            if (selectedItem.Action != null)
                            {
                                var success = await selectedItem.Action();
                            }
                        }
                    }.SetColumn(1),
                },
            };
            Children.Add(grid);
        }
예제 #5
0
        private void InitComponent()
        {
            try
            {
                ImageBack = FindViewById <ImageView>(Resource.Id.iv_back);

                UsernameLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_username);
                TxtUsername         = FindViewById <EditText>(Resource.Id.etUsername);
                TxtUsernameRequired = FindViewById <TextView>(Resource.Id.tv_username_required);

                FirstNameLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_firstname);
                TxtFirstName         = FindViewById <EditText>(Resource.Id.etFirstName);
                TxtFirstNameRequired = FindViewById <TextView>(Resource.Id.tv_firstname_required);

                LastNameLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_lastname);
                TxtLastName         = FindViewById <EditText>(Resource.Id.etLastName);
                TxtLastNameRequired = FindViewById <TextView>(Resource.Id.tv_lastname_required);

                EmailLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_email);
                TxtEmail         = FindViewById <EditText>(Resource.Id.etEmail);
                TxtEmailRequired = FindViewById <TextView>(Resource.Id.tv_email_required);

                PasswordLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_password);
                TxtPassword         = FindViewById <EditText>(Resource.Id.etPassword);
                TxtPasswordRequired = FindViewById <TextView>(Resource.Id.tv_password_required);

                ConfirmPasswordLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_confirm_password);
                TxtConfirmPassword         = FindViewById <EditText>(Resource.Id.etConfirmPassword);
                TxtConfirmPasswordRequired = FindViewById <TextView>(Resource.Id.tv_confirm_password_required);

                GenderLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_gender);
                TxtGender         = FindViewById <EditText>(Resource.Id.etGender);
                TxtGenderRequired = FindViewById <TextView>(Resource.Id.tv_gender_required);

                PhoneLayout         = FindViewById <LinearLayout>(Resource.Id.phoneNumLayout);
                PhoneNumLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_phoneNum);
                TxtPhoneNum         = FindViewById <EditText>(Resource.Id.etPhoneNum);
                TxtPhoneNumRequired = FindViewById <TextView>(Resource.Id.tv_phoneNum_required);

                ImageShowPass    = FindViewById <ImageView>(Resource.Id.imageShowPass);
                ImageShowConPass = FindViewById <ImageView>(Resource.Id.imageShowConPass);

                ChkTermsOfUse     = FindViewById <CheckBox>(Resource.Id.terms_of_use);
                TxtTermsOfService = FindViewById <TextView>(Resource.Id.terms_of_service);

                ProgressBar = FindViewById <ProgressBar>(Resource.Id.progressBar);
                BtnSignUp   = FindViewById <Button>(Resource.Id.btn_create_account);

                BlurView = FindViewById <BlurView>(Resource.Id.bv_create_account);
                //BlurBackground(BlurView, 10f);

                ToggleVisibility(false);
                Methods.SetFocusable(TxtGender);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
 private void DestroyBasic()
 {
     try
     {
         BtnRegisterEmail = null;
         LayoutLogin      = null;
         BlurView         = null;
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
예제 #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            root           = FindViewById <ViewGroup>(Resource.Id.root);
            viewPager      = FindViewById <ViewPager>(Resource.Id.viewPager);
            radiusSeekBar  = FindViewById <SeekBar>(Resource.Id.radiusSeekBar);
            topBlurView    = FindViewById <BlurView>(Resource.Id.topBlurView);
            bottomBlurView = FindViewById <BlurView>(Resource.Id.bottomBlurView);
            tabLayout      = FindViewById <TabLayout>(Resource.Id.tabLayout);

            SetupBlurView();
            SetupViewPager();
        }
        private void InitComponent()
        {
            try
            {
                BtnRegisterEmail = FindViewById <Button>(Resource.Id.btn_register_email);
                LayoutLogin      = FindViewById <LinearLayout>(Resource.Id.layout_login);

                BlurView = FindViewById <BlurView>(Resource.Id.bv_register);
                BlurBackground(BlurView, 10f);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
예제 #9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            //BlurView Start
            root         = FindViewById <ViewGroup>(Resource.Id.root);
            mainBlurView = FindViewById <BlurView>(Resource.Id.mainBlurView);

            float radius = 0.5F;

            //set background, if your root layout doesn't have one
            Drawable windowBackground = Window.DecorView.Background;

            var topViewSettings = mainBlurView.SetupWith(root)
                                  .WindowBackground(windowBackground)
                                  .BlurAlgorithm(new RenderScriptBlur(this)) // SupportRenderScriptBlur
                                  .BlurRadius(radius)
                                  .SetHasFixedTransformationMatrix(true);

            ////BlurView End

            // Find views
            var pager     = FindViewById <ViewPager>(Resource.Id.pager);
            var tabLayout = FindViewById <TabLayout>(Resource.Id.sliding_tabs);
            var adapter   = new CustomPagerAdapter(this, SupportFragmentManager);
            var toolbar   = FindViewById <Toolbar>(Resource.Id.my_toolbar);

            // Setup Toolbar
            SetSupportActionBar(toolbar);
            //SupportActionBar.Title = "Lettre";
            SupportActionBar.Hide();

            // Set adapter to view pager
            pager.Adapter = adapter;

            // Setup tablayout with view pager
            tabLayout.SetupWithViewPager(pager);

            // Iterate over all tabs and set the custom view
            for (int i = 0; i < tabLayout.TabCount; i++)
            {
                TabLayout.Tab tab = tabLayout.GetTabAt(i);
                tab.SetCustomView(adapter.GetTabView(i));
            }
        }
        private void InitComponent()
        {
            try
            {
                EmailLayout      = FindViewById <RelativeLayout>(Resource.Id.rl_email);
                TxtEmail         = FindViewById <EditText>(Resource.Id.etEmail);
                TxtEmailRequired = FindViewById <TextView>(Resource.Id.tv_email_required);

                BtnSend = FindViewById <Button>(Resource.Id.btn_request_password);

                BlurView = FindViewById <BlurView>(Resource.Id.bv_forgot_password);
                BlurBackground(BlurView, 10f);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
예제 #11
0
        protected override void OnElementChanged(ElementChangedEventArgs <FormsBlurView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                var context  = Context;
                var activity = context as Activity;

                var rootView         = (ViewGroup)activity.Window.DecorView.FindViewById(Android.Resource.Id.Content);
                var windowBackground = activity.Window.DecorView.Background;

                var blurView = new BlurView(context);

                blurView.SetOverlayColor(Resource.Color.colorOverlay);

                blurView.SetupWith(rootView)
                .WindowBackground(windowBackground)
                .BlurAlgorithm(new RenderScriptBlur(context))
                .BlurRadius(10f);

                SetNativeControl(blurView);
            }
        }