Skip to content

Commit 375bb2f

Browse files
committed
refactor: ui corners radius
1 parent f34b283 commit 375bb2f

File tree

11 files changed

+81
-30
lines changed

11 files changed

+81
-30
lines changed

app/src/main/java/org/shirabox/app/ui/activity/auth/AuthActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ fun AuthForm(
190190
) {
191191
OutlinedButton(
192192
modifier = Modifier.fillMaxWidth(),
193+
shape = RoundedCornerShape(32),
193194
onClick = { onRegister() },
194195
enabled = !loginInProcess,
195196
contentPadding = PaddingValues(12.dp),

app/src/main/java/org/shirabox/app/ui/activity/downloads/screen/DownloadsSavedScreen.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.size
1818
import androidx.compose.foundation.lazy.LazyColumn
1919
import androidx.compose.foundation.lazy.items
2020
import androidx.compose.foundation.lazy.rememberLazyListState
21+
import androidx.compose.foundation.shape.RoundedCornerShape
2122
import androidx.compose.material3.AlertDialog
2223
import androidx.compose.material3.Button
2324
import androidx.compose.material3.ButtonDefaults
@@ -324,13 +325,15 @@ internal fun RemovalConfirmDialog(
324325
text = {
325326
Text(text = text)
326327
},
328+
shape = RoundedCornerShape(16.dp),
327329
onDismissRequest = { dialogVisibilityState.value = false },
328330
confirmButton = {
329331
Button(
330332
onClick = {
331333
onConfirm()
332334
dialogVisibilityState.value = false
333335
},
336+
shape = RoundedCornerShape(32),
334337
colors = ButtonDefaults.buttonColors()
335338
.copy(
336339
containerColor = MaterialTheme.colorScheme.tertiaryContainer,
@@ -342,6 +345,7 @@ internal fun RemovalConfirmDialog(
342345
},
343346
dismissButton = {
344347
TextButton (
348+
shape = RoundedCornerShape(16.dp),
345349
onClick = { dialogVisibilityState.value = false }
346350
) {
347351
Text(text = stringResource(R.string.downloads_cancel_action))

app/src/main/java/org/shirabox/app/ui/activity/player/presentation/controls/PlayerSkipButton.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ internal fun PlayerSkipButton(
6363
OutlinedButton(
6464
modifier = Modifier.padding(0.dp, 128.dp, endPadding, 0.dp),
6565
border = BorderStroke(1.dp, Color.White),
66-
shape = RoundedCornerShape(40),
66+
shape = RoundedCornerShape(32),
6767
contentPadding = PaddingValues(0.dp),
6868
onClick = onClick
6969
) {

app/src/main/java/org/shirabox/app/ui/activity/resource/ResourceActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ fun Resource(
215215
horizontalAlignment = Alignment.CenterHorizontally
216216
) {
217217
ScaredEmoticon(text = errorText)
218-
Button(onClick = { activity?.finish() }) {
218+
Button(
219+
shape = RoundedCornerShape(32),
220+
onClick = { activity?.finish() }
221+
) {
219222
Text(stringResource(id = R.string.go_back))
220223
}
221224
}
@@ -365,6 +368,7 @@ fun Resource(
365368
.height(54.dp)
366369
.fillMaxWidth()
367370
.weight(weight = 1f, fill = false),
371+
shape = RoundedCornerShape(32),
368372
onClick = {
369373
bottomSheetVisibilityState.value = true
370374
},

app/src/main/java/org/shirabox/app/ui/activity/settings/category/playback/Dialogs.kt

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.shirabox.app.ui.activity.settings.category.playback
33
import androidx.compose.foundation.layout.Arrangement
44
import androidx.compose.foundation.layout.Column
55
import androidx.compose.foundation.layout.size
6+
import androidx.compose.foundation.shape.RoundedCornerShape
67
import androidx.compose.material3.AlertDialog
78
import androidx.compose.material3.Icon
89
import androidx.compose.material3.MaterialTheme
@@ -43,22 +44,32 @@ fun AnimeSkipDialog(visibilityState: MutableState<Boolean>) {
4344
visibilityState.value = false
4445
},
4546
confirmButton = {
46-
TextButton(onClick = { visibilityState.value = false }) {
47+
TextButton(
48+
shape = RoundedCornerShape(32),
49+
onClick = { visibilityState.value = false }
50+
) {
4751
Text(text = stringResource(id = R.string.confirm))
4852
}
4953
},
5054
dismissButton = {
51-
TextButton(onClick = {
52-
coroutineScope.launch {
53-
visibilityState.value = false
54-
AppDataStore.write(
55-
context,
56-
DataStoreScheme.FIELD_ANIMESKIP_USER_CLIENT_ID,
57-
""
58-
)
59-
AppDataStore.write(context, DataStoreScheme.FIELD_USE_ANIMESKIP.key, false)
60-
}
61-
}) {
55+
TextButton(
56+
shape = RoundedCornerShape(32),
57+
onClick = {
58+
coroutineScope.launch {
59+
visibilityState.value = false
60+
AppDataStore.write(
61+
context,
62+
DataStoreScheme.FIELD_ANIMESKIP_USER_CLIENT_ID,
63+
"",
64+
)
65+
AppDataStore.write(
66+
context,
67+
DataStoreScheme.FIELD_USE_ANIMESKIP.key,
68+
false,
69+
)
70+
}
71+
},
72+
) {
6273
Text(text = stringResource(id = R.string.logout), color = Color.Red)
6374
}
6475
},
@@ -115,7 +126,10 @@ fun InstantSeekDialog(visibilityState: MutableState<Boolean>) {
115126
visibilityState.value = false
116127
},
117128
confirmButton = {
118-
TextButton(onClick = { visibilityState.value = false }) {
129+
TextButton(
130+
shape = RoundedCornerShape(32),
131+
onClick = { visibilityState.value = false }
132+
) {
119133
Text(text = stringResource(id = R.string.confirm))
120134
}
121135
},

app/src/main/java/org/shirabox/app/ui/activity/update/AppUpdateActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.padding
1616
import androidx.compose.foundation.layout.size
1717
import androidx.compose.foundation.layout.widthIn
1818
import androidx.compose.foundation.lazy.LazyColumn
19+
import androidx.compose.foundation.shape.RoundedCornerShape
1920
import androidx.compose.material3.AlertDialog
2021
import androidx.compose.material3.Button
2122
import androidx.compose.material3.ButtonDefaults
@@ -224,6 +225,7 @@ fun AppUpdateScreen(
224225
) {
225226
Button(
226227
modifier = Modifier.size(256.dp, 64.dp),
228+
shape = RoundedCornerShape(32),
227229
onClick = {
228230
isUpdating.value = true
229231
dialogVisibilityState.value = true
@@ -333,9 +335,9 @@ fun UpdateDialog(
333335
},
334336
confirmButton = {
335337
OutlinedButton(
338+
shape = RoundedCornerShape(32),
336339
onClick = {
337340
UpdateManager.cancelDownload()
338-
339341
downloadFinished = true
340342
updateProcessState.value = false
341343
dialogVisibilityState.value = false

app/src/main/java/org/shirabox/app/ui/component/general/Dialogs.kt

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Arrangement
99
import androidx.compose.foundation.layout.Column
1010
import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.size
12+
import androidx.compose.foundation.shape.RoundedCornerShape
1213
import androidx.compose.material3.AlertDialog
1314
import androidx.compose.material3.Icon
1415
import androidx.compose.material3.ListItemDefaults
@@ -39,6 +40,7 @@ fun NotificationsRequestDialog(isOpen: MutableState<Boolean>, onConfirm: () -> U
3940
onDismissRequest = {
4041
isOpen.value = false
4142
},
43+
shape = RoundedCornerShape(16.dp),
4244
icon = {
4345
Icon(
4446
modifier = Modifier.size(48.dp),
@@ -61,6 +63,7 @@ fun NotificationsRequestDialog(isOpen: MutableState<Boolean>, onConfirm: () -> U
6163
},
6264
confirmButton = {
6365
TextButton(
66+
shape = RoundedCornerShape(32),
6467
onClick = {
6568
isOpen.value = false
6669
onConfirm()
@@ -71,6 +74,7 @@ fun NotificationsRequestDialog(isOpen: MutableState<Boolean>, onConfirm: () -> U
7174
},
7275
dismissButton = {
7376
TextButton(
77+
shape = RoundedCornerShape(32),
7478
onClick = {
7579
isOpen.value = false
7680
}
@@ -89,6 +93,7 @@ fun NotificationsDismissDialog(context: Context, isOpen: MutableState<Boolean>)
8993
onDismissRequest = {
9094
isOpen.value = false
9195
},
96+
shape = RoundedCornerShape(16.dp),
9297
icon = {
9398
Icon(
9499
modifier = Modifier.size(48.dp),
@@ -111,6 +116,7 @@ fun NotificationsDismissDialog(context: Context, isOpen: MutableState<Boolean>)
111116
},
112117
confirmButton = {
113118
TextButton(
119+
shape = RoundedCornerShape(32),
114120
onClick = {
115121
isOpen.value = false
116122
}
@@ -120,14 +126,15 @@ fun NotificationsDismissDialog(context: Context, isOpen: MutableState<Boolean>)
120126
},
121127
dismissButton = {
122128
TextButton(
123-
onClick = {
124-
isOpen.value = false
125-
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
126-
data = Uri.parse("package:${context.applicationContext.packageName}")
127-
}
128-
context.startActivity(intent)
129+
shape = RoundedCornerShape(32),
130+
onClick = {
131+
isOpen.value = false
132+
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
133+
data = Uri.parse("package:${context.applicationContext.packageName}")
129134
}
130-
) {
135+
context.startActivity(intent)
136+
}
137+
) {
131138
Text(stringResource(R.string.notifications_request))
132139
}
133140
}
@@ -142,6 +149,7 @@ fun DisposableScheduleDialog(isOpen: MutableState<Boolean>, onConfirm: () -> Uni
142149
onDismissRequest = {
143150
isOpen.value = false
144151
},
152+
shape = RoundedCornerShape(16.dp),
145153
icon = {
146154
Icon(
147155
modifier = Modifier.size(48.dp),
@@ -164,6 +172,7 @@ fun DisposableScheduleDialog(isOpen: MutableState<Boolean>, onConfirm: () -> Uni
164172
},
165173
confirmButton = {
166174
TextButton(
175+
shape = RoundedCornerShape(32),
167176
onClick = {
168177
isOpen.value = false
169178
onConfirm()
@@ -193,11 +202,15 @@ fun QualityDialog(
193202
onDismissRequest = {
194203
visibilityState.value = false
195204
},
205+
shape = RoundedCornerShape(16.dp),
196206
confirmButton = {
197-
TextButton(onClick = {
198-
onConfirm(selectedQuality.value)
199-
visibilityState.value = false
200-
}) {
207+
TextButton(
208+
shape = RoundedCornerShape(32),
209+
onClick = {
210+
onConfirm(selectedQuality.value)
211+
visibilityState.value = false
212+
}
213+
) {
201214
Text(text = stringResource(id = R.string.confirm))
202215
}
203216
},

app/src/main/java/org/shirabox/app/ui/component/top/TopBar.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.height
1111
import androidx.compose.foundation.layout.padding
1212
import androidx.compose.foundation.layout.requiredSize
1313
import androidx.compose.foundation.layout.size
14+
import androidx.compose.foundation.shape.RoundedCornerShape
1415
import androidx.compose.material3.Badge
1516
import androidx.compose.material3.BadgedBox
1617
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -65,7 +66,7 @@ fun TopBar(
6566
.fillMaxWidth()
6667
.weight(weight = 1f, fill = false)
6768
.height(SearchBarDefaults.InputFieldHeight)
68-
.clip(SearchBarDefaults.dockedShape)
69+
.clip(RoundedCornerShape(32))
6970
.background(MaterialTheme.colorScheme.secondaryContainer)
7071
.clickable {
7172
context.startActivity(

app/src/main/java/org/shirabox/app/ui/screen/explore/TroubleMessage.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Box
88
import androidx.compose.foundation.layout.Column
99
import androidx.compose.foundation.layout.fillMaxSize
1010
import androidx.compose.foundation.layout.fillMaxWidth
11+
import androidx.compose.foundation.shape.RoundedCornerShape
1112
import androidx.compose.material3.OutlinedButton
1213
import androidx.compose.material3.Text
1314
import androidx.compose.runtime.Composable
@@ -45,7 +46,10 @@ fun TroubleMessage(
4546
else -> ScaredEmoticon(text = stringResource(id = R.string.no_contents))
4647
}
4748

48-
OutlinedButton(onClick = { model.refresh(false) }) {
49+
OutlinedButton(
50+
shape = RoundedCornerShape(32),
51+
onClick = { model.refresh(false) }
52+
) {
4953
Text(stringResource(id = R.string.refresh))
5054
}
5155
}

app/src/main/java/org/shirabox/app/ui/screen/explore/notifications/NotificationsScreen.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1010
import androidx.compose.foundation.layout.padding
1111
import androidx.compose.foundation.layout.size
1212
import androidx.compose.foundation.rememberScrollState
13+
import androidx.compose.foundation.shape.RoundedCornerShape
1314
import androidx.compose.foundation.verticalScroll
1415
import androidx.compose.material3.Icon
1516
import androidx.compose.material3.MaterialTheme
@@ -99,6 +100,7 @@ fun NotificationsScreen(
99100

100101
OutlinedButton(
101102
enabled = notifications.value.isNotEmpty(),
103+
shape = RoundedCornerShape(32),
102104
onClick = {
103105
model.clearNotifications()
104106
}

0 commit comments

Comments
 (0)