diff --git a/app/src/main/java/com/example/cahier/core/navigation/CahierNavGraph.kt b/app/src/main/java/com/example/cahier/core/navigation/CahierNavGraph.kt index 05eec5f6..4c851540 100644 --- a/app/src/main/java/com/example/cahier/core/navigation/CahierNavGraph.kt +++ b/app/src/main/java/com/example/cahier/core/navigation/CahierNavGraph.kt @@ -25,12 +25,11 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.navArgument import com.example.cahier.core.ui.CahierTextureBitmapStore -import com.example.cahier.developer.brushdesigner.ui.BrushDesignerScreen +import com.example.cahier.developer.brushgraph.ui.BrushGraphScreen import com.example.cahier.features.drawing.DrawingCanvas import com.example.cahier.features.home.HomeDestination import com.example.cahier.features.home.HomePane import com.example.cahier.features.text.TextNoteCanvasScreen -import com.example.cahier.developer.brushgraph.ui.BrushGraphScreen @OptIn(ExperimentalComposeApi::class) @@ -38,7 +37,7 @@ import com.example.cahier.developer.brushgraph.ui.BrushGraphScreen fun CahierNavHost( navController: NavHostController, textureStore: CahierTextureBitmapStore, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, ) { NavHost( navController = navController, @@ -56,9 +55,6 @@ fun CahierNavHost( navigateUp = { navController.navigateUp() }, - navigateToBrushDesigner = { - navController.navigate(BrushDesignerDestination.route) - }, navigateToBrushGraph = { navController.navigate(BrushGraphDestination.route) }, @@ -86,11 +82,6 @@ fun CahierNavHost( navigateToBrushGraph = { navController.navigate(BrushGraphDestination.route) } ) } - composable(route = BrushDesignerDestination.route) { - BrushDesignerScreen( - onNavigateUp = { navController.navigateUp() }, - ) - } composable(route = BrushGraphDestination.route) { BrushGraphScreen( onNavigateUp = { navController.navigateUp() } @@ -113,10 +104,6 @@ object DrawingCanvasDestination : NavigationDestination { val routeWithArgs = "$route/{$NOTE_ID_ARG}" } -object BrushDesignerDestination : NavigationDestination { - override val route = "brush_designer" -} - object BrushGraphDestination : NavigationDestination { override val route = "brush_graph" } \ No newline at end of file diff --git a/app/src/main/java/com/example/cahier/features/home/CahierHomeScreen.kt b/app/src/main/java/com/example/cahier/features/home/CahierHomeScreen.kt index 190f6077..377708c3 100644 --- a/app/src/main/java/com/example/cahier/features/home/CahierHomeScreen.kt +++ b/app/src/main/java/com/example/cahier/features/home/CahierHomeScreen.kt @@ -109,7 +109,7 @@ object HomeDestination : NavigationDestination { enum class AppDestinations( @param:StringRes val label: Int, @param:DrawableRes val icon: Int, - @param:StringRes val contentDescription: Int + @param:StringRes val contentDescription: Int, ) { Home( label = R.string.home, @@ -133,7 +133,6 @@ enum class AppDestinations( fun HomePane( navigateToCanvas: (Long) -> Unit, navigateToDrawingCanvas: (Long) -> Unit, - navigateToBrushDesigner: () -> Unit = {}, navigateToBrushGraph: () -> Unit = {}, navigateUp: () -> Unit, modifier: Modifier = Modifier, @@ -222,7 +221,6 @@ fun HomePane( selectedNoteUIState = selectedNoteUIState, navigateToCanvas = navigateToCanvas, navigateToDrawingCanvas = navigateToDrawingCanvas, - navigateToBrushDesigner = navigateToBrushDesigner, navigateToBrushGraph = navigateToBrushGraph, navigateUp = navigateUp ) @@ -243,9 +241,8 @@ private fun CahierNavigationSuite( selectedNoteUIState: CahierUiState, navigateToCanvas: (Long) -> Unit, navigateToDrawingCanvas: (Long) -> Unit, - navigateToBrushDesigner: () -> Unit, navigateToBrushGraph: () -> Unit, - navigateUp: () -> Unit + navigateUp: () -> Unit, ) { NavigationSuiteScaffold( modifier = modifier, @@ -369,7 +366,6 @@ private fun CahierNavigationSuite( AppDestinations.Settings -> { SettingsScreen( - navigateToBrushDesigner = navigateToBrushDesigner, navigateToBrushGraph = navigateToBrushGraph, modifier = Modifier.fillMaxSize() ) @@ -416,7 +412,7 @@ private fun DetailPaneContent( note: Note, strokes: List, onClickToEdit: (Note) -> Unit, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, ) { NoteDetail( note = note, diff --git a/app/src/main/java/com/example/cahier/features/home/SettingsScreen.kt b/app/src/main/java/com/example/cahier/features/home/SettingsScreen.kt index 74b0528b..c99e8816 100644 --- a/app/src/main/java/com/example/cahier/features/home/SettingsScreen.kt +++ b/app/src/main/java/com/example/cahier/features/home/SettingsScreen.kt @@ -35,7 +35,6 @@ import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold -import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @@ -58,14 +57,12 @@ import kotlinx.coroutines.launch @OptIn(ExperimentalMaterial3AdaptiveApi::class, ExperimentalMaterial3Api::class) @Composable fun SettingsScreen( - navigateToBrushDesigner: () -> Unit, navigateToBrushGraph: () -> Unit, modifier: Modifier = Modifier, - viewModel: SettingsViewModel = hiltViewModel() + viewModel: SettingsViewModel = hiltViewModel(), ) { val isRoleAvailable by viewModel.isRoleAvailable.collectAsStateWithLifecycle() val isRoleHeld by viewModel.isRoleHeld.collectAsStateWithLifecycle() - val isUsingGraphUi by viewModel.isUsingGraphUi.collectAsStateWithLifecycle() LocalContext.current val coroutineScope = rememberCoroutineScope() @@ -131,6 +128,7 @@ fun SettingsScreen( !isRoleAvailable -> stringResource( R.string.notes_role_not_available ) + isRoleHeld -> stringResource(R.string.notes_role_held) else -> stringResource(R.string.notes_role_not_held) }, @@ -175,8 +173,10 @@ fun SettingsScreen( style = MaterialTheme.typography.titleMedium ) Text( - text = stringResource(R.string - .settings_developer_tools_description), + text = stringResource( + R.string + .settings_developer_tools_description + ), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant ) @@ -190,8 +190,10 @@ fun SettingsScreen( style = MaterialTheme.typography.bodyLarge ) Text( - text = stringResource(R.string - .settings_brush_designer_description), + text = stringResource( + R.string + .settings_brush_designer_description + ), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant ) @@ -199,39 +201,12 @@ fun SettingsScreen( FilledTonalButton( onClick = { - if (isUsingGraphUi) { - navigateToBrushGraph() - } else { - navigateToBrushDesigner() - } + navigateToBrushGraph() } ) { Text(stringResource(R.string.settings_launch)) } } - - Row( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.fillMaxWidth() - ) { - Column(modifier = Modifier.weight(1f)) { - Text( - text = stringResource(R.string.settings_graph_ui), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) - Text( - text = stringResource(R.string.settings_graph_description), - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) - } - Switch( - checked = isUsingGraphUi, - onCheckedChange = { viewModel.setUsingGraphUi(it) }, - enabled = true - ) - } } } } diff --git a/app/src/main/java/com/example/cahier/features/home/viewmodel/SettingsViewModel.kt b/app/src/main/java/com/example/cahier/features/home/viewmodel/SettingsViewModel.kt index 5977fee1..b0e75b53 100644 --- a/app/src/main/java/com/example/cahier/features/home/viewmodel/SettingsViewModel.kt +++ b/app/src/main/java/com/example/cahier/features/home/viewmodel/SettingsViewModel.kt @@ -39,7 +39,7 @@ import javax.inject.Inject @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) @HiltViewModel class SettingsViewModel @Inject constructor( - @param: ApplicationContext private val context: Context + @param:ApplicationContext private val context: Context, ) : ViewModel() { private val _isRoleAvailable = MutableStateFlow(false) @@ -47,14 +47,6 @@ class SettingsViewModel @Inject constructor( private val _isRoleHeld = MutableStateFlow(false) val isRoleHeld: StateFlow = _isRoleHeld.asStateFlow() - - private val _isUsingGraphUi = MutableStateFlow(true) - val isUsingGraphUi: StateFlow = _isUsingGraphUi.asStateFlow() - - fun setUsingGraphUi(isDefault: Boolean) { - _isUsingGraphUi.value = isDefault - } - private val roleManager: RoleManager? by lazy { context.getSystemService(RoleManager::class.java) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cf21cc73..e88315fc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -270,10 +270,8 @@ Developer Tools Experimental features and debugging tools. Ink Brush Designer - Create, test, and export custom brush families. + Create, test, and export custom brush families in a visual, node-based, graph UI. Launch - Graph UI - Visual, node-based brush designer Name Texture diff --git a/app/src/test/java/com/example/cahier/ScreenshotTest.kt b/app/src/test/java/com/example/cahier/ScreenshotTest.kt index 018669be..af6ab9b5 100644 --- a/app/src/test/java/com/example/cahier/ScreenshotTest.kt +++ b/app/src/test/java/com/example/cahier/ScreenshotTest.kt @@ -30,7 +30,6 @@ class ScreenshotTest { HomePane( navigateToCanvas = { _ -> }, navigateToDrawingCanvas = { _ -> }, - navigateToBrushDesigner = {}, navigateToBrushGraph = {}, navigateUp = {}, homeScreenViewModel = fakeViewModel