|
@@ -1,6 +1,7 @@
|
|
|
package com.vpn.fastestvpnservice.screens.accountScreensAll
|
|
|
|
|
|
import android.app.Activity
|
|
|
+import android.content.Context
|
|
|
import android.content.res.Configuration
|
|
|
import android.util.Log
|
|
|
import android.widget.Toast
|
|
@@ -52,6 +53,7 @@ import androidx.compose.ui.draw.alpha
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
import androidx.compose.ui.graphics.toArgb
|
|
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
|
+import androidx.compose.ui.platform.LocalContext
|
|
|
import androidx.compose.ui.platform.LocalFocusManager
|
|
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
|
import androidx.compose.ui.platform.LocalView
|
|
@@ -105,6 +107,7 @@ fun ChangePassword(navHostController: NavHostController) {
|
|
|
}
|
|
|
}
|
|
|
) {
|
|
|
+ val context = LocalContext.current
|
|
|
val view = LocalView.current
|
|
|
val window = (view.context as Activity).window
|
|
|
window.statusBarColor = Color.Transparent.toArgb()
|
|
@@ -149,15 +152,15 @@ fun ChangePassword(navHostController: NavHostController) {
|
|
|
.background(Color.Transparent)
|
|
|
|
|
|
) {
|
|
|
- TextFieldCurrPass() {
|
|
|
+ TextFieldCurrPass(context) {
|
|
|
currentPassword = it
|
|
|
}
|
|
|
Spacer(modifier = Modifier.height(25.dp))
|
|
|
- TextFieldNewPass() {
|
|
|
+ TextFieldNewPass(context) {
|
|
|
newPassword = it
|
|
|
}
|
|
|
Spacer(modifier = Modifier.height(25.dp))
|
|
|
- TextFieldReWriteNewPass() {
|
|
|
+ TextFieldReWriteNewPass(context) {
|
|
|
confirmPassword = it
|
|
|
}
|
|
|
val customValidation = CustomValidation()
|
|
@@ -212,7 +215,7 @@ fun ChangePassword(navHostController: NavHostController) {
|
|
|
),
|
|
|
)
|
|
|
{
|
|
|
- Text(text = "Save",
|
|
|
+ Text(text = context.getString(R.string.save),
|
|
|
style = TextStyle(
|
|
|
color = colorResource(id = R.color.white),
|
|
|
textAlign = TextAlign.Center,
|
|
@@ -249,7 +252,7 @@ fun ChangePassword(navHostController: NavHostController) {
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
|
-fun ColumnScope.TextFieldCurrPass(currentPassword: (String) -> Unit) {
|
|
|
+fun ColumnScope.TextFieldCurrPass(context: Context, currentPassword: (String) -> Unit) {
|
|
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
|
val focusManager = LocalFocusManager.current
|
|
|
|
|
@@ -289,7 +292,7 @@ fun ColumnScope.TextFieldCurrPass(currentPassword: (String) -> Unit) {
|
|
|
// },
|
|
|
label = {
|
|
|
Text(
|
|
|
- text = "Current Password",
|
|
|
+ text = context.getString(R.string.current_pass),
|
|
|
color = MaterialTheme.colorScheme.tertiaryContainer,
|
|
|
style = MaterialTheme.typography.labelMedium
|
|
|
)
|
|
@@ -365,7 +368,7 @@ fun ColumnScope.TextFieldCurrPass(currentPassword: (String) -> Unit) {
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
|
-fun ColumnScope.TextFieldNewPass(newPassword: (String) -> Unit) {
|
|
|
+fun ColumnScope.TextFieldNewPass(context: Context, newPassword: (String) -> Unit) {
|
|
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
|
val focusManager = LocalFocusManager.current
|
|
|
|
|
@@ -403,7 +406,7 @@ fun ColumnScope.TextFieldNewPass(newPassword: (String) -> Unit) {
|
|
|
// color = colorResource(id = R.color.white))
|
|
|
// },
|
|
|
label = {
|
|
|
- androidx.compose.material3.Text(text = "New Password",
|
|
|
+ androidx.compose.material3.Text(text = context.getString(R.string.new_pass),
|
|
|
style = TextStyle(
|
|
|
MaterialTheme.colorScheme.tertiaryContainer,
|
|
|
fontSize = 16.sp,
|
|
@@ -482,7 +485,7 @@ fun ColumnScope.TextFieldNewPass(newPassword: (String) -> Unit) {
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
|
-fun ColumnScope.TextFieldReWriteNewPass(confirmPassword: (String) -> Unit) {
|
|
|
+fun ColumnScope.TextFieldReWriteNewPass(context: Context, confirmPassword: (String) -> Unit) {
|
|
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
|
val focusManager = LocalFocusManager.current
|
|
|
|
|
@@ -519,7 +522,7 @@ fun ColumnScope.TextFieldReWriteNewPass(confirmPassword: (String) -> Unit) {
|
|
|
// color = colorResource(id = R.color.white))
|
|
|
// },
|
|
|
label = {
|
|
|
- androidx.compose.material3.Text(text = "Rewrite New Password",
|
|
|
+ androidx.compose.material3.Text(text = context.getString(R.string.rewrite_new_pass),
|
|
|
style = TextStyle(
|
|
|
MaterialTheme.colorScheme.tertiaryContainer,
|
|
|
fontSize = 16.sp,
|
|
@@ -599,6 +602,7 @@ fun ColumnScope.TextFieldReWriteNewPass(confirmPassword: (String) -> Unit) {
|
|
|
|
|
|
@Composable
|
|
|
fun BoxScope.HeaderRowCP(navHostController: NavHostController) {
|
|
|
+ val context = LocalContext.current
|
|
|
IconButton(
|
|
|
onClick = {
|
|
|
navHostController.popBackStack()
|
|
@@ -625,7 +629,7 @@ fun BoxScope.HeaderRowCP(navHostController: NavHostController) {
|
|
|
.padding(5.dp),
|
|
|
color = colorResource(id = R.color.transparent)
|
|
|
) {
|
|
|
- Text(text = "Change Password",
|
|
|
+ Text(text = context.getString(R.string.change_password),
|
|
|
color = MaterialTheme.colorScheme.primary,
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
modifier = Modifier.fillMaxHeight()
|