mirror of
https://github.com/priyanshujain/bertsatlas.git
synced 2026-10-02 11:06:59 +00:00
build shared offline app experience
This commit is contained in:
1 parent
e21a2f39e0
commit
c7259ea645
45 files changed
+4584
-40
No files matched your search
@@ -15,11 +15,15 @@ android {
|
||||
versionName = "1.0.0"
|
||||
}
|
||||
|
||||
buildFeatures.compose = true
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
packaging.resources.excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":composeApp"))
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(libs.androidx.room.runtime)
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:label="Bert's Atlas"
|
||||
@@ -16,4 +17,3 @@
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -3,11 +3,30 @@ package app.bertsatlas
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import app.bertsatlas.data.buildBertsAtlasDatabase
|
||||
import app.bertsatlas.data.createPreferencesStore
|
||||
import app.bertsatlas.data.getDatabaseBuilder
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
private var controller: AppController? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent { App() }
|
||||
val database = getDatabaseBuilder(this).buildBertsAtlasDatabase()
|
||||
val preferences = createPreferencesStore(filesDir.resolve("berts-atlas.preferences_pb").absolutePath)
|
||||
val feedback = AndroidDeviceFeedback(this)
|
||||
setContent {
|
||||
App(database, preferences, BuildConfig.DEBUG, feedback) { controller = it }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
controller?.pauseForInterruption()
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
controller?.resumeAfterInterruption()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user