Skip to content

Commit

Permalink
[optimize|build] Changed icons to outlined; update SDK version
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyD666 committed Sep 6, 2024
1 parent 5577911 commit 0962f7e
Show file tree
Hide file tree
Showing 47 changed files with 304 additions and 293 deletions.
10 changes: 7 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ apply(from = "../secret.gradle.kts")

android {
namespace = "com.skyd.rays"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "com.skyd.rays"
minSdk = 24
targetSdk = 34
targetSdk = 35
versionCode = 67
versionName = "2.3-alpha05"
versionName = "2.3-alpha06"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -121,6 +121,10 @@ android {
useLegacyPackaging = true
}
}
androidResources {
@Suppress("UnstableApiUsage")
generateLocaleConfig = true
}
}

tasks.withType(KotlinCompile::class.java).configureEach {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SelfieSegmentationRepository @Inject constructor() : BaseRepository() {
val underlayBitmap = if (backgroundUri != null) {
appContext.contentResolver.openInputStream(backgroundUri)!!.use {
val origin = BitmapFactory.decodeStream(it)
origin.copy(origin.config, true).apply {
origin.copy(origin.config!!, true).apply {
setHasAlpha(true)
origin.recycle()
}
Expand Down Expand Up @@ -104,7 +104,7 @@ class SelfieSegmentationRepository @Inject constructor() : BaseRepository() {
val foregroundBitmap =
appContext.contentResolver.openInputStream(foregroundUri)!!.use {
val origin = BitmapFactory.decodeStream(it)
origin.copy(origin.config, true).apply {
origin.copy(origin.config!!, true).apply {
setHasAlpha(true)
origin.recycle()
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/skyd/rays/ui/activity/CrashActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.BugReport
import androidx.compose.material.icons.outlined.BugReport
import androidx.compose.material3.Button
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -122,7 +122,7 @@ private fun CrashScreen(
Spacer(modifier = Modifier.height(40.dp))
Icon(
modifier = Modifier.size(40.dp),
imageVector = Icons.Default.BugReport,
imageVector = Icons.Outlined.BugReport,
contentDescription = null,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material3.Icon
import androidx.compose.material3.SwipeToDismissBox
import androidx.compose.material3.SwipeToDismissBoxState
Expand All @@ -31,7 +31,7 @@ fun RaysSwipeToDismiss(
contentAlignment = Alignment.CenterEnd
) {
Icon(
imageVector = Icons.Default.Delete,
imageVector = Icons.Outlined.Delete,
contentDescription = stringResource(R.string.delete),
tint = Color.White
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Row
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Folder
import androidx.compose.material.icons.outlined.Folder
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -61,7 +61,7 @@ fun ExportDialog(
onClick = {
pickExportDirLauncher.safeLaunch(Uri.parse(exportStickerDir))
},
imageVector = Icons.Default.Folder,
imageVector = Icons.Outlined.Folder,
contentDescription = stringResource(R.string.home_screen_select_export_folder)
)
}
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/java/com/skyd/rays/ui/screen/about/AboutScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Balance
import androidx.compose.material.icons.filled.Coffee
import androidx.compose.material.icons.filled.Lightbulb
import androidx.compose.material.icons.filled.Translate
import androidx.compose.material.icons.filled.Update
import androidx.compose.material.icons.outlined.Balance
import androidx.compose.material.icons.outlined.Coffee
import androidx.compose.material.icons.outlined.Lightbulb
import androidx.compose.material.icons.outlined.Translate
import androidx.compose.material.icons.outlined.Update
import androidx.compose.material3.Badge
import androidx.compose.material3.BadgedBox
import androidx.compose.material3.Button
Expand Down Expand Up @@ -112,13 +112,13 @@ fun AboutScreen() {
title = { Text(text = stringResource(R.string.about)) },
actions = {
RaysIconButton(
imageVector = Icons.Default.Balance,
imageVector = Icons.Outlined.Balance,
contentDescription = stringResource(id = R.string.license_screen_name),
onClick = { navController.navigate(LICENSE_SCREEN_ROUTE) }
)
RaysIconButton(
onClick = { openUpdateDialog = true },
imageVector = Icons.Default.Update,
imageVector = Icons.Outlined.Update,
contentDescription = stringResource(id = R.string.update_check)
)
},
Expand Down Expand Up @@ -308,7 +308,7 @@ private fun HelpArea(
.weight(1f)
.fillMaxHeight()
) {
Icon(imageVector = Icons.Default.Translate, contentDescription = null)
Icon(imageVector = Icons.Outlined.Translate, contentDescription = null)
Spacer(modifier = Modifier.width(6.dp))
Text(text = stringResource(id = R.string.help_translate), textAlign = TextAlign.Center)
}
Expand All @@ -319,7 +319,7 @@ private fun HelpArea(
.weight(1f)
.fillMaxHeight()
) {
Icon(imageVector = Icons.Default.Coffee, contentDescription = null)
Icon(imageVector = Icons.Outlined.Coffee, contentDescription = null)
Spacer(modifier = Modifier.width(6.dp))
Text(text = stringResource(id = R.string.sponsor), textAlign = TextAlign.Center)
}
Expand All @@ -332,7 +332,7 @@ private fun SponsorDialog(visible: Boolean, onClose: () -> Unit) {
RaysDialog(
visible = visible,
onDismissRequest = onClose,
icon = { Icon(imageVector = Icons.Default.Coffee, contentDescription = null) },
icon = { Icon(imageVector = Icons.Outlined.Coffee, contentDescription = null) },
title = { Text(text = stringResource(id = R.string.sponsor)) },
selectable = false,
text = {
Expand All @@ -346,7 +346,7 @@ private fun SponsorDialog(visible: Boolean, onClose: () -> Unit) {
},
headlineContent = { Text(text = stringResource(R.string.sponsor_afadian)) },
leadingContent = {
Icon(imageVector = Icons.Default.Lightbulb, contentDescription = null)
Icon(imageVector = Icons.Outlined.Lightbulb, contentDescription = null)
},
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
)
Expand All @@ -358,7 +358,7 @@ private fun SponsorDialog(visible: Boolean, onClose: () -> Unit) {
},
headlineContent = { Text(text = stringResource(R.string.sponsor_buy_me_a_coffee)) },
leadingContent = {
Icon(imageVector = Icons.Default.Coffee, contentDescription = null)
Icon(imageVector = Icons.Outlined.Coffee, contentDescription = null)
},
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
)
Expand Down
54 changes: 27 additions & 27 deletions app/src/main/java/com/skyd/rays/ui/screen/add/AddScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Help
import androidx.compose.material.icons.filled.AddBox
import androidx.compose.material.icons.filled.AddPhotoAlternate
import androidx.compose.material.icons.filled.AddToPhotos
import androidx.compose.material.icons.filled.Autorenew
import androidx.compose.material.icons.filled.Cancel
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.EditOff
import androidx.compose.material.icons.filled.ExpandLess
import androidx.compose.material.icons.filled.ExpandMore
import androidx.compose.material.icons.filled.HighlightOff
import androidx.compose.material.icons.filled.Save
import androidx.compose.material.icons.automirrored.outlined.Help
import androidx.compose.material.icons.outlined.AddBox
import androidx.compose.material.icons.outlined.AddPhotoAlternate
import androidx.compose.material.icons.outlined.AddToPhotos
import androidx.compose.material.icons.outlined.Autorenew
import androidx.compose.material.icons.outlined.Cancel
import androidx.compose.material.icons.outlined.Close
import androidx.compose.material.icons.outlined.EditOff
import androidx.compose.material.icons.outlined.ExpandLess
import androidx.compose.material.icons.outlined.ExpandMore
import androidx.compose.material.icons.outlined.HighlightOff
import androidx.compose.material.icons.outlined.Save
import androidx.compose.material3.AssistChipDefaults
import androidx.compose.material3.Card
import androidx.compose.material3.DropdownMenu
Expand Down Expand Up @@ -209,7 +209,7 @@ fun AddScreen(
processNext()
},
contentDescription = stringResource(R.string.add_screen_skip_current_sticker),
imageVector = Icons.Default.EditOff,
imageVector = Icons.Outlined.EditOff,
)
RaysIconButton(
onClick = {
Expand Down Expand Up @@ -254,12 +254,12 @@ fun AddScreen(
},
enabled = saveButtonEnable && !uiState.loadingDialog,
contentDescription = stringResource(R.string.add_screen_save_current_sticker),
imageVector = Icons.Default.Save,
imageVector = Icons.Outlined.Save,
)
// RaysIconButton(
// onClick = { openMoreMenu = true },
// contentDescription = stringResource(R.string.more),
// imageVector = Icons.Default.MoreVert,
// imageVector = Icons.Outlined.MoreVert,
// )
// MoreMenu(
// expanded = openMoreMenu,
Expand Down Expand Up @@ -429,7 +429,7 @@ private fun LazyListScope.titleInputFieldItem(
if (value.isNotEmpty()) {
RaysIconButton(
onClick = { onValueChange("") },
imageVector = Icons.Default.Cancel,
imageVector = Icons.Outlined.Cancel,
contentDescription = stringResource(R.string.cancel),
)
}
Expand Down Expand Up @@ -473,17 +473,17 @@ private fun LazyListScope.tagsInputFieldItem(
onAddClick()
onValueChange("")
},
imageVector = Icons.Default.AddBox,
imageVector = Icons.Outlined.AddBox,
contentDescription = stringResource(R.string.add_screen_add_tag),
)
RaysIconButton(
onClick = onAddToAllClick,
imageVector = Icons.Default.AddToPhotos,
imageVector = Icons.Outlined.AddToPhotos,
contentDescription = stringResource(R.string.add_screen_add_tag_to_all),
)
RaysIconButton(
onClick = { onValueChange("") },
imageVector = Icons.Default.Cancel,
imageVector = Icons.Outlined.Cancel,
contentDescription = stringResource(R.string.clear_input_text),
)
}
Expand Down Expand Up @@ -539,14 +539,14 @@ private fun AddToAllList(list: List<String>, onDeleteTag: (String) -> Unit) {
) {
RaysIconButton(
onClick = { scope.launch { tooltipState.show(MutatePriority.PreventUserInput) } },
imageVector = Icons.AutoMirrored.Default.Help,
imageVector = Icons.AutoMirrored.Outlined.Help,
)
}
Spacer(modifier = Modifier.weight(1f))
RaysIconButton(
onClick = { expandFlowRow = !expandFlowRow },
imageVector = if (expandFlowRow) Icons.Default.ExpandLess
else Icons.Default.ExpandMore,
imageVector = if (expandFlowRow) Icons.Outlined.ExpandLess
else Icons.Outlined.ExpandMore,
interactionSource = interactionSource,
)
}
Expand All @@ -569,7 +569,7 @@ private fun AddToAllList(list: List<String>, onDeleteTag: (String) -> Unit) {
trailingIcon = {
Icon(
modifier = Modifier.size(AssistChipDefaults.IconSize),
imageVector = Icons.Default.Close,
imageVector = Icons.Outlined.Close,
contentDescription = null
)
}
Expand Down Expand Up @@ -608,7 +608,7 @@ private fun WaitingRow(
if (!isEdit) {
RaysIconButton(
onClick = onSelectStickersClick,
imageVector = Icons.Default.AddPhotoAlternate,
imageVector = Icons.Outlined.AddPhotoAlternate,
contentDescription = stringResource(R.string.add_screen_add_stickers),
)
}
Expand Down Expand Up @@ -650,15 +650,15 @@ private fun WaitingRow(
modifier = iconButtonModifier,
colors = iconButtonColors,
onClick = { onRemoveStickerFromWaitingListClick(index) },
imageVector = Icons.Default.HighlightOff,
imageVector = Icons.Outlined.HighlightOff,
contentDescription = stringResource(R.string.add_screen_remove_sticker_from_waiting_list),
)
Spacer(modifier = Modifier.width(3.dp))
RaysIconButton(
modifier = iconButtonModifier,
colors = iconButtonColors,
onClick = { onReplaceStickerClick(index) },
imageVector = Icons.Default.Autorenew,
imageVector = Icons.Outlined.Autorenew,
contentDescription = stringResource(R.string.add_screen_update_sticker),
)
}
Expand Down Expand Up @@ -688,7 +688,7 @@ private fun AddedTags(tags: List<String>, onClick: (Int) -> Unit) {
trailingIcon = {
Icon(
modifier = Modifier.size(AssistChipDefaults.IconSize),
imageVector = Icons.Default.Close,
imageVector = Icons.Outlined.Close,
contentDescription = null
)
}
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/java/com/skyd/rays/ui/screen/detail/DetailMenu.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.skyd.rays.ui.screen.detail

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Help
import androidx.compose.material.icons.filled.AspectRatio
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.Info
import androidx.compose.material.icons.filled.Save
import androidx.compose.material.icons.automirrored.outlined.Help
import androidx.compose.material.icons.outlined.AspectRatio
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.Save
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.HorizontalDivider
Expand Down Expand Up @@ -40,11 +40,11 @@ fun DetailMenu(
onDismissRequest()
onStickerScaleClick()
},
leadingIcon = { Icon(Icons.Default.AspectRatio, contentDescription = null) },
leadingIcon = { Icon(Icons.Outlined.AspectRatio, contentDescription = null) },
trailingIcon = {
RaysIconButton(
onClick = { openBrowser(IMAGE_CONTENT_SCALE_HELP_URL) },
imageVector = Icons.AutoMirrored.Default.Help,
imageVector = Icons.AutoMirrored.Outlined.Help,
)
}
)
Expand All @@ -56,7 +56,7 @@ fun DetailMenu(
onDismissRequest()
onDeleteClick()
},
leadingIcon = { Icon(Icons.Default.Delete, contentDescription = null) }
leadingIcon = { Icon(Icons.Outlined.Delete, contentDescription = null) }
)
DropdownMenuItem(
enabled = stickerMenuItemEnabled,
Expand All @@ -65,7 +65,7 @@ fun DetailMenu(
onDismissRequest()
onExportClick()
},
leadingIcon = { Icon(Icons.Default.Save, contentDescription = null) }
leadingIcon = { Icon(Icons.Outlined.Save, contentDescription = null) }
)
DropdownMenuItem(
enabled = stickerMenuItemEnabled,
Expand All @@ -74,7 +74,7 @@ fun DetailMenu(
onDismissRequest()
onStickerInfoClick()
},
leadingIcon = { Icon(Icons.Default.Info, contentDescription = null) }
leadingIcon = { Icon(Icons.Outlined.Info, contentDescription = null) }
)
}
}
Loading

0 comments on commit 0962f7e

Please sign in to comment.