app style: refactored ui components
This commit is contained in:
parent
02043a325e
commit
aa38f689a5
7 changed files with 125 additions and 62 deletions
|
@ -0,0 +1,17 @@
|
||||||
|
package xyz.atnrch.wrench.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import xyz.atnrch.wrench.components.input.InputEntries
|
||||||
|
import xyz.atnrch.wrench.components.output.OutputEntries
|
||||||
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun WatcherDisplay(
|
||||||
|
watcherManager: WatcherManager
|
||||||
|
) {
|
||||||
|
Row {
|
||||||
|
InputEntries(watcherManager)
|
||||||
|
OutputEntries()
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.unit.ExperimentalUnitApi
|
import androidx.compose.ui.unit.ExperimentalUnitApi
|
||||||
import androidx.compose.ui.unit.TextUnit
|
import androidx.compose.ui.unit.TextUnit
|
||||||
import androidx.compose.ui.unit.TextUnitType
|
import androidx.compose.ui.unit.TextUnitType
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
import xyz.atnrch.wrench.components.dialog.EntryDialog
|
import xyz.atnrch.wrench.components.dialog.EntryDialog
|
||||||
import xyz.atnrch.wrench.ui.Fonts
|
import xyz.atnrch.wrench.ui.Fonts
|
||||||
import xyz.atnrch.wrench.watcher.WatcherEntry
|
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
|
@ -24,12 +25,13 @@ fun WatcherTextEntry(entry: WatcherEntry) {
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color.Black,
|
color = Color.Black,
|
||||||
fontSize = TextUnit(15F, TextUnitType.Sp),
|
fontSize = TextUnit(15F, TextUnitType.Sp),
|
||||||
fontFamily = Fonts.JOST_LIGHT_ITALIC
|
fontFamily = Fonts.ROBOTO_REGULAR
|
||||||
),
|
),
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
dialogState = true
|
dialogState = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Spacer(Modifier.height(15.dp))
|
||||||
|
|
||||||
if (dialogState) {
|
if (dialogState) {
|
||||||
EntryDialog(onStateChange = { dialogState = it })
|
EntryDialog(onStateChange = { dialogState = it })
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
package xyz.atnrch.wrench.components
|
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.layout.*
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.mutableStateOf
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.graphics.RectangleShape
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import xyz.atnrch.wrench.components.debug.DummyTextEntry
|
|
||||||
import xyz.atnrch.wrench.ui.UIColors
|
|
||||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun WatcherDisplay(
|
|
||||||
watcherManager: WatcherManager
|
|
||||||
) {
|
|
||||||
var selectedFile = remember { mutableStateOf("") }
|
|
||||||
|
|
||||||
Row(
|
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
|
|
||||||
.fillMaxHeight()
|
|
||||||
.fillMaxWidth(0.5f)
|
|
||||||
.border(BorderStroke(4.dp, UIColors.ORANGE), RectangleShape)
|
|
||||||
) {
|
|
||||||
Column {
|
|
||||||
//.............
|
|
||||||
// INPUT SIDE
|
|
||||||
//.............
|
|
||||||
watcherManager.getEntries().forEach {
|
|
||||||
WatcherTextEntry(it)
|
|
||||||
}
|
|
||||||
DummyTextEntry()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Box(
|
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
|
|
||||||
.fillMaxHeight()
|
|
||||||
.fillMaxWidth(1f)
|
|
||||||
.border(BorderStroke(4.dp, UIColors.STRESS), RectangleShape)
|
|
||||||
) {
|
|
||||||
Column {
|
|
||||||
//.............
|
|
||||||
// OUTPUT SIDE
|
|
||||||
//.............
|
|
||||||
DummyTextEntry()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package xyz.atnrch.wrench.components.input
|
||||||
|
|
||||||
|
import androidx.compose.foundation.BorderStroke
|
||||||
|
import androidx.compose.foundation.border
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.RectangleShape
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import xyz.atnrch.wrench.components.WatcherTextEntry
|
||||||
|
import xyz.atnrch.wrench.components.debug.DummyTextEntry
|
||||||
|
import xyz.atnrch.wrench.ui.UIColors
|
||||||
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun InputEntries(
|
||||||
|
watcherManager: WatcherManager
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
|
||||||
|
.fillMaxHeight()
|
||||||
|
.fillMaxWidth(0.5f)
|
||||||
|
.border(BorderStroke(4.dp, UIColors.ORANGE), RectangleShape)
|
||||||
|
) {
|
||||||
|
InputTopText()
|
||||||
|
Column {
|
||||||
|
watcherManager.getEntries().forEach {
|
||||||
|
WatcherTextEntry(it)
|
||||||
|
}
|
||||||
|
for (i in 0..5) {
|
||||||
|
DummyTextEntry()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package xyz.atnrch.wrench.components.input
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.material.ButtonDefaults
|
||||||
|
import androidx.compose.material.Icon
|
||||||
|
import androidx.compose.material.Text
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Input
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun InputTopText() {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.TopCenter,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(PaddingValues(0.dp, 24.dp, 0.dp, 55.dp))
|
||||||
|
.fillMaxHeight()
|
||||||
|
.fillMaxWidth(0.5f)
|
||||||
|
) {
|
||||||
|
Row {
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.Input,
|
||||||
|
tint = Color.Black,
|
||||||
|
contentDescription = "Input",
|
||||||
|
modifier = Modifier.size(ButtonDefaults.IconSize)
|
||||||
|
)
|
||||||
|
Spacer(Modifier.width(5.dp))
|
||||||
|
Text("Input")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package xyz.atnrch.wrench.components.output
|
||||||
|
|
||||||
|
import androidx.compose.foundation.BorderStroke
|
||||||
|
import androidx.compose.foundation.border
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.RectangleShape
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import xyz.atnrch.wrench.components.debug.DummyTextEntry
|
||||||
|
import xyz.atnrch.wrench.ui.UIColors
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun OutputEntries() {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
|
||||||
|
.fillMaxHeight()
|
||||||
|
.fillMaxWidth()
|
||||||
|
.border(BorderStroke(4.dp, UIColors.STRESS), RectangleShape)
|
||||||
|
) {
|
||||||
|
Column {
|
||||||
|
for (i in 0..5) {
|
||||||
|
DummyTextEntry()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
package xyz.atnrch.wrench.components.tooltip
|
||||||
|
|
Reference in a new issue