Skip to content

Commit

Permalink
icons improved
Browse files Browse the repository at this point in the history
  • Loading branch information
T8RIN committed Mar 14, 2024
1 parent 9fe310d commit 8356f08
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* ImageToolbox is an image editor for android
* Copyright (c) 2024 T8RIN (Malik Mukhametzyanov)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* You should have received a copy of the Apache License
* along with this program. If not, see <http://www.apache.org/licenses/LICENSE-2.0>.
*/

package ru.tech.imageresizershrinker.core.ui.icons.material

import androidx.compose.material.icons.Icons
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp

val Icons.Rounded.ImageReset: ImageVector by lazy {
Builder(
name = "ImageReset", defaultWidth = 24.0.dp, defaultHeight = 24.0.dp,
viewportWidth = 960.0f, viewportHeight = 960.0f
).apply {
path(
fill = SolidColor(Color(0xFF000000)), stroke = null, strokeLineWidth = 0.0f,
strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(120.0f, 360.0f)
verticalLineToRelative(-240.0f)
horizontalLineToRelative(80.0f)
verticalLineToRelative(134.0f)
quadToRelative(50.0f, -62.0f, 122.5f, -98.0f)
reflectiveQuadTo(480.0f, 120.0f)
quadToRelative(118.0f, 0.0f, 210.5f, 67.0f)
reflectiveQuadTo(820.0f, 360.0f)
horizontalLineToRelative(-87.0f)
quadToRelative(-34.0f, -72.0f, -101.0f, -116.0f)
reflectiveQuadToRelative(-152.0f, -44.0f)
quadToRelative(-57.0f, 0.0f, -107.5f, 21.0f)
reflectiveQuadTo(284.0f, 280.0f)
horizontalLineToRelative(76.0f)
verticalLineToRelative(80.0f)
lineTo(120.0f, 360.0f)
close()
moveTo(240.0f, 720.0f)
horizontalLineToRelative(480.0f)
lineTo(570.0f, 520.0f)
lineTo(450.0f, 680.0f)
lineToRelative(-90.0f, -120.0f)
lineToRelative(-120.0f, 160.0f)
close()
moveTo(200.0f, 880.0f)
quadToRelative(-33.0f, 0.0f, -56.5f, -23.5f)
reflectiveQuadTo(120.0f, 800.0f)
verticalLineToRelative(-320.0f)
horizontalLineToRelative(80.0f)
verticalLineToRelative(320.0f)
horizontalLineToRelative(560.0f)
verticalLineToRelative(-320.0f)
horizontalLineToRelative(80.0f)
verticalLineToRelative(320.0f)
quadToRelative(0.0f, 33.0f, -23.5f, 56.5f)
reflectiveQuadTo(760.0f, 880.0f)
lineTo(200.0f, 880.0f)
close()
}
}.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ package ru.tech.imageresizershrinker.core.ui.widget.dialogs

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.DoneOutline
import androidx.compose.material.icons.rounded.RestartAlt
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import kotlinx.coroutines.launch
import ru.tech.imageresizershrinker.core.resources.R
import ru.tech.imageresizershrinker.core.ui.icons.material.ImageReset
import ru.tech.imageresizershrinker.core.ui.widget.buttons.EnhancedButton
import ru.tech.imageresizershrinker.core.ui.widget.modifier.alertDialogBorder
import ru.tech.imageresizershrinker.core.ui.widget.other.LocalToastHostState
Expand All @@ -41,7 +42,8 @@ fun ResetDialog(
onDismiss: () -> Unit,
onReset: () -> Unit,
title: String = stringResource(R.string.reset_image),
text: String = stringResource(R.string.reset_image_sub)
text: String = stringResource(R.string.reset_image_sub),
icon: ImageVector = Icons.Rounded.ImageReset
) {
val scope = rememberCoroutineScope()
val context = LocalContext.current
Expand All @@ -50,7 +52,12 @@ fun ResetDialog(
if (visible) {
AlertDialog(
modifier = Modifier.alertDialogBorder(),
icon = { Icon(Icons.Rounded.RestartAlt, null) },
icon = {
Icon(
imageVector = icon,
contentDescription = title
)
},
title = { Text(title) },
text = { Text(text) },
onDismissRequest = onDismiss,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.BurstMode
import androidx.compose.material.icons.outlined.CameraAlt
import androidx.compose.material.icons.outlined.Image
import androidx.compose.material.icons.outlined.TaskAlt
import androidx.compose.material.icons.outlined.Wallpaper
import androidx.compose.material.icons.outlined.WebStories
import androidx.compose.material.icons.rounded.FolderOpen
import androidx.compose.material.icons.rounded.RadioButtonChecked
import androidx.compose.material.icons.rounded.RadioButtonUnchecked
Expand All @@ -55,7 +55,7 @@ fun ImagePickerModeSettingItemGroup(
shape = ContainerShapeDefaults.topShape,
onClick = { updateImagePickerMode(0) },
title = stringResource(R.string.embedded_picker),
startIcon = Icons.Outlined.TaskAlt,
startIcon = Icons.Outlined.Wallpaper,
subtitle = stringResource(R.string.embedded_picker_sub),
color = takeColorFromScheme {
if (settingsState.imagePickerModeInt == 0) secondaryContainer.copy(0.7f)
Expand All @@ -82,7 +82,7 @@ fun ImagePickerModeSettingItemGroup(
shape = ContainerShapeDefaults.centerShape,
onClick = { updateImagePickerMode(1) },
title = stringResource(R.string.photo_picker),
startIcon = Icons.Outlined.BurstMode,
startIcon = Icons.Outlined.WebStories,
subtitle = stringResource(R.string.photo_picker_sub),
color = takeColorFromScheme {
if (settingsState.imagePickerModeInt == 1) secondaryContainer.copy(0.7f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fun ResetSettingsSettingItem(
onReset()
},
title = stringResource(R.string.reset),
text = stringResource(R.string.reset_settings_sub)
text = stringResource(R.string.reset_settings_sub),
icon = Icons.Rounded.RestartAlt
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.History
import androidx.compose.material.icons.rounded.RestartAlt
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
Expand All @@ -54,6 +53,7 @@ import dev.olshevski.navigation.reimagined.hilt.hiltViewModel
import kotlinx.coroutines.launch
import ru.tech.imageresizershrinker.core.resources.R
import ru.tech.imageresizershrinker.core.settings.presentation.LocalSettingsState
import ru.tech.imageresizershrinker.core.ui.icons.material.ImageReset
import ru.tech.imageresizershrinker.core.ui.utils.confetti.LocalConfettiHostState
import ru.tech.imageresizershrinker.core.ui.utils.helper.Picker
import ru.tech.imageresizershrinker.core.ui.utils.helper.asClip
Expand Down Expand Up @@ -227,7 +227,7 @@ fun ResizeAndConvertScreen(
onClick = { showResetDialog = true }
) {
Icon(
imageVector = Icons.Rounded.RestartAlt,
imageVector = Icons.Rounded.ImageReset,
contentDescription = null
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.History
import androidx.compose.material.icons.rounded.RestartAlt
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
Expand All @@ -47,6 +46,7 @@ import dev.olshevski.navigation.reimagined.hilt.hiltViewModel
import kotlinx.coroutines.launch
import ru.tech.imageresizershrinker.core.resources.R
import ru.tech.imageresizershrinker.core.settings.presentation.LocalSettingsState
import ru.tech.imageresizershrinker.core.ui.icons.material.ImageReset
import ru.tech.imageresizershrinker.core.ui.utils.confetti.LocalConfettiHostState
import ru.tech.imageresizershrinker.core.ui.utils.helper.Picker
import ru.tech.imageresizershrinker.core.ui.utils.helper.asClip
Expand Down Expand Up @@ -246,7 +246,7 @@ fun SingleEditScreen(
onClick = { showResetDialog = true }
) {
Icon(
imageVector = Icons.Rounded.RestartAlt,
imageVector = Icons.Rounded.ImageReset,
contentDescription = null
)
}
Expand All @@ -264,7 +264,12 @@ fun SingleEditScreen(
enableAutoShadowAndBorder = false,
enabled = false,
onClick = {}
) { Icon(Icons.Rounded.History, null) }
) {
Icon(
imageVector = Icons.Rounded.History,
contentDescription = null
)
}
}
},
imagePreview = {
Expand Down

0 comments on commit 8356f08

Please sign in to comment.