mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-18 16:25:27 +02:00
Less trash in code
This commit is contained in:
parent
fe81601fa8
commit
f25af1caad
@ -16,6 +16,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Suppress("UnstableApiUsage")
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
@ -34,10 +34,10 @@ sealed class TopLevelDestinations(
|
|||||||
name = R.string.calculator
|
name = R.string.calculator
|
||||||
)
|
)
|
||||||
|
|
||||||
object Epoch : TopLevelDestinations(
|
// object Epoch : TopLevelDestinations(
|
||||||
route = "epoch_route",
|
// route = "epoch_route",
|
||||||
name = R.string.epoch_converter
|
// name = R.string.epoch_converter
|
||||||
)
|
// )
|
||||||
|
|
||||||
object Settings : TopLevelDestinations(
|
object Settings : TopLevelDestinations(
|
||||||
route = "settings_graph",
|
route = "settings_graph",
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
~ Unitto is a unit converter for Android
|
|
||||||
~ Copyright (c) 2023 Elshan Agaev
|
|
||||||
~
|
|
||||||
~ This program is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ This program is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@color/ic_launcher_icon_background"/>
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_icon_foreground"/>
|
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_icon_monochrome"/>
|
|
||||||
</adaptive-icon>
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
@ -27,7 +27,7 @@ sealed class FormatterSymbols(val grouping: String, val fractional: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object AllFormatterSymbols {
|
object AllFormatterSymbols {
|
||||||
private val allFormatterSymbs by lazy {
|
private val allFormatterSymbols by lazy {
|
||||||
hashMapOf(
|
hashMapOf(
|
||||||
Separator.SPACES to FormatterSymbols.Spaces,
|
Separator.SPACES to FormatterSymbols.Spaces,
|
||||||
Separator.PERIOD to FormatterSymbols.Period,
|
Separator.PERIOD to FormatterSymbols.Period,
|
||||||
@ -41,6 +41,6 @@ object AllFormatterSymbols {
|
|||||||
* @see Separator
|
* @see Separator
|
||||||
*/
|
*/
|
||||||
fun getById(separator: Int): FormatterSymbols {
|
fun getById(separator: Int): FormatterSymbols {
|
||||||
return allFormatterSymbs.getOrElse(separator) { FormatterSymbols.Spaces }
|
return allFormatterSymbols.getOrElse(separator) { FormatterSymbols.Spaces }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import androidx.compose.animation.expandVertically
|
|||||||
import androidx.compose.animation.fadeIn
|
import androidx.compose.animation.fadeIn
|
||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
import androidx.compose.animation.shrinkVertically
|
import androidx.compose.animation.shrinkVertically
|
||||||
import androidx.compose.animation.with
|
import androidx.compose.animation.togetherWith
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
@ -147,7 +147,9 @@ internal fun TopScreenPart(
|
|||||||
ExpressionTextField(
|
ExpressionTextField(
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
value = calculatedTextFieldValue,
|
value = calculatedTextFieldValue,
|
||||||
onCursorChange = { calculatedTextFieldValue = calculatedTextFieldValue.copy(selection = it) },
|
onCursorChange = { newSelection ->
|
||||||
|
calculatedTextFieldValue = calculatedTextFieldValue.copy(selection = newSelection)
|
||||||
|
},
|
||||||
formatterSymbols = formatterSymbols,
|
formatterSymbols = formatterSymbols,
|
||||||
textColor = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f),
|
textColor = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f),
|
||||||
minRatio = 0.7f
|
minRatio = 0.7f
|
||||||
@ -159,8 +161,7 @@ internal fun TopScreenPart(
|
|||||||
transitionSpec = {
|
transitionSpec = {
|
||||||
// Enter animation
|
// Enter animation
|
||||||
(expandHorizontally(clip = false, expandFrom = Alignment.Start) + fadeIn()
|
(expandHorizontally(clip = false, expandFrom = Alignment.Start) + fadeIn()
|
||||||
// Exit animation
|
togetherWith fadeOut())
|
||||||
with fadeOut())
|
|
||||||
.using(SizeTransform(clip = false))
|
.using(SizeTransform(clip = false))
|
||||||
}
|
}
|
||||||
) { value ->
|
) { value ->
|
||||||
@ -178,7 +179,9 @@ internal fun TopScreenPart(
|
|||||||
ExpressionTextField(
|
ExpressionTextField(
|
||||||
modifier = Modifier.weight(2f),
|
modifier = Modifier.weight(2f),
|
||||||
value = outputTextFieldValue,
|
value = outputTextFieldValue,
|
||||||
onCursorChange = { outputTextFieldValue = outputTextFieldValue.copy(selection = it) },
|
onCursorChange = { newSelection ->
|
||||||
|
outputTextFieldValue = outputTextFieldValue.copy(selection = newSelection)
|
||||||
|
},
|
||||||
formatterSymbols = formatterSymbols,
|
formatterSymbols = formatterSymbols,
|
||||||
readOnly = true,
|
readOnly = true,
|
||||||
minRatio = 0.7f
|
minRatio = 0.7f
|
||||||
@ -197,7 +200,9 @@ internal fun TopScreenPart(
|
|||||||
UnformattedTextField(
|
UnformattedTextField(
|
||||||
modifier = Modifier.weight(2f),
|
modifier = Modifier.weight(2f),
|
||||||
value = outputTextFieldValue,
|
value = outputTextFieldValue,
|
||||||
onCursorChange = { outputTextFieldValue = outputTextFieldValue.copy(selection = it) },
|
onCursorChange = { newSelection ->
|
||||||
|
outputTextFieldValue = outputTextFieldValue.copy(selection = newSelection)
|
||||||
|
},
|
||||||
minRatio = 0.7f,
|
minRatio = 0.7f,
|
||||||
readOnly = true
|
readOnly = true
|
||||||
)
|
)
|
||||||
@ -210,7 +215,9 @@ internal fun TopScreenPart(
|
|||||||
UnformattedTextField(
|
UnformattedTextField(
|
||||||
modifier = Modifier.weight(2f),
|
modifier = Modifier.weight(2f),
|
||||||
value = outputTextFieldValue,
|
value = outputTextFieldValue,
|
||||||
onCursorChange = { outputTextFieldValue = outputTextFieldValue.copy(selection = it) },
|
onCursorChange = { newSelection ->
|
||||||
|
outputTextFieldValue = outputTextFieldValue.copy(selection = newSelection)
|
||||||
|
},
|
||||||
minRatio = 0.7f,
|
minRatio = 0.7f,
|
||||||
readOnly = true
|
readOnly = true
|
||||||
)
|
)
|
||||||
@ -245,7 +252,7 @@ internal fun TopScreenPart(
|
|||||||
// Enter animation
|
// Enter animation
|
||||||
(expandHorizontally(clip = false, expandFrom = Alignment.Start) + fadeIn()
|
(expandHorizontally(clip = false, expandFrom = Alignment.Start) + fadeIn()
|
||||||
// Exit animation
|
// Exit animation
|
||||||
with fadeOut())
|
togetherWith fadeOut())
|
||||||
.using(SizeTransform(clip = false))
|
.using(SizeTransform(clip = false))
|
||||||
}
|
}
|
||||||
) { value ->
|
) { value ->
|
||||||
|
@ -82,11 +82,11 @@ internal fun UnitSelectionButton(
|
|||||||
targetState = label ?: 0,
|
targetState = label ?: 0,
|
||||||
transitionSpec = {
|
transitionSpec = {
|
||||||
if (targetState > initialState) {
|
if (targetState > initialState) {
|
||||||
(slideInVertically { height -> height } + fadeIn()).togetherWith(
|
(slideInVertically { height -> height } + fadeIn()) togetherWith
|
||||||
slideOutVertically { height -> -height } + fadeOut())
|
slideOutVertically { height -> -height } + fadeOut()
|
||||||
} else {
|
} else {
|
||||||
(slideInVertically { height -> -height } + fadeIn()).togetherWith(
|
(slideInVertically { height -> -height } + fadeIn()) togetherWith
|
||||||
slideOutVertically { height -> height } + fadeOut())
|
slideOutVertically { height -> height } + fadeOut()
|
||||||
}.using(
|
}.using(
|
||||||
SizeTransform(clip = false)
|
SizeTransform(clip = false)
|
||||||
)
|
)
|
||||||
|
@ -7,6 +7,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UnstableApiUsage")
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
repositories {
|
repositories {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user