Skip to content

Commit

Permalink
updated login conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
robinsrk committed Dec 28, 2022
1 parent f0f8fed commit 409b61b
Show file tree
Hide file tree
Showing 79 changed files with 27 additions and 43 deletions.
Empty file modified .github/workflows/build-and-release.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .idea/.gitignore
100644 → 100755
Empty file.
Empty file modified .idea/.name
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .idea/codestream.xml
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified .idea/git_toolbox_prj.xml
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified .idea/inspectionProfiles/Project_Default.xml
100644 → 100755
Empty file.
Empty file modified .idea/kotlinc.xml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified .idea/vcs.xml
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified app/.gitignore
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions app/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation platform('androidx.compose:compose-bom:2022.10.00')
implementation platform('androidx.compose:compose-bom:2022.12.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
Expand All @@ -69,7 +69,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
androidTestImplementation platform('androidx.compose:compose-bom:2022.12.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
Expand All @@ -96,7 +96,7 @@ dependencies {
implementation "androidx.camera:camera-view:1.2.0"

// Zxing for QR Code scanning
implementation "com.google.zxing:core:3.3.3"
implementation 'com.google.zxing:core:3.5.1'

// LiveData
implementation 'androidx.compose.runtime:runtime-livedata:1.3.2'
Expand All @@ -105,8 +105,8 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'

// Hilt
implementation 'com.google.dagger:hilt-android:2.41'
implementation 'com.google.dagger:hilt-android:2.44.2'
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
kapt 'com.google.dagger:hilt-compiler:2.41'
kapt 'com.google.dagger:hilt-compiler:2.44.2'
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03'
}
Empty file modified app/google-services.json
100644 → 100755
Empty file.
Empty file modified app/proguard-rules.pro
100644 → 100755
Empty file.
Empty file.
Empty file modified app/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/assets/busFare.json
100644 → 100755
Empty file.
Empty file modified app/src/main/ic_launcher-playstore.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/java/com/example/buspayment/MainScreen.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/data/User.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/data/UserDao.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/data/UserDatabase.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/data/UserRepository.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/data/UserViewModel.kt
100644 → 100755
Empty file.
31 changes: 0 additions & 31 deletions app/src/main/java/com/example/buspayment/db/DatabaseModule.kt

This file was deleted.

15 changes: 15 additions & 0 deletions app/src/main/java/com/example/buspayment/funtions/Credentials.kt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.example.buspayment.funtions

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue

class Credentials() {
private var name: String = ""
private var email: String = ""
Expand All @@ -19,4 +25,13 @@ class Credentials() {
return email
}

}

@Composable
fun Info() {
var email by remember { mutableStateOf("") }
fun getEmail() = email
fun setEmail(mail: String) {
email = mail
}
}
Empty file.
Empty file.
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/navigations/Screens.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/screens/HomeScreen.kt
100644 → 100755
Empty file.
3 changes: 1 addition & 2 deletions app/src/main/java/com/example/buspayment/screens/LoginScreen.kt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController
import com.example.buspayment.data.User
import com.example.buspayment.data.UserViewModel
import com.example.buspayment.funtions.Credentials
import com.example.buspayment.navigations.Screens
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
Expand Down Expand Up @@ -74,6 +73,7 @@ fun LoginForm(navController: NavController) {
val mUserViewModel: UserViewModel = viewModel(
factory = UserViewModel.UserViewModelFactory(context.applicationContext as Application)
)

Column(horizontalAlignment = Alignment.CenterHorizontally) {
OutlinedTextField(
value = email,
Expand Down Expand Up @@ -137,7 +137,6 @@ fun LoginForm(navController: NavController) {
val user = User(0, "", email)
mUserViewModel.deleteUsers()
mUserViewModel.addUser(user)
Credentials().setEmail(email)
Toast.makeText(context, "Successfully logged in", Toast.LENGTH_LONG).show()
} else {
error = "Wrong username or password"
Expand Down
Empty file.
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/screens/ScanScreen.kt
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/buspayment/screens/SplashScreen.kt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun SplashScreen(navController: NavController) {
val mUserViewModel: UserViewModel =
viewModel(factory = UserViewModel.UserViewModelFactory(context.applicationContext as Application))
user = mUserViewModel.readUser.observeAsState(listOf()).value
LaunchedEffect(key1 = true) {
LaunchedEffect(key1 = user) {
delay(2000)
if (user.isNotEmpty()) {
Credentials().setEmail(user[0].email)
Expand Down
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/ui/theme/Color.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/ui/theme/LogoImage.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/ui/theme/Theme.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/java/com/example/buspayment/ui/theme/Type.kt
100644 → 100755
Empty file.
Empty file modified app/src/main/res/drawable-v24/ic_launcher_foreground.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/drawable/ic_launcher_background.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/drawable/ticket_logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable/undraw_bus_stop_re_h8ej.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/values/colors.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/ic_launcher_background.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/strings.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/themes.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/xml/backup_rules.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/xml/data_extraction_rules.xml
100644 → 100755
Empty file.
Empty file modified app/src/test/java/com/example/buspayment/ExampleUnitTest.kt
100644 → 100755
Empty file.
Empty file modified build.gradle
100644 → 100755
Empty file.
Empty file modified google-services.json
100644 → 100755
Empty file.
Empty file modified gradle.properties
100644 → 100755
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Dec 04 18:47:07 BDT 2022
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Empty file modified gradlew.bat
100644 → 100755
Empty file.
Empty file modified settings.gradle
100644 → 100755
Empty file.

0 comments on commit 409b61b

Please sign in to comment.