refactor: folders structure
This commit is contained in:
parent
29d5c34bd3
commit
41ec4d6e37
17 changed files with 110 additions and 74 deletions
|
@ -2,8 +2,8 @@ package xyz.atnrch.wrench.components
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import xyz.atnrch.wrench.components.input.InputEntries
|
import xyz.atnrch.wrench.components.center.input.InputEntries
|
||||||
import xyz.atnrch.wrench.components.output.OutputEntries
|
import xyz.atnrch.wrench.components.center.output.OutputEntries
|
||||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|
|
@ -27,9 +27,6 @@ fun BottomRow(
|
||||||
) {
|
) {
|
||||||
val buttonColors = remember { arrayOf(UIColors.WATCHER_START_BG) }
|
val buttonColors = remember { arrayOf(UIColors.WATCHER_START_BG) }
|
||||||
|
|
||||||
//.............
|
|
||||||
// START BUTTON
|
|
||||||
//.............
|
|
||||||
Spacer(Modifier.width(5.dp))
|
Spacer(Modifier.width(5.dp))
|
||||||
Button(
|
Button(
|
||||||
{
|
{
|
|
@ -17,9 +17,6 @@ import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
fun AddButton(
|
fun AddButton(
|
||||||
watcherManager: WatcherManager
|
watcherManager: WatcherManager
|
||||||
) {
|
) {
|
||||||
//.............
|
|
||||||
// ADD BUTTON (FLOATING)
|
|
||||||
//.............
|
|
||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
{
|
{
|
||||||
createFileChooser({
|
createFileChooser({
|
|
@ -11,7 +11,7 @@ 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 androidx.compose.ui.unit.dp
|
||||||
import xyz.atnrch.wrench.components.dialog.EntryDialog
|
import xyz.atnrch.wrench.components.center.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
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package xyz.atnrch.wrench.components.center.dialog
|
||||||
|
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DialogButton(
|
||||||
|
icon: () -> Unit,
|
||||||
|
) {
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package xyz.atnrch.wrench.components.center.dialog
|
||||||
|
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.material.Icon
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Close
|
||||||
|
import androidx.compose.material.icons.filled.Settings
|
||||||
|
import androidx.compose.material.icons.sharp.FolderOpen
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.draw.shadow
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.window.Dialog
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun EntryDialog(
|
||||||
|
onStateChange: (state: Boolean) -> Unit
|
||||||
|
) {
|
||||||
|
Dialog(
|
||||||
|
onCloseRequest = { onStateChange(false) },
|
||||||
|
resizable = true
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.fillMaxHeight(),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = Arrangement.Center
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
horizontalArrangement = Arrangement.SpaceEvenly,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(50.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(Color.White)
|
||||||
|
.shadow(30.dp, CircleShape, false)
|
||||||
|
.height(10.dp),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Sharp.FolderOpen,
|
||||||
|
tint = Color.Black,
|
||||||
|
contentDescription = "Open Folder",
|
||||||
|
modifier = Modifier.size(45.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.width(75.dp))
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.Settings,
|
||||||
|
tint = Color.Black,
|
||||||
|
contentDescription = "Entry Settings...",
|
||||||
|
modifier = Modifier.size(45.dp)
|
||||||
|
)
|
||||||
|
Spacer(Modifier.width(75.dp))
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.Settings,
|
||||||
|
tint = Color.Black,
|
||||||
|
contentDescription = "Entry Settings...",
|
||||||
|
modifier = Modifier.size(45.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.fillMaxHeight(),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = Arrangement.Bottom
|
||||||
|
) {
|
||||||
|
Row {
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.Close,
|
||||||
|
tint = Color.Black,
|
||||||
|
contentDescription = "Entry Settings...",
|
||||||
|
modifier = Modifier.size(45.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.height(15.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package xyz.atnrch.wrench.components.input
|
package xyz.atnrch.wrench.components.center.input
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
|
@ -1,4 +1,4 @@
|
||||||
package xyz.atnrch.wrench.components.input
|
package xyz.atnrch.wrench.components.center.input
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material.ButtonDefaults
|
|
@ -1,4 +1,4 @@
|
||||||
package xyz.atnrch.wrench.components.output
|
package xyz.atnrch.wrench.components.center.output
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
|
@ -1,2 +0,0 @@
|
||||||
package xyz.atnrch.wrench.components.dialog
|
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
package xyz.atnrch.wrench.components.dialog
|
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.material.Card
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.material.TextButton
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.window.Dialog
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun EntryDialog(
|
|
||||||
onStateChange: (state: Boolean) -> Unit
|
|
||||||
) {
|
|
||||||
Dialog(
|
|
||||||
onCloseRequest = { onStateChange(false) },
|
|
||||||
resizable = false,
|
|
||||||
) {
|
|
||||||
Card(
|
|
||||||
elevation = 8.dp,
|
|
||||||
shape = RoundedCornerShape(12.dp)
|
|
||||||
) {
|
|
||||||
// Buttons
|
|
||||||
Row(
|
|
||||||
horizontalArrangement = Arrangement.End,
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.fillMaxHeight(),
|
|
||||||
verticalAlignment = Alignment.Bottom
|
|
||||||
) {
|
|
||||||
TextButton(onClick = { onStateChange(false) }) {
|
|
||||||
Text(text = "Cancel")
|
|
||||||
}
|
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
|
||||||
TextButton(onClick = {}) {
|
|
||||||
Text(text = "OK")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,2 +0,0 @@
|
||||||
package xyz.atnrch.wrench.components.tooltip
|
|
||||||
|
|
|
@ -15,27 +15,19 @@ class Fonts {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val JOST_BOLD: FontFamily = FontFamily(
|
val ROBOTO_MEDIUM: FontFamily = FontFamily(
|
||||||
Font(
|
Font(
|
||||||
resource = "font/Jost-Bold.ttf",
|
resource = "font/Roboto-Medium.ttf",
|
||||||
style = FontStyle.Normal,
|
style = FontStyle.Normal,
|
||||||
weight = FontWeight.Bold
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
val JOST_MEDIUM_ITALIC: FontFamily = FontFamily(
|
|
||||||
Font(
|
|
||||||
resource = "font/Jost-MediumItalic.ttf",
|
|
||||||
style = FontStyle.Italic,
|
|
||||||
weight = FontWeight.Medium
|
weight = FontWeight.Medium
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val JOST_LIGHT_ITALIC: FontFamily = FontFamily(
|
val ROBOTO_REGULAR: FontFamily = FontFamily(
|
||||||
Font(
|
Font(
|
||||||
resource = "font/Jost-LightItalic.ttf",
|
resource = "font/Roboto-Regular.ttf",
|
||||||
style = FontStyle.Italic,
|
style = FontStyle.Normal,
|
||||||
weight = FontWeight.Light
|
weight = FontWeight.Medium
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue