From d3ceecf6200654649fc543cda0322b8ee2b3cccc Mon Sep 17 00:00:00 2001 From: Soitora Date: Thu, 20 May 2021 04:21:22 +0200 Subject: [PATCH] Add icons for links in the About section (#5117) * Add an icon for each link in About * Add icon for Open source licenses * Reorder Facebook and Discord * Revert "Add icon for Open source licenses" This reverts commit 9b73f8443d1afea60f8bc4165663c8bef0ebf108. --- .../tachiyomi/ui/more/AboutController.kt | 47 ++++++++++++------- app/src/main/res/drawable/ic_discord_24dp.xml | 12 +++++ app/src/main/res/drawable/ic_earth_24dp.xml | 9 ++++ .../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, 79 insertions(+), 16 deletions(-) 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 5a762b6d3..ed8eaa516 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,38 +88,48 @@ 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) } } } - preference { - key = "pref_about_facebook" - title = "Facebook" - "https://facebook.com/tachiyomiorg".also { - summary = it - onClick { openInBrowser(it) } - } - } - preference { - key = "pref_about_twitter" - title = "Twitter" - "https://twitter.com/tachiyomiorg".also { - summary = it - onClick { openInBrowser(it) } - } - } 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) } } } + 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) } + } + } + 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) } + } + } 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 000000000..4593a323c --- /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 000000000..8b11a470f --- /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 000000000..62ceb98fb --- /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 000000000..711b50d38 --- /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 000000000..970b94c02 --- /dev/null +++ b/app/src/main/res/drawable/ic_twitter_24dp.xml @@ -0,0 +1,9 @@ + + +