diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Platform.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/Platform.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Android/Platform.cs b/Xamarin.Forms.Platform.Android/Platform.cs index d3e56336..87bf5354 100644 --- a/Xamarin.Forms.Platform.Android/Platform.cs +++ b/Xamarin.Forms.Platform.Android/Platform.cs @@ -144,7 +144,9 @@ namespace Xamarin.Forms.Platform.Android } } +#pragma warning disable 618 ActionBarDrawerToggle MasterDetailPageToggle { get; set; } +#pragma warning restore 618 void IDisposable.Dispose() { @@ -456,10 +458,10 @@ namespace Xamarin.Forms.Platform.Android Color colorToUse = Color.Default; if (CurrentNavigationPage != null) { -//#pragma warning disable 618 +#pragma warning disable 618 if (CurrentNavigationPage.Tint != Color.Default) colorToUse = CurrentNavigationPage.Tint; -//#pragma warning restore 618 +#pragma warning restore 618 else if (CurrentNavigationPage.BarBackgroundColor != Color.Default) colorToUse = CurrentNavigationPage.BarBackgroundColor; } @@ -524,12 +526,16 @@ namespace Xamarin.Forms.Platform.Android _renderer.AddView(renderView.ViewGroup); } +#pragma warning disable 618 ActionBar.Tab AddTab(Page page, int index) +#pragma warning restore 618 { ActionBar actionBar = ((Activity)_context).ActionBar; TabbedPage currentTabs = CurrentTabbedPage; +#pragma warning disable 618 ActionBar.Tab atab = actionBar.NewTab(); +#pragma warning restore 618 atab.SetText(page.Title); atab.TabSelected += (sender, e) => { @@ -588,7 +594,9 @@ namespace Xamarin.Forms.Platform.Android void CurrentNavigationPageOnPropertyChanged(object sender, PropertyChangedEventArgs e) { +#pragma warning disable 618 if (e.PropertyName == NavigationPage.TintProperty.PropertyName) +#pragma warning restore 618 UpdateActionBarBackgroundColor(); else if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName) UpdateActionBarBackgroundColor(); @@ -680,7 +688,9 @@ namespace Xamarin.Forms.Platform.Android var drawer = GetRenderer(CurrentMasterDetailPage) as MasterDetailRenderer; if (drawer == null) return; +#pragma warning disable 618 MasterDetailPageToggle = new ActionBarDrawerToggle(_context as Activity, drawer, icon, 0, 0); +#pragma warning restore 618 MasterDetailPageToggle.SyncState(); } @@ -731,7 +741,9 @@ namespace Xamarin.Forms.Platform.Android return; var page = sender as Page; +#pragma warning disable 618 ActionBar.Tab atab = actionBar.GetTabAt(currentTabs.Children.IndexOf(page)); +#pragma warning restore 618 atab.SetText(page.Title); } } @@ -815,7 +827,9 @@ namespace Xamarin.Forms.Platform.Android var i = 0; foreach (Page tab in CurrentTabbedPage.Children.OfType<Page>()) { +#pragma warning disable 618 ActionBar.Tab realTab = AddTab(tab, i++); +#pragma warning restore 618 if (tab == CurrentTabbedPage.CurrentPage) realTab.Select(); } |