Update dependencies

This commit is contained in:
Ash 2022-05-22 05:06:49 +08:00
parent 647ef7a0bd
commit ae394da387
17 changed files with 79 additions and 44 deletions

View File

@ -116,7 +116,7 @@ dependencies {
implementation "org.conscrypt:conscrypt-android:2.5.2" implementation "org.conscrypt:conscrypt-android:2.5.2"
// https://square.github.io/okhttp/changelogs/changelog/ // https://square.github.io/okhttp/changelogs/changelog/
implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.6" implementation "com.squareup.okhttp3:okhttp:$okhttp"
implementation "com.squareup.retrofit2:retrofit:$retrofit2" implementation "com.squareup.retrofit2:retrofit:$retrofit2"
implementation "com.squareup.retrofit2:converter-gson:$retrofit2" implementation "com.squareup.retrofit2:converter-gson:$retrofit2"

View File

@ -1,13 +1,8 @@
package me.ash.reader.ui.component.base package me.ash.reader.ui.component.base
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.material3.*
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SmallTopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
@ -28,7 +23,7 @@ fun RYScaffold(
floatingActionButton: (@Composable () -> Unit)? = null, floatingActionButton: (@Composable () -> Unit)? = null,
content: @Composable () -> Unit = {}, content: @Composable () -> Unit = {},
) { ) {
androidx.compose.material3.Scaffold( Scaffold(
modifier = Modifier modifier = Modifier
.background( .background(
MaterialTheme.colorScheme.surfaceColorAtElevation( MaterialTheme.colorScheme.surfaceColorAtElevation(
@ -62,7 +57,12 @@ fun RYScaffold(
) )
} }
}, },
content = { content() }, content = {
Column {
Spacer(modifier = Modifier.height(it.calculateTopPadding()))
content()
}
},
bottomBar = { bottomBar?.invoke() }, bottomBar = { bottomBar?.invoke() },
floatingActionButton = { floatingActionButton?.invoke() }, floatingActionButton = { floatingActionButton?.invoke() },
) )

View File

@ -39,7 +39,7 @@ fun RYTextField(
TextField( TextField(
modifier = Modifier.focusRequester(focusRequester), modifier = Modifier.focusRequester(focusRequester),
colors = TextFieldDefaults.textFieldColors( colors = TextFieldDefaults.textFieldColors(
backgroundColor = Color.Transparent, containerColor = Color.Transparent,
), ),
maxLines = 1, maxLines = 1,
enabled = !readOnly, enabled = !readOnly,

View File

@ -67,7 +67,7 @@ fun FeedsPage(
val newVersion = LocalNewVersionNumber.current val newVersion = LocalNewVersionNumber.current
val skipVersion = LocalSkipVersionNumber.current val skipVersion = LocalSkipVersionNumber.current
val currentVersion by remember { mutableStateOf(context.getCurrentVersion()) } val currentVersion = remember { context.getCurrentVersion() }
val owner = LocalLifecycleOwner.current val owner = LocalLifecycleOwner.current
var isSyncing by remember { mutableStateOf(false) } var isSyncing by remember { mutableStateOf(false) }
@ -89,7 +89,7 @@ fun FeedsPage(
) { result -> ) { result ->
feedsViewModel.exportAsOpml { string -> feedsViewModel.exportAsOpml { string ->
result?.let { uri -> result?.let { uri ->
context.contentResolver.openOutputStream(uri)?.let { outputStream -> context.contentResolver.openOutputStream(uri)?.use { outputStream ->
outputStream.write(string.toByteArray()) outputStream.write(string.toByteArray())
} }
} }

View File

@ -45,7 +45,7 @@ fun SubscribeDialog(
val groupsState = subscribeUiState.groups.collectAsState(initial = emptyList()) val groupsState = subscribeUiState.groups.collectAsState(initial = emptyList())
val launcher = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { val launcher = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) {
it?.let { uri -> it?.let { uri ->
context.contentResolver.openInputStream(uri)?.let { inputStream -> context.contentResolver.openInputStream(uri)?.use { inputStream ->
subscribeViewModel.importFromInputStream(inputStream) subscribeViewModel.importFromInputStream(inputStream)
} }
} }

View File

@ -240,10 +240,7 @@ fun FlowPage(
} }
} }
item { item {
Spacer(modifier = Modifier.height(64.dp)) Spacer(modifier = Modifier.height(128.dp))
if (pagingItems.loadState.source.refresh is LoadState.NotLoading && pagingItems.itemCount != 0) {
Spacer(modifier = Modifier.height(64.dp))
}
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars)) Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
} }
} }

View File

@ -62,7 +62,7 @@ fun SearchBar(
.fillMaxWidth() .fillMaxWidth()
.focusRequester(focusRequester), .focusRequester(focusRequester),
colors = TextFieldDefaults.textFieldColors( colors = TextFieldDefaults.textFieldColors(
backgroundColor = Color.Transparent, containerColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent, focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent,
), ),

View File

@ -26,7 +26,7 @@ import me.ash.reader.R
import me.ash.reader.ui.component.base.CanBeDisabledIconButton import me.ash.reader.ui.component.base.CanBeDisabledIconButton
@Composable @Composable
fun ReadBar( fun ReadingBar(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
disabled: Boolean, disabled: Boolean,
isUnread: Boolean, isUnread: Boolean,
@ -40,9 +40,7 @@ fun ReadBar(
var fullContent by remember { mutableStateOf(isFullContent) } var fullContent by remember { mutableStateOf(isFullContent) }
Surface( Surface(
modifier = Modifier modifier = modifier.background(MaterialTheme.colorScheme.surface),
.background(MaterialTheme.colorScheme.surface)
.navigationBarsPadding(),
tonalElevation = 0.dp, tonalElevation = 0.dp,
) { ) {
Box( Box(

View File

@ -80,6 +80,7 @@ fun ReadingPage(
articleWithFeed = readingUiState.articleWithFeed, articleWithFeed = readingUiState.articleWithFeed,
isLoading = readingUiState.isLoading, isLoading = readingUiState.isLoading,
listState = readingUiState.listState, listState = readingUiState.listState,
isShowToolBar = readingUiState.articleWithFeed == null || !isScrollDown,
) )
Box( Box(
modifier = Modifier modifier = Modifier
@ -186,6 +187,7 @@ private fun Content(
articleWithFeed: ArticleWithFeed?, articleWithFeed: ArticleWithFeed?,
listState: LazyListState, listState: LazyListState,
isLoading: Boolean, isLoading: Boolean,
isShowToolBar: Boolean,
) { ) {
if (articleWithFeed == null) return if (articleWithFeed == null) return
val context = LocalContext.current val context = LocalContext.current
@ -195,7 +197,13 @@ private fun Content(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.statusBarsPadding() .statusBarsPadding()
.navigationBarsPadding() .run {
if (isShowToolBar) {
navigationBarsPadding()
} else {
this
}
}
.drawVerticalScrollbar(listState), .drawVerticalScrollbar(listState),
state = listState, state = listState,
) { ) {
@ -242,8 +250,8 @@ private fun Content(
) )
} }
item { item {
Spacer(modifier = Modifier.height(64.dp)) Spacer(modifier = Modifier.height(128.dp))
Spacer(modifier = Modifier.height(64.dp)) Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
} }
} }
} }
@ -263,7 +271,8 @@ private fun BottomBar(
enter = fadeIn() + expandVertically(), enter = fadeIn() + expandVertically(),
exit = fadeOut() + shrinkVertically(), exit = fadeOut() + shrinkVertically(),
) { ) {
ReadBar( ReadingBar(
modifier = Modifier.navigationBarsPadding(),
disabled = false, disabled = false,
isUnread = articleWithFeed.article.isUnread, isUnread = articleWithFeed.article.isUnread,
isStarred = articleWithFeed.article.isStarred, isStarred = articleWithFeed.article.isStarred,

View File

@ -138,6 +138,8 @@ fun SettingsPage(
launchSingleTop = true launchSingleTop = true
} }
} }
}
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars)) Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
} }
} }

View File

@ -182,7 +182,9 @@ fun ColorAndStylePage(
enable = false, enable = false,
onClick = {}, onClick = {},
) {} ) {}
Spacer(modifier = Modifier.height(24.dp)) }
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
} }
} }
} }

View File

@ -1,6 +1,6 @@
package me.ash.reader.ui.page.settings.color package me.ash.reader.ui.page.settings.color
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack import androidx.compose.material.icons.rounded.ArrowBack
@ -77,6 +77,9 @@ fun DarkThemePage(
} }
} }
} }
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
}
} }
} }
) )

View File

@ -185,7 +185,9 @@ fun FeedsPageStylePage(
filterBarTonalElevationDialogVisible = true filterBarTonalElevationDialogVisible = true
}, },
) {} ) {}
Spacer(modifier = Modifier.height(24.dp)) }
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
} }
} }
} }

View File

@ -247,7 +247,9 @@ fun FlowPageStylePage(
filterBarTonalElevationDialogVisible = true filterBarTonalElevationDialogVisible = true
}, },
) {} ) {}
Spacer(modifier = Modifier.height(24.dp)) }
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
} }
} }
} }

View File

@ -1,8 +1,6 @@
package me.ash.reader.ui.page.settings.interaction package me.ash.reader.ui.page.settings.interaction
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack import androidx.compose.material.icons.rounded.ArrowBack
@ -70,6 +68,9 @@ fun InteractionPage(
}, },
) {} ) {}
} }
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
}
} }
} }
) )

View File

@ -2,8 +2,7 @@ package me.ash.reader.ui.page.settings.languages
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.KeyboardArrowRight import androidx.compose.material.icons.outlined.KeyboardArrowRight
@ -88,6 +87,9 @@ fun LanguagesPage(
} }
} }
} }
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
}
} }
} }
) )

View File

@ -1,20 +1,37 @@
buildscript { buildscript {
ext { ext {
compose = '1.2.0-alpha07' // https://developer.android.com/jetpack/androidx/releases/compose-ui
accompanist = '0.24.6-alpha' compose = '1.2.0-beta02'
material3 = '1.0.0-alpha09' // https://github.com/google/accompanist/releases
lifecycle = '2.5.0-alpha06' accompanist = '0.24.7-alpha'
navigation = '2.5.0-alpha04' // https://developer.android.com/jetpack/androidx/releases/compose-material3
material3 = '1.0.0-alpha12'
// https://developer.android.com/jetpack/androidx/releases/lifecycle
lifecycle = '2.5.0-rc01'
// https://developer.android.com/jetpack/androidx/releases/navigation
navigation = '2.5.0-rc01'
// https://developer.android.com/jetpack/androidx/releases/paging
paging = '3.1.1' paging = '3.1.1'
// https://developer.android.com/jetpack/androidx/releases/room
room = '2.5.0-alpha01' room = '2.5.0-alpha01'
// https://developer.android.com/jetpack/androidx/releases/datastore
datastore = '1.0.0' datastore = '1.0.0'
// https://developer.android.com/jetpack/androidx/releases/work
work = '2.8.0-alpha02' work = '2.8.0-alpha02'
profileinstaller = '1.2.0-alpha02' // https://developer.android.com/jetpack/androidx/releases/profileinstaller
profileinstaller = '1.2.0-beta02'
// https://square.github.io/okhttp/changelogs/changelog/
okhttp = '5.0.0-alpha.7'
retrofit2 = '2.9.0' retrofit2 = '2.9.0'
coil = '2.0.0-rc03' // https://coil-kt.github.io/coil/changelog/
coil = '2.1.0'
// https://mvnrepository.com/artifact/com.rometools/rome
rome = '1.18.0' rome = '1.18.0'
// https://github.com/dankito/Readability4J
readability4j = '1.0.8' readability4j = '1.0.8'
// https://github.com/mdewilde/opml-parser
opmlParser = '2.2.0' opmlParser = '2.2.0'
// http://bigbadaboom.github.io/androidsvg/release_notes.html
androidSVG = '1.4' androidSVG = '1.4'
} }
@ -27,7 +44,7 @@ buildscript {
plugins { plugins {
id 'com.android.application' version '7.1.1' apply false id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false id 'com.android.library' version '7.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
} }
task clean(type: Delete) { task clean(type: Delete) {