private void OnChildViewAdded(object sender, ChildViewAddedEventArgs childViewAddedEventArgs)
        {
            var scrollView = (ScrollViewEx)Element;

            UpdateHorizontalScroll(scrollView);
            UpdateVerticalScroll(scrollView);
        }
示例#2
0
 private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
 {
     if (e.Child is TextView view)
     {
         _textView = view;
         _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
     }
 }
示例#3
0
 private void ToolbarChildAdded(object sender, ChildViewAddedEventArgs e)
 {
     if (e.Child is Android.Support.V7.Widget.AppCompatTextView tv)
     {
         // identify the title text view and center it
         tv.LayoutParameters = new Android.Support.V7.Widget.Toolbar.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent, (int)GravityFlags.CenterHorizontal);
     }
 }
示例#4
0
 void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
 {
     if (e.Child is TextView textView)
     {
         textView.Typeface = Typeface.CreateFromAsset(Context.Assets, CustomNavigationPage.GetFontFamily(CurrentPage).FontNameToFontFile());
         textView.SetTextSize(ComplexUnitType.Sp, (float)CustomNavigationPage.GetFontSize(CurrentPage));
     }
 }
示例#5
0
        private void OnChildViewAdded(object sender, ChildViewAddedEventArgs args)
        {
            //var li = (args.Child as MvxListItemView);
            var radioButton = args.Child as RadioButton;

            // radio buttons require an id so that they get un-checked correctly
            if (radioButton?.Id == NoId)
            {
                radioButton.Id = GenerateViewId();
            }
        }
示例#6
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Widget.TextView))
            {
                var textView = (Android.Widget.TextView)e.Child;
                textView.Typeface       = Typeface.CreateFromAsset(Forms.Context.Assets, "Fonts/RobotoLight.ttf");
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#7
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            if (e.Child?.GetType() != typeof(AppCompatTextView))
            {
                return;
            }

            var textView = (AppCompatTextView)e.Child;

            textView.Typeface        = Typeface.CreateFromAsset(Context?.Assets, "GorditaBold.otf");
            _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView  = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Context.ApplicationContext.Assets, "Poppins-Light.ttf");
                textView.Typeface        = spaceFont;
                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (view == typeof(AppCompatTextView))
            {
                var textView  = (AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Context.ApplicationContext.Assets, "Rubik-Medium.ttf");
                textView.Typeface        = spaceFont;
                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView = (Android.Widget.TextView)e.Child;
                textView.Typeface       = Typeface.CreateFromAsset(Context.ApplicationContext.Assets, "Nunito-ExtraLight.ttf");
                textView.TextSize       = 18;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var font     = Typeface.Create("sans-serif-condensed", TypefaceStyle.Bold);
                textView.Typeface        = font;
                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#12
0
        void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var swFont   = Typeface.CreateFromAsset(Xamarin.Forms.Forms.Context.ApplicationContext.Assets, "Starjhol.ttf");
                textView.Typeface       = swFont;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#13
0
        //protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        //{
        //    base.OnElementPropertyChanged(sender, e);

        //    var page = this.Element as NavigationPage;

        //    if (page != null && toolbar != null)
        //    {

        //        Typeface tf = Typeface.CreateFromAsset(Android.App.Application.Context.Assets, "BryantBoldAlt-Regular.otf");

        //        TextView title = (TextView)toolbar.FindViewById(Resource.Id.toolbar_title);
        //        title.SetText(page.CurrentPage.Title, TextView.BufferType.Normal);
        //        title.SetTypeface(tf, TypefaceStyle.Normal);
        //    }
        //}

        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Widget.TextView))
            {
                var textView = (Android.Widget.TextView)e.Child;
                var font     = Typeface.CreateFromAsset(Android.App.Application.Context.Assets, "BryantBoldAlt-Regular.otf");
                textView.Typeface       = font;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#14
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView  = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Context.Assets, "LibreBaskerville-Regular.ttf");
                textView.Typeface       = spaceFont;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#15
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Widget.TextView))
            {
                var textView  = (Android.Widget.TextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Android.App.Application.Context.ApplicationContext.Assets, "CALIBRI.ttf");
                textView.Typeface       = spaceFont;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView = (Android.Widget.TextView)e.Child;
//                var spaceFont = Typeface.CreateFromAsset(Forms.Context.ApplicationContext.Assets, "space_age.ttf");
//
//                textView.Typeface = spaceFont;
                textView.TextSize = 20;
                textView.SetTypeface(null, TypefaceStyle.Bold);

                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#17
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();


            Console.WriteLine(e.Child.GetType().ToString());
            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView  = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Forms.Context.Assets, "Fonts/flow-bold.otf");
                textView.Typeface        = spaceFont;
                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#18
0
 private void OnChildViewAdded(object sender, ChildViewAddedEventArgs args)
 {
     var li = (args.Child as MvxListItemView);
     var radioButton = li?.GetChildAt(0) as RadioButton;
     if (radioButton != null)
     {
         // radio buttons require an id so that they get un-checked correctly
         if (radioButton.Id == NoId)
         {
             radioButton.Id = GenerateViewId();
         }
         radioButton.CheckedChange += OnRadioButtonCheckedChange;
     }
 }
 private void MultiLineRadioGroup_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
 {
     if (e.Child.GetType().Equals(typeof(LinearLayout)))
     {
         LinearLayout ll = e.Child as LinearLayout;
         SetRadioButtons(ll);
     }
     if (e.Child.GetType().Equals(typeof(ItemHolderRadioButton)))
     {
         ItemHolderRadioButton rb = e.Child as ItemHolderRadioButton;
         rb.CheckedChange += Rb_CheckedChange;
         myButtons.Add(rb);
     }
 }
示例#20
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Widget.TextView))
            {
                var textView       = (Android.Widget.TextView)e.Child;
                var spaceFont      = Typeface.CreateFromAsset(Context.ApplicationContext.Assets, "Montserrat-Bold.ttf");
                var systemFont     = Typeface.Default;
                var systemBoldFont = Typeface.DefaultBold;
                textView.Typeface        = spaceFont;
                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            if (e.Child.GetType() == typeof(Android.Widget.TextView))
            {
                var textView = (Android.Widget.TextView)e.Child;
                textView.Gravity = GravityFlags.Center;

                //toolbar.SetBackgroundColor(Color.White.ToAndroid());
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
            toolbar.SetForegroundGravity(GravityFlags.Center);
            toolbar.SetBackgroundColor(Color.Black.ToAndroid());
            toolbar.SetForegroundGravity(GravityFlags.Center);
            toolbar.Background.SetAlpha(122);
        }
示例#22
0
        private void OnChildViewAdded(object sender, ChildViewAddedEventArgs args)
        {
            var li          = (args.Child as MvxListItemView);
            var radioButton = li?.GetChildAt(0) as RadioButton;

            if (radioButton != null)
            {
                // radio buttons require an id so that they get un-checked correctly
                if (radioButton.Id == NoId)
                {
                    radioButton.Id = GenerateViewId();
                }
                radioButton.CheckedChange += OnRadioButtonCheckedChange;
            }
        }
        private void OnToolbarChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(AppCompatTextView))
            {
                var textView = (AppCompatTextView)e.Child;
                textView.Visibility = ViewStates.Gone;
                _originalDrawable   = textView.Background;
                _originalFont       = textView.Typeface;

                var lastPage = Element?.Navigation?.NavigationStack?.Last();
                //SetupToolbarCustomization(lastPage);
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            System.Diagnostics.Debug.WriteLine(view);

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView = (Android.Support.V7.Widget.AppCompatTextView)e.Child;

                // TODO: CHANGE VALUES HERE
                textView.TextSize = 25;
                textView.SetTypeface(null, TypefaceStyle.Bold);

                _toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            try
            {
                var view = e.Child.GetType();
                if (e.Child.GetType() == typeof(Android.Widget.TextView))
                {
                    var textView = (Android.Widget.TextView)e.Child;

                    var spaceFont = Typeface.CreateFromAsset(Xamarin.Forms.Forms.Context.ApplicationContext.Assets, "Kokila Bold.ttf");
                    textView.Typeface       = spaceFont;
                    toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
                }
            }
            catch
            {
            }
        }
        void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Widget.TextView))
            {
                var textView  = (Android.Widget.TextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Xamarin.Forms.Forms.Context.ApplicationContext.Assets, "space_age.ttf");
                textView.Typeface       = spaceFont;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
            // If your app is not using the AppCompatTextView, you don't need this check
            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView  = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Xamarin.Forms.Forms.Context.ApplicationContext.Assets, "space_age.ttf");
                textView.Typeface       = spaceFont;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#27
0
        private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView  = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Forms.Context.ApplicationContext.Assets, "Arial-Black.ttf");
                textView.Typeface = spaceFont;
                textView.TextSize = (float)(App.DisplayScreenWidth / 26.666666666666667);
                //textView.TextAlignment = Android.Views.TextAlignment.Center;
                //textView.Gravity = Android.Views.GravityFlags.CenterHorizontal;

                float toolbarCenter = (float)(App.DisplayScreenWidth / 2);
                float titleCenter   = (float)(App.DisplayScreenWidth / 5) / 2;
                //textView.SetX(toolbarCenter - titleCenter);
                textView.SetX((float)150);
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
示例#28
0
        private void GridBase_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            ResizeRequested = true;

            var control = e.Child as IElement;

            if (control == null)
            {
                return;
            }

            // Supplying the parent metadata ensures that if the element is removed (via cell recycling
            // for example), it has a local handle to reattach itself.
            control.Metadata["Parent"] = Pair;
            ((IPairable)(control as GridBase))?.SetBinding(new Binding(nameof(Parent), nameof(Parent))
            {
                Source = this,
            });

            OnPropertyChanged(nameof(Children));
        }
        void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (view == typeof(Android.Widget.TextView))
            {
                var textView  = (Android.Widget.TextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Android.App.Application.Context.ApplicationContext.Assets, "FiraSans-Regular.otf");
                textView.Typeface       = spaceFont;
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
            // If your app is not using the AppCompatTextView, you don't need this check
            if (view == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView  = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                var spaceFont = Typeface.CreateFromAsset(Android.App.Application.Context.ApplicationContext.Assets, "FiraSans-Regular.otf");
                textView.Typeface = spaceFont;
                Console.WriteLine(textView.Text);
                toolbar.ChildViewAdded -= Toolbar_ChildViewAdded;
            }
        }
        private void OnToolbarChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            var view = e.Child.GetType();

            if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
            {
                var textView = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
                textView.Visibility     = ViewStates.Gone;
                _originalDrawable       = textView.Background;
                _originalFont           = textView.Typeface;
                _originalColorStateList = textView.TextColors;

                SetupToolbarCustomization(Element.CurrentPage);
            }
            else if (e.Child.GetType() == typeof(Android.Support.V7.Widget.ActionMenuView))
            {
                var menuView = (Android.Support.V7.Widget.ActionMenuView)e.Child;
                menuView.ChildViewAdded += MenuView_ChildViewAdded;

                SetupToolbarCustomization(Element.CurrentPage);
            }
        }
示例#31
0
        private void ToolBar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
        {
            if (e.Child is Android.Support.V7.Widget.ActionMenuView menuView)
            {
                var mnuWrapper = (e.Child as Android.Support.V7.Widget.ActionMenuView);
                mnuWrapper.ChildViewAdded += MnuWrapper_ChildViewAdded;

                menus.Add(menuView);

                // mnuWrapper.SetBackgroundColor(global::Android.Graphics.Color.Orange);
                // for some reason just on start app (mainpage just first time):

                /*
                 * menuView.ViewAttachedToWindow += (object s, ViewAttachedToWindowEventArgs ev) =>
                 * {
                 *  menuView.Alpha = 0.1f;
                 *  objectAnimator = ObjectAnimator.OfFloat(menuView, "Alpha", 1f);
                 *  objectAnimator.SetDuration(1000);
                 *  objectAnimator.Start();
                 * };//*/
            }
        }