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
dependencies { | |
classpath 'com.android.tools.build:gradle:3.1.2' | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
// Add These Bintray and Maven Gradle Classpaths | |
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' | |
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' | |
} |
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"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item | |
android:drawable="@color/colorPrimary"/> | |
<item | |
android:drawable="@drawable/bg_watermark" /> | |
<item android:bottom="@dimen/_70sdp" |
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
apply plugin: 'com.jfrog.bintray' | |
version = libraryVersion | |
if (project.hasProperty("android")) { // Android libraries | |
task sourcesJar(type: Jar) { | |
classifier = 'sources' | |
from android.sourceSets.main.java.srcDirs | |
} |
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
/** | |
* Kotlin Extensions for simpler, easier and funw way | |
* of launching of Activities | |
*/ | |
inline fun <reified T : Any> Activity.launchActivity ( | |
requestCode: Int = -1, | |
options: Bundle? = null, | |
noinline init: Intent.() -> Unit = {}) | |
{ |
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
Abbrevation | Description | |
---|---|---|
center | Centers any view in the parent horizontally and vertically | |
centerh | Centers any view horizontally in the parent | |
centerv | Centers any view vertically in the parent | |
vertical | Centers any view vertically in any other view | |
horizontal | Centers any view horizontally in any other view | |
fill | Fills any view on all edges to parent | |
over | Puts any view over an other view by setting same constrains as the original view. Works like fill but for any other view | |
above | Puts any view above another view | |
below | Puts any view below another view |
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> | |
<!-- Your AppTheme or other themes/styles here --> | |
<!-- The splash theme. to set the background with your splash screen drawable --> | |
<style name=”AppTheme.Splash” parent="Theme.AppCompat.DayNight.NoActionBar"> | |
<item name=”android:windowBackground”>@drawable/splash_drawable</item> | |
</style> | |
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"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque"> | |
<!-- The white background color as one in Amazon, YouTube, or Drive app --> | |
<item android:drawable="@android:color/white"/> | |
<!-- App logo --> | |
<item> | |
<bitmap |
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" | |
package="com.wajahatkarim.splashscreen.demo"> | |
<application | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" | |
android:theme="@style/AppTheme"> |
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
package com.wajahatkarim.splashscreen | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
class SplashThemeActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
setTheme(R.style.AppTheme) | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_splash_theme) |
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
package com.wajahatkarim.splashscreen | |
import android.content.Intent | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.os.Handler | |
import androidx.core.os.postDelayed | |
class CommonSplashActivity : AppCompatActivity() { | |