Bimba.git

ref: ead57a14f5fdd23da994c20304bdce1ca9010f26

app/src/main/java/xyz/apiote/bimba/czwek/onboarding/FirstRunActivity.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-FileCopyrightText: Adam Evyčędo
//
// SPDX-License-Identifier: GPL-3.0-or-later

package xyz.apiote.bimba.czwek.onboarding

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import xyz.apiote.bimba.czwek.dashboard.MainActivity
import xyz.apiote.bimba.czwek.repo.migrateDB
import xyz.apiote.bimba.czwek.settings.feeds.migrateFeedsSettings

class FirstRunActivity : AppCompatActivity() {
	override fun onCreate(savedInstanceState: Bundle?) {
		installSplashScreen()
		super.onCreate(savedInstanceState)

		val preferences = getSharedPreferences("shp", MODE_PRIVATE)

		migrateFeedsSettings(this)
		migrateDB(this)

		val intent = if (preferences.getBoolean("firstRun", true)) {
			Intent(this, OnboardingActivity::class.java)
		} else {
			Intent(this, MainActivity::class.java)
		}
		startActivity(intent)
		finish()
	}

}