From 4ded71685408120afa979f5fb195970b426f1633 Mon Sep 17 00:00:00 2001 From: Tarek Date: Mon, 28 Aug 2023 11:39:10 +0000 Subject: [PATCH] fix TabViewIndicator position on RTL --- .../Xamarin.CommunityToolkit/Views/TabView/TabView.shared.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CommunityToolkit/Xamarin.CommunityToolkit/Views/TabView/TabView.shared.cs b/src/CommunityToolkit/Xamarin.CommunityToolkit/Views/TabView/TabView.shared.cs index b106826ce..fa59dde6c 100644 --- a/src/CommunityToolkit/Xamarin.CommunityToolkit/Views/TabView/TabView.shared.cs +++ b/src/CommunityToolkit/Xamarin.CommunityToolkit/Views/TabView/TabView.shared.cs @@ -1083,8 +1083,8 @@ void UpdateTabIndicatorPosition(ItemsViewScrolledEventArgs args) void UpdateTabIndicatorPosition(View currentTabViewItem) { var width = TabIndicatorWidth > 0 ? (currentTabViewItem.Width - tabStripIndicator.Width) : 0; - var position = currentTabViewItem.X + (width / 2) - 1; - tabStripIndicator.TranslateTo(position, 0, tabIndicatorAnimationDuration, Easing.Linear); + var position = (currentTabViewItem.Width * SelectedIndex) + (width / 2) - 1; + tabStripIndicator.TranslateTo(FlowDirection == FlowDirection.RightToLeft ? -position : position, 0, tabIndicatorAnimationDuration, Easing.Linear); } internal virtual void OnTabSelectionChanged(TabSelectionChangedEventArgs e)