feat(wear): add DevBadge visible only in dev-profile builds
Small red 'DEV' tag in the top-right of CaseListScreen and RecordingScreen when BuildConfig.IS_DEV_PROFILE is true. Production profiles render nothing — Krey's UI stays clean. refs #3
This commit is contained in:
@@ -30,6 +30,7 @@ import com.doctate.watch.DoctateApp
|
|||||||
import com.doctate.watch.domain.CaseEntry
|
import com.doctate.watch.domain.CaseEntry
|
||||||
import com.doctate.watch.domain.displayText
|
import com.doctate.watch.domain.displayText
|
||||||
import com.doctate.watch.domain.isManual
|
import com.doctate.watch.domain.isManual
|
||||||
|
import com.doctate.watch.presentation.components.DevBadge
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CaseListScreen(
|
fun CaseListScreen(
|
||||||
@@ -61,6 +62,11 @@ fun CaseListScreen(
|
|||||||
},
|
},
|
||||||
edgeButtonSpacing = 4.dp,
|
edgeButtonSpacing = 4.dp,
|
||||||
) { contentPadding ->
|
) { contentPadding ->
|
||||||
|
DevBadge(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
.padding(end = 4.dp, top = 2.dp),
|
||||||
|
)
|
||||||
if (displayed.isEmpty()) {
|
if (displayed.isEmpty()) {
|
||||||
EmptyState(onNewCase)
|
EmptyState(onNewCase)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import androidx.wear.compose.material3.EdgeButton
|
|||||||
import androidx.wear.compose.material3.MaterialTheme
|
import androidx.wear.compose.material3.MaterialTheme
|
||||||
import androidx.wear.compose.material3.ScreenScaffold
|
import androidx.wear.compose.material3.ScreenScaffold
|
||||||
import androidx.wear.compose.material3.Text
|
import androidx.wear.compose.material3.Text
|
||||||
|
import com.doctate.watch.presentation.components.DevBadge
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun RecordingScreen(
|
fun RecordingScreen(
|
||||||
@@ -79,6 +80,11 @@ fun RecordingScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScreenScaffold { contentPadding ->
|
ScreenScaffold { contentPadding ->
|
||||||
|
DevBadge(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
.padding(end = 4.dp, top = 2.dp),
|
||||||
|
)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.doctate.watch.presentation.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.wear.compose.material3.MaterialTheme
|
||||||
|
import androidx.wear.compose.material3.Text
|
||||||
|
import com.doctate.watch.BuildConfig
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DevBadge(modifier: Modifier = Modifier) {
|
||||||
|
if (!BuildConfig.IS_DEV_PROFILE) return
|
||||||
|
Text(
|
||||||
|
text = "DEV",
|
||||||
|
color = Color(0xFFFF5252),
|
||||||
|
style = MaterialTheme.typography.labelSmall.copy(fontWeight = FontWeight.Bold),
|
||||||
|
modifier = modifier
|
||||||
|
.background(Color.Black.copy(alpha = 0.6f), RoundedCornerShape(4.dp))
|
||||||
|
.padding(horizontal = 4.dp, vertical = 1.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user