From 3ed1e1a96511a00517512addf6757517f3353c95 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 10 Jan 2021 18:12:44 -0800 Subject: [PATCH] Remove analytic content --- .../frost/activities/IntroActivity.kt | 2 - .../frost/intro/IntroMainFragments.kt | 37 ------------- .../com/pitchedapps/frost/prefs/OldPrefs.kt | 12 ----- .../frost/prefs/sections/CorePrefs.kt | 17 ------ .../pitchedapps/frost/settings/Behaviour.kt | 3 -- .../kotlin/com/pitchedapps/frost/utils/L.kt | 19 ------- app/src/main/res/layout/intro_analytics.xml | 52 ------------------- build.gradle | 1 - 8 files changed, 143 deletions(-) delete mode 100644 app/src/main/res/layout/intro_analytics.xml diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt index efb9956c2..337c9678e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt @@ -41,7 +41,6 @@ import com.pitchedapps.frost.R import com.pitchedapps.frost.databinding.ActivityIntroBinding import com.pitchedapps.frost.intro.BaseIntroFragment import com.pitchedapps.frost.intro.IntroAccountFragment -import com.pitchedapps.frost.intro.IntroFragmentAnalytics import com.pitchedapps.frost.intro.IntroFragmentEnd import com.pitchedapps.frost.intro.IntroFragmentTheme import com.pitchedapps.frost.intro.IntroFragmentWelcome @@ -76,7 +75,6 @@ class IntroActivity : KauBaseActivity(), ViewPager.PageTransformer, IntroAccountFragment(), IntroTabTouchFragment(), IntroTabContextFragment(), - IntroFragmentAnalytics(), IntroFragmentEnd() ) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt index 3bf986786..d160bee4a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt @@ -30,12 +30,9 @@ import androidx.fragment.app.Fragment import ca.allanwang.kau.kotlin.LazyResettableRegistry import ca.allanwang.kau.utils.Kotterknife import ca.allanwang.kau.utils.bindViewResettable -import ca.allanwang.kau.utils.setIcon import ca.allanwang.kau.utils.setOnSingleTapListener -import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial import com.pitchedapps.frost.R import com.pitchedapps.frost.activities.IntroActivity -import com.pitchedapps.frost.databinding.IntroAnalyticsBinding import com.pitchedapps.frost.prefs.Prefs import kotlin.math.abs import org.koin.android.ext.android.inject @@ -141,40 +138,6 @@ class IntroFragmentWelcome : BaseIntroFragment(R.layout.intro_welcome) { } } -class IntroFragmentAnalytics : BaseIntroFragment(R.layout.intro_analytics) { - - val container: ConstraintLayout by bindViewResettable(R.id.intro_analytics_container) - - private lateinit var binding: IntroAnalyticsBinding - - override fun viewArray(): Array> = with(binding) { - arrayOf( - arrayOf(title), arrayOf(image), - arrayOf(introSwitch), arrayOf(desc) - ) - } - - override fun themeFragmentImpl() { - super.themeFragmentImpl() - image.imageTintList = ColorStateList.valueOf(prefs.textColor) - } - - @SuppressLint("ClickableViewAccessibility") - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - binding = IntroAnalyticsBinding.bind(view) - binding.init() - } - - private fun IntroAnalyticsBinding.init() { - image.setIcon(GoogleMaterial.Icon.gmd_bug_report, 120) - introSwitch.isSelected = prefs.analytics - introSwitch.setOnCheckedChangeListener { _, isChecked -> - prefs.analytics = isChecked - } - } -} - class IntroFragmentEnd : BaseIntroFragment(R.layout.intro_end) { val container: ConstraintLayout by bindViewResettable(R.id.intro_end_container) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/prefs/OldPrefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/prefs/OldPrefs.kt index 954c7f9a5..1abed8fba 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/prefs/OldPrefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/prefs/OldPrefs.kt @@ -111,18 +111,6 @@ class OldPrefs(factory: KPrefFactory) : KPref("${BuildConfig.APPLICATION_ID}.pre */ var verboseLogging: Boolean by kpref("verbose_logging", false) - var analytics: Boolean by kpref("analytics", false) { -// if (!BuildConfig.DEBUG) { -// if (it) { -// Bugsnag.setAutoCaptureSessions(true) -// Bugsnag.enableExceptionHandler() -// } else { -// Bugsnag.setAutoCaptureSessions(false) -// Bugsnag.disableExceptionHandler() -// } -// } - } - var biometricsEnabled: Boolean by kpref("biometrics_enabled", false) var overlayEnabled: Boolean by kpref("overlay_enabled", true) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/CorePrefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/CorePrefs.kt index b7041f75a..6d3885cbf 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/CorePrefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/CorePrefs.kt @@ -47,11 +47,6 @@ interface CorePrefs : PrefsBase { */ var verboseLogging: Boolean - /** - * True to enable analytic reports (BugSnag) - */ - var analytics: Boolean - var enablePip: Boolean var exitConfirmation: Boolean @@ -93,18 +88,6 @@ class CorePrefsImpl( oldPrefs.verboseLogging /* false */ ) - override var analytics: Boolean by kpref("analytics", oldPrefs.analytics /* false */) { -// if (!BuildConfig.DEBUG) { -// if (it) { -// Bugsnag.setAutoCaptureSessions(true) -// Bugsnag.enableExceptionHandler() -// } else { -// Bugsnag.setAutoCaptureSessions(false) -// Bugsnag.disableExceptionHandler() -// } -// } - } - override var enablePip: Boolean by kpref("enable_pip", oldPrefs.enablePip /* true */) override var exitConfirmation: Boolean by kpref( diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt index 45a3e5c02..5cc989d67 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt @@ -88,7 +88,4 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = { descRes = R.string.exit_confirmation_desc } - checkbox(R.string.analytics, prefs::analytics, { prefs.analytics = it }) { - descRes = R.string.analytics_desc - } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt index 67d2f55a9..e455aaceb 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -51,25 +51,6 @@ object L : KauLogger("Frost") { } } - var hasAnalytics: () -> Boolean = { false } - - override fun logImpl(priority: Int, message: String?, t: Throwable?) { - /* - * Debug flag is constant and should help with optimization - * bugsnagInit is changed per application and helps prevent crashes (if calling pre init) - * analytics is changed by the user, and may be toggled throughout the app - */ - if (BuildConfig.DEBUG || !hasAnalytics()) { - super.logImpl(priority, message, t) - } else { -// if (message != null) { -// Bugsnag.leaveBreadcrumb(message) -// } -// if (t != null) { -// Bugsnag.notify(t) -// } - } - } } fun KauLoggerExtension.test(message: () -> Any?) { diff --git a/app/src/main/res/layout/intro_analytics.xml b/app/src/main/res/layout/intro_analytics.xml deleted file mode 100644 index 3a44e0bbc..000000000 --- a/app/src/main/res/layout/intro_analytics.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8811522b2..0a7aae8ac 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,6 @@ buildscript { dependencies { classpath kau.Plugins.android classpath kau.Plugins.kotlin - classpath kau.Plugins.bugsnag classpath kau.Plugins.spotless classpath kau.Plugins.dexCount classpath kau.Plugins.gitVersion