Coder Social home page Coder Social logo

splashscreen's Introduction

Android SplashScreen

Android Arsenal API

Android library for getting a nice and simple SlashScreen into your Android app.

Animated demo

Installation

Up to now, the library is only available on JitPack. Please add this code to your build.gradle file on project level:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

To load the library into your project, use this code in the build.gradle file within the app module:

  implementation 'com.github.mrgames13:SplashScreen:1.0.5'

Usage

To use the SplashScreen, paste this code to the beginning of the onCreate method of the launcher activity of your app. For better performance, we recommend to do this before setContentView().

SplashScreenBuilder.getInstance(this)
                .setVideo(R.raw.splash_animation)
                .setVideoDark(R.raw.splash_animation_dark)
                .setImage(R.drawable.app_icon)
                .show();

If you want to receive a result from the SplashScreen, you can override onActivtyResult as following:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(requestCode == SplashScreenBuilder.SPLASH_SCREEN_FINISHED) {
        if(resultCode == RESULT_OK) {
            //SplashScreen finished without manual canceling
        } else if(resultCode == RESULT_CANCELED) {
            //SplashScreen finished through manual canceling
        }
    }
}

You can customize the appearance of the SplashScreen using following arguments when building the Activity with SplashScreenBuilder:

Method Description
setVideo(int res_id) Sets the animation video of the SplashScreen. You have to pass this argument, otherwise the app will get an error.
setVideoDark(int res_id) Set the animation video of the Splash Screen for the dark theme.
setImage(int res_id) Sets the image of the SplashScreen, which is displayed when the animation has ended. You have to pass this argument, otherwise the app will get an error.
setTextFadeInDuration(int millis) You can call this method to set the duration of the fade in animation of the title and the subtitle.
setTitle(String title) This method replaces the name of your app, which is the default title of the SplashScreen, with a custom string.
setSubtitle(String title) This method replaces the default subtitle, with a custom string.
skipImage(boolean skip) This opens the ability to skip the image after the video.

Thank you for using the SplashScreen!

© M&R Games 2018-2019 (Designed and developed by Marc Auberer in 2018 and 2019)

splashscreen's People

Contributors

mrgames13 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.