From a49021c096f18cfef2fa54b2369ed044341187c5 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 31 Mar 2019 22:44:06 -0400 Subject: Remove round icon settings --- .../com/pitchedapps/frost/glide/RoundCornerTransformation.kt | 5 ++--- app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt | 2 +- app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt | 7 ------- app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 2 -- app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 1 - .../main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt | 1 - app/src/web/assets/css/components/round_icons.css | 4 ---- app/src/web/assets/css/components/round_icons.scss | 4 ---- 8 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 app/src/web/assets/css/components/round_icons.css delete mode 100644 app/src/web/assets/css/components/round_icons.scss (limited to 'app') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/glide/RoundCornerTransformation.kt b/app/src/main/kotlin/com/pitchedapps/frost/glide/RoundCornerTransformation.kt index 564224ea..b63c5588 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/glide/RoundCornerTransformation.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/glide/RoundCornerTransformation.kt @@ -33,7 +33,7 @@ import java.security.MessageDigest class RoundCornerTransformation : BitmapTransformation() { override fun updateDiskCacheKey(messageDigest: MessageDigest) { - messageDigest.update("FrostRoundCornerTransform-${Prefs.showRoundedIcons}".toByteArray()) + messageDigest.update("FrostRoundCornerTransform".toByteArray()) } override fun transform(pool: BitmapPool, toTransform: Bitmap, outWidth: Int, outHeight: Int): Bitmap { @@ -44,8 +44,7 @@ class RoundCornerTransformation : BitmapTransformation() { val bitmap = pool.get(width, height, Bitmap.Config.ARGB_8888) bitmap.setHasAlpha(true) - val radius = Math.min(width, height).toFloat() / - (if (Prefs.showRoundedIcons) 2f else 10f) + val radius = Math.min(width, height) * 0.5f val canvas = Canvas(bitmap) val paint = Paint() diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt index a466feec..e7efbf2a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt @@ -41,7 +41,7 @@ import java.util.Locale * The enum name must match the css file name */ enum class CssAssets(val folder: String = THEME_FOLDER) : InjectorContract { - MATERIAL_LIGHT, MATERIAL_DARK, MATERIAL_AMOLED, MATERIAL_GLASS, CUSTOM, ROUND_ICONS("components") + MATERIAL_LIGHT, MATERIAL_DARK, MATERIAL_AMOLED, MATERIAL_GLASS, CUSTOM ; @VisibleForTesting diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt index 1b1ca796..c8431464 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt @@ -155,13 +155,6 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = { onClick = { launchTabCustomizerActivity() } } - checkbox(R.string.rounded_icons, Prefs::showRoundedIcons, { - Prefs.showRoundedIcons = it - setFrostResult(REQUEST_REFRESH) - }) { - descRes = R.string.rounded_icons_desc - } - checkbox(R.string.tint_nav, Prefs::tintNavBar, { Prefs.tintNavBar = it frostNavigationBar() diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt index 9a63f527..391d422a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -116,8 +116,6 @@ object Prefs : KPref() { var aggressiveRecents: Boolean by kpref("aggressive_recents", false) - var showRoundedIcons: Boolean by kpref("rounded_icons", true) - var showComposer: Boolean by kpref("status_composer_feed", true) var showSuggestedFriends: Boolean by kpref("suggested_friends_feed", true) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt index 6b186b1c..80edd62e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -102,7 +102,6 @@ class DebugWebView @JvmOverloads constructor( injectBackgroundColor() if (url.isFacebookUrl) view.jsInject( - CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons), // CssHider.CORE, CssHider.COMPOSER.maybe(!Prefs.showComposer), CssHider.STORIES.maybe(!Prefs.showStories), diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt index e162f9da..bac27010 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt @@ -91,7 +91,6 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() { injectBackgroundColor() if (url.isFacebookUrl) view.jsInject( - CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons), // CssHider.CORE, CssHider.HEADER, CssHider.COMPOSER.maybe(!Prefs.showComposer), diff --git a/app/src/web/assets/css/components/round_icons.css b/app/src/web/assets/css/components/round_icons.css deleted file mode 100644 index 5477f7c0..00000000 --- a/app/src/web/assets/css/components/round_icons.css +++ /dev/null @@ -1,4 +0,0 @@ -#threadlist_rows, [role*=presentation] img._1e_c, -i.img.profpic:not(._1_0m):not(#MStoriesTray), ._42b6._42b6._42b6, ._5i9c.img, img._2cu2, i.img.l, [id*=threadlist] i.img:not(._1_0m) { - border-radius: 50% !important; -} diff --git a/app/src/web/assets/css/components/round_icons.scss b/app/src/web/assets/css/components/round_icons.scss deleted file mode 100644 index b4662e60..00000000 --- a/app/src/web/assets/css/components/round_icons.scss +++ /dev/null @@ -1,4 +0,0 @@ -#threadlist_rows, [role*=presentation] img._1e_c, -i.img.profpic:not(._1_0m):not(#MStoriesTray), ._42b6._42b6._42b6, ._5i9c.img, img._2cu2, i.img.l, [id*=threadlist] i.img:not(._1_0m) { - border-radius: 50% !important; -} -- cgit v1.2.3