From 7272f89db3e2456f69b55e288680488aa3157164 Mon Sep 17 00:00:00 2001 From: Soitora Date: Thu, 20 May 2021 03:12:58 +0200 Subject: [PATCH] Add an icon for each link in About --- .../kanade/tachiyomi/ui/more/AboutController.kt | 15 +++++++++++++++ app/src/main/res/drawable/ic_discord_24dp.xml | 12 ++++++++++++ app/src/main/res/drawable/ic_earth_24dp.xml | 9 +++++++++ app/src/main/res/drawable/ic_facebook_24dp.xml | 9 +++++++++ app/src/main/res/drawable/ic_github_24dp.xml | 9 +++++++++ app/src/main/res/drawable/ic_twitter_24dp.xml | 9 +++++++++ 6 files changed, 63 insertions(+) create mode 100644 app/src/main/res/drawable/ic_discord_24dp.xml create mode 100644 app/src/main/res/drawable/ic_earth_24dp.xml create mode 100644 app/src/main/res/drawable/ic_facebook_24dp.xml create mode 100644 app/src/main/res/drawable/ic_github_24dp.xml create mode 100644 app/src/main/res/drawable/ic_twitter_24dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt index 5a762b6d33..e023e7ed9c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt @@ -17,11 +17,14 @@ import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.util.CrashLogUtil import eu.kanade.tachiyomi.util.lang.launchNow import eu.kanade.tachiyomi.util.lang.toDateTimestampString +import eu.kanade.tachiyomi.util.preference.iconRes +import eu.kanade.tachiyomi.util.preference.iconTint import eu.kanade.tachiyomi.util.preference.onClick import eu.kanade.tachiyomi.util.preference.preference import eu.kanade.tachiyomi.util.preference.preferenceCategory import eu.kanade.tachiyomi.util.preference.titleRes import eu.kanade.tachiyomi.util.system.copyToClipboard +import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.toast import timber.log.Timber import java.text.DateFormat @@ -41,6 +44,8 @@ class AboutController : SettingsController() { override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply { titleRes = R.string.pref_category_about + val tintColor = context.getResourceColor(R.attr.colorAccent) + preference { key = "pref_about_version" titleRes = R.string.version @@ -83,6 +88,8 @@ class AboutController : SettingsController() { preference { key = "pref_about_website" titleRes = R.string.website + iconRes = R.drawable.ic_earth_24dp + iconTint = tintColor "https://tachiyomi.org".also { summary = it onClick { openInBrowser(it) } @@ -91,6 +98,8 @@ class AboutController : SettingsController() { preference { key = "pref_about_facebook" title = "Facebook" + iconRes = R.drawable.ic_facebook_24dp + iconTint = tintColor "https://facebook.com/tachiyomiorg".also { summary = it onClick { openInBrowser(it) } @@ -99,6 +108,8 @@ class AboutController : SettingsController() { preference { key = "pref_about_twitter" title = "Twitter" + iconRes = R.drawable.ic_twitter_24dp + iconTint = tintColor "https://twitter.com/tachiyomiorg".also { summary = it onClick { openInBrowser(it) } @@ -107,6 +118,8 @@ class AboutController : SettingsController() { preference { key = "pref_about_discord" title = "Discord" + iconRes = R.drawable.ic_discord_24dp + iconTint = tintColor "https://discord.gg/tachiyomi".also { summary = it onClick { openInBrowser(it) } @@ -115,6 +128,8 @@ class AboutController : SettingsController() { preference { key = "pref_about_github" title = "GitHub" + iconRes = R.drawable.ic_github_24dp + iconTint = tintColor "https://github.com/tachiyomiorg".also { summary = it onClick { openInBrowser(it) } diff --git a/app/src/main/res/drawable/ic_discord_24dp.xml b/app/src/main/res/drawable/ic_discord_24dp.xml new file mode 100644 index 0000000000..4593a323cf --- /dev/null +++ b/app/src/main/res/drawable/ic_discord_24dp.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_earth_24dp.xml b/app/src/main/res/drawable/ic_earth_24dp.xml new file mode 100644 index 0000000000..8b11a470f2 --- /dev/null +++ b/app/src/main/res/drawable/ic_earth_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_facebook_24dp.xml b/app/src/main/res/drawable/ic_facebook_24dp.xml new file mode 100644 index 0000000000..62ceb98fb6 --- /dev/null +++ b/app/src/main/res/drawable/ic_facebook_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_github_24dp.xml b/app/src/main/res/drawable/ic_github_24dp.xml new file mode 100644 index 0000000000..711b50d380 --- /dev/null +++ b/app/src/main/res/drawable/ic_github_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_twitter_24dp.xml b/app/src/main/res/drawable/ic_twitter_24dp.xml new file mode 100644 index 0000000000..970b94c02d --- /dev/null +++ b/app/src/main/res/drawable/ic_twitter_24dp.xml @@ -0,0 +1,9 @@ + + +