mirror of https://github.com/Ashinch/ReadYou.git
feat(about): add license list page and improve about page (#664)
This commit is contained in:
parent
d7057268bb
commit
cbc0e064b0
|
@ -4,6 +4,7 @@ plugins {
|
||||||
id "kotlin-kapt"
|
id "kotlin-kapt"
|
||||||
id "dagger.hilt.android.plugin"
|
id "dagger.hilt.android.plugin"
|
||||||
id "com.google.dagger.hilt.android"
|
id "com.google.dagger.hilt.android"
|
||||||
|
id 'com.mikepenz.aboutlibraries.plugin'
|
||||||
}
|
}
|
||||||
|
|
||||||
def gitCommitHash = "git rev-parse --verify --short HEAD".execute().text.trim()
|
def gitCommitHash = "git rev-parse --verify --short HEAD".execute().text.trim()
|
||||||
|
@ -107,6 +108,11 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// https://github.com/mikepenz/AboutLibraries/releases
|
||||||
|
implementation "com.mikepenz:aboutlibraries-core:${aboutLibsRelease}"
|
||||||
|
implementation "com.mikepenz:aboutlibraries-compose-m3:${aboutLibsRelease}"
|
||||||
|
|
||||||
|
// https://github.com/ireward/compose-html/tags
|
||||||
implementation "com.github.ireward:compose-html:1.0.2"
|
implementation "com.github.ireward:compose-html:1.0.2"
|
||||||
|
|
||||||
// http://bigbadaboom.github.io/androidsvg/release_notes.html
|
// http://bigbadaboom.github.io/androidsvg/release_notes.html
|
||||||
|
|
|
@ -4,8 +4,13 @@ import android.util.Log
|
||||||
import androidx.compose.animation.ExperimentalAnimationApi
|
import androidx.compose.animation.ExperimentalAnimationApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.DisposableEffect
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.saveable.rememberSaveable
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
@ -18,7 +23,12 @@ import kotlinx.coroutines.flow.collectLatest
|
||||||
import me.ash.reader.domain.model.general.Filter
|
import me.ash.reader.domain.model.general.Filter
|
||||||
import me.ash.reader.infrastructure.preference.LocalDarkTheme
|
import me.ash.reader.infrastructure.preference.LocalDarkTheme
|
||||||
import me.ash.reader.infrastructure.preference.LocalReadingDarkTheme
|
import me.ash.reader.infrastructure.preference.LocalReadingDarkTheme
|
||||||
import me.ash.reader.ui.ext.*
|
import me.ash.reader.ui.ext.collectAsStateValue
|
||||||
|
import me.ash.reader.ui.ext.findActivity
|
||||||
|
import me.ash.reader.ui.ext.forwardAndBackwardComposable
|
||||||
|
import me.ash.reader.ui.ext.initialFilter
|
||||||
|
import me.ash.reader.ui.ext.initialPage
|
||||||
|
import me.ash.reader.ui.ext.isFirstLaunch
|
||||||
import me.ash.reader.ui.page.home.HomeViewModel
|
import me.ash.reader.ui.page.home.HomeViewModel
|
||||||
import me.ash.reader.ui.page.home.feeds.FeedsPage
|
import me.ash.reader.ui.page.home.feeds.FeedsPage
|
||||||
import me.ash.reader.ui.page.home.feeds.subscribe.SubscribeViewModel
|
import me.ash.reader.ui.page.home.feeds.subscribe.SubscribeViewModel
|
||||||
|
@ -32,9 +42,15 @@ import me.ash.reader.ui.page.settings.color.ColorAndStylePage
|
||||||
import me.ash.reader.ui.page.settings.color.DarkThemePage
|
import me.ash.reader.ui.page.settings.color.DarkThemePage
|
||||||
import me.ash.reader.ui.page.settings.color.feeds.FeedsPageStylePage
|
import me.ash.reader.ui.page.settings.color.feeds.FeedsPageStylePage
|
||||||
import me.ash.reader.ui.page.settings.color.flow.FlowPageStylePage
|
import me.ash.reader.ui.page.settings.color.flow.FlowPageStylePage
|
||||||
import me.ash.reader.ui.page.settings.color.reading.*
|
import me.ash.reader.ui.page.settings.color.reading.ReadingDarkThemePage
|
||||||
|
import me.ash.reader.ui.page.settings.color.reading.ReadingImagePage
|
||||||
|
import me.ash.reader.ui.page.settings.color.reading.ReadingStylePage
|
||||||
|
import me.ash.reader.ui.page.settings.color.reading.ReadingTextPage
|
||||||
|
import me.ash.reader.ui.page.settings.color.reading.ReadingTitlePage
|
||||||
|
import me.ash.reader.ui.page.settings.color.reading.ReadingVideoPage
|
||||||
import me.ash.reader.ui.page.settings.interaction.InteractionPage
|
import me.ash.reader.ui.page.settings.interaction.InteractionPage
|
||||||
import me.ash.reader.ui.page.settings.languages.LanguagesPage
|
import me.ash.reader.ui.page.settings.languages.LanguagesPage
|
||||||
|
import me.ash.reader.ui.page.settings.tips.LicenseListPage
|
||||||
import me.ash.reader.ui.page.settings.tips.TipsAndSupportPage
|
import me.ash.reader.ui.page.settings.tips.TipsAndSupportPage
|
||||||
import me.ash.reader.ui.page.startup.StartupPage
|
import me.ash.reader.ui.page.startup.StartupPage
|
||||||
import me.ash.reader.ui.theme.AppTheme
|
import me.ash.reader.ui.theme.AppTheme
|
||||||
|
@ -225,6 +241,9 @@ fun HomeEntry(
|
||||||
forwardAndBackwardComposable(route = RouteName.TIPS_AND_SUPPORT) {
|
forwardAndBackwardComposable(route = RouteName.TIPS_AND_SUPPORT) {
|
||||||
TipsAndSupportPage(navController)
|
TipsAndSupportPage(navController)
|
||||||
}
|
}
|
||||||
|
forwardAndBackwardComposable(route = RouteName.LICENSE_LIST) {
|
||||||
|
LicenseListPage(navController)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,5 @@ object RouteName {
|
||||||
|
|
||||||
// Tips & Support
|
// Tips & Support
|
||||||
const val TIPS_AND_SUPPORT = "tips_and_support"
|
const val TIPS_AND_SUPPORT = "tips_and_support"
|
||||||
|
const val LICENSE_LIST = "license_list"
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
package me.ash.reader.ui.page.settings.tips
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
import androidx.compose.foundation.layout.add
|
||||||
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.navigationBars
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.rounded.ArrowBack
|
||||||
|
import androidx.compose.material.icons.rounded.Star
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.navigation.NavHostController
|
||||||
|
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
|
||||||
|
import me.ash.reader.R
|
||||||
|
import me.ash.reader.infrastructure.preference.OpenLinkPreference
|
||||||
|
import me.ash.reader.ui.component.base.FeedbackIconButton
|
||||||
|
import me.ash.reader.ui.component.base.RYScaffold
|
||||||
|
import me.ash.reader.ui.ext.openURL
|
||||||
|
import me.ash.reader.ui.theme.palette.onLight
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun LicenseListPage(
|
||||||
|
navController: NavHostController,
|
||||||
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
|
||||||
|
RYScaffold(
|
||||||
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
|
navigationIcon = {
|
||||||
|
FeedbackIconButton(
|
||||||
|
imageVector = Icons.AutoMirrored.Rounded.ArrowBack,
|
||||||
|
contentDescription = stringResource(R.string.back),
|
||||||
|
tint = MaterialTheme.colorScheme.onSurface
|
||||||
|
) {
|
||||||
|
navController.popBackStack()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
FeedbackIconButton(
|
||||||
|
modifier = Modifier.size(20.dp),
|
||||||
|
imageVector = Icons.Rounded.Star,
|
||||||
|
contentDescription = stringResource(R.string.open_source_licenses),
|
||||||
|
tint = MaterialTheme.colorScheme.onSurface
|
||||||
|
) {
|
||||||
|
context.openURL(
|
||||||
|
url = context.getString(R.string.github_link) + "/blob/main/LICENSE",
|
||||||
|
openLink = OpenLinkPreference.AutoPreferCustomTabs,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
content = {
|
||||||
|
Column {
|
||||||
|
LibrariesContainer(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
contentPadding = WindowInsets(0, 0, 0, 24)
|
||||||
|
.add(WindowInsets.navigationBars)
|
||||||
|
.asPaddingValues(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
|
@ -8,7 +8,17 @@ import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.gestures.detectTapGestures
|
import androidx.compose.foundation.gestures.detectTapGestures
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.offset
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
@ -16,8 +26,20 @@ import androidx.compose.material.icons.automirrored.rounded.ArrowBack
|
||||||
import androidx.compose.material.icons.rounded.Balance
|
import androidx.compose.material.icons.rounded.Balance
|
||||||
import androidx.compose.material.icons.rounded.TipsAndUpdates
|
import androidx.compose.material.icons.rounded.TipsAndUpdates
|
||||||
import androidx.compose.material.icons.rounded.VolunteerActivism
|
import androidx.compose.material.icons.rounded.VolunteerActivism
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.Badge
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.material3.BadgedBox
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.Immutable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
|
@ -38,7 +60,13 @@ import me.ash.reader.infrastructure.preference.OpenLinkPreference
|
||||||
import me.ash.reader.ui.component.base.CurlyCornerShape
|
import me.ash.reader.ui.component.base.CurlyCornerShape
|
||||||
import me.ash.reader.ui.component.base.FeedbackIconButton
|
import me.ash.reader.ui.component.base.FeedbackIconButton
|
||||||
import me.ash.reader.ui.component.base.RYScaffold
|
import me.ash.reader.ui.component.base.RYScaffold
|
||||||
import me.ash.reader.ui.ext.*
|
import me.ash.reader.ui.ext.DataStoreKeys
|
||||||
|
import me.ash.reader.ui.ext.dataStore
|
||||||
|
import me.ash.reader.ui.ext.getCurrentVersion
|
||||||
|
import me.ash.reader.ui.ext.openURL
|
||||||
|
import me.ash.reader.ui.ext.put
|
||||||
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
import me.ash.reader.ui.page.common.RouteName
|
||||||
import me.ash.reader.ui.theme.palette.alwaysLight
|
import me.ash.reader.ui.theme.palette.alwaysLight
|
||||||
import me.ash.reader.ui.theme.palette.onLight
|
import me.ash.reader.ui.theme.palette.onLight
|
||||||
|
|
||||||
|
@ -80,7 +108,9 @@ fun TipsAndSupportPage(
|
||||||
contentDescription = stringResource(R.string.open_source_licenses),
|
contentDescription = stringResource(R.string.open_source_licenses),
|
||||||
tint = MaterialTheme.colorScheme.onSurface
|
tint = MaterialTheme.colorScheme.onSurface
|
||||||
) {
|
) {
|
||||||
context.showToast(context.getString(R.string.coming_soon))
|
navController.navigate(RouteName.LICENSE_LIST) {
|
||||||
|
launchSingleTop = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
content = {
|
content = {
|
||||||
|
@ -213,7 +243,7 @@ fun TipsAndSupportPage(
|
||||||
) {
|
) {
|
||||||
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
|
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
|
||||||
view.playSoundEffect(SoundEffectConstants.CLICK)
|
view.playSoundEffect(SoundEffectConstants.CLICK)
|
||||||
context.showToast(context.getString(R.string.coming_soon))
|
context.openURL(context.getString(R.string.wiki_link), OpenLinkPreference.AutoPreferCustomTabs)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(48.dp))
|
Spacer(modifier = Modifier.height(48.dp))
|
||||||
|
|
|
@ -260,6 +260,7 @@
|
||||||
<string name="open_source_licenses">Open source licenses</string>
|
<string name="open_source_licenses">Open source licenses</string>
|
||||||
<string name="github_link" translatable="false">https://github.com/Ashinch/ReadYou</string>
|
<string name="github_link" translatable="false">https://github.com/Ashinch/ReadYou</string>
|
||||||
<string name="telegram_link" translatable="false">https://t.me/ReadYouApp</string>
|
<string name="telegram_link" translatable="false">https://t.me/ReadYouApp</string>
|
||||||
|
<string name="wiki_link" translatable="false">https://github.com/Ashinch/ReadYou/wiki/Getting-Started</string>
|
||||||
<string name="update_link">https://api.github.com/repos/Ashinch/ReadYou/releases/latest</string>
|
<string name="update_link">https://api.github.com/repos/Ashinch/ReadYou/releases/latest</string>
|
||||||
<string name="change_log">Changelog</string>
|
<string name="change_log">Changelog</string>
|
||||||
<string name="update">Update</string>
|
<string name="update">Update</string>
|
||||||
|
|
|
@ -35,6 +35,8 @@ buildscript {
|
||||||
opmlParser = '3.1.0'
|
opmlParser = '3.1.0'
|
||||||
// http://bigbadaboom.github.io/androidsvg/release_notes.html
|
// http://bigbadaboom.github.io/androidsvg/release_notes.html
|
||||||
androidSVG = '1.4'
|
androidSVG = '1.4'
|
||||||
|
// https://github.com/mikepenz/AboutLibraries/releases
|
||||||
|
aboutLibsRelease = '11.1.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -46,6 +48,7 @@ plugins {
|
||||||
id 'com.android.application' version '8.2.1' apply false
|
id 'com.android.application' version '8.2.1' apply false
|
||||||
id 'com.android.library' version '8.2.1' apply false
|
id 'com.android.library' version '8.2.1' apply false
|
||||||
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
|
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
|
||||||
|
id 'com.mikepenz.aboutlibraries.plugin' version "${aboutLibsRelease}" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
|
Loading…
Reference in New Issue