mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
load pspdfkit key from secrets file
This commit is contained in:
parent
7adf8a8fd8
commit
dae10b2f48
2 changed files with 20 additions and 3 deletions
3
android/Omnivore/app/.gitignore
vendored
3
android/Omnivore/app/.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
/build
|
||||
keystore.properties
|
||||
*.keystore
|
||||
*.keystore
|
||||
src/main/res/values/secrets.xml
|
||||
|
|
@ -10,16 +10,20 @@ import androidx.compose.foundation.layout.Box
|
|||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import app.omnivore.omnivore.ui.theme.OmnivoreTheme
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import app.omnivore.omnivore.ui.auth.LoginViewModel
|
||||
import app.omnivore.omnivore.ui.home.HomeViewModel
|
||||
import app.omnivore.omnivore.ui.reader.PDFReaderViewModel
|
||||
import app.omnivore.omnivore.ui.reader.WebReaderViewModel
|
||||
import app.omnivore.omnivore.ui.root.RootView
|
||||
import app.omnivore.omnivore.ui.theme.OmnivoreTheme
|
||||
import com.pspdfkit.PSPDFKit
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
|
|
@ -30,6 +34,18 @@ class MainActivity : ComponentActivity() {
|
|||
val homeViewModel: HomeViewModel by viewModels()
|
||||
val webReaderViewModel: WebReaderViewModel by viewModels()
|
||||
|
||||
val context = this
|
||||
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
val licenseKey = getString(R.string.pspdfkit_license_key)
|
||||
|
||||
if (licenseKey.length > 30) {
|
||||
PSPDFKit.initialize(context, licenseKey)
|
||||
} else {
|
||||
PSPDFKit.initialize(context, null)
|
||||
}
|
||||
}
|
||||
|
||||
setContent {
|
||||
OmnivoreTheme {
|
||||
Box(
|
||||
|
|
|
|||
Loading…
Reference in a new issue