mirror of
https://github.com/jrpie/Launcher.git
synced 2025-04-19 10:20:51 +02:00
Create FirstStartupActivity
This commit is contained in:
parent
de6ba2705e
commit
b322aa613f
4 changed files with 63 additions and 2 deletions
|
@ -0,0 +1,35 @@
|
|||
package com.finnmglas.launcher
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
class FirstStartupActivity : AppCompatActivity(){
|
||||
|
||||
/* Overrides */
|
||||
|
||||
@SuppressLint("SetTextI18n") // I do not care
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val sharedPref = this.getSharedPreferences(
|
||||
getString(R.string.preference_file_key), Context.MODE_PRIVATE)
|
||||
|
||||
initSettings(sharedPref, this)
|
||||
|
||||
// Flags
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
|
||||
setContentView(R.layout.activity_firststartup)
|
||||
}
|
||||
|
||||
fun clickAnywhere(view: View){
|
||||
finish()
|
||||
}
|
||||
}
|
|
@ -33,7 +33,7 @@ GestureDetector.OnDoubleTapListener {
|
|||
private lateinit var mDetector: GestureDetectorCompat
|
||||
|
||||
// get device dimensions
|
||||
val displayMetrics = DisplayMetrics()
|
||||
private val displayMetrics = DisplayMetrics()
|
||||
|
||||
private fun getIntent(packageName: String): Intent? {
|
||||
val pm = applicationContext.packageManager
|
||||
|
@ -108,7 +108,7 @@ GestureDetector.OnDoubleTapListener {
|
|||
|
||||
// First Startup
|
||||
if (!sharedPref.getBoolean("startedBefore", false))
|
||||
initSettings(sharedPref, this)
|
||||
startActivity(Intent(this, FirstStartupActivity::class.java))
|
||||
|
||||
loadSettings(sharedPref)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue