Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

[CircleScroller]Fix the issue that can't set ScrollBarVisibility #164

Merged
merged 1 commit into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<CircleScrollVie
{
(e.NewElement as IScrollViewController).ScrollToRequested += OnScrollRequestedAsync;
}

UpdateAll();

base.OnElementChanged(e);
Expand All @@ -88,6 +89,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
{
UpdateHorizontalScrollBarVisibility();
}

base.OnElementPropertyChanged(sender, e);
}

Expand Down Expand Up @@ -116,11 +118,15 @@ protected override void Dispose(bool disposing)
void UpdateAll()
{
UpdateOrientation();
UpdateVerticalScrollBarVisibility();
UpdateHorizontalScrollBarVisibility();
}

void UpdateVerticalScrollBarVisibility()
{
Control.VerticalScrollBarVisiblePolicy = ScrollBarVisibilityToTizen(Element.VerticalScrollBarVisibility);
var orientation = Element.Orientation;
if (orientation == ScrollOrientation.Vertical || orientation == ScrollOrientation.Both)
Control.VerticalScrollBarVisiblePolicy = ScrollBarVisibilityToTizen(Element.VerticalScrollBarVisibility);
}

void UpdateHorizontalScrollBarVisibility()
Expand Down
10 changes: 7 additions & 3 deletions test/WearableUIGallery/WearableUIGallery/TC/TCTwoButtonPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:WearableUIGallery.TC"
xmlns:w="clr-namespace:Tizen.Wearable.CircularUI.Forms;assembly=Tizen.Wearable.CircularUI.Forms"
w:CircleSurfaceEffectBehavior.RotaryFocusObject="{x:Reference myscroller}"
Title="{Binding Title}}">
<w:TwoButtonPage.BindingContext>
<w:TwoButtonPage.Behaviors>
<w:CircleSurfaceEffectBehavior />
</w:TwoButtonPage.Behaviors>
<w:TwoButtonPage.BindingContext>
<local:TCTwoButtonPageViewModel />
</w:TwoButtonPage.BindingContext>
<w:TwoButtonPage.Content>
<ScrollView>
<w:CircleScrollView x:Name="myscroller" Orientation="Vertical" VerticalScrollBarVisibility="Never">
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Label
HorizontalOptions="FillAndExpand"
Expand All @@ -25,7 +29,7 @@
<Button AutomationId="changeColor1" Clicked="OnChangeColor1" Text="change color 1" />
<Button AutomationId="changeColor2" Clicked="OnChangeColor2" Text="change color 2" />
</StackLayout>
</ScrollView>
</w:CircleScrollView>
</w:TwoButtonPage.Content>
<w:TwoButtonPage.FirstButton>
<MenuItem Command="{Binding Command1}" Icon="image/tw_ic_popup_btn_check.png" />
Expand Down