diff --git a/app/build.gradle b/app/build.gradle index 971e099..8bcf265 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,14 @@ plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' + id "com.android.application" + id "org.jetbrains.kotlin.android" + id "kotlin-kapt" + id "dagger.hilt.android.plugin" id "androidx.navigation.safeargs.kotlin" } -def gitCommitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim() +def gitCommitHash = "git rev-parse --verify --short HEAD".execute().text.trim() def keyProps = new Properties() -def keyPropsFile = rootProject.file('ReadYouSecret/keystore.properties') +def keyPropsFile = rootProject.file("ReadYouSecret/keystore.properties") if (keyPropsFile.exists()) { println("Loading keystore properties from ${keyPropsFile.absolutePath}") keyProps.load(new FileInputStream(keyPropsFile)) @@ -31,17 +31,17 @@ android { } signingConfigs { release { - keyAlias keyProps['keyAlias'] - keyPassword keyProps['keyPassword'] - storeFile keyProps['storeFile'] ? file(keyProps['storeFile']) : null - storePassword keyProps['storePassword'] + keyAlias keyProps["keyAlias"] + keyPassword keyProps["keyPassword"] + storeFile keyProps["storeFile"] ? file(keyProps["storeFile"]) : null + storePassword keyProps["storePassword"] } } buildTypes { release { minifyEnabled true shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" signingConfig signingConfigs.release } } @@ -58,70 +58,107 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = "1.8" } buildFeatures { compose true } composeOptions { - kotlinCompilerExtensionVersion compose_version + kotlinCompilerExtensionVersion compose } packagingOptions { resources { - excludes += '/META-INF/{AL2.0,LGPL2.1}' + excludes += "/META-INF/{AL2.0,LGPL2.1}" } } } dependencies { - implementation 'com.caverock:androidsvg-aar:1.4' - implementation 'com.github.ireward:compose-html:1.0.2' - implementation 'be.ceau:opml-parser:2.2.0' - implementation "androidx.profileinstaller:profileinstaller:1.2.0-alpha02" - implementation("io.coil-kt:coil-svg:2.0.0-rc03") - implementation("io.coil-kt:coil-compose:2.0.0-rc03") - implementation("androidx.compose.animation:animation-graphics:$compose_version") - implementation("com.google.accompanist:accompanist-flowlayout:0.24.3-alpha") - implementation("com.google.accompanist:accompanist-navigation-animation:0.24.3-alpha") - implementation "androidx.datastore:datastore-preferences:1.0.0" - implementation "com.airbnb.android:lottie-compose:4.2.2" + implementation "com.github.ireward:compose-html:1.0.2" + + // http://bigbadaboom.github.io/androidsvg/release_notes.html + implementation "com.caverock:androidsvg-aar:$androidSVG" + + // https://github.com/mdewilde/opml-parser + implementation "be.ceau:opml-parser:$opmlParser" + + // https://github.com/dankito/Readability4J + implementation "net.dankito.readability4j:readability4j:$readability4j" + + // https://github.com/muhrifqii/ParseRSS/releases + implementation "com.github.muhrifqii.ParseRSS:parserss:$parseRSS" + implementation "com.github.muhrifqii.ParseRSS:retrofit:$parseRSS" + + // https://coil-kt.github.io/coil/changelog/ + implementation("io.coil-kt:coil-compose:$coil") + implementation("io.coil-kt:coil-svg:$coil") + + // https://square.github.io/okhttp/changelogs/changelog/ + implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.6" + implementation "com.squareup.retrofit2:retrofit:$retrofit2" + implementation "com.squareup.retrofit2:converter-gson:$retrofit2" + + // https://developer.android.com/jetpack/androidx/releases/profileinstaller + implementation "androidx.profileinstaller:profileinstaller:$profileinstaller" + + // https://developer.android.com/jetpack/androidx/releases/work + implementation "androidx.work:work-runtime-ktx:$work" + + // https://developer.android.com/jetpack/androidx/releases/datastore + implementation "androidx.datastore:datastore-preferences:$datastore" + + // https://developer.android.com/jetpack/androidx/releases/room + implementation "androidx.room:room-paging:$room" + implementation "androidx.room:room-common:$room" + implementation "androidx.room:room-ktx:$room" + kapt "androidx.room:room-compiler:$room" + + // https://developer.android.com/jetpack/androidx/releases/paging + implementation "androidx.paging:paging-common:$paging" + implementation "androidx.paging:paging-runtime:$paging" + implementation "androidx.paging:paging-compose:1.0.0-alpha14" + + // https://developer.android.com/jetpack/androidx/releases/navigation + implementation "androidx.navigation:navigation-compose:$navigation" + + // https://developer.android.com/jetpack/androidx/releases/lifecycle + implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle" + + // https://developer.android.com/jetpack/androidx/releases/compose-material3 + implementation "androidx.compose.material3:material3:$material3" + + // https://github.com/google/accompanist/releases + implementation "com.google.accompanist:accompanist-insets:$accompanist" + implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist" + implementation "com.google.accompanist:accompanist-pager:$accompanist" + implementation "com.google.accompanist:accompanist-flowlayout:$accompanist" + implementation "com.google.accompanist:accompanist-navigation-animation:$accompanist" + implementation "com.google.accompanist:accompanist-swiperefresh:$accompanist" + + // https://developer.android.com/jetpack/androidx/releases/compose-animation + implementation "androidx.compose.animation:animation-graphics:$compose" + // https://developer.android.com/jetpack/androidx/releases/compose-ui + implementation "androidx.compose.ui:ui:$compose" + // https://developer.android.com/jetpack/androidx/releases/compose-material + implementation "androidx.compose.material:material:$compose" + implementation "androidx.compose.material:material-icons-extended:$compose" + implementation "androidx.compose.ui:ui-tooling-preview:$compose" + androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose" + debugImplementation "androidx.compose.ui:ui-tooling:$compose" + + // hilt implementation "androidx.hilt:hilt-work:1.0.0" - implementation "androidx.work:work-runtime-ktx:2.8.0-alpha01" - implementation "net.dankito.readability4j:readability4j:1.0.8" - implementation "androidx.navigation:navigation-compose:2.5.0-alpha01" implementation "com.google.dagger:hilt-android:2.40.5" kapt "com.google.dagger:hilt-android-compiler:2.40.5" - implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03' - kapt 'androidx.hilt:hilt-compiler:1.0.0' + implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03" + kapt "androidx.hilt:hilt-compiler:1.0.0" implementation "androidx.hilt:hilt-navigation-compose:1.0.0" - implementation 'com.google.accompanist:accompanist-swiperefresh:0.24.1-alpha' - implementation 'androidx.paging:paging-compose:1.0.0-alpha14' - implementation 'androidx.paging:paging-runtime:3.1.0' - implementation 'androidx.paging:paging-common:3.1.0' - implementation 'androidx.room:room-paging:2.4.1' - implementation 'androidx.room:room-common:2.4.1' - implementation 'androidx.room:room-ktx:2.4.1' - kapt "androidx.room:room-compiler:2.4.1" - implementation "com.github.muhrifqii.ParseRSS:parserss:0.4.0" - implementation "com.github.muhrifqii.ParseRSS:retrofit:0.4.0" - implementation 'com.squareup.retrofit2:retrofit:2.9.0' - implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.4' - implementation 'com.squareup.retrofit2:converter-gson:2.9.0' - implementation "com.google.accompanist:accompanist-insets:0.24.1-alpha" - implementation "com.google.accompanist:accompanist-systemuicontroller:0.24.1-alpha" - implementation 'com.google.accompanist:accompanist-pager:0.24.1-alpha' - implementation 'androidx.core:core-ktx:1.7.0' - implementation "androidx.compose.ui:ui:$compose_version" - implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.0-alpha01" - implementation "androidx.compose.material:material:1.2.0-alpha04" - implementation "androidx.compose.material3:material3:1.0.0-alpha07" - implementation "androidx.compose.material:material-icons-extended:$compose_version" - implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' - implementation 'androidx.activity:activity-compose:1.3.1' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' - androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" - debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" + + // android + implementation "androidx.core:core-ktx:1.7.0" + implementation "androidx.activity:activity-compose:1.4.0" + testImplementation "junit:junit:4.13.2" + androidTestImplementation "androidx.test.ext:junit:1.1.3" + androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0" } \ No newline at end of file diff --git a/app/src/main/java/me/ash/reader/ui/component/LottieAnimation.kt b/app/src/main/java/me/ash/reader/ui/component/LottieAnimation.kt deleted file mode 100644 index 0ef4ed4..0000000 --- a/app/src/main/java/me/ash/reader/ui/component/LottieAnimation.kt +++ /dev/null @@ -1,26 +0,0 @@ -package me.ash.reader.ui.component - -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.ui.Modifier -import com.airbnb.lottie.compose.LottieAnimation -import com.airbnb.lottie.compose.LottieCompositionSpec -import com.airbnb.lottie.compose.rememberLottieComposition - -@Composable -fun LottieAnimation( - modifier: Modifier = Modifier, - url: String, -) { - val composition by rememberLottieComposition( - LottieCompositionSpec.Url(url) - ) - - LottieAnimation( - composition = composition, - modifier = modifier, - isPlaying = true, - restartOnPlay = true, - iterations = Int.MAX_VALUE, - ) -} \ No newline at end of file diff --git a/app/src/main/java/me/ash/reader/ui/component/TextField.kt b/app/src/main/java/me/ash/reader/ui/component/TextField.kt index a86c978..63f11d2 100644 --- a/app/src/main/java/me/ash/reader/ui/component/TextField.kt +++ b/app/src/main/java/me/ash/reader/ui/component/TextField.kt @@ -2,14 +2,10 @@ package me.ash.reader.ui.component import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions -import androidx.compose.material.TextFieldDefaults import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material.icons.rounded.ContentPaste -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text +import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.remember @@ -40,14 +36,12 @@ fun TextField( focusRequester.requestFocus() } - androidx.compose.material.TextField( + TextField( modifier = Modifier.focusRequester(focusRequester), colors = TextFieldDefaults.textFieldColors( backgroundColor = Color.Transparent, - cursorColor = MaterialTheme.colorScheme.onSurface, - textColor = MaterialTheme.colorScheme.onSurface, - focusedIndicatorColor = MaterialTheme.colorScheme.primary, ), + maxLines = 1, enabled = !readOnly, value = value, onValueChange = { @@ -56,7 +50,8 @@ fun TextField( placeholder = { Text( text = placeholder, - color = MaterialTheme.colorScheme.outline.copy(alpha = 0.7f) + color = MaterialTheme.colorScheme.outline.copy(alpha = 0.7f), + style = MaterialTheme.typography.bodyMedium ) }, isError = errorMessage.isNotEmpty(), diff --git a/app/src/main/java/me/ash/reader/ui/page/home/HomePage.kt b/app/src/main/java/me/ash/reader/ui/page/home/HomePage.kt index 26b2de3..ddac4d2 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/HomePage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/HomePage.kt @@ -3,6 +3,7 @@ package me.ash.reader.ui.page.home import androidx.activity.compose.BackHandler import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.* import androidx.compose.runtime.saveable.rememberSaveable @@ -10,7 +11,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavHostController -import com.google.accompanist.insets.statusBarsPadding import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.ui.component.ViewPager import me.ash.reader.ui.ext.collectAsStateValue diff --git a/app/src/main/java/me/ash/reader/ui/page/home/flow/SearchBar.kt b/app/src/main/java/me/ash/reader/ui/page/home/flow/SearchBar.kt index 5399a09..c327c92 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/flow/SearchBar.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/flow/SearchBar.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions -import androidx.compose.material.TextFieldDefaults import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material.icons.rounded.Search @@ -57,15 +56,13 @@ fun SearchBar( contentDescription = stringResource(R.string.search), tint = MaterialTheme.colorScheme.onSurfaceVariant, ) - androidx.compose.material.TextField( + TextField( modifier = Modifier .height(56.dp) .fillMaxWidth() .focusRequester(focusRequester), colors = TextFieldDefaults.textFieldColors( backgroundColor = Color.Transparent, - cursorColor = MaterialTheme.colorScheme.onSurface, - textColor = MaterialTheme.colorScheme.onSurface, focusedIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent, ), diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/ColorAndStyle.kt b/app/src/main/java/me/ash/reader/ui/page/settings/ColorAndStyle.kt index 54abfb9..5220ddb 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/ColorAndStyle.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/ColorAndStyle.kt @@ -24,7 +24,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController -import com.google.accompanist.insets.statusBarsPadding import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt index 61c0dfd..0313cee 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt @@ -3,6 +3,7 @@ package me.ash.reader.ui.page.settings import androidx.compose.foundation.background import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.* @@ -14,7 +15,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController -import com.google.accompanist.insets.statusBarsPadding import me.ash.reader.R import me.ash.reader.ui.component.Banner import me.ash.reader.ui.component.DisplayText diff --git a/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt b/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt index fde1a9b..4d8e46c 100644 --- a/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt @@ -16,7 +16,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController -import com.google.accompanist.insets.statusBarsPadding import com.ireward.htmlcompose.HtmlText import kotlinx.coroutines.launch import me.ash.reader.R diff --git a/build.gradle b/build.gradle index 42dac33..75f7b0f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,21 @@ buildscript { ext { - compose_version = '1.2.0-alpha06' + compose = '1.2.0-alpha07' + accompanist = '0.24.6-alpha' + material3 = '1.0.0-alpha09' + lifecycle = '2.5.0-alpha06' + navigation = '2.5.0-alpha04' + paging = '3.1.1' + room = '2.5.0-alpha01' + datastore = '1.0.0' + work = '2.8.0-alpha02' + profileinstaller = '1.2.0-alpha02' + retrofit2 = '2.9.0' + coil = '2.0.0-rc03' + parseRSS = '0.5.0' + readability4j = '1.0.8' + opmlParser = '2.2.0' + androidSVG = '1.4' } dependencies { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df0bbc0..0f414ae 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Feb 05 00:02:40 CST 2022 +#Wed Apr 20 21:38:37 CST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME