1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-09 12:32:30 +01:00

Remove analytic content

This commit is contained in:
Allan Wang 2021-01-10 18:12:44 -08:00
parent 69a6d5742b
commit 3ed1e1a965
8 changed files with 0 additions and 143 deletions

View File

@ -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()
)

View File

@ -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<Array<out View>> = 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)

View File

@ -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)

View File

@ -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(

View File

@ -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
}
}

View File

@ -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?) {

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/intro_analytics_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@id/intro_title"
style="@style/IntroTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/analytics"
app:layout_constraintBottom_toTopOf="@id/intro_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread" />
<ImageView
android:id="@id/intro_image"
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="fitCenter"
app:layout_constraintBottom_toTopOf="@id/intro_switch"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/intro_title"
tools:layout_editor_absoluteX="112dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/intro_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/intro_desc"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/intro_image" />
<TextView
android:id="@id/intro_desc"
style="@style/IntroSubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/analytics_desc"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/intro_switch" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -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