[Lab] Add Open Chucker button. (#114)

This commit is contained in:
Antoni Czaplicki 2021-10-31 14:23:59 +01:00 committed by GitHub
parent c39b5442c9
commit 3f11e75985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -9,7 +9,10 @@ import android.os.Process
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.sqlite.db.SimpleSQLiteQuery import androidx.sqlite.db.SimpleSQLiteQuery
import com.chuckerteam.chucker.api.Chucker
import com.chuckerteam.chucker.api.Chucker.SCREEN_HTTP
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -95,6 +98,13 @@ class LabPageFragment : LazyFragment(), CoroutineScope {
.show() .show()
} }
if (App.enableChucker) {
b.openChucker.isVisible = true
b.openChucker.onClick {
startActivity(Chucker.getLaunchIntent(activity, SCREEN_HTTP))
}
}
b.disableDebug.onClick { b.disableDebug.onClick {
app.config.devMode = false app.config.devMode = false
App.devMode = false App.devMode = false

View File

@ -47,6 +47,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Chucker" /> android:text="Chucker" />
<Button
android:id="@+id/openChucker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Open Chucker"
android:textAllCaps="false"
android:visibility="gone"
tools:visibility="visible" />
<Button <Button
android:id="@+id/last10unseen" android:id="@+id/last10unseen"
android:layout_width="match_parent" android:layout_width="match_parent"