|
@@ -21,15 +21,21 @@ import androidx.compose.foundation.layout.navigationBarsPadding
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
import androidx.compose.foundation.layout.statusBarsPadding
|
|
|
+import androidx.compose.foundation.layout.width
|
|
|
+import androidx.compose.foundation.layout.wrapContentHeight
|
|
|
import androidx.compose.foundation.rememberScrollState
|
|
|
import androidx.compose.foundation.selection.selectable
|
|
|
import androidx.compose.foundation.shape.CircleShape
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
+import androidx.compose.material.icons.Icons
|
|
|
+import androidx.compose.material.icons.filled.AccountCircle
|
|
|
import androidx.compose.material3.AlertDialog
|
|
|
import androidx.compose.material3.Button
|
|
|
import androidx.compose.material3.ButtonDefaults
|
|
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
|
+import androidx.compose.material3.Icon
|
|
|
+import androidx.compose.material3.IconButton
|
|
|
import androidx.compose.material3.MaterialTheme
|
|
|
import androidx.compose.material3.ModalBottomSheet
|
|
|
import androidx.compose.material3.RadioButton
|
|
@@ -55,11 +61,14 @@ import androidx.compose.ui.draw.clip
|
|
|
import androidx.compose.ui.draw.scale
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
import androidx.compose.ui.graphics.ColorFilter
|
|
|
+import androidx.compose.ui.platform.ClipboardManager
|
|
|
+import androidx.compose.ui.platform.LocalClipboardManager
|
|
|
import androidx.compose.ui.platform.LocalFocusManager
|
|
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
|
import androidx.compose.ui.res.colorResource
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
+import androidx.compose.ui.text.AnnotatedString
|
|
|
import androidx.compose.ui.text.TextStyle
|
|
|
import androidx.compose.ui.text.font.FontWeight
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
@@ -532,16 +541,55 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
)
|
|
|
- Spacer(modifier = Modifier.height(15.dp))
|
|
|
- Text(
|
|
|
- passwordStrength,
|
|
|
- style = MaterialTheme.typography.displayMedium.copy(
|
|
|
- color = colorResource(id = updatedTextColor),
|
|
|
- fontWeight = FontWeight.SemiBold
|
|
|
- ),
|
|
|
+ Spacer(modifier = Modifier.weight(1f))
|
|
|
+ Row(
|
|
|
+// horizontalArrangement = Arrangement.SpaceBetween,
|
|
|
+ verticalAlignment = Alignment.CenterVertically,
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
- )
|
|
|
+ .wrapContentHeight()
|
|
|
+ .background(Color.Transparent)
|
|
|
+ ) {
|
|
|
+ Text(
|
|
|
+ passwordStrength,
|
|
|
+ style = MaterialTheme.typography.displayMedium.copy(
|
|
|
+ color = colorResource(id = updatedTextColor),
|
|
|
+ fontWeight = FontWeight.SemiBold
|
|
|
+ ),
|
|
|
+ modifier = Modifier
|
|
|
+ )
|
|
|
+ Spacer(modifier = Modifier.weight(1f))
|
|
|
+ IconButton(
|
|
|
+ onClick = {
|
|
|
+ val pass1 = generatePassword(selectedSliderType, isLowerCaseEnabled, isUpperCaseEnabled, isNumberEnabled, isRandomSymbolsEnabled, sliderPosition.roundToInt())
|
|
|
+ generatedPassword = pass1
|
|
|
+ },
|
|
|
+ ) {
|
|
|
+ Icon(
|
|
|
+ painter = painterResource(id = R.drawable.resetpassword),
|
|
|
+ contentDescription = "Reset Logo",
|
|
|
+ modifier = Modifier
|
|
|
+ .size(24.dp, 24.dp),
|
|
|
+ tint = colorResource(id = R.color.gray_splash)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ Spacer(modifier = Modifier.width(10.dp))
|
|
|
+ val clipboardManager: ClipboardManager = LocalClipboardManager.current
|
|
|
+ IconButton(
|
|
|
+ onClick = {
|
|
|
+ clipboardManager.setText(AnnotatedString(generatedPassword))
|
|
|
+ },
|
|
|
+ ) {
|
|
|
+ Icon(
|
|
|
+ painter = painterResource(id = R.drawable.copy),
|
|
|
+ contentDescription = "Copy Logo",
|
|
|
+ modifier = Modifier
|
|
|
+ .size(24.dp, 24.dp),
|
|
|
+ tint = colorResource(id = R.color.gray_splash)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Spacer(modifier = Modifier.height(5.dp))
|
|
|
}
|
|
|
}
|
|
|
Box(
|
|
@@ -625,7 +673,14 @@ fun ColumnScope.OpenModalBottomSheetAS(
|
|
|
isRandomSymbolsEnabled = false
|
|
|
}
|
|
|
|
|
|
- val passGen = generatePassword(selectedSliderType, isLowerCaseEnabled, isUpperCaseEnabled, isNumberEnabled, isRandomSymbolsEnabled, sliderPosition.roundToInt())
|
|
|
+ val passGen = generatePassword(
|
|
|
+ selectedSliderType,
|
|
|
+ isLowerCaseEnabled,
|
|
|
+ isUpperCaseEnabled,
|
|
|
+ isNumberEnabled,
|
|
|
+ isRandomSymbolsEnabled,
|
|
|
+ sliderPosition.roundToInt()
|
|
|
+ )
|
|
|
generatedPassword = passGen
|
|
|
}
|
|
|
),
|
|
@@ -927,9 +982,5 @@ fun generatePassword(
|
|
|
""
|
|
|
}
|
|
|
|
|
|
- Log.d("test_generate_pass", "$isLowercaseEnabled $isUppercaseEnabled $isNumbersEnabled $isRandomSymbolsEnabled")
|
|
|
- Log.d("test_generate_pass", "charPool = $charPool")
|
|
|
- Log.d("test_generate_pass", "password = $password")
|
|
|
-
|
|
|
return password
|
|
|
}
|