Euridice01
Euridice01

Reputation: 2568

How can I prevent white screen between page transitions in Android?

I noticed my Xamarin.Forms app for Android temporarily shows a white screen between page transitions. On Startup and between page loads, I was wondering what's the best way to handle this situation in Xamarin.Forms?

I tried these settings in my resource styles but with no luck:

<style name="AppDefaultTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowDisablePreview">true</item>
  </style>

And in my manifest:

<application 
android:label="App" 
android:icon="@drawable/AppIcon" 
android:theme="@style/AppDefaultTheme">

Anyone encountered this previously? What is your best approach?

Upvotes: 4

Views: 2049

Answers (1)

Mario Galv&#225;n
Mario Galv&#225;n

Reputation: 4032

There is a great article about page transitions on Xamarin.Android here:

http://cyrilmottier.com/2013/01/23/android-app-launching-made-gorgeous/

My best approach is the Xamarin MVVM way in combination with a Splash Screen and MainLauncher Activity color:

<style name="Theme.Splash" parent="android:Theme">
     <item name="android:windowBackground">@drawable/splash</item>
     <item name="android:windowNoTitle">true</item>
</style>

#ffffff

<style name="AppMainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:windowBackground">@color/AppBackgroundColor</item>
</style>

And for MVVM Xamarin way I am referring to first show the simplest UI you can show and the show loading indicators to let the user know something is happening in the background while you do your async/await calls from a ws or something that is going to take time, take a look at Slack app as example:

Slack App

And that is how your page transitions will minimize and create a more stable UX for your app.

also you can follow this Jason Smith technics to create a faster UI:

http://kent-boogaart.com/blog/jason-smith's-xamarin-forms-performance-tips

Upvotes: 4

Related Questions