Add About libraries screen in MoreTab
This commit is contained in:
parent
0b9a055d89
commit
5bf566184d
@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
id("com.mikepenz.aboutlibraries.plugin")
|
||||
}
|
||||
|
||||
|
||||
@ -80,4 +81,6 @@ dependencies {
|
||||
androidTestImplementation(libs.bundles.kointest)
|
||||
|
||||
androidTestImplementation(libs.okhttp.mockserver)
|
||||
|
||||
implementation(libs.aboutlibraries.composem3)
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.readrops.app.more
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.rememberTopAppBarState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
|
||||
import com.readrops.app.R
|
||||
import com.readrops.app.util.components.AndroidScreen
|
||||
|
||||
class AboutLibrariesScreen : AndroidScreen() {
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
override fun Content() {
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
title = { Text(text = stringResource(id = R.string.open_source_libraries)) },
|
||||
navigationIcon = {
|
||||
IconButton(
|
||||
onClick = { navigator.pop() }
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Default.ArrowBack,
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
},
|
||||
scrollBehavior = scrollBehavior
|
||||
)
|
||||
}
|
||||
) { paddingValues ->
|
||||
LibrariesContainer(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(paddingValues)
|
||||
.nestedScroll(scrollBehavior.nestedScrollConnection)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -13,6 +13,8 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||
import cafe.adriel.voyager.navigator.tab.Tab
|
||||
import cafe.adriel.voyager.navigator.tab.TabOptions
|
||||
import com.readrops.app.BuildConfig
|
||||
@ -36,9 +38,12 @@ object MoreTab : Tab {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.statusBarsPadding()
|
||||
) {
|
||||
LargeSpacer()
|
||||
@ -70,23 +75,17 @@ object MoreTab : Tab {
|
||||
text = stringResource(R.string.settings),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
spacing = MaterialTheme.spacing.mediumSpacing,
|
||||
padding = MaterialTheme.spacing.mediumSpacing,
|
||||
onClick = { }
|
||||
)
|
||||
|
||||
SelectableIconText(
|
||||
icon = painterResource(id = R.drawable.ic_settings),
|
||||
text = "Backup",
|
||||
icon = painterResource(id = R.drawable.ic_library),
|
||||
text = stringResource(id = R.string.open_source_libraries),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
spacing = MaterialTheme.spacing.mediumSpacing,
|
||||
onClick = { }
|
||||
)
|
||||
|
||||
SelectableIconText(
|
||||
icon = painterResource(id = R.drawable.ic_settings),
|
||||
text = "Open-source libraries",
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
spacing = MaterialTheme.spacing.mediumSpacing,
|
||||
onClick = { }
|
||||
padding = MaterialTheme.spacing.mediumSpacing,
|
||||
onClick = { navigator.push(AboutLibrariesScreen()) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
5
app/src/main/res/drawable/ic_library.xml
Normal file
5
app/src/main/res/drawable/ic_library.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,11.55C9.64,9.35 6.48,8 3,8v11c3.48,0 6.64,1.35 9,3.55 2.36,-2.19 5.52,-3.55 9,-3.55V8c-3.48,0 -6.64,1.35 -9,3.55zM12,8c1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3 1.34,3 3,3z"/>
|
||||
|
||||
</vector>
|
@ -168,4 +168,5 @@
|
||||
<string name="updating_account">Mise à jour du compte %1$s</string>
|
||||
<string name="enable_all">Tout activer</string>
|
||||
<string name="disable_all">Tout désactiver</string>
|
||||
<string name="open_source_libraries">Bibliothèques Open source</string>
|
||||
</resources>
|
@ -174,4 +174,5 @@
|
||||
<string name="updating_account">Updating %1$s account</string>
|
||||
<string name="enable_all">Enable all</string>
|
||||
<string name="disable_all">Disable all</string>
|
||||
<string name="open_source_libraries">Open source libraries</string>
|
||||
</resources>
|
@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@ -14,6 +15,7 @@ buildscript {
|
||||
classpath(libs.android.agp)
|
||||
classpath(libs.kotlin.kgp)
|
||||
classpath(libs.jacoco)
|
||||
classpath(libs.aboutlibraries)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ koin-bom = "3.5.0"
|
||||
paging = "3.2.1"
|
||||
okhttp = "4.11.0"
|
||||
retrofit = "2.9.0"
|
||||
about_libraries = "11.2.2"
|
||||
|
||||
[plugins]
|
||||
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
|
||||
@ -74,6 +75,9 @@ okhttp-mockserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref
|
||||
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
|
||||
retrofit-convertermoshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" }
|
||||
|
||||
aboutlibraries = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin", version.ref = "about_libraries" }
|
||||
aboutlibraries-composem3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "about_libraries" }
|
||||
|
||||
konsumexml = "com.gitlab.mvysny.konsume-xml:konsume-xml:1.1"
|
||||
kotlinxmlbuilder = "org.redundent:kotlin-xml-builder:1.7.3" #TODO update this
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user