Skip to content

Commit

Permalink
icons improved and 2.5.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
T8RIN committed Nov 28, 2023
1 parent 0b79eca commit 255418b
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 104 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
minSdk = 21
targetSdk = 34
versionCode = 101
versionName = "2.4.3-beta01"
versionName = "2.5.0-rc1"
resourceConfigurations += setOf(
"en",
"ar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package ru.tech.imageresizershrinker.presentation.main_screen.components.setting

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.HorizontalSplit
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import ru.tech.imageresizershrinker.R
import ru.tech.imageresizershrinker.presentation.root.icons.material.TopAppBar
import ru.tech.imageresizershrinker.presentation.root.widget.modifier.ContainerShapeDefaults
import ru.tech.imageresizershrinker.presentation.root.widget.preferences.PreferenceRowSwitch
import ru.tech.imageresizershrinker.presentation.root.widget.utils.LocalSettingsState
Expand All @@ -28,6 +28,6 @@ fun AppBarShadowsSettingItem(
subtitle = stringResource(R.string.app_bar_shadow_sub),
checked = settingsState.drawAppBarShadows,
onClick = onClick,
startIcon = Icons.Rounded.TopAppBar
startIcon = Icons.Outlined.HorizontalSplit
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.tech.imageresizershrinker.presentation.main_screen.components.setting

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.SmartButton
import androidx.compose.material.icons.outlined.Gamepad
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
Expand All @@ -28,6 +28,6 @@ fun ButtonShadowsSettingItem(
subtitle = stringResource(R.string.button_shadow_sub),
checked = settingsState.drawButtonShadows,
onClick = onClick,
startIcon = Icons.Filled.SmartButton
startIcon = Icons.Outlined.Gamepad
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.tech.imageresizershrinker.presentation.main_screen.components.setting

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ViewCompactAlt
import androidx.compose.material.icons.outlined.Dashboard
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
Expand All @@ -28,6 +28,6 @@ fun ContainerShadowsSettingItem(
subtitle = stringResource(R.string.container_shadow_sub),
checked = settingsState.drawContainerShadows,
onClick = onClick,
startIcon = Icons.Filled.ViewCompactAlt
startIcon = Icons.Outlined.Dashboard
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ fun SettingItem(
EmojisCountSettingItem(updateEmojisCount = viewModel::updateEmojisCount)
}

Setting.ContainerShadows -> {
ContainerShadowsSettingItem(onClick = { viewModel.toggleDrawContainerShadows() })
}

Setting.FabAlignment -> {
FabAlignmentSettingItem(updateAlignment = viewModel::setAlignment)
}
Expand Down Expand Up @@ -366,6 +362,10 @@ fun SettingItem(
}
}

Setting.ContainerShadows -> {
ContainerShadowsSettingItem(onClick = { viewModel.toggleDrawContainerShadows() })
}

Setting.ButtonShadows -> {
ButtonShadowsSettingItem(onClick = { viewModel.toggleDrawButtonShadows() })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package ru.tech.imageresizershrinker.presentation.main_screen.components.setting

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Tune
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import ru.tech.imageresizershrinker.R
import ru.tech.imageresizershrinker.presentation.root.icons.material.Slider
import ru.tech.imageresizershrinker.presentation.root.widget.modifier.ContainerShapeDefaults
import ru.tech.imageresizershrinker.presentation.root.widget.preferences.PreferenceRowSwitch
import ru.tech.imageresizershrinker.presentation.root.widget.utils.LocalSettingsState
Expand All @@ -28,6 +28,6 @@ fun SliderShadowsSettingItem(
subtitle = stringResource(R.string.slider_shadow_sub),
checked = settingsState.drawSliderShadows,
onClick = onClick,
startIcon = Icons.Rounded.Tune
startIcon = Icons.Rounded.Slider
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.tech.imageresizershrinker.presentation.main_screen.components.setting

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ToggleOn
import androidx.compose.material.icons.outlined.ToggleOff
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
Expand All @@ -28,6 +28,6 @@ fun SwitchShadowsSettingItem(
subtitle = stringResource(R.string.switch_shadow_sub),
checked = settingsState.drawSwitchShadows,
onClick = onClick,
startIcon = Icons.Filled.ToggleOn
startIcon = Icons.Outlined.ToggleOff
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.lifecycle.viewModelScope
import coil.ImageLoader
import com.t8rin.dynamic.theme.ColorTuple
import com.t8rin.dynamic.theme.extractPrimaryColor
import com.t8rin.logger.makeLog
import dagger.hilt.android.lifecycle.HiltViewModel
import dev.olshevski.navigation.reimagined.navController
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -343,7 +344,12 @@ class MainViewModel @Inject constructor(

private fun isNeedUpdate(nameFrom: String, nameTo: String): Boolean {
fun String.toVersionCode(): Int {
return replace("-", "")
return replace(
regex = Regex("0\\d"),
transform = {
it.value.replace("0", "")
}
).replace("-", "")
.replace(".", "")
.replace("_", "")
.replace("alpha", "1")
Expand All @@ -355,11 +361,11 @@ class MainViewModel @Inject constructor(
}

val betaList = listOf(
"beta", "alpha", "rc"
"alpha", "beta", "rc"
)

val tagVC = nameTo.toVersionCode()
val buildVC = nameFrom.toVersionCode()
val tagVC = nameTo.toVersionCode().makeLog()
val buildVC = nameFrom.toVersionCode().makeLog()
return if (betaList.all { it !in nameTo }) {
tagVC > buildVC
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,41 @@ val Icons.Rounded.FloatingActionButton: ImageVector by lazy {
strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(16.3f, 3.0f)
horizontalLineTo(7.7f)
curveTo(5.1f, 3.0f, 3.0f, 5.1f, 3.0f, 7.7f)
verticalLineToRelative(8.7f)
curveTo(3.0f, 18.9f, 5.1f, 21.0f, 7.7f, 21.0f)
horizontalLineToRelative(8.7f)
curveToRelative(2.6f, 0.0f, 4.7f, -2.1f, 4.7f, -4.7f)
verticalLineTo(7.7f)
curveTo(21.0f, 5.1f, 18.9f, 3.0f, 16.3f, 3.0f)
moveTo(12.9692f, 10.67f)
lineToRelative(-3.0954f, 3.0955f)
lineToRelative(0.0f, 0.4512f)
lineToRelative(0.4512f, 0.0f)
lineToRelative(3.0954f, -3.0954f)
lineToRelative(-0.2296f, -0.2217f)
close()
moveTo(11.6f, 14.1f)
lineTo(10.7f, 16.0f)
lineToRelative(-0.9f, -1.9f)
lineTo(8.0f, 13.3f)
lineToRelative(1.9f, -0.9f)
lineToRelative(0.9f, -1.9f)
lineToRelative(0.9f, 1.9f)
lineToRelative(1.9f, 0.9f)
lineTo(11.6f, 14.1f)
}
path(
fill = SolidColor(Color(0xFF000000)), stroke = null, strokeLineWidth = 0.0f,
strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(15.8593f, 3.1335f)
horizontalLineTo(8.1407f)
curveTo(5.3016f, 3.1335f, 3.0f, 5.4351f, 3.0f, 8.2742f)
verticalLineToRelative(7.7186f)
curveToRelative(0.0f, 2.8392f, 2.3016f, 5.1407f, 5.1407f, 5.1407f)
horizontalLineToRelative(7.7186f)
curveToRelative(2.8391f, 0.0f, 5.1407f, -2.3015f, 5.1407f, -5.1407f)
verticalLineTo(8.2742f)
curveTo(21.0f, 5.4351f, 18.6984f, 3.1335f, 15.8593f, 3.1335f)
close()
moveTo(14.8f, 10.5f)
lineToRelative(-0.6f, 1.4f)
lineToRelative(-0.6f, -1.4f)
lineToRelative(-1.4f, -0.6f)
lineToRelative(1.4f, -0.6f)
lineToRelative(0.6f, -1.4f)
lineToRelative(0.6f, 1.4f)
lineToRelative(1.4f, 0.6f)
lineTo(14.8f, 10.5f)
moveTo(14.7643f, 10.672f)
curveToRelative(-0.001f, 0.001f, -0.0026f, 0.0013f, -0.0036f, 0.0024f)
curveToRelative(-0.001f, 0.0011f, -0.0012f, 0.0024f, -0.0023f, 0.0035f)
lineToRelative(-4.1721f, 4.1721f)
horizontalLineTo(9.2404f)
verticalLineToRelative(-1.3458f)
lineToRelative(4.18f, -4.1721f)
curveToRelative(4.0E-4f, -3.0E-4f, 8.0E-4f, -4.0E-4f, 0.0012f, -7.0E-4f)
curveToRelative(4.0E-4f, -4.0E-4f, 4.0E-4f, -9.0E-4f, 8.0E-4f, -0.0012f)
curveToRelative(0.2612f, -0.2612f, 0.6848f, -0.2612f, 0.946f, 0.0f)
lineToRelative(0.3959f, 0.3959f)
curveTo(15.0255f, 9.9872f, 15.0255f, 10.4108f, 14.7643f, 10.672f)
close()
}
}.build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package ru.tech.imageresizershrinker.presentation.root.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.Slider: ImageVector by lazy {
Builder(
name = "Slider", 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(200.0f, 600.0f)
quadToRelative(-50.0f, 0.0f, -85.0f, -35.0f)
reflectiveQuadToRelative(-35.0f, -85.0f)
quadToRelative(0.0f, -50.0f, 35.0f, -85.0f)
reflectiveQuadToRelative(85.0f, -35.0f)
horizontalLineToRelative(560.0f)
quadToRelative(50.0f, 0.0f, 85.0f, 35.0f)
reflectiveQuadToRelative(35.0f, 85.0f)
quadToRelative(0.0f, 50.0f, -35.0f, 85.0f)
reflectiveQuadToRelative(-85.0f, 35.0f)
lineTo(200.0f, 600.0f)
close()
moveTo(560.0f, 520.0f)
horizontalLineToRelative(200.0f)
quadToRelative(17.0f, 0.0f, 28.5f, -11.5f)
reflectiveQuadTo(800.0f, 480.0f)
quadToRelative(0.0f, -17.0f, -11.5f, -28.5f)
reflectiveQuadTo(760.0f, 440.0f)
lineTo(560.0f, 440.0f)
verticalLineToRelative(80.0f)
close()
}
}
.build()
}

This file was deleted.

0 comments on commit 255418b

Please sign in to comment.