mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-13 09:48:47 +00:00
Changed splash screen code to Kotlin
This commit is contained in:
parent
f5a09af505
commit
bc9a91fdbf
@ -1,5 +1,6 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion "30.0.2"
|
||||
@ -54,5 +55,7 @@ dependencies {
|
||||
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
|
||||
implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'
|
||||
implementation "androidx.cardview:cardview:1.0.0"
|
||||
|
||||
compileOnly "com.android.support:appcompat-v7:$supportLibVersion"
|
||||
compileOnly "com.android.support:recyclerview-v7:$supportLibVersion"
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.example.listify;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
public static boolean showSplash = true;
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_splashscreen);
|
||||
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showSplash = false;
|
||||
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
|
||||
intent.putExtra("prev", "Splash");
|
||||
startActivity(intent);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.example.listify
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
class SplashActivity : AppCompatActivity() {
|
||||
override fun onBackPressed() {}
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_splashscreen)
|
||||
Handler().postDelayed({
|
||||
showSplash = false
|
||||
val intent = Intent(this@SplashActivity, MainActivity::class.java)
|
||||
intent.putExtra("prev", "Splash")
|
||||
startActivity(intent)
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
var showSplash = true
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
ext.kotlin_version = "1.3.72"
|
||||
ext.supportLibVersion = "25.3.0"
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
@ -7,6 +9,8 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:4.0.1"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
@ -19,7 +23,6 @@ allprojects {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user