diff --git a/panel-core/build.gradle.kts b/panel-core/build.gradle.kts
index 11d839a4..67851357 100644
--- a/panel-core/build.gradle.kts
+++ b/panel-core/build.gradle.kts
@@ -51,6 +51,7 @@ dependencies {
implementation(stack.kotlinx.coroutines.android)
implementation(stack.timber)
+ implementation(stack.material)
api(androidx.lifecycle.viewmodel)
}
diff --git a/panel-core/src/main/AndroidManifest.xml b/panel-core/src/main/AndroidManifest.xml
index 8d5d63ee..7e09788f 100644
--- a/panel-core/src/main/AndroidManifest.xml
+++ b/panel-core/src/main/AndroidManifest.xml
@@ -10,10 +10,10 @@
android:theme="@style/DebugPanelTheme" />
Unit) {
- val state = rememberModalBottomSheetState(
- initialValue = ModalBottomSheetValue.Expanded,
- confirmValueChange = { sheetState ->
- if (sheetState == ModalBottomSheetValue.Hidden) onClose()
- true
- },
- skipHalfExpanded = false
- )
-
- ModalBottomSheetLayout(
- modifier = Modifier.statusBarsPadding(),
- sheetContent = { BottomSheetContent() },
- sheetState = state,
- scrimColor = Color.Transparent,
- sheetShape = RoundedCornerShape(size = 16.dp),
- content = {},
- )
-}
-
-@Composable
-private fun BottomSheetContent() {
+public fun DebugPanelScreen(onClose: () -> Unit) {
val plugins = remember { getAllPlugins() }
val pluginsName = remember { plugins.map { it.getName() } }
val pagerState = rememberPagerState(initialPage = 0, pageCount = { plugins.size })
- Column(modifier = Modifier.fillMaxSize()) {
- Divider(
- modifier = Modifier
- .width(width = 50.dp)
- .padding(vertical = 8.dp)
- .align(alignment = Alignment.CenterHorizontally),
- color = Color.Gray,
- thickness = 4.dp
- )
- PluginsTabLayout(pluginsName = pluginsName, pagerState = pagerState)
- PluginsPager(plugins = plugins, pagerState = pagerState)
+ Scaffold(
+ topBar = {
+ TopAppBar(
+ title = { Text(text = stringResource(R.string.debug_panel)) },
+ navigationIcon = {
+ IconButton(onClick = onClose) {
+ Icon(
+ painter = painterResource(id = R.drawable.ic_arrow_back),
+ contentDescription = null,
+ )
+ }
+ },
+ backgroundColor = MaterialTheme.colors.background,
+ elevation = 0.dp,
+ )
+ },
+ ) { paddingValues ->
+ Column(modifier = Modifier.padding(paddingValues)) {
+ PluginsTabLayout(pluginsName = pluginsName, pagerState = pagerState)
+ PluginsPager(plugins = plugins, pagerState = pagerState)
+ }
}
}
diff --git a/panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugBottomSheetActivity.kt b/panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugBottomSheetActivity.kt
deleted file mode 100644
index 06cbad09..00000000
--- a/panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugBottomSheetActivity.kt
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.redmadrobot.debug.core.ui.debugpanel
-
-import android.os.Bundle
-import android.view.WindowManager
-import androidx.activity.ComponentActivity
-import androidx.activity.compose.setContent
-import androidx.compose.material.MaterialTheme
-import androidx.core.view.WindowCompat
-import com.redmadrobot.debug.core.inapp.compose.DebugBottomSheet
-
-internal class DebugBottomSheetActivity : ComponentActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- configureWindow()
-
- setContent {
- MaterialTheme {
- DebugBottomSheet(onClose = { this.finish() })
- }
- }
- }
-
- private fun configureWindow() = with(window) {
- WindowCompat.setDecorFitsSystemWindows(this, false)
- this.setFlags(
- WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
- WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
- )
- }
-}
diff --git a/panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugPanelActivity.kt b/panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugPanelActivity.kt
new file mode 100644
index 00000000..197d24bb
--- /dev/null
+++ b/panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugPanelActivity.kt
@@ -0,0 +1,18 @@
+package com.redmadrobot.debug.core.ui.debugpanel
+
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.compose.material.MaterialTheme
+import com.redmadrobot.debug.core.inapp.compose.DebugPanelScreen
+
+internal class DebugPanelActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContent {
+ MaterialTheme {
+ DebugPanelScreen(onClose = { finish() })
+ }
+ }
+ }
+}
diff --git a/panel-core/src/main/res/drawable/ic_arrow_back.xml b/panel-core/src/main/res/drawable/ic_arrow_back.xml
new file mode 100644
index 00000000..176d7bb7
--- /dev/null
+++ b/panel-core/src/main/res/drawable/ic_arrow_back.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/panel-core/src/main/res/values/strings.xml b/panel-core/src/main/res/values/strings.xml
index 3986a42d..747f7ccf 100644
--- a/panel-core/src/main/res/values/strings.xml
+++ b/panel-core/src/main/res/values/strings.xml
@@ -1,7 +1,10 @@
+
DebugPanel
+
-
+
Open DebugPanel
Open Settings
+
diff --git a/panel-core/src/main/res/values/styles.xml b/panel-core/src/main/res/values/styles.xml
index 2adf35ce..67a1bf00 100644
--- a/panel-core/src/main/res/values/styles.xml
+++ b/panel-core/src/main/res/values/styles.xml
@@ -1,22 +1,5 @@
-
-
-
+
diff --git a/plugins/plugin-about-app/src/main/kotlin/com/redmadrobot/debug/plugin/aboutapp/AboutAppPlugin.kt b/plugins/plugin-about-app/src/main/kotlin/com/redmadrobot/debug/plugin/aboutapp/AboutAppPlugin.kt
index ffe5c3d4..05f42d03 100644
--- a/plugins/plugin-about-app/src/main/kotlin/com/redmadrobot/debug/plugin/aboutapp/AboutAppPlugin.kt
+++ b/plugins/plugin-about-app/src/main/kotlin/com/redmadrobot/debug/plugin/aboutapp/AboutAppPlugin.kt
@@ -2,7 +2,6 @@ package com.redmadrobot.debug.plugin.aboutapp
import androidx.compose.runtime.Composable
import com.redmadrobot.debug.core.internal.CommonContainer
-import com.redmadrobot.debug.core.internal.EditablePlugin
import com.redmadrobot.debug.core.internal.PluginDependencyContainer
import com.redmadrobot.debug.core.plugin.Plugin
import com.redmadrobot.debug.plugin.aboutapp.model.AboutAppInfo
@@ -10,7 +9,7 @@ import com.redmadrobot.debug.plugin.aboutapp.ui.AboutAppScreen
public class AboutAppPlugin(
private val appInfoList: List
-) : Plugin(), EditablePlugin {
+) : Plugin() {
init {
appInfoList.firstOrNull()
?: error("AboutAppPlugin can't be initialized. At least one information block must be set.")