-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
Password Checker
while creating Master Password
- Loading branch information
1 parent
1e4d0f1
commit 77b8a20
Showing
4 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/geekymusketeers/uncrack/components/PasswordStrengthIndicator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.geekymusketeers.uncrack.components | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Clear | ||
import androidx.compose.material.icons.filled.Done | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.ColorFilter | ||
import androidx.compose.ui.unit.dp | ||
import com.geekymusketeers.uncrack.ui.theme.normal14 | ||
|
||
@Composable | ||
fun PasswordStrengthIndicator( | ||
text: String, | ||
isMet: Boolean, | ||
modifier: Modifier = Modifier | ||
) { | ||
|
||
val color = if (isMet) Color.Green else Color.Red | ||
val icon = if (isMet) Icons.Default.Done else Icons.Default.Clear | ||
val iconColor = if (isMet) Color.Green else Color.Red | ||
|
||
Row(modifier = modifier.fillMaxWidth()) { | ||
Image( | ||
imageVector = icon, | ||
colorFilter = ColorFilter.tint(iconColor), | ||
contentDescription = null | ||
) | ||
|
||
Spacer(modifier = Modifier.width(5.dp)) | ||
|
||
Text( | ||
text = text, | ||
color = color, | ||
style = normal14 | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters