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"
// 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:converter-gson:$retrofit2"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -182,7 +182,9 @@ fun ColorAndStylePage(
enable = false,
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
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
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
},
) {}
Spacer(modifier = Modifier.height(24.dp))
}
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
}
}
}

View File

@ -247,7 +247,9 @@ fun FlowPageStylePage(
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
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
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.net.Uri
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
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 {
ext {
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'
// https://developer.android.com/jetpack/androidx/releases/compose-ui
compose = '1.2.0-beta02'
// https://github.com/google/accompanist/releases
accompanist = '0.24.7-alpha'
// 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'
// https://developer.android.com/jetpack/androidx/releases/room
room = '2.5.0-alpha01'
// https://developer.android.com/jetpack/androidx/releases/datastore
datastore = '1.0.0'
// https://developer.android.com/jetpack/androidx/releases/work
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'
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'
// https://github.com/dankito/Readability4J
readability4j = '1.0.8'
// https://github.com/mdewilde/opml-parser
opmlParser = '2.2.0'
// http://bigbadaboom.github.io/androidsvg/release_notes.html
androidSVG = '1.4'
}
@ -27,7 +44,7 @@ buildscript {
plugins {
id 'com.android.application' 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) {