Step 1 : At First Create a new Activity
Step2: Disable the Main Launcher Screen From Main Activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SplashScreen.Droid | |
{ | |
[Activity(Theme ="@style/Theme.Splash", | |
MainLauncher = true, | |
NoHistory =true, | |
Icon ="@drawable/clap")] | |
public class SplashActivity : Activity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
System.Threading.Thread.Sleep(500); | |
StartActivity(typeof(MainActivity)); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Activity(Label = "SplashScreen", Theme = "@style/MainTheme", MainLauncher = false, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] | |
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="Theme.Splash" | |
parent="android:Theme"> | |
<item name="android:windowBackground">@drawable/clap</item> | |
<item name="andorid:windowNoTitle">true</item> | |
</style> |
Step4:Holaa Our Steps Are Completed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<resources> | |
<style name="Theme.Splash" | |
parent="Theme.AppCompat.Light.NoActionBar"> | |
<item name="android:windowBackground">@drawable/icon</item> | |
</style> | |
<style name="MainTheme" parent="MainTheme.Base"> | |
</style> | |
<!-- Base theme applied no matter what API --> | |
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> | |
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:--> | |
<item name="windowNoTitle">true</item> | |
<!--We will be using the toolbar so no need to show ActionBar--> | |
<item name="windowActionBar">false</item> | |
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette --> | |
<!-- colorPrimary is used for the default action bar background --> | |
<item name="colorPrimary">#2196F3</item> | |
<!-- colorPrimaryDark is used for the status bar --> | |
<item name="colorPrimaryDark">#1976D2</item> | |
<!-- colorAccent is used as the default value for colorControlActivated | |
which is used to tint widgets --> | |
<item name="colorAccent">#FF4081</item> | |
<!-- You can also set colorControlNormal, colorControlActivated | |
colorControlHighlight and colorSwitchThumbNormal. --> | |
<item name="windowActionModeOverlay">true</item> | |
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item> | |
</style> | |
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog"> | |
<item name="colorAccent">#FF4081</item> | |
</style> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
namespace XFormsContosoCookbook.Droid | |
{ | |
[Activity(Theme = "@style/Theme.Splash", | |
MainLauncher = true, | |
NoHistory = true, | |
Icon = "@drawable/icon")] | |
public class SplashActivity : Activity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
System.Threading.Thread.Sleep(500); | |
StartActivity(typeof(MainActivity)); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.xamarin.contosocookbook" android:versionCode="1" android:versionName="1.0"> | |
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="25" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application android:label="Xamarin Zero to Hero"> | |
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" /> | |
</application> | |
</manifest> |
No comments:
Post a Comment