Skip to content

Commit 42906e7

Browse files
committed
fixed an UI bug
1 parent 3f2fd2e commit 42906e7

2 files changed

Lines changed: 76 additions & 63 deletions

File tree

app/lint-baseline.xml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,28 @@
122122
column="14"/>
123123
</issue>
124124

125+
<issue
126+
id="GradleDependency"
127+
message="A newer version of androidx.credentials:credentials than 1.6.0-rc02 is available: 1.6.0"
128+
errorLine1="credentials = &quot;1.6.0-rc02&quot;"
129+
errorLine2=" ~~~~~~~~~~~~">
130+
<location
131+
file="$HOME/StudioProjects/aShellYou/gradle/libs.versions.toml"
132+
line="9"
133+
column="15"/>
134+
</issue>
135+
136+
<issue
137+
id="GradleDependency"
138+
message="A newer version of androidx.credentials:credentials-play-services-auth than 1.6.0-rc02 is available: 1.6.0"
139+
errorLine1="credentials = &quot;1.6.0-rc02&quot;"
140+
errorLine2=" ~~~~~~~~~~~~">
141+
<location
142+
file="$HOME/StudioProjects/aShellYou/gradle/libs.versions.toml"
143+
line="9"
144+
column="15"/>
145+
</issue>
146+
125147
<issue
126148
id="GradleDependency"
127149
message="A newer version of androidx.core:core-ktx than 1.17.0 is available: 1.18.0"
@@ -349,7 +371,7 @@
349371
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
350372
<location
351373
file="src/main/res/values/strings.xml"
352-
line="27"
374+
line="37"
353375
column="5"/>
354376
</issue>
355377

@@ -360,7 +382,7 @@
360382
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
361383
<location
362384
file="src/main/res/values/strings.xml"
363-
line="89"
385+
line="99"
364386
column="5"/>
365387
</issue>
366388

@@ -371,7 +393,7 @@
371393
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
372394
<location
373395
file="src/main/res/values/strings.xml"
374-
line="93"
396+
line="103"
375397
column="5"/>
376398
</issue>
377399

@@ -382,7 +404,7 @@
382404
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
383405
<location
384406
file="src/main/res/values/strings.xml"
385-
line="102"
407+
line="112"
386408
column="5"/>
387409
</issue>
388410

@@ -393,7 +415,7 @@
393415
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
394416
<location
395417
file="src/main/res/values/strings.xml"
396-
line="113"
418+
line="123"
397419
column="5"/>
398420
</issue>
399421

@@ -404,7 +426,7 @@
404426
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
405427
<location
406428
file="src/main/res/values/strings.xml"
407-
line="114"
429+
line="124"
408430
column="5"/>
409431
</issue>
410432

@@ -415,7 +437,7 @@
415437
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
416438
<location
417439
file="src/main/res/values/strings.xml"
418-
line="211"
440+
line="221"
419441
column="5"/>
420442
</issue>
421443

@@ -426,7 +448,7 @@
426448
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
427449
<location
428450
file="src/main/res/values/strings.xml"
429-
line="222"
451+
line="232"
430452
column="5"/>
431453
</issue>
432454

@@ -437,7 +459,7 @@
437459
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
438460
<location
439461
file="src/main/res/values/strings.xml"
440-
line="223"
462+
line="233"
441463
column="5"/>
442464
</issue>
443465

@@ -448,7 +470,7 @@
448470
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
449471
<location
450472
file="src/main/res/values/strings.xml"
451-
line="224"
473+
line="234"
452474
column="5"/>
453475
</issue>
454476

@@ -459,7 +481,7 @@
459481
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
460482
<location
461483
file="src/main/res/values/strings.xml"
462-
line="311"
484+
line="321"
463485
column="5"/>
464486
</issue>
465487

@@ -990,17 +1012,6 @@
9901012
column="1"/>
9911013
</issue>
9921014

993-
<issue
994-
id="UnusedResources"
995-
message="The resource `R.drawable.ic_shizuku` appears to be unused"
996-
errorLine1="&lt;vector"
997-
errorLine2="^">
998-
<location
999-
file="src/main/res/drawable/ic_shizuku.xml"
1000-
line="1"
1001-
column="1"/>
1002-
</issue>
1003-
10041015
<issue
10051016
id="UnusedResources"
10061017
message="The resource `R.drawable.ic_star` appears to be unused"
@@ -1183,8 +1194,8 @@
11831194
errorLine1=" .offset(x = offsetX)"
11841195
errorLine2=" ~~~~~~">
11851196
<location
1186-
file="src/main/java/in/hridayan/ashell/qstiles/presentation/screen/TileDashBoardScreen.kt"
1187-
line="352"
1197+
file="src/main/java/in/hridayan/ashell/core/presentation/components/navigation/FloatingNavPill.kt"
1198+
line="65"
11881199
column="22"/>
11891200
</issue>
11901201

app/src/main/java/in/hridayan/ashell/qstiles/presentation/screen/CreateTileScreen.kt

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
7777
import `in`.hridayan.ashell.R
7878
import `in`.hridayan.ashell.core.common.LocalDarkMode
7979
import `in`.hridayan.ashell.core.common.LocalWeakHaptic
80-
import `in`.hridayan.ashell.core.presentation.components.modifier.dashedBorder
8180
import `in`.hridayan.ashell.core.presentation.components.haptic.withHaptic
81+
import `in`.hridayan.ashell.core.presentation.components.modifier.dashedBorder
8282
import `in`.hridayan.ashell.core.presentation.components.text.AutoResizeableText
8383
import `in`.hridayan.ashell.core.utils.showToast
8484
import `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

Comments
 (0)