Skip to content

Commit

Permalink
fixed a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
jumaallan committed May 16, 2023
1 parent 1edafc6 commit 495105e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/com/hover/stax/home/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ class MainActivity : AbstractGoogleAuthActivity(), BiometricChecker.AuthListener
val loginViewModel: LoginViewModel by viewModels()
return loginViewModel
}
lateinit var navHelper: NavHelper

private val loginViewModel : LoginViewModel by viewModels()
lateinit var navHelper: NavHelper

private val transferViewModel: TransferViewModel by viewModels()
private val requestViewModel: NewRequestViewModel by viewModels()
Expand Down Expand Up @@ -143,7 +142,7 @@ class MainActivity : AbstractGoogleAuthActivity(), BiometricChecker.AuthListener
}
}

fun signIn() = loginForResult.launch(loginViewModel.signInClient.signInIntent)
fun signInUser() = loginForResult.launch(loginViewModel.signInClient.signInIntent)

private val loginForResult =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ package com.hover.stax.login

import android.content.Intent
import android.os.Bundle
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.google.android.material.snackbar.Snackbar
import com.google.android.play.core.appupdate.AppUpdateInfo
import com.google.android.play.core.appupdate.AppUpdateManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class BountyApplicationFragment : Fragment(), View.OnClickListener {
private fun startGoogleSignIn() {
logAnalyticsEvent(getString(R.string.clicked_bounty_email_continue_btn), requireContext())
updateProgress(0)
(activity as MainActivity).signIn()
(activity as MainActivity).signInUser()
}

// TODO - delete me
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class SettingsFragment : Fragment() {
private fun startGoogleLogin() {
binding.staxSupport.contactCard.showProgressIndicator()
optInMarketing = true
(requireActivity() as MainActivity).signIn()
(requireActivity() as MainActivity).signInUser()
}

private fun marketingOptIn(optedIn: Boolean) {
Expand Down

0 comments on commit 495105e

Please sign in to comment.