Skip to content

Commit

Permalink
Added annotations and navigation flow
Browse files Browse the repository at this point in the history
  • Loading branch information
aritra-tech committed Mar 11, 2024
1 parent 637572f commit 6da609d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.geekymusketeers.uncrack.presentation.auth.login

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
Expand Down Expand Up @@ -27,13 +29,15 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.geekymusketeers.uncrack.MainActivity
import com.geekymusketeers.uncrack.R
import com.geekymusketeers.uncrack.components.UCButton
import com.geekymusketeers.uncrack.components.UCTextField
Expand All @@ -42,6 +46,7 @@ import com.geekymusketeers.uncrack.ui.theme.OnPrimaryContainerLight
import com.geekymusketeers.uncrack.ui.theme.PrimaryLight
import com.geekymusketeers.uncrack.ui.theme.UnCrackTheme
import com.geekymusketeers.uncrack.ui.theme.medium16
import com.geekymusketeers.uncrack.util.UtilsKt.findActivity
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -61,15 +66,16 @@ class LoginScreens : ComponentActivity() {

setContent {
UnCrackTheme {
LoginContent()
LoginContent(this@LoginScreens)
}
}
}
}

@Composable
fun LoginContent(modifier: Modifier = Modifier) {
fun LoginContent(activity: Activity, modifier: Modifier = Modifier) {

val context = LocalContext.current
val email by remember {
mutableStateOf("")
}
Expand Down Expand Up @@ -149,8 +155,11 @@ fun LoginContent(modifier: Modifier = Modifier) {
text = stringResource(R.string.login),
onClick = {
// TODO: Perform req operation and navigate to Home Screen
context.findActivity()?.apply {
startActivity(Intent(activity, MainActivity::class.java))
}
},
enabled = false
// enabled = false
)

Spacer(modifier = Modifier.height(15.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ import com.geekymusketeers.uncrack.ui.theme.OnPrimaryContainerLight
import com.geekymusketeers.uncrack.ui.theme.PrimaryLight
import com.geekymusketeers.uncrack.ui.theme.UnCrackTheme
import com.geekymusketeers.uncrack.ui.theme.medium16
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class SignupScreen : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down

0 comments on commit 6da609d

Please sign in to comment.