Add: Help links' items

This commit is contained in:
machiav3lli 2022-09-18 14:43:03 +02:00
parent 170ac5a8d4
commit f35f5a7f9b
3 changed files with 38 additions and 0 deletions

View File

@ -63,6 +63,11 @@ const val PREFS_LANGUAGE_DEFAULT = "system"
const val EXTRA_REPOSITORY_ID = "repositoryId" const val EXTRA_REPOSITORY_ID = "repositoryId"
const val HELP_SOURCECODE = "https://github.com/NeoApplications/Neo-Store"
const val HELP_CHANGELOG = "https://github.com/NeoApplications/Neo-Store/blob/master/CHANGELOG.md"
const val HELP_TELEGRAM = "https://t.me/neo_android_store"
const val HELP_MATRIX = "https://matrix.to/#/#neo-store:matrix.org"
const val HELP_LICENSE = "https://github.com/NeoApplications/Neo-Store/blob/master/COPYING"
const val NAV_MAIN = 0 const val NAV_MAIN = 0
const val NAV_PREFS = 1 const val NAV_PREFS = 1

View File

@ -18,6 +18,11 @@ import androidx.compose.material.icons.rounded.Launch
import androidx.compose.material.icons.rounded.Share import androidx.compose.material.icons.rounded.Share
import androidx.compose.material.icons.rounded.Tune import androidx.compose.material.icons.rounded.Tune
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import com.machiav3lli.fdroid.HELP_CHANGELOG
import com.machiav3lli.fdroid.HELP_LICENSE
import com.machiav3lli.fdroid.HELP_MATRIX
import com.machiav3lli.fdroid.HELP_SOURCECODE
import com.machiav3lli.fdroid.HELP_TELEGRAM
import com.machiav3lli.fdroid.R import com.machiav3lli.fdroid.R
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString import kotlinx.serialization.decodeFromString
@ -93,6 +98,32 @@ enum class AntiFeature(val key: String, @StringRes val titleResId: Int) {
NSFW("NSFW", R.string.not_safe_for_work) NSFW("NSFW", R.string.not_safe_for_work)
} }
enum class LinkRef(
@StringRes val titleId: Int,
val url: String? = null
) {
Sourcecode(
titleId = R.string.source_code,
url = HELP_SOURCECODE
),
Changelog(
titleId = R.string.changelog,
url = HELP_CHANGELOG
),
Telegram(
titleId = R.string.group_telegram,
url = HELP_TELEGRAM
),
Matrix(
titleId = R.string.group_matrix,
url = HELP_MATRIX
),
License(
titleId = R.string.license,
url = HELP_LICENSE
),
}
sealed interface ComponentState { sealed interface ComponentState {
val icon: ImageVector val icon: ImageVector
val textId: Int val textId: Int

View File

@ -216,4 +216,6 @@
<string name="prefs_personal">Personal</string> <string name="prefs_personal">Personal</string>
<string name="prefs_cache">Cache</string> <string name="prefs_cache">Cache</string>
<string name="prefs_sync">Synchronization</string> <string name="prefs_sync">Synchronization</string>
<string name="group_telegram">Our Telegram group</string>
<string name="group_matrix">Our Matrix group</string>
</resources> </resources>