summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Platform.cs
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-04-12 08:53:36 -0700
committerJason Smith <jason.smith@xamarin.com>2016-04-12 08:53:36 -0700
commitba2a434ec13370cc4814b54f6ce51d4d16594f97 (patch)
treece0d082e4e114fa689e7c5eee3da9d892b11f49c /Xamarin.Forms.Platform.Android/Platform.cs
parent0a20bdaa3c373ec303c9a94ae45ecaa144996ba5 (diff)
downloadxamarin-forms-ba2a434ec13370cc4814b54f6ce51d4d16594f97.tar.gz
xamarin-forms-ba2a434ec13370cc4814b54f6ce51d4d16594f97.tar.bz2
xamarin-forms-ba2a434ec13370cc4814b54f6ce51d4d16594f97.zip
Add compatibility shims to fix warnings; annotate warnings which require (#75)
more thought to fix; Fix a few more warnings VS didn't see fit to raise as errors Adding comments to `pragma warning disable` statements pragma comments Fix typo Set TabletMasterDetailRenderer back to previous version Fix incorrect config access in legacy activity
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Platform.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/Platform.cs24
1 files changed, 10 insertions, 14 deletions
diff --git a/Xamarin.Forms.Platform.Android/Platform.cs b/Xamarin.Forms.Platform.Android/Platform.cs
index 87bf5354..8c289ef4 100644
--- a/Xamarin.Forms.Platform.Android/Platform.cs
+++ b/Xamarin.Forms.Platform.Android/Platform.cs
@@ -144,7 +144,7 @@ namespace Xamarin.Forms.Platform.Android
}
}
-#pragma warning disable 618
+#pragma warning disable 618 // Eventually we will need to determine how to handle the v7 ActionBarDrawerToggle for AppCompat
ActionBarDrawerToggle MasterDetailPageToggle { get; set; }
#pragma warning restore 618
@@ -458,7 +458,7 @@ namespace Xamarin.Forms.Platform.Android
Color colorToUse = Color.Default;
if (CurrentNavigationPage != null)
{
-#pragma warning disable 618
+#pragma warning disable 618 // Make sure Tint still works
if (CurrentNavigationPage.Tint != Color.Default)
colorToUse = CurrentNavigationPage.Tint;
#pragma warning restore 618
@@ -526,16 +526,14 @@ namespace Xamarin.Forms.Platform.Android
_renderer.AddView(renderView.ViewGroup);
}
-#pragma warning disable 618
+#pragma warning disable 618 // This may need to be updated to work with TabLayout/AppCompat
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
+ var atab = actionBar.NewTab();
atab.SetText(page.Title);
atab.TabSelected += (sender, e) =>
{
@@ -594,7 +592,7 @@ namespace Xamarin.Forms.Platform.Android
void CurrentNavigationPageOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
-#pragma warning disable 618
+#pragma warning disable 618 // Make sure Tint still works
if (e.PropertyName == NavigationPage.TintProperty.PropertyName)
#pragma warning restore 618
UpdateActionBarBackgroundColor();
@@ -688,9 +686,11 @@ namespace Xamarin.Forms.Platform.Android
var drawer = GetRenderer(CurrentMasterDetailPage) as MasterDetailRenderer;
if (drawer == null)
return;
-#pragma warning disable 618
+
+#pragma warning disable 618 // Eventually we will need to determine how to handle the v7 ActionBarDrawerToggle for AppCompat
MasterDetailPageToggle = new ActionBarDrawerToggle(_context as Activity, drawer, icon, 0, 0);
#pragma warning restore 618
+
MasterDetailPageToggle.SyncState();
}
@@ -741,9 +741,7 @@ 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
+ var atab = actionBar.GetTabAt(currentTabs.Children.IndexOf(page));
atab.SetText(page.Title);
}
}
@@ -827,9 +825,7 @@ 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
+ var realTab = AddTab(tab, i++);
if (tab == CurrentTabbedPage.CurrentPage)
realTab.Select();
}