From 857fe0a28ccb5b8f7f3caef4ecd477596fe2468c Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 27 Sep 2018 20:49:45 -0400 Subject: Add tests and move header hider to css --- app/src/main/assets/css/core/core.css | 2 +- app/src/main/assets/css/core/core.scss | 5 +---- app/src/main/assets/css/themes/custom.css | 2 +- app/src/main/assets/css/themes/material_amoled.css | 2 +- app/src/main/assets/css/themes/material_dark.css | 2 +- app/src/main/assets/css/themes/material_glass.css | 2 +- app/src/main/assets/css/themes/material_light.css | 2 +- app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt | 6 +++--- app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 2 +- .../main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt | 5 +++-- 10 files changed, 14 insertions(+), 16 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/assets/css/core/core.css b/app/src/main/assets/css/core/core.css index b57ef4be..497dd969 100644 --- a/app/src/main/assets/css/core/core.css +++ b/app/src/main/assets/css/core/core.css @@ -210,7 +210,7 @@ button ._v89 ._54k8._1fl1 { box-shadow: none !important; } -[data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { +[data-sigil=m_login_upsell] [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } diff --git a/app/src/main/assets/css/core/core.scss b/app/src/main/assets/css/core/core.scss index 15074674..8091e2a6 100644 --- a/app/src/main/assets/css/core/core.scss +++ b/app/src/main/assets/css/core/core.scss @@ -1,6 +1,5 @@ @import "colors"; @import "base"; - @import "core_text"; @import "core_bg"; @import "core_border"; @@ -15,7 +14,7 @@ // box-shadow: none !important; // } -//menu spinner +[data-sigil=m_login_upsell], [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } @@ -24,8 +23,6 @@ color: $text !important; } - - .excessItem { outline: $divider !important; } diff --git a/app/src/main/assets/css/themes/custom.css b/app/src/main/assets/css/themes/custom.css index ee27be23..c7e31ed5 100644 --- a/app/src/main/assets/css/themes/custom.css +++ b/app/src/main/assets/css/themes/custom.css @@ -210,7 +210,7 @@ button ._v89 ._54k8._1fl1 { box-shadow: none !important; } -[data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { +[data-sigil=m_login_upsell] [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } diff --git a/app/src/main/assets/css/themes/material_amoled.css b/app/src/main/assets/css/themes/material_amoled.css index 6f044052..7a055429 100644 --- a/app/src/main/assets/css/themes/material_amoled.css +++ b/app/src/main/assets/css/themes/material_amoled.css @@ -210,7 +210,7 @@ button ._v89 ._54k8._1fl1 { box-shadow: none !important; } -[data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { +[data-sigil=m_login_upsell] [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } diff --git a/app/src/main/assets/css/themes/material_dark.css b/app/src/main/assets/css/themes/material_dark.css index 990b5168..f4e20933 100644 --- a/app/src/main/assets/css/themes/material_dark.css +++ b/app/src/main/assets/css/themes/material_dark.css @@ -210,7 +210,7 @@ button ._v89 ._54k8._1fl1 { box-shadow: none !important; } -[data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { +[data-sigil=m_login_upsell] [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } diff --git a/app/src/main/assets/css/themes/material_glass.css b/app/src/main/assets/css/themes/material_glass.css index ee16ee2a..bad6bd44 100644 --- a/app/src/main/assets/css/themes/material_glass.css +++ b/app/src/main/assets/css/themes/material_glass.css @@ -210,7 +210,7 @@ button ._v89 ._54k8._1fl1 { box-shadow: none !important; } -[data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { +[data-sigil=m_login_upsell] [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } diff --git a/app/src/main/assets/css/themes/material_light.css b/app/src/main/assets/css/themes/material_light.css index 55ddebcf..f4a5dee4 100644 --- a/app/src/main/assets/css/themes/material_light.css +++ b/app/src/main/assets/css/themes/material_light.css @@ -210,7 +210,7 @@ button ._v89 ._54k8._1fl1 { box-shadow: none !important; } -[data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { +[data-sigil=m_login_upsell] [data-sigil="m-loading-indicator-animate m-loading-indicator-root"] { display: none !important; } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt index 6981fd1c..5444fad8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt @@ -8,9 +8,9 @@ import android.webkit.WebView * List of elements to hide */ enum class CssHider(vararg val items: String) : InjectorContract { - CORE("[data-sigil=m_login_upsell]", "role=progressbar"), - // HEADER("#header", "[data-sigil=MTopBlueBarHeader]", -// "#header-notices", "[data-sigil*=m-promo-jewel-header]"), + CORE("[data-sigil=m_login_upsell]", "[role=progressbar]"), + HEADER("#header", "#mJewelNav", "[data-sigil=MTopBlueBarHeader]", + "#header-notices", "[data-sigil*=m-promo-jewel-header]"), ADS("article[data-xt*=sponsor]", "article[data-store*=sponsor]"), PEOPLE_YOU_MAY_KNOW("article._d2r"), 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 4c4e5525..ac62f142 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -82,7 +82,7 @@ class DebugWebView @JvmOverloads constructor( if (url.isFacebookUrl) view.jsInject( CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons), - CssHider.CORE, +// CssHider.CORE, CssHider.COMPOSER.maybe(!Prefs.showComposer), CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends), CssHider.SUGGESTED_GROUPS.maybe(!Prefs.showSuggestedGroups), 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 a1fd594f..8824e635 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt @@ -65,7 +65,8 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() { if (url.isFacebookUrl) view.jsInject( CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons), - CssHider.CORE, +// CssHider.CORE, + CssHider.HEADER, CssHider.COMPOSER.maybe(!Prefs.showComposer), CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends), CssHider.SUGGESTED_GROUPS.maybe(!Prefs.showSuggestedGroups), @@ -76,7 +77,7 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() { JsAssets.CLICK_A, CssHider.ADS.maybe(!Prefs.showFacebookAds), JsAssets.CONTEXT_A, - JsAssets.HEADER_HIDER, +// JsAssets.HEADER_HIDER, JsAssets.MEDIA) else refresh.onNext(false) -- cgit v1.2.3