From: Pavel Yakovlev Date: Tue, 12 Feb 2019 13:39:03 +0000 (+0300) Subject: [Android] fixes TabStop on Stepper Control (#5000) fixes #4956 X-Git-Tag: accepted/tizen/5.5/unified/20200421.150457~510 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd1cf19fcad6ae049e90fdc5819c4f7c6adb57f6;p=platform%2Fcore%2Fcsapi%2Fxsf.git [Android] fixes TabStop on Stepper Control (#5000) fixes #4956 --- diff --git a/Xamarin.Forms.Platform.Android/Renderers/StepperRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/StepperRenderer.cs index 1604d0d..353b2c8 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/StepperRenderer.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/StepperRenderer.cs @@ -27,7 +27,12 @@ namespace Xamarin.Forms.Platform.Android protected override LinearLayout CreateNativeControl() { - return new LinearLayout(Context) { Orientation = Orientation.Horizontal }; + return new LinearLayout(Context) + { + Orientation = Orientation.Horizontal, + Focusable = true, + DescendantFocusability = DescendantFocusability.AfterDescendants + }; } protected override void OnElementChanged(ElementChangedEventArgs e) @@ -36,16 +41,18 @@ namespace Xamarin.Forms.Platform.Android if (e.OldElement == null) { - _downButton = new AButton(Context) { Text = "-", Gravity = GravityFlags.Center, Tag = this }; + _downButton = new AButton(Context) { Text = "-", Gravity = GravityFlags.Center, Tag = this, Focusable = true }; _downButton.SetHeight((int)Context.ToPixels(10.0)); _downButton.SetOnClickListener(StepperListener.Instance); - _upButton = new AButton(Context) { Text = "+", Tag = this }; + _upButton = new AButton(Context) { Text = "+", Tag = this, Focusable = true }; _upButton.SetOnClickListener(StepperListener.Instance); _upButton.SetHeight((int)Context.ToPixels(10.0)); + _downButton.NextFocusForwardId = _upButton.Id = Platform.GenerateViewId(); + var layout = CreateNativeControl(); layout.AddView(_downButton);