A Splash Screen library for Android made in Kotlin
Splashy
Splash screen library for Android.
? Installation
Add this in your app's build.gradle file:
dependencies {
implementation 'com.rbddevs.splashy:splashy:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21+" // For JAVA Only
}
Or add Splashy as a new dependency inside your pom.xml
<dependency>
<groupId>com.rbddevs.splashy</groupId>
<artifactId>splashy</artifactId>
<version>1.1.0</version>
<type>pom</type>
</dependency>
❔ Usage
Basic Usage
Splashy(this) // For JAVA : new Splashy(this)
.setLogo(R.drawable.splashy)
.setTitle("Splashy")
.show()
Advanced Usage
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Call it immediately after any setContentView() for quick launch
setSplashy()
}
fun setSplashy(){
Splashy(this) // For JAVA : new Splashy(this)
.setLogo(R.drawable.splashy)
.setTitle("Splashy")
.setTitleColor("#FFFFFF")
.setSubTitle("Splash screen made easy")
.setProgressColor(R.color.white)
.setBackgroundResource("#000000")
.setFullScreen(true)
.setTime(5000)
.show()
}
Splashy.hide() AND Splashy.onComplete(getComplete: OnComplete)
fun checkLogin(){
Splashy(this).setInfiniteDuration(true).show() // For JAVA : new Splashy(this)
// Some mock example response operation
Response.onResponse(object : Response.onResponse{
override fun onResponse(response){
Splashy.hide() // Hide after operation
}
}
// Listener for completion of splash screen
Splashy.onComplete(object : Splashy.OnComplete {
override fun onComplete() {
Toast.makeText(this@MainActivity, "Logged In", Toast.LENGTH_SHORT).show()
}
})
}