@@ -77,8 +77,8 @@ import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
7777import `in`.hridayan.ashell.R
7878import `in`.hridayan.ashell.core.common.LocalDarkMode
7979import `in`.hridayan.ashell.core.common.LocalWeakHaptic
80- import `in`.hridayan.ashell.core.presentation.components.modifier.dashedBorder
8180import `in`.hridayan.ashell.core.presentation.components.haptic.withHaptic
81+ import `in`.hridayan.ashell.core.presentation.components.modifier.dashedBorder
8282import `in`.hridayan.ashell.core.presentation.components.text.AutoResizeableText
8383import `in`.hridayan.ashell.core.utils.showToast
8484import `in`.hridayan.ashell.navigation.LocalNavController
@@ -253,31 +253,29 @@ fun CreateTileScreen(
253253 )
254254 )
255255 }
256-
257256 item {
258257 val label = if (uiState.isToggleable)
259- stringResource(R .string.adb_command_on_state )
258+ stringResource(R .string.subtitle_on_state )
260259 else
261- stringResource(R .string.adb_command )
260+ stringResource(R .string.subtitle )
262261 SectionLabel (
263262 text = label,
264263 modifier = Modifier .padding(top = 25 .dp, start = 25 .dp, bottom = 10 .dp)
265264 )
266265 }
267-
268266 item {
269267 TileTextField (
270268 modifier = Modifier
271269 .fillMaxWidth()
272- .padding(horizontal = 20 .dp)
273- .animateContentSize() ,
274- value = uiState.activeCommand,
275- onValueChange = { createTileViewModel.onActiveCommandChange (it) },
276- hint = stringResource( R .string.adb_command_hint),
277- shape = RoundedCornerShape ( 28 .dp) ,
278- singleLine = false ,
279- minLines = 3 ,
280- fontFamily = FontFamily . Monospace ,
270+ .padding(horizontal = 20 .dp),
271+ value = uiState. run { if (isActive) activeSubtitle else inactiveSubtitle } ,
272+ onValueChange = {
273+ if (uiState.isActive) createTileViewModel.onActiveSubtitleChange (it)
274+ else createTileViewModel.onInactiveSubtitleChange(it)
275+ } ,
276+ hint = stringResource( R .string.on_state) ,
277+ shape = RoundedCornerShape ( 50 ) ,
278+ singleLine = true ,
281279 )
282280 }
283281
@@ -289,48 +287,49 @@ fun CreateTileScreen(
289287 ) {
290288 Column {
291289 SectionLabel (
292- text = stringResource(R .string.adb_command_off_state ),
290+ text = stringResource(R .string.subtitle_off_state ),
293291 modifier = Modifier .padding(
294292 top = 20 .dp, start = 25 .dp, bottom = 10 .dp
295293 )
296294 )
297295 TileTextField (
298296 modifier = Modifier
299297 .fillMaxWidth()
300- .padding(horizontal = 20 .dp)
301- .animateContentSize(),
302- value = uiState.inactiveCommand,
303- onValueChange = { createTileViewModel.onInactiveCommandChange(it) },
304- hint = stringResource(R .string.adb_command_hint),
305- shape = RoundedCornerShape (28 .dp),
306- singleLine = false ,
307- minLines = 3 ,
308- fontFamily = FontFamily .Monospace ,
298+ .padding(horizontal = 20 .dp),
299+ value = uiState.inactiveSubtitle,
300+ onValueChange = { createTileViewModel.onInactiveSubtitleChange(it) },
301+ hint = stringResource(R .string.off_state),
302+ shape = RoundedCornerShape (50 ),
303+ singleLine = true ,
309304 )
310305 }
311306 }
312307 }
313308
314309 item {
315310 val label = if (uiState.isToggleable)
316- stringResource(R .string.subtitle_on_state )
311+ stringResource(R .string.adb_command_on_state )
317312 else
318- stringResource(R .string.subtitle )
313+ stringResource(R .string.adb_command )
319314 SectionLabel (
320315 text = label,
321316 modifier = Modifier .padding(top = 25 .dp, start = 25 .dp, bottom = 10 .dp)
322317 )
323318 }
319+
324320 item {
325321 TileTextField (
326322 modifier = Modifier
327323 .fillMaxWidth()
328- .padding(horizontal = 20 .dp),
329- value = uiState.run { if (isActive) activeSubtitle else inactiveSubtitle },
330- onValueChange = { createTileViewModel.onActiveSubtitleChange(it) },
331- hint = stringResource(R .string.on_state),
332- shape = RoundedCornerShape (50 ),
333- singleLine = true ,
324+ .padding(horizontal = 20 .dp)
325+ .animateContentSize(),
326+ value = uiState.activeCommand,
327+ onValueChange = { createTileViewModel.onActiveCommandChange(it) },
328+ hint = stringResource(R .string.adb_command_hint),
329+ shape = RoundedCornerShape (28 .dp),
330+ singleLine = false ,
331+ minLines = 3 ,
332+ fontFamily = FontFamily .Monospace ,
334333 )
335334 }
336335
@@ -342,20 +341,23 @@ fun CreateTileScreen(
342341 ) {
343342 Column {
344343 SectionLabel (
345- text = stringResource(R .string.subtitle_off_state ),
344+ text = stringResource(R .string.adb_command_off_state ),
346345 modifier = Modifier .padding(
347346 top = 20 .dp, start = 25 .dp, bottom = 10 .dp
348347 )
349348 )
350349 TileTextField (
351350 modifier = Modifier
352351 .fillMaxWidth()
353- .padding(horizontal = 20 .dp),
354- value = uiState.inactiveSubtitle,
355- onValueChange = { createTileViewModel.onInactiveSubtitleChange(it) },
356- hint = stringResource(R .string.off_state),
357- shape = RoundedCornerShape (50 ),
358- singleLine = true ,
352+ .padding(horizontal = 20 .dp)
353+ .animateContentSize(),
354+ value = uiState.inactiveCommand,
355+ onValueChange = { createTileViewModel.onInactiveCommandChange(it) },
356+ hint = stringResource(R .string.adb_command_hint),
357+ shape = RoundedCornerShape (28 .dp),
358+ singleLine = false ,
359+ minLines = 3 ,
360+ fontFamily = FontFamily .Monospace ,
359361 )
360362 }
361363 }
0 commit comments