app style: some tweaking and new button on bottom bar to add outputs
This commit is contained in:
parent
ac17437a71
commit
d1600d389e
11 changed files with 140 additions and 108 deletions
|
@ -1,55 +1,34 @@
|
||||||
package xyz.atnrch.wrench.components
|
package xyz.atnrch.wrench.components
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.Icon
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.material.icons.Icons
|
|
||||||
import androidx.compose.material.icons.rounded.QuestionMark
|
|
||||||
import androidx.compose.runtime.*
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import xyz.atnrch.wrench.components.center.empty.DefaultDisplay
|
||||||
import xyz.atnrch.wrench.components.center.input.InputEntries
|
import xyz.atnrch.wrench.components.center.input.InputEntries
|
||||||
import xyz.atnrch.wrench.components.center.output.OutputEntries
|
import xyz.atnrch.wrench.components.center.output.OutputEntries
|
||||||
import xyz.atnrch.wrench.ui.Fonts
|
|
||||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.nio.file.Path
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun WatcherDisplay(watcherManager: WatcherManager) {
|
fun WatcherDisplay(
|
||||||
var currentClick by remember { mutableStateOf(-1) }
|
watcherManager: WatcherManager,
|
||||||
|
currentClick: Int,
|
||||||
|
outputs: MutableList<Path>,
|
||||||
|
onEntryClick: (id: Int) -> Unit
|
||||||
|
) {
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(0.dp, 0.dp, 0.dp, 55.dp)
|
modifier = Modifier.padding(0.dp, 0.dp, 0.dp, 55.dp)
|
||||||
) {
|
) {
|
||||||
if (watcherManager.getEntries().isEmpty()) {
|
if (watcherManager.getEntries().isEmpty()) {
|
||||||
watcherManager.addFile(File("/home/aro/IdeaProjects/Wrench/dummy"))
|
watcherManager.addFile(File("/home/aro/IdeaProjects/Wrench/dummy"))
|
||||||
Box(
|
DefaultDisplay()
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
modifier = Modifier.fillMaxWidth().fillMaxHeight()
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Rounded.QuestionMark,
|
|
||||||
tint = Color.White,
|
|
||||||
contentDescription = "Open Folder",
|
|
||||||
modifier = Modifier.size(ButtonDefaults.IconSize)
|
|
||||||
)
|
|
||||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
|
||||||
Text(
|
|
||||||
text = "Add a file to start...",
|
|
||||||
fontFamily = Fonts.ROBOTO_REGULAR,
|
|
||||||
color = Color.White
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
InputEntries(watcherManager) { currentClick = it }
|
InputEntries(watcherManager, onEntryClick)
|
||||||
OutputEntries(watcherManager, currentClick)
|
OutputEntries(watcherManager, currentClick, outputs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,7 @@ package xyz.atnrch.wrench.components
|
||||||
import androidx.compose.material.Scaffold
|
import androidx.compose.material.Scaffold
|
||||||
import androidx.compose.material.ScaffoldState
|
import androidx.compose.material.ScaffoldState
|
||||||
import androidx.compose.material.rememberScaffoldState
|
import androidx.compose.material.rememberScaffoldState
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.runtime.mutableStateMapOf
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
|
||||||
import xyz.atnrch.wrench.components.bottom.BottomAppBar
|
import xyz.atnrch.wrench.components.bottom.BottomAppBar
|
||||||
import xyz.atnrch.wrench.components.bottom.FloatingButton
|
import xyz.atnrch.wrench.components.bottom.FloatingButton
|
||||||
import xyz.atnrch.wrench.components.top.TopBar
|
import xyz.atnrch.wrench.components.top.TopBar
|
||||||
|
@ -15,14 +12,17 @@ import xyz.atnrch.wrench.ui.UIColors
|
||||||
import xyz.atnrch.wrench.watcher.Watcher
|
import xyz.atnrch.wrench.watcher.Watcher
|
||||||
import xyz.atnrch.wrench.watcher.WatcherEntry
|
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
import java.nio.file.Path
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun WrenchScaffold() {
|
fun WrenchScaffold() {
|
||||||
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
||||||
val entries: MutableMap<Int, WatcherEntry> = remember { mutableStateMapOf() }
|
val entries: MutableMap<Int, WatcherEntry> = remember { mutableStateMapOf() }
|
||||||
|
val outputs: MutableList<Path> = remember { mutableStateListOf() }
|
||||||
val snackBarDataHolder = SnackBarDataHolder(scaffoldState, rememberCoroutineScope())
|
val snackBarDataHolder = SnackBarDataHolder(scaffoldState, rememberCoroutineScope())
|
||||||
val watcherManager = remember { WatcherManager(entries) }
|
val watcherManager = remember { WatcherManager(entries) }
|
||||||
val watcher = remember { Watcher(watcherManager, snackBarDataHolder) }
|
val watcher = remember { Watcher(watcherManager, snackBarDataHolder) }
|
||||||
|
var currentClick by remember { mutableStateOf(-1) }
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
scaffoldState = scaffoldState,
|
scaffoldState = scaffoldState,
|
||||||
|
@ -30,6 +30,6 @@ fun WrenchScaffold() {
|
||||||
floatingActionButton = { FloatingButton(watcherManager) },
|
floatingActionButton = { FloatingButton(watcherManager) },
|
||||||
isFloatingActionButtonDocked = true,
|
isFloatingActionButtonDocked = true,
|
||||||
backgroundColor = UIColors.PRIMARY,
|
backgroundColor = UIColors.PRIMARY,
|
||||||
bottomBar = { BottomAppBar(watcher) }
|
bottomBar = { BottomAppBar(watcherManager, watcher, currentClick, outputs) }
|
||||||
) { WatcherDisplay(watcherManager) }
|
) { WatcherDisplay(watcherManager, currentClick, outputs) { currentClick = it } }
|
||||||
}
|
}
|
|
@ -5,15 +5,20 @@ import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import xyz.atnrch.wrench.ui.UIColors
|
import xyz.atnrch.wrench.ui.UIColors
|
||||||
import xyz.atnrch.wrench.watcher.Watcher
|
import xyz.atnrch.wrench.watcher.Watcher
|
||||||
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
import java.nio.file.Path
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BottomAppBar(
|
fun BottomAppBar(
|
||||||
watcher: Watcher
|
watcherManager: WatcherManager,
|
||||||
|
watcher: Watcher,
|
||||||
|
currentClick: Int,
|
||||||
|
outputs: MutableList<Path>
|
||||||
) {
|
) {
|
||||||
androidx.compose.material.BottomAppBar(
|
androidx.compose.material.BottomAppBar(
|
||||||
cutoutShape = MaterialTheme.shapes.small.copy(
|
cutoutShape = MaterialTheme.shapes.small.copy(
|
||||||
CornerSize(percent = 50)
|
CornerSize(percent = 50)
|
||||||
),
|
),
|
||||||
backgroundColor = UIColors.DARK
|
backgroundColor = UIColors.DARK
|
||||||
) { BottomRowNew(watcher) }
|
) { BottomRowNew(watcherManager, watcher, currentClick, outputs) }
|
||||||
}
|
}
|
|
@ -18,12 +18,20 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import xyz.atnrch.wrench.components.center.showDirectoryPicker
|
||||||
|
import xyz.atnrch.wrench.logger.Logger
|
||||||
import xyz.atnrch.wrench.ui.UIColors
|
import xyz.atnrch.wrench.ui.UIColors
|
||||||
import xyz.atnrch.wrench.watcher.Watcher
|
import xyz.atnrch.wrench.watcher.Watcher
|
||||||
|
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
import java.nio.file.Path
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BottomRowNew(
|
fun BottomRowNew(
|
||||||
watcher: Watcher
|
watcherManager: WatcherManager,
|
||||||
|
watcher: Watcher,
|
||||||
|
currentClick: Int,
|
||||||
|
outputs: MutableList<Path>
|
||||||
) {
|
) {
|
||||||
Spacer(Modifier.width(10.dp))
|
Spacer(Modifier.width(10.dp))
|
||||||
Button(
|
Button(
|
||||||
|
@ -48,9 +56,20 @@ fun BottomRowNew(
|
||||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||||
Text("Move files")
|
Text("Move files")
|
||||||
}
|
}
|
||||||
|
if(currentClick != -1) {
|
||||||
Spacer(Modifier.width(10.dp))
|
Spacer(Modifier.width(10.dp))
|
||||||
Button(
|
Button(
|
||||||
onClick = { println("Show Directory Picker") },
|
onClick =
|
||||||
|
{
|
||||||
|
val entry: WatcherEntry? = watcherManager.getFromId(currentClick)
|
||||||
|
showDirectoryPicker({
|
||||||
|
Logger.info("Path: ${it.absolutePath}")
|
||||||
|
entry!!.map.add(it.toPath())
|
||||||
|
outputs.add(it.toPath())
|
||||||
|
}, {
|
||||||
|
Logger.info("No file selected.")
|
||||||
|
})
|
||||||
|
},
|
||||||
colors = ButtonDefaults.buttonColors(UIColors.DARK, Color.White),
|
colors = ButtonDefaults.buttonColors(UIColors.DARK, Color.White),
|
||||||
contentPadding = PaddingValues(
|
contentPadding = PaddingValues(
|
||||||
start = 14.dp,
|
start = 14.dp,
|
||||||
|
@ -72,3 +91,4 @@ fun BottomRowNew(
|
||||||
Text("Add output...")
|
Text("Add output...")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package xyz.atnrch.wrench.components.center
|
package xyz.atnrch.wrench.components.center
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import xyz.atnrch.wrench.components.center.input.InputTextEntry
|
||||||
import xyz.atnrch.wrench.registery.RegisterComposable
|
import xyz.atnrch.wrench.registery.RegisterComposable
|
||||||
import xyz.atnrch.wrench.watcher.WatcherEntry
|
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
@ -13,7 +14,7 @@ fun DummyTextEntry(
|
||||||
) {
|
) {
|
||||||
val id = 0
|
val id = 0
|
||||||
RegisterComposable(id) {
|
RegisterComposable(id) {
|
||||||
WatcherTextEntry(
|
InputTextEntry(
|
||||||
id,
|
id,
|
||||||
WatcherEntry(File("/home/aro/IdeaProjects/Wrench/dummy"), arrayListOf()),
|
WatcherEntry(File("/home/aro/IdeaProjects/Wrench/dummy"), arrayListOf()),
|
||||||
onEntrySelected
|
onEntrySelected
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package xyz.atnrch.wrench.components.center.empty
|
||||||
|
|
||||||
|
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.rounded.QuestionMark
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import xyz.atnrch.wrench.ui.Fonts
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DefaultDisplay() {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
modifier = Modifier.fillMaxWidth().fillMaxHeight()
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.SpaceEvenly
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Rounded.QuestionMark,
|
||||||
|
tint = Color.White,
|
||||||
|
contentDescription = "Open Folder",
|
||||||
|
modifier = Modifier.size(ButtonDefaults.IconSize)
|
||||||
|
)
|
||||||
|
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||||
|
Text(
|
||||||
|
text = "Add a file to start...",
|
||||||
|
fontFamily = Fonts.ROBOTO_REGULAR,
|
||||||
|
color = Color.White
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,7 +9,6 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.RectangleShape
|
import androidx.compose.ui.graphics.RectangleShape
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import xyz.atnrch.wrench.components.center.WatcherTextEntry
|
|
||||||
import xyz.atnrch.wrench.registery.ACTIVE_COMPOSABLE
|
import xyz.atnrch.wrench.registery.ACTIVE_COMPOSABLE
|
||||||
import xyz.atnrch.wrench.registery.RegisterComposable
|
import xyz.atnrch.wrench.registery.RegisterComposable
|
||||||
import xyz.atnrch.wrench.ui.UIColors
|
import xyz.atnrch.wrench.ui.UIColors
|
||||||
|
@ -37,7 +36,7 @@ fun InputEntries(
|
||||||
) {
|
) {
|
||||||
watcherManager.getEntries().forEach {
|
watcherManager.getEntries().forEach {
|
||||||
RegisterComposable(it.key) {
|
RegisterComposable(it.key) {
|
||||||
WatcherTextEntry(
|
InputTextEntry(
|
||||||
it.key,
|
it.key,
|
||||||
it.value,
|
it.value,
|
||||||
onEntryClick
|
onEntryClick
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package xyz.atnrch.wrench.components.center
|
package xyz.atnrch.wrench.components.center.input
|
||||||
|
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.PointerMatcher
|
import androidx.compose.foundation.PointerMatcher
|
||||||
|
@ -20,7 +20,7 @@ import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
|
|
||||||
@OptIn(ExperimentalUnitApi::class, ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalUnitApi::class, ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun WatcherTextEntry(
|
fun InputTextEntry(
|
||||||
id: Int,
|
id: Int,
|
||||||
entry: WatcherEntry,
|
entry: WatcherEntry,
|
||||||
onEntrySelected: (id: Int) -> Unit
|
onEntrySelected: (id: Int) -> Unit
|
||||||
|
@ -31,8 +31,8 @@ fun WatcherTextEntry(
|
||||||
text = entry.file.absolutePath,
|
text = entry.file.absolutePath,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = if(ACTIVE_COMPOSABLE == id) UIColors.GREEN else Color.White,
|
color = if(ACTIVE_COMPOSABLE == id) UIColors.GREEN else Color.White,
|
||||||
fontSize = TextUnit(15F, TextUnitType.Sp),
|
fontSize = TextUnit(17F, TextUnitType.Sp),
|
||||||
fontFamily = Fonts.ROBOTO_REGULAR
|
fontFamily = if(ACTIVE_COMPOSABLE == id) Fonts.ROBOTO_BOLD else Fonts.ROBOTO_REGULAR
|
||||||
),
|
),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.onClick(
|
.onClick(
|
|
@ -3,14 +3,8 @@ 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
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.Button
|
|
||||||
import androidx.compose.material.Icon
|
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
||||||
import androidx.compose.material.icons.Icons
|
|
||||||
import androidx.compose.material.icons.filled.PostAdd
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.mutableStateListOf
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
@ -19,8 +13,6 @@ 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.center.showDirectoryPicker
|
|
||||||
import xyz.atnrch.wrench.logger.Logger
|
|
||||||
import xyz.atnrch.wrench.ui.UIColors
|
import xyz.atnrch.wrench.ui.UIColors
|
||||||
import xyz.atnrch.wrench.watcher.WatcherEntry
|
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||||
|
@ -31,10 +23,9 @@ import kotlin.io.path.pathString
|
||||||
@Composable
|
@Composable
|
||||||
fun OutputEntries(
|
fun OutputEntries(
|
||||||
watcherManager: WatcherManager,
|
watcherManager: WatcherManager,
|
||||||
currentSelectedInputId: Int
|
currentClick: Int,
|
||||||
|
outputs: MutableList<Path>
|
||||||
) {
|
) {
|
||||||
val outputs: MutableList<Path> = remember { mutableStateListOf() }
|
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
@ -46,7 +37,7 @@ fun OutputEntries(
|
||||||
Column(
|
Column(
|
||||||
verticalArrangement = Arrangement.spacedBy(15.dp)
|
verticalArrangement = Arrangement.spacedBy(15.dp)
|
||||||
) {
|
) {
|
||||||
val entry: WatcherEntry? = watcherManager.getFromId(currentSelectedInputId)
|
val entry: WatcherEntry? = watcherManager.getFromId(currentClick)
|
||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
outputs.clear()
|
outputs.clear()
|
||||||
outputs.addAll(entry.map)
|
outputs.addAll(entry.map)
|
||||||
|
@ -66,26 +57,9 @@ fun OutputEntries(
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
outputs.forEach {
|
outputs.forEach {
|
||||||
Text(it.pathString)
|
Text(
|
||||||
}
|
text = it.pathString,
|
||||||
}
|
color = Color.White
|
||||||
Spacer(Modifier.height(24.dp))
|
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
showDirectoryPicker({
|
|
||||||
Logger.info("Path: ${it.absolutePath}")
|
|
||||||
entry.map.add(it.toPath())
|
|
||||||
outputs.add(it.toPath())
|
|
||||||
}, {
|
|
||||||
Logger.info("No file selected.")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
Icons.Filled.PostAdd,
|
|
||||||
tint = Color.White,
|
|
||||||
contentDescription = "Add",
|
|
||||||
modifier = Modifier.size(28.dp)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,3 +68,4 @@ fun OutputEntries(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
|
@ -30,5 +30,13 @@ class Fonts {
|
||||||
weight = FontWeight.Medium
|
weight = FontWeight.Medium
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val ROBOTO_BOLD: FontFamily = FontFamily(
|
||||||
|
Font(
|
||||||
|
resource = "font/Roboto-Bold.ttf",
|
||||||
|
style = FontStyle.Normal,
|
||||||
|
weight = FontWeight.Medium
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,9 +4,11 @@ import androidx.compose.material.SnackbarDuration
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import xyz.atnrch.wrench.compose.SnackBarDataHolder
|
import xyz.atnrch.wrench.compose.SnackBarDataHolder
|
||||||
import xyz.atnrch.wrench.logger.Logger
|
import xyz.atnrch.wrench.logger.Logger
|
||||||
|
import java.io.IOException
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.nio.file.StandardCopyOption
|
import java.nio.file.StandardCopyOption
|
||||||
|
import kotlin.io.path.name
|
||||||
|
|
||||||
class Watcher(
|
class Watcher(
|
||||||
private val watcherManager: WatcherManager,
|
private val watcherManager: WatcherManager,
|
||||||
|
@ -21,8 +23,12 @@ class Watcher(
|
||||||
filesTotal += 1
|
filesTotal += 1
|
||||||
entry.map.forEach {
|
entry.map.forEach {
|
||||||
val movePath = "${it.toAbsolutePath()}/${entry.file.name}"
|
val movePath = "${it.toAbsolutePath()}/${entry.file.name}"
|
||||||
|
try {
|
||||||
Files.copy(entry.file.toPath(), Path.of(movePath), StandardCopyOption.REPLACE_EXISTING)
|
Files.copy(entry.file.toPath(), Path.of(movePath), StandardCopyOption.REPLACE_EXISTING)
|
||||||
foldersTotal += 1
|
foldersTotal += 1
|
||||||
|
} catch (exception: IOException) {
|
||||||
|
Logger.warn("Failed to move ${it.name} to $movePath! (${exception.message}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val logMessage: String = if (foldersTotal < 1) {
|
val logMessage: String = if (foldersTotal < 1) {
|
||||||
|
|
Reference in a new issue