From f0f95295bdb2b853aa6262ec4bed2353ce326eee Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 13 Apr 2019 20:53:46 -0400 Subject: Add fdroid link (#1402) * Add fdroid link * Simplify icon * Provide svg source --- .../com/pitchedapps/frost/activities/AboutActivity.kt | 18 ++++++++++++++---- app/src/main/res/drawable/ic_fdroid_24.xml | 5 +++++ app/src/main/res/values/strings_no_translate.xml | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/ic_fdroid_24.xml (limited to 'app') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt index f4c1244f..56125303 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt @@ -30,6 +30,7 @@ import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.logging.KL import ca.allanwang.kau.utils.bindView import ca.allanwang.kau.utils.dimenPixelSize +import ca.allanwang.kau.utils.drawable import ca.allanwang.kau.utils.resolveDrawable import ca.allanwang.kau.utils.startLink import ca.allanwang.kau.utils.string @@ -156,17 +157,26 @@ class AboutActivity : AboutActivityBase(null, { init { val c = itemView.context val size = c.dimenPixelSize(R.dimen.kau_avatar_bounds) - images = arrayOf Unit>>( + + val icons: Array Unit>> = + arrayOf(R.drawable.ic_fdroid_24 to { c.startLink(R.string.fdroid_url) }) + val iicons: Array Unit>> = arrayOf( GoogleMaterial.Icon.gmd_file_download to { c.startLink(R.string.github_downloads_url) }, CommunityMaterial.Icon2.cmd_reddit to { c.startLink(R.string.reddit_url) }, CommunityMaterial.Icon.cmd_github_circle to { c.startLink(R.string.github_url) }, CommunityMaterial.Icon2.cmd_slack to { c.startLink(R.string.slack_url) }, - CommunityMaterial.Icon2.cmd_xda to { c.startLink(R.string.xda_url) } - ).mapIndexed { i, (icon, onClick) -> + CommunityMaterial.Icon2.cmd_xda to { c.startLink(R.string.xda_url) }) + + images = (icons.map { (icon, onClick) -> c.drawable(icon) to onClick } + iicons.map { (icon, onClick) -> + icon.toDrawable( + c, + 32 + ) to onClick + }).mapIndexed { i, (icon, onClick) -> ImageView(c).apply { layoutParams = ViewGroup.LayoutParams(size, size) id = 109389 + i - setImageDrawable(icon.toDrawable(context, 32)) + setImageDrawable(icon) scaleType = ImageView.ScaleType.CENTER background = context.resolveDrawable(android.R.attr.selectableItemBackgroundBorderless) setOnClickListener { onClick() } diff --git a/app/src/main/res/drawable/ic_fdroid_24.xml b/app/src/main/res/drawable/ic_fdroid_24.xml new file mode 100644 index 00000000..2c718fa6 --- /dev/null +++ b/app/src/main/res/drawable/ic_fdroid_24.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/values/strings_no_translate.xml b/app/src/main/res/values/strings_no_translate.xml index 9eb85dc2..d9aa6cee 100644 --- a/app/src/main/res/values/strings_no_translate.xml +++ b/app/src/main/res/values/strings_no_translate.xml @@ -6,6 +6,7 @@ https://crwd.in/frost-for-facebook https://github.com/AllanWang/Frost-for-Facebook https://github.com/AllanWang/Frost-for-Facebook/releases + https://f-droid.org/en/packages/com.pitchedapps.frost https://www.reddit.com/r/FrostForFacebook https://frost-slack.allanwang.ca https://forum.xda-developers.com/android/apps-games/app-frost-facebook-t3685896 -- cgit v1.2.3