How to show introscreens in android app when app is opened first time - SpartaCode


Make your development faster and easier !

How to show introscreens in android app when app is opened first time

To download app click on : Check out App

Custom In-App intro guide screens for Android :

Main idea behind in app intro guide screen is to make activity background transparent with some alpha and customizing look as you want.

Step 1 : Download Layout file : 


Step 2: Edit your Manifest.xml file :

  <activity android:name=".IntroScreenActivity"


Step 3 : Add code in res - styles.xml file

 <style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">

        <item name="android:windowIsTranslucent">true</item>

        <item name="android:statusBarColor">@android:color/transparent</item>

        <item name="android:windowBackground">@android:color/transparent</item>


We are done with setting up introscreen you can run and see output and add which ever design you like.

You can finish introscreen activity once user clicks on it.

To make it more Cool :

You can add fade out animation on click of introscreen as follows :

Step 1: Create Animation file in anim package :fade_in.xml

<?xml version="1.0" encoding="utf-8"?>

<alpha xmlns:android=""


           android:fromAlpha="0.0" android:toAlpha="1.0"

           android:duration="500" />

Step 2: Create Animation file for closing effect : fade_out.xml

<?xml version="1.0" encoding="utf-8"?>

<alpha xmlns:android=""


           android:fromAlpha="1.0" android:toAlpha="0.0"


           android:duration="500" />

Step 3: Add this code when starting your introscreen activity :

Intent i = new Intent(this, IntroScreenActivity.class);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);

If you want your introscreen to be only launched first time user opens app  you can use sharedPreference to store app opened status.

Download SharedPreference Util file :

Copy paste code into your first homescreen Activity :

        SharedPreference spre=new SharedPreference(getApplicationContext());
        String show=spref.getData("IntroShown");
            Intent intent=new Intent(getApplicationContext(),IntroScreenActivity.class);

Thank you
Share and Comment

No comments:

Post a Comment