Skip to content

Commit

Permalink
update setting widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartToolFactory committed Jul 27, 2023
1 parent dc78a07 commit e35a573
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ internal fun SliderWithValueSelection(
valueRange: ClosedFloatingPointRange<Float>,
colors: MaterialSliderColors = MaterialSliderDefaults.materialColors(
activeTrackColor = SliderBrushColor(MaterialTheme.colorScheme.primary),
inactiveTrackColor = SliderBrushColor(Color.Transparent),
thumbColor = SliderBrushColor(MaterialTheme.colorScheme.inversePrimary)
)
inactiveTrackColor = SliderBrushColor(Color.Transparent)
),
) {
Column {

Expand All @@ -83,7 +82,7 @@ internal fun SliderWithValueSelection(
valueRange = valueRange,
colors = colors,
trackHeight = 10.dp,
thumbRadius = 12.dp
thumbRadius = 10.dp
)
}
}
Expand All @@ -109,7 +108,7 @@ internal fun SliderSelection(
colors = colors,
borderStroke = BorderStroke(2.dp, MaterialTheme.colorScheme.primary),
trackHeight = 10.dp,
thumbRadius = 12.dp,
thumbRadius = 10.dp,
onValueChangeFinished = onValueChangeFinished
)
}
Expand Down Expand Up @@ -160,17 +159,18 @@ internal fun FullRowSwitch(
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun CropTextField(value: String, onValueChange: (String) -> Unit) {
TextField(
value = value,
onValueChange = onValueChange,
colors = TextFieldDefaults.textFieldColors(
containerColor = Color.Transparent,
colors = TextFieldDefaults.colors(
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
disabledContainerColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
disabledIndicatorColor = Color.Transparent
disabledIndicatorColor = Color.Transparent,
)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.smarttoolfactory.cropper.widget

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -14,6 +18,7 @@ import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.drawscope.translate
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.smarttoolfactory.cropper.model.CropAspectRatio
Expand Down Expand Up @@ -72,7 +77,13 @@ fun AspectRatioSelectionCard(
)
}
if (cropAspectRatio.title.isNotEmpty()) {
Text(text = cropAspectRatio.title, color = color, fontSize = 14.sp)
Text(
text = cropAspectRatio.title,
color = color,
fontSize = 14.sp,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}
}
}
Expand Down

0 comments on commit e35a573

Please sign in to comment.