summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Controls/App.cs13
-rw-r--r--Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs25
-rw-r--r--Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj3
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs7
4 files changed, 45 insertions, 3 deletions
diff --git a/Xamarin.Forms.Controls/App.cs b/Xamarin.Forms.Controls/App.cs
index c648004..3af36ee 100644
--- a/Xamarin.Forms.Controls/App.cs
+++ b/Xamarin.Forms.Controls/App.cs
@@ -8,6 +8,7 @@ using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
namespace Xamarin.Forms.Controls
{
+
public class App : Application
{
public const string AppName = "XamarinFormsControls";
@@ -31,6 +32,18 @@ namespace Xamarin.Forms.Controls
Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
Detail = CoreGallery.GetMainPage()
};
+
+ //// Uncomment to verify that there is no gray screen displayed between the blue splash and red MasterDetailPage.
+ //MainPage = new Bugzilla44596SplashPage(() =>
+ //{
+ // var newTabbedPage = new TabbedPage();
+ // newTabbedPage.Children.Add(new ContentPage { BackgroundColor = Color.Red, Content = new Label { Text = "yay" } });
+ // MainPage = new MasterDetailPage
+ // {
+ // Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
+ // Detail = newTabbedPage
+ // };
+ //});
}
protected override void OnAppLinkRequestReceived(Uri uri)
diff --git a/Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs b/Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs
new file mode 100644
index 0000000..ba7cdc4
--- /dev/null
+++ b/Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Xamarin.Forms.Controls
+{
+ public class Bugzilla44596SplashPage : ContentPage
+ {
+ Action FinishedLoading { get; set; }
+
+
+ public Bugzilla44596SplashPage(Action finishedLoading)
+ {
+ BackgroundColor = Color.Blue;
+ FinishedLoading = finishedLoading;
+ }
+
+
+ protected async override void OnAppearing()
+ {
+ base.OnAppearing();
+ await Task.Delay(2000);
+ FinishedLoading?.Invoke();
+ }
+ }
+}
diff --git a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
index 200e5f8..b85020b 100644
--- a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
+++ b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
@@ -84,6 +84,7 @@
<ItemGroup>
<Compile Include="App.cs" />
<Compile Include="AppLifeCycle.cs" />
+ <Compile Include="Bugzilla44596SplashPage.cs" />
<Compile Include="ControlGalleryPages\CellForceUpdateSizeGalleryPage.cs" />
<Compile Include="ControlGalleryPages\LayoutAddPerformance.xaml.cs">
<DependentUpon>LayoutAddPerformance.xaml</DependentUpon>
@@ -312,4 +313,4 @@
<Copy SourceFiles="@(ConfigFile)" DestinationFiles="controlgallery.config" Condition="!Exists('controlgallery.config')" />
</Target>
<Import Project="..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
-</Project>
+</Project> \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
index 1b85b42..fad745a 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
@@ -1,5 +1,6 @@
using Android.App;
using Android.Content;
+using Android.OS;
using Fragment = Android.Support.V4.App.Fragment;
using FragmentManager = Android.Support.V4.App.FragmentManager;
using FragmentTransaction = Android.Support.V4.App.FragmentTransaction;
@@ -82,7 +83,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
// The renderers for NavigationPage and TabbedPage both host fragments, so they need to be wrapped in a
// FragmentContainer in order to get isolated fragment management
Fragment fragment = FragmentContainer.CreateInstance(page);
-
+
var fc = fragment as FragmentContainer;
fc?.SetOnCreateCallback(pc =>
@@ -100,10 +101,12 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
}
transaction.Add(Id, fragment);
- transaction.SetTransition((int)FragmentTransit.FragmentOpen);
+ transaction.SetTransition((int)FragmentTransit.None);
transaction.Commit();
_currentFragment = fragment;
+
+ new Handler(Looper.MainLooper).PostAtFrontOfQueue(() => FragmentManager.ExecutePendingTransactions());
}
}