Add github repo, issues and changelog links in MoreTab

This commit is contained in:
Shinokuni 2024-07-07 15:54:26 +02:00
parent 5bf566184d
commit 016d309d05
9 changed files with 118 additions and 3 deletions

View File

@ -1,15 +1,21 @@
package com.readrops.app.more package com.readrops.app.more
import androidx.compose.foundation.Image import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -20,7 +26,9 @@ import cafe.adriel.voyager.navigator.tab.TabOptions
import com.readrops.app.BuildConfig import com.readrops.app.BuildConfig
import com.readrops.app.R import com.readrops.app.R
import com.readrops.app.account.selection.adaptiveIconPainterResource import com.readrops.app.account.selection.adaptiveIconPainterResource
import com.readrops.app.util.components.IconText
import com.readrops.app.util.components.SelectableIconText import com.readrops.app.util.components.SelectableIconText
import com.readrops.app.util.openUrl
import com.readrops.app.util.theme.LargeSpacer import com.readrops.app.util.theme.LargeSpacer
import com.readrops.app.util.theme.MediumSpacer import com.readrops.app.util.theme.MediumSpacer
import com.readrops.app.util.theme.ShortSpacer import com.readrops.app.util.theme.ShortSpacer
@ -39,6 +47,7 @@ object MoreTab : Tab {
@Composable @Composable
override fun Content() { override fun Content() {
val navigator = LocalNavigator.currentOrThrow val navigator = LocalNavigator.currentOrThrow
val context = LocalContext.current
Column( Column(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
@ -63,11 +72,61 @@ object MoreTab : Tab {
ShortSpacer() ShortSpacer()
Text( IconText(
text = "v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", text = if (BuildConfig.DEBUG) {
"v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
} else {
"v${BuildConfig.VERSION_NAME}"
},
icon = painterResource(id = R.drawable.ic_version),
style = MaterialTheme.typography.labelLarge style = MaterialTheme.typography.labelLarge
) )
ShortSpacer()
Text(
text = stringResource(id = R.string.app_licence),
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
ShortSpacer()
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
modifier = Modifier.fillMaxWidth()
) {
IconButton(
onClick = { context.openUrl(context.getString(R.string.app_url)) }
) {
Icon(
painter = painterResource(id = R.drawable.ic_github),
contentDescription = null,
modifier = Modifier.size(24.dp)
)
}
IconButton(
onClick = { context.openUrl(context.getString(R.string.changelog_url)) }
) {
Icon(
painter = painterResource(id = R.drawable.ic_changelog),
contentDescription = null,
modifier = Modifier.size(24.dp)
)
}
IconButton(
onClick = { context.openUrl(context.getString(R.string.app_issues_url)) }
) {
Icon(
painter = painterResource(id = R.drawable.ic_bug_report),
contentDescription = null
)
}
}
LargeSpacer() LargeSpacer()
SelectableIconText( SelectableIconText(
@ -87,6 +146,15 @@ object MoreTab : Tab {
padding = MaterialTheme.spacing.mediumSpacing, padding = MaterialTheme.spacing.mediumSpacing,
onClick = { navigator.push(AboutLibrariesScreen()) } onClick = { navigator.push(AboutLibrariesScreen()) }
) )
SelectableIconText(
icon = painterResource(id = R.drawable.ic_donation),
text = stringResource(id = R.string.make_donation),
style = MaterialTheme.typography.titleMedium,
spacing = MaterialTheme.spacing.mediumSpacing,
padding = MaterialTheme.spacing.mediumSpacing,
onClick = { }
)
} }
} }
} }

View File

@ -1,7 +1,12 @@
package com.readrops.app.util package com.readrops.app.util
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
fun TextStyle.toDp(): Dp = fontSize.value.dp fun TextStyle.toDp(): Dp = fontSize.value.dp
fun Context.openUrl(url: String) = startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,21q-1.625,0 -3.012,-0.8Q7.6,19.4 6.8,18L4,18v-2h2.1q-0.075,-0.5 -0.087,-1Q6,14.5 6,14L4,14v-2h2q0,-0.5 0.013,-1 0.012,-0.5 0.087,-1L4,10L4,8h2.8q0.35,-0.575 0.788,-1.075 0.437,-0.5 1.012,-0.875L7,4.4 8.4,3l2.15,2.15q0.7,-0.225 1.425,-0.225 0.725,0 1.425,0.225L15.6,3 17,4.4l-1.65,1.65q0.575,0.375 1.038,0.862Q16.85,7.4 17.2,8L20,8v2h-2.1q0.075,0.5 0.088,1 0.012,0.5 0.012,1h2v2h-2q0,0.5 -0.012,1 -0.013,0.5 -0.088,1L20,16v2h-2.8q-0.8,1.4 -2.187,2.2 -1.388,0.8 -3.013,0.8ZM12,19q1.65,0 2.825,-1.175Q16,16.65 16,15v-4q0,-1.65 -1.175,-2.825Q13.65,7 12,7q-1.65,0 -2.825,1.175Q8,9.35 8,11v4q0,1.65 1.175,2.825Q10.35,19 12,19ZM10,16h4v-2h-4ZM10,12h4v-2h-4ZM12,13Z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M19,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM14,17L7,17v-2h7v2zM17,13L7,13v-2h10v2zM17,9L7,9L7,7h10v2z"/>
</vector>

View 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="M11.8,10.9c-2.27,-0.59 -3,-1.2 -3,-2.15 0,-1.09 1.01,-1.85 2.7,-1.85 1.78,0 2.44,0.85 2.5,2.1h2.21c-0.07,-1.72 -1.12,-3.3 -3.21,-3.81V3h-3v2.16c-1.94,0.42 -3.5,1.68 -3.5,3.61 0,2.31 1.91,3.46 4.7,4.13 2.5,0.6 3,1.48 3,2.41 0,0.69 -0.49,1.79 -2.7,1.79 -2.06,0 -2.87,-0.92 -2.98,-2.1h-2.2c0.12,2.19 1.76,3.42 3.68,3.83V21h3v-2.15c1.95,-0.37 3.5,-1.5 3.5,-3.55 0,-2.84 -2.43,-3.81 -4.7,-4.4z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="496dp"
android:height="512dp"
android:viewportWidth="496"
android:viewportHeight="512">
<path
android:fillColor="#FF000000"
android:pathData="M165.9,397.4c0,2 -2.3,3.6 -5.2,3.6 -3.3,0.3 -5.6,-1.3 -5.6,-3.6 0,-2 2.3,-3.6 5.2,-3.6 3,-0.3 5.6,1.3 5.6,3.6zM134.8,392.9c-0.7,2 1.3,4.3 4.3,4.9 2.6,1 5.6,0 6.2,-2s-1.3,-4.3 -4.3,-5.2c-2.6,-0.7 -5.5,0.3 -6.2,2.3zM179,391.2c-2.9,0.7 -4.9,2.6 -4.6,4.9 0.3,2 2.9,3.3 5.9,2.6 2.9,-0.7 4.9,-2.6 4.6,-4.6 -0.3,-1.9 -3,-3.2 -5.9,-2.9zM244.8,8C106.1,8 0,113.3 0,252c0,110.9 69.8,205.8 169.5,239.2 12.8,2.3 17.3,-5.6 17.3,-12.1 0,-6.2 -0.3,-40.4 -0.3,-61.4 0,0 -70,15 -84.7,-29.8 0,0 -11.4,-29.1 -27.8,-36.6 0,0 -22.9,-15.7 1.6,-15.4 0,0 24.9,2 38.6,25.8 21.9,38.6 58.6,27.5 72.9,20.9 2.3,-16 8.8,-27.1 16,-33.7 -55.9,-6.2 -112.3,-14.3 -112.3,-110.5 0,-27.5 7.6,-41.3 23.6,-58.9 -2.6,-6.5 -11.1,-33.3 2.6,-67.9 20.9,-6.5 69,27 69,27 20,-5.6 41.5,-8.5 62.8,-8.5s42.8,2.9 62.8,8.5c0,0 48.1,-33.6 69,-27 13.7,34.7 5.2,61.4 2.6,67.9 16,17.7 25.8,31.5 25.8,58.9 0,96.5 -58.9,104.2 -114.8,110.5 9.2,7.9 17,22.9 17,46.4 0,33.7 -0.3,75.4 -0.3,83.6 0,6.5 4.6,14.4 17.3,12.1C428.2,457.8 496,362.9 496,252 496,113.3 383.5,8 244.8,8zM97.2,352.9c-1.3,1 -1,3.3 0.7,5.2 1.6,1.6 3.9,2.3 5.2,1 1.3,-1 1,-3.3 -0.7,-5.2 -1.6,-1.6 -3.9,-2.3 -5.2,-1zM86.4,344.8c-0.7,1.3 0.3,2.9 2.3,3.9 1.6,1 3.6,0.7 4.3,-0.7 0.7,-1.3 -0.3,-2.9 -2.3,-3.9 -2,-0.6 -3.6,-0.3 -4.3,0.7zM118.8,380.4c-1.6,1.3 -1,4.3 1.3,6.2 2.3,2.3 5.2,2.6 6.5,1 1.3,-1.3 0.7,-4.3 -1.3,-6.2 -2.2,-2.3 -5.2,-2.6 -6.5,-1zM107.4,365.7c-1.6,1 -1.6,3.6 0,5.9 1.6,2.3 4.3,3.3 5.6,2.3 1.6,-1.3 1.6,-3.9 0,-6.2 -1.4,-2.3 -4,-3.3 -5.6,-2z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M21.41,11.58l-9,-9C12.05,2.22 11.55,2 11,2H4c-1.1,0 -2,0.9 -2,2v7c0,0.55 0.22,1.05 0.59,1.42l9,9c0.36,0.36 0.86,0.58 1.41,0.58 0.55,0 1.05,-0.22 1.41,-0.59l7,-7c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-0.55 -0.23,-1.06 -0.59,-1.42zM5.5,7C4.67,7 4,6.33 4,5.5S4.67,4 5.5,4 7,4.67 7,5.5 6.33,7 5.5,7z"
android:fillColor="#000000"/>
</vector>

View File

@ -169,4 +169,5 @@
<string name="enable_all">Tout activer</string> <string name="enable_all">Tout activer</string>
<string name="disable_all">Tout désactiver</string> <string name="disable_all">Tout désactiver</string>
<string name="open_source_libraries">Bibliothèques Open source</string> <string name="open_source_libraries">Bibliothèques Open source</string>
<string name="make_donation">Faire une donation</string>
</resources> </resources>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name" translatable="false">Readrops</string> <string name="app_name" translatable="false">Readrops</string>
<string name="app_licence">App released under the GPLv3 licence</string>
<string name="to_read">To read</string> <string name="to_read">To read</string>
<string name="non_read_articles">Non read articles</string> <string name="non_read_articles">Non read articles</string>
<string name="open_nav_drawer">Open menu</string> <string name="open_nav_drawer">Open menu</string>
@ -175,4 +176,7 @@
<string name="enable_all">Enable all</string> <string name="enable_all">Enable all</string>
<string name="disable_all">Disable all</string> <string name="disable_all">Disable all</string>
<string name="open_source_libraries">Open source libraries</string> <string name="open_source_libraries">Open source libraries</string>
<string name="make_donation">Make a donation</string>
<string name="app_changelog_url" translatable="false">https://github.com/readrops/Readrops/blob/develop/CHANGELOG.md</string>
<string name="app_issues_url" translatable="false">https://github.com/readrops/Readrops/issues</string>
</resources> </resources>