|
@@ -510,9 +510,9 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
var isSheetOpen by remember { mutableStateOf(true) }
|
|
var isSheetOpen by remember { mutableStateOf(true) }
|
|
var passwordStrength by remember { mutableStateOf("Average") }
|
|
var passwordStrength by remember { mutableStateOf("Average") }
|
|
var selectedSliderType by remember { mutableStateOf(sliderPasswordTypeList[0]) }
|
|
var selectedSliderType by remember { mutableStateOf(sliderPasswordTypeList[0]) }
|
|
- var sliderPosition by remember { mutableFloatStateOf(8F) }
|
|
|
|
- var updatedColor by remember { mutableStateOf((R.color.light_yellow)) }
|
|
|
|
- var updatedTextColor by remember { mutableStateOf((R.color.brown_text)) }
|
|
|
|
|
|
+ var sliderPosition by remember { mutableFloatStateOf(18F) }
|
|
|
|
+ var updatedColor by remember { mutableStateOf((R.color.gray_text)) }
|
|
|
|
+ var updatedTextColor by remember { mutableStateOf((R.color.gray_text)) }
|
|
|
|
|
|
var isLowerCaseEnabled by remember { mutableStateOf(true) }
|
|
var isLowerCaseEnabled by remember { mutableStateOf(true) }
|
|
var isUpperCaseEnabled by remember { mutableStateOf(false) }
|
|
var isUpperCaseEnabled by remember { mutableStateOf(false) }
|
|
@@ -550,7 +550,10 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
.height(150.dp)
|
|
.height(150.dp)
|
|
- .background(colorResource(id = updatedColor))
|
|
|
|
|
|
+ .background(colorResource(id = updatedColor).copy(
|
|
|
|
+ alpha = 0.2f
|
|
|
|
+ ))
|
|
|
|
+
|
|
) {
|
|
) {
|
|
Column(
|
|
Column(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
@@ -562,7 +565,7 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
Text(
|
|
Text(
|
|
generatedPassword,
|
|
generatedPassword,
|
|
style = MaterialTheme.typography.displayLarge.copy(
|
|
style = MaterialTheme.typography.displayLarge.copy(
|
|
- color = colorResource(id = R.color.gray_splash)
|
|
|
|
|
|
+ color = colorResource(id = updatedTextColor)
|
|
),
|
|
),
|
|
maxLines = 2,
|
|
maxLines = 2,
|
|
overflow = TextOverflow.Ellipsis,
|
|
overflow = TextOverflow.Ellipsis,
|
|
@@ -598,7 +601,7 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
contentDescription = "Reset Logo",
|
|
contentDescription = "Reset Logo",
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.size(24.dp, 24.dp),
|
|
.size(24.dp, 24.dp),
|
|
- tint = colorResource(id = R.color.gray_splash)
|
|
|
|
|
|
+ tint = colorResource(id = updatedTextColor)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
Spacer(modifier = Modifier.width(10.dp))
|
|
Spacer(modifier = Modifier.width(10.dp))
|
|
@@ -613,7 +616,7 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
contentDescription = "Copy Logo",
|
|
contentDescription = "Copy Logo",
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.size(24.dp, 24.dp),
|
|
.size(24.dp, 24.dp),
|
|
- tint = colorResource(id = R.color.gray_splash)
|
|
|
|
|
|
+ tint = colorResource(id = updatedTextColor)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -649,25 +652,25 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
},
|
|
},
|
|
onValueChangeFinished = {
|
|
onValueChangeFinished = {
|
|
Log.d("slider", "Finish => ${sliderPosition.roundToInt()}")
|
|
Log.d("slider", "Finish => ${sliderPosition.roundToInt()}")
|
|
- if (sliderPosition.roundToInt() == 8) {
|
|
|
|
|
|
+ if (sliderPosition.roundToInt() <= 25) {
|
|
passwordStrength = "Average"
|
|
passwordStrength = "Average"
|
|
- updatedColor = R.color.light_yellow
|
|
|
|
- updatedTextColor = R.color.brown_text
|
|
|
|
|
|
+ updatedColor = R.color.gray_text
|
|
|
|
+ updatedTextColor = R.color.gray_text
|
|
}
|
|
}
|
|
- else if (sliderPosition.roundToInt() == 9 || sliderPosition.roundToInt() == 10) {
|
|
|
|
|
|
+ else if (sliderPosition.roundToInt() <= 40) {
|
|
passwordStrength = "Strong"
|
|
passwordStrength = "Strong"
|
|
- updatedColor = R.color.light_green
|
|
|
|
- updatedTextColor = R.color.green_text
|
|
|
|
|
|
+ updatedColor = R.color.radio_button_blue
|
|
|
|
+ updatedTextColor = R.color.radio_button_blue
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
passwordStrength = "Very strong"
|
|
passwordStrength = "Very strong"
|
|
- updatedColor = R.color.light_green
|
|
|
|
|
|
+ updatedColor = R.color.green_text
|
|
updatedTextColor = R.color.green_text
|
|
updatedTextColor = R.color.green_text
|
|
}
|
|
}
|
|
|
|
|
|
generatedPassword = generatePassword(selectedSliderType, isLowerCaseEnabled, isUpperCaseEnabled, isNumberEnabled, isRandomSymbolsEnabled, sliderPosition.roundToInt())
|
|
generatedPassword = generatePassword(selectedSliderType, isLowerCaseEnabled, isUpperCaseEnabled, isNumberEnabled, isRandomSymbolsEnabled, sliderPosition.roundToInt())
|
|
},
|
|
},
|
|
- valueRange = 8f..128f,
|
|
|
|
|
|
+ valueRange = 18f..50f,
|
|
colors = SliderDefaults.colors(
|
|
colors = SliderDefaults.colors(
|
|
thumbColor = colorResource(id = R.color.sky_green),
|
|
thumbColor = colorResource(id = R.color.sky_green),
|
|
activeTrackColor = colorResource(id = R.color.sky_green),
|
|
activeTrackColor = colorResource(id = R.color.sky_green),
|
|
@@ -859,40 +862,40 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
}
|
|
}
|
|
)
|
|
)
|
|
|
|
|
|
- Spacer(modifier = Modifier.height(5.dp))
|
|
|
|
- Row(
|
|
|
|
- modifier = Modifier
|
|
|
|
- .fillMaxWidth()
|
|
|
|
- .background(Color.Transparent),
|
|
|
|
- horizontalArrangement = Arrangement.End
|
|
|
|
- ) {
|
|
|
|
- TextButton(onClick = {
|
|
|
|
- isSheetOpen = false
|
|
|
|
- isSheetOpened.invoke()
|
|
|
|
- }) {
|
|
|
|
- Text(
|
|
|
|
- text = "CANCEL",
|
|
|
|
- style = MaterialTheme.typography.bodyMedium.copy(
|
|
|
|
- textAlign = TextAlign.End
|
|
|
|
- ),
|
|
|
|
- color = colorResource(id = R.color.blue_text),
|
|
|
|
- modifier = Modifier
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- TextButton(onClick = {
|
|
|
|
- isSheetOpen = false
|
|
|
|
- isSheetOpened.invoke()
|
|
|
|
- }) {
|
|
|
|
- Text(
|
|
|
|
- text = "USE",
|
|
|
|
- style = MaterialTheme.typography.bodyMedium.copy(
|
|
|
|
- textAlign = TextAlign.End
|
|
|
|
- ),
|
|
|
|
- color = colorResource(id = R.color.blue_text),
|
|
|
|
- modifier = Modifier
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// Spacer(modifier = Modifier.height(5.dp))
|
|
|
|
+// Row(
|
|
|
|
+// modifier = Modifier
|
|
|
|
+// .fillMaxWidth()
|
|
|
|
+// .background(Color.Transparent),
|
|
|
|
+// horizontalArrangement = Arrangement.End
|
|
|
|
+// ) {
|
|
|
|
+// TextButton(onClick = {
|
|
|
|
+// isSheetOpen = false
|
|
|
|
+// isSheetOpened.invoke()
|
|
|
|
+// }) {
|
|
|
|
+// Text(
|
|
|
|
+// text = "CANCEL",
|
|
|
|
+// style = MaterialTheme.typography.bodyMedium.copy(
|
|
|
|
+// textAlign = TextAlign.End
|
|
|
|
+// ),
|
|
|
|
+// color = colorResource(id = R.color.blue_text),
|
|
|
|
+// modifier = Modifier
|
|
|
|
+// )
|
|
|
|
+// }
|
|
|
|
+// TextButton(onClick = {
|
|
|
|
+// isSheetOpen = false
|
|
|
|
+// isSheetOpened.invoke()
|
|
|
|
+// }) {
|
|
|
|
+// Text(
|
|
|
|
+// text = "USE",
|
|
|
|
+// style = MaterialTheme.typography.bodyMedium.copy(
|
|
|
|
+// textAlign = TextAlign.End
|
|
|
|
+// ),
|
|
|
|
+// color = colorResource(id = R.color.blue_text),
|
|
|
|
+// modifier = Modifier
|
|
|
|
+// )
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|