Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Add some null checks for TabView #1033

Merged
merged 5 commits into from
Mar 18, 2021
Merged
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 @@ -958,11 +958,27 @@ void UpdateIsTabStripVisible(bool isTabStripVisible)

void UpdateTabContentHeight(double tabContentHeight) => contentContainer.HeightRequest = tabContentHeight;

void UpdateTabIndicatorColor(Color tabIndicatorColor) => tabStripIndicator.BackgroundColor = tabIndicatorColor;
void UpdateTabIndicatorColor(Color tabIndicatorColor)
{
if (tabStripIndicator != null)
tabStripIndicator.BackgroundColor = tabIndicatorColor;
}

void UpdateTabIndicatorHeight(double tabIndicatorHeight) => tabStripIndicator.HeightRequest = tabIndicatorHeight;
void UpdateTabIndicatorHeight(double tabIndicatorHeight)
{
if (tabStripIndicator != null)
{
tabStripIndicator.HeightRequest = tabIndicatorHeight;
}
}

void UpdateTabIndicatorWidth(double tabIndicatorWidth) => tabStripIndicator.WidthRequest = tabIndicatorWidth;
void UpdateTabIndicatorWidth(double tabIndicatorWidth)
{
if (tabStripIndicator != null)
{
tabStripIndicator.WidthRequest = tabIndicatorWidth;
}
}

void UpdateTabIndicatorView(View tabIndicatorView)
{
Expand Down Expand Up @@ -991,9 +1007,21 @@ void UpdateTabIndicatorPlacement(TabIndicatorPlacement tabIndicatorPlacement)
UpdateTabIndicatorMargin();
}

void UpdateIsSwipeEnabled(bool isSwipeEnabled) => contentContainer.IsSwipeEnabled = isSwipeEnabled;
void UpdateIsSwipeEnabled(bool isSwipeEnabled)
{
if (contentContainer != null)
{
contentContainer.IsSwipeEnabled = isSwipeEnabled;
}
}

void UpdateIsTabTransitionEnabled(bool isTabTransitionEnabled) => contentContainer.IsScrollAnimated = isTabTransitionEnabled;
void UpdateIsTabTransitionEnabled(bool isTabTransitionEnabled)
{
if (contentContainer != null)
{
contentContainer.IsScrollAnimated = isTabTransitionEnabled;
}
}

void UpdateTabIndicatorPosition(int tabViewItemIndex)
{
Expand Down