Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package org.neotech.app.abysner.presentation.screens
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.android.tools.screenshot.PreviewTest
import org.neotech.app.abysner.presentation.preview.DEVICE_PHONE_MAX_HEIGHT

@PreviewTest
@Preview(device = DEVICE_SHARE_IMAGE)
Expand Down
23 changes: 0 additions & 23 deletions buildSrc/src/main/kotlin/org/neotech/gradle/GradleUtilities.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ class ScreenshotTestCoveragePlugin : Plugin<Project> {

val classFiles = listOf(
"com/android/tools/screenshot/renderer/Renderer.class",
"com/android/tools/screenshot/renderer/Renderer\$copyObject\$objectIn\$1.class",
$$"com/android/tools/screenshot/renderer/Renderer$copyObject$objectIn$1.class",
"com/android/tools/screenshot/renderer/RendererKt.class",
"com/android/tools/screenshot/renderer/RendererKt\$createResourceEnhancedClassLoader\$1.class",
$$"com/android/tools/screenshot/renderer/RendererKt$createResourceEnhancedClassLoader$1.class",
)

for (classFile in classFiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,7 @@ private fun AlertDialogFlowRowCopy(

val crossAxisLayoutSize = max(crossAxisSpace, constraints.minHeight)

val layoutWidth = mainAxisLayoutSize

val layoutHeight = crossAxisLayoutSize

layout(layoutWidth, layoutHeight) {
layout(mainAxisLayoutSize, crossAxisLayoutSize) {
sequences.fastForEachIndexed { i, placeables ->
val childrenMainAxisSizes = IntArray(placeables.size) { j ->
placeables[j].width +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
package org.neotech.app.abysner

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import org.neotech.app.abysner.di.AppComponent

@Composable
@Preview
fun App(appComponent: AppComponent) {
appComponent.mainNavController()
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.compose.animation.core.DurationBasedAnimationSpec
import androidx.compose.animation.core.TwoWayConverter
import androidx.compose.animation.core.VectorizedDurationBasedAnimationSpec

fun <T> none(): AnimationSpec<T> = AnimationSpecNone<T>()
fun <T> none(): AnimationSpec<T> = AnimationSpecNone()

class AnimationSpecNone<T>: DurationBasedAnimationSpec<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@
package org.neotech.app.abysner.presentation.component

import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.AnnotatedString.Builder
import androidx.compose.ui.text.ParagraphStyle
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextIndent
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.sp

internal fun Builder.appendBold(
internal fun AnnotatedString.Builder.appendBold(
text: String,
) {
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold)) {
append(text)
}
}

internal fun Builder.appendBoldLine(
internal fun AnnotatedString.Builder.appendBoldLine(
text: String,
) {
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold)) {
Expand All @@ -46,9 +45,5 @@ internal inline fun <R: Any> AnnotatedString.Builder.appendBulletPoint(crossinli
}

internal fun CharSequence.toAnnotatedString(): AnnotatedString {
return if(this is AnnotatedString) {
return this
} else {
AnnotatedString(this.toString())
}
return this as? AnnotatedString ?: AnnotatedString(this.toString())
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ import org.neotech.app.abysner.domain.core.model.Cylinder
import org.neotech.app.abysner.domain.core.model.Gas
import org.neotech.app.abysner.domain.core.model.UnitSystem
import org.neotech.app.abysner.domain.core.physics.GasEquationOfStateModel
import org.neotech.app.abysner.domain.core.physics.LITERS_PER_CUBIC_FOOT
import org.neotech.app.abysner.domain.core.physics.PSI_PER_BAR
import org.neotech.app.abysner.domain.core.physics.asBarToPsi
import org.neotech.app.abysner.domain.core.physics.asCubicFeetToLiters
import org.neotech.app.abysner.domain.core.physics.asLitersToCubicFeet
import org.neotech.app.abysner.domain.core.physics.asPsiToBar
import org.neotech.app.abysner.domain.utilities.DecimalFormat
import org.neotech.app.abysner.presentation.component.list.LazyColumnWithScrollIndicators
import org.neotech.app.abysner.presentation.component.textfield.OutlinedDecimalInputField
Expand All @@ -81,7 +83,7 @@ fun CylinderSizeField(

val displayText = when (unitSystem) {
UnitSystem.METRIC -> DecimalFormat.format(1, cylinderSize.waterVolume)
UnitSystem.IMPERIAL -> (cylinderSize.ratedCapacity() / LITERS_PER_CUBIC_FOOT).roundToInt().toString()
UnitSystem.IMPERIAL -> cylinderSize.ratedCapacity().asLitersToCubicFeet().roundToInt().toString()
}

OutlinedTextField(
Expand Down Expand Up @@ -143,15 +145,15 @@ private fun CylinderSizeDialog(
mutableStateOf(
when (unitSystem) {
UnitSystem.METRIC -> currentCylinderSize.waterVolume
UnitSystem.IMPERIAL -> currentCylinderSize.ratedCapacity() / LITERS_PER_CUBIC_FOOT
UnitSystem.IMPERIAL -> currentCylinderSize.ratedCapacity().asLitersToCubicFeet()
}
)
}
var customPressure: Double? by remember {
mutableStateOf(
when (unitSystem) {
UnitSystem.METRIC -> currentCylinderSize.workingPressure
UnitSystem.IMPERIAL -> currentCylinderSize.workingPressure * PSI_PER_BAR
UnitSystem.IMPERIAL -> currentCylinderSize.workingPressure.asBarToPsi()
}
)
}
Expand All @@ -177,8 +179,8 @@ private fun CylinderSizeDialog(
workingPressure = customPressure!!,
)
UnitSystem.IMPERIAL -> {
val pressureBar = customPressure!! / PSI_PER_BAR
val targetCapacityLiters = customVolume!! * LITERS_PER_CUBIC_FOOT
val pressureBar = customPressure!!.asPsiToBar()
val targetCapacityLiters = customVolume!!.asCubicFeetToLiters()
val gasVolumePerLiter = GasEquationOfStateModel.Default.getGasVolume(Gas.Air, 1.0, pressureBar)
Cylinder.Size(
waterVolume = targetCapacityLiters / gasVolumePerLiter,
Expand Down Expand Up @@ -300,14 +302,14 @@ private fun PresetsTankSizeTab(
label = when (unitSystem) {
UnitSystem.METRIC -> null
UnitSystem.IMPERIAL -> {
val pressurePsi = (preset.workingPressure * PSI_PER_BAR).roundToInt()
val pressurePsi = preset.workingPressure.asBarToPsi().roundToInt()
"$pressurePsi ${unitSystem.pressureUnitLabel}"
}
},
value = when (unitSystem) {
UnitSystem.METRIC -> "${DecimalFormat.format(1, preset.waterVolume)} ${unitSystem.volumeUnitLabel}"
UnitSystem.IMPERIAL -> {
val capacityCuFt = (preset.ratedCapacity() / LITERS_PER_CUBIC_FOOT).roundToInt()
val capacityCuFt = preset.ratedCapacity().asLitersToCubicFeet().roundToInt()
"$capacityCuFt ${unitSystem.volumeUnitLabel}"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@

package org.neotech.app.abysner.presentation.component

import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.material3.SegmentedButton
import androidx.compose.material3.SegmentedButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.compose.runtime.toMutableStateList
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList

@Stable
class MultiChoiceSegmentedButtonRowState(initialCheckedItemIndexes: ImmutableList<Int>) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.unit.LayoutDirection

@Composable
fun PaddingValues.withoutBottom(layoutDirection: LayoutDirection = LocalLayoutDirection.current): PaddingValues = PaddingValues(
start = calculateStartPadding(layoutDirection),
end = calculateEndPadding(layoutDirection),
top = calculateTopPadding()
)

fun PaddingValues.onlyBottom(): PaddingValues = PaddingValues(
bottom = calculateBottomPadding()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@

package org.neotech.app.abysner.presentation.component.preferences

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.AlertDialogCustomContent
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
Expand All @@ -27,7 +25,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@

package org.neotech.app.abysner.presentation.component.preferences

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.AlertDialogCustomContent
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
Expand All @@ -27,7 +25,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.neotech.app.abysner.presentation.component.textfield.OutlinedNumberInputField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@

package org.neotech.app.abysner.presentation.component.preferences

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.AlertDialogCustomContent
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
Expand All @@ -28,10 +26,9 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.unit.dp
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.neotech.app.abysner.presentation.component.textfield.OutlinedNumberInputField
import org.neotech.app.abysner.presentation.component.textfield.SuffixVisualTransformation
import org.neotech.app.abysner.presentation.theme.AbysnerTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
import androidx.compose.ui.tooling.preview.Preview
import org.neotech.app.abysner.domain.core.model.Salinity
import org.neotech.app.abysner.presentation.component.list.LazyColumnWithScrollIndicators
import org.neotech.app.abysner.presentation.component.toAnnotatedString
Expand Down
Loading
Loading