Dependency update, added LocalActivity provider
This commit is contained in:
@@ -14,12 +14,21 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 31
|
||||
compileSdk = 33
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = File(System.getenv("SIGNING_STORE_FILE"))
|
||||
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
|
||||
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
|
||||
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "xyz.quaver.pupil"
|
||||
minSdk = 21
|
||||
targetSdk = 31
|
||||
targetSdk = 33
|
||||
versionCode = 600
|
||||
versionName = VERSION
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -43,15 +52,8 @@ android {
|
||||
isCrunchPngs = false
|
||||
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = File("/tmp/keystore.jks")
|
||||
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
|
||||
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
|
||||
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +83,7 @@ android {
|
||||
)
|
||||
)
|
||||
}
|
||||
namespace = "xyz.quaver.pupil"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -89,8 +92,8 @@ dependencies {
|
||||
implementation(Kotlin.SERIALIZATION)
|
||||
implementation(Kotlin.COROUTINE)
|
||||
|
||||
implementation("androidx.activity:activity-compose:1.4.0")
|
||||
implementation("androidx.navigation:navigation-compose:2.4.2")
|
||||
implementation("androidx.activity:activity-compose:1.6.1")
|
||||
implementation("androidx.navigation:navigation-compose:2.5.3")
|
||||
|
||||
implementation(JetpackCompose.FOUNDATION)
|
||||
implementation(JetpackCompose.UI)
|
||||
@@ -117,10 +120,10 @@ dependencies {
|
||||
implementation(KtorClient.CONTENT_NEGOTIATION)
|
||||
implementation(KtorClient.SERIALIZATION)
|
||||
|
||||
implementation("androidx.room:room-runtime:2.4.2")
|
||||
annotationProcessor("androidx.room:room-compiler:2.4.2")
|
||||
kapt("androidx.room:room-compiler:2.4.2")
|
||||
implementation("androidx.room:room-ktx:2.4.2")
|
||||
implementation("androidx.room:room-runtime:2.4.3")
|
||||
annotationProcessor("androidx.room:room-compiler:2.4.3")
|
||||
kapt("androidx.room:room-compiler:2.4.3")
|
||||
implementation("androidx.room:room-ktx:2.4.3")
|
||||
|
||||
implementation("androidx.datastore:datastore:1.0.0")
|
||||
implementation("androidx.datastore:datastore-preferences:1.0.0")
|
||||
@@ -138,10 +141,10 @@ dependencies {
|
||||
|
||||
implementation("org.jsoup:jsoup:1.14.3")
|
||||
|
||||
implementation("xyz.quaver.pupil.sources:core:0.0.1-alpha01-DEV26")
|
||||
implementation("xyz.quaver.pupil.sources:core:0.0.1-alpha01-DEV29")
|
||||
|
||||
implementation("xyz.quaver:documentfilex:0.7.2")
|
||||
implementation("xyz.quaver:subsampledimage:0.0.1-alpha19-SNAPSHOT")
|
||||
implementation("xyz.quaver:subsampledimage:0.0.1-alpha22-SNAPSHOT")
|
||||
|
||||
implementation("org.kodein.log:kodein-log:0.12.0")
|
||||
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.8.1")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="xyz.quaver.pupil">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
@@ -33,11 +33,13 @@ import androidx.navigation.compose.rememberNavController
|
||||
import com.google.accompanist.insets.ProvideWindowInsets
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
import kotlinx.coroutines.launch
|
||||
import org.kodein.di.DIAware
|
||||
import org.kodein.di.*
|
||||
import org.kodein.di.android.closestDI
|
||||
import org.kodein.di.android.subDI
|
||||
import org.kodein.di.compose.rememberInstance
|
||||
import xyz.quaver.pupil.BuildConfig
|
||||
import xyz.quaver.pupil.sources.core.Source
|
||||
import xyz.quaver.pupil.sources.core.util.LocalActivity
|
||||
import xyz.quaver.pupil.sources.loadSource
|
||||
import xyz.quaver.pupil.ui.theme.PupilTheme
|
||||
import xyz.quaver.pupil.util.PupilHttpClient
|
||||
@@ -64,7 +66,7 @@ class MainActivity : ComponentActivity(), DIAware {
|
||||
val client: PupilHttpClient by rememberInstance()
|
||||
|
||||
val latestRelease by produceState<Release?>(null) {
|
||||
value = client.latestRelease()
|
||||
value = null //client.latestRelease()
|
||||
}
|
||||
|
||||
var dismissUpdate by remember { mutableStateOf(false) }
|
||||
@@ -102,10 +104,12 @@ class MainActivity : ComponentActivity(), DIAware {
|
||||
}
|
||||
}
|
||||
else {
|
||||
CompositionLocalProvider(LocalActivity provides this@MainActivity) {
|
||||
_source.Entry()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
composable("settings") {
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import coil.compose.rememberImagePainter
|
||||
import coil.compose.AsyncImage
|
||||
import com.google.accompanist.drawablepainter.rememberDrawablePainter
|
||||
import com.google.accompanist.insets.LocalWindowInsets
|
||||
import com.google.accompanist.insets.rememberInsetsPaddingValues
|
||||
@@ -58,8 +58,10 @@ import com.google.accompanist.insets.ui.TopAppBar
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.kodein.di.*
|
||||
import org.kodein.di.DI
|
||||
import org.kodein.di.DIAware
|
||||
import org.kodein.di.compose.localDI
|
||||
import org.kodein.di.instance
|
||||
import xyz.quaver.pupil.sources.SourceEntry
|
||||
import xyz.quaver.pupil.sources.rememberLocalSourceList
|
||||
import xyz.quaver.pupil.sources.rememberRemoteSourceList
|
||||
@@ -67,11 +69,6 @@ import xyz.quaver.pupil.util.PupilHttpClient
|
||||
import xyz.quaver.pupil.util.RemoteSourceInfo
|
||||
import xyz.quaver.pupil.util.launchApkInstaller
|
||||
import java.io.File
|
||||
import kotlin.collections.associateBy
|
||||
import kotlin.collections.contains
|
||||
import kotlin.collections.forEach
|
||||
import kotlin.collections.listOf
|
||||
import kotlin.collections.orEmpty
|
||||
|
||||
private sealed class SourceSelectorScreen(val route: String, val icon: ImageVector) {
|
||||
object Local: SourceSelectorScreen("local", Icons.Default.DownloadDone)
|
||||
@@ -97,9 +94,9 @@ class DownloadApkActionState(override val di: DI) : DIAware {
|
||||
suspend fun download(url: String): File? = withContext(Dispatchers.IO) {
|
||||
progress = 0f
|
||||
|
||||
val file = File.createTempFile("pupil", ".apk", File(app.cacheDir, "apks")).also {
|
||||
it.parentFile?.mkdirs()
|
||||
}
|
||||
val file = File.createTempFile("pupil", ".apk", File(app.cacheDir, "apks").also {
|
||||
it.mkdirs()
|
||||
})
|
||||
|
||||
client.downloadFile(url, file).collect { progress = it }
|
||||
|
||||
@@ -256,8 +253,8 @@ fun Explore() {
|
||||
|
||||
SourceListItem(
|
||||
icon = { modifier ->
|
||||
Image(
|
||||
rememberImagePainter("https://raw.githubusercontent.com/tom5079/PupilSources/master/${sourceInfo.projectName}/src/main/res/mipmap-xxxhdpi/ic_launcher.png"),
|
||||
AsyncImage(
|
||||
"https://raw.githubusercontent.com/tom5079/PupilSources/master/${sourceInfo.projectName}/src/main/res/mipmap-xxxhdpi/ic_launcher.png",
|
||||
contentDescription = "source icon",
|
||||
modifier = modifier
|
||||
)
|
||||
|
||||
@@ -6,15 +6,15 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:7.1.3")
|
||||
classpath("com.android.tools.build:gradle:7.3.1")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}")
|
||||
classpath("org.jetbrains.kotlin:kotlin-android-extensions:${Versions.KOTLIN}")
|
||||
classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.KOTLIN}")
|
||||
classpath("com.google.gms:google-services:4.3.10")
|
||||
classpath("com.google.gms:google-services:4.3.14")
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
classpath("com.google.firebase:firebase-crashlytics-gradle:2.8.1")
|
||||
classpath("com.google.firebase:perf-plugin:1.4.1")
|
||||
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.2")
|
||||
classpath("com.google.firebase:perf-plugin:1.4.2")
|
||||
classpath("com.google.android.gms:oss-licenses-plugin:0.10.5")
|
||||
classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.18")
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ const val GROUP_ID = "xyz.quaver"
|
||||
const val VERSION = "6.0.0-alpha02"
|
||||
|
||||
object Versions {
|
||||
const val KOTLIN = "1.6.10"
|
||||
const val COROUTINE = "1.6.1"
|
||||
const val SERIALIZATION = "1.3.2"
|
||||
const val KOTLIN = "1.7.10"
|
||||
const val COROUTINE = "1.6.4"
|
||||
const val SERIALIZATION = "1.4.1"
|
||||
|
||||
const val JETPACK_COMPOSE = "1.2.0-alpha07"
|
||||
const val ACCOMPANIST = "0.23.1"
|
||||
const val JETPACK_COMPOSE = "1.3.0"
|
||||
const val ACCOMPANIST = "0.27.0"
|
||||
|
||||
const val KTOR = "2.0.0"
|
||||
const val KTOR = "2.1.3"
|
||||
}
|
||||
|
||||
object Kotlin {
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user