diff --git a/app/src/main/java/com/hover/stax/data/repository/BountyRepositoryImpl.kt b/app/src/main/java/com/hover/stax/data/repository/BountyRepositoryImpl.kt index 5c098fa8d..56bba3d98 100644 --- a/app/src/main/java/com/hover/stax/data/repository/BountyRepositoryImpl.kt +++ b/app/src/main/java/com/hover/stax/data/repository/BountyRepositoryImpl.kt @@ -72,12 +72,12 @@ class BountyRepositoryImpl( private fun generateChannelBounties(channels: List, bounties: List): List { if (channels.isEmpty() || bounties.isEmpty()) return emptyList() - val openBounties = bounties.filter { it.action.bounty_is_open || it.transactionCount != 0 } +// val openBounties = bounties.filter { it.action.bounty_is_open || it.transactionCount != 0 } val channelBounties = channels.filter { c -> - openBounties.any { it.action.channel_id == c.id } + bounties.any { it.action.channel_id == c.id } }.map { channel -> - ChannelBounties(channel, openBounties.filter { it.action.channel_id == channel.id }) + ChannelBounties(channel, bounties.filter { it.action.channel_id == channel.id }) } return channelBounties diff --git a/app/src/main/java/com/hover/stax/home/MainActivity.kt b/app/src/main/java/com/hover/stax/home/MainActivity.kt index a6bc0b412..a7c4c6ba7 100644 --- a/app/src/main/java/com/hover/stax/home/MainActivity.kt +++ b/app/src/main/java/com/hover/stax/home/MainActivity.kt @@ -64,7 +64,6 @@ class MainActivity : AbstractGoogleAuthActivity(), BiometricChecker.AuthListener checkForRequest(intent) checkForFragmentDirection(intent) observeForAppReview() - setGoogleLoginInterface(this) } override fun onNewIntent(intent: Intent?) { diff --git a/app/src/main/java/com/hover/stax/hover/TransactionReceiver.kt b/app/src/main/java/com/hover/stax/hover/TransactionReceiver.kt index a3d03be2a..6045cdf16 100644 --- a/app/src/main/java/com/hover/stax/hover/TransactionReceiver.kt +++ b/app/src/main/java/com/hover/stax/hover/TransactionReceiver.kt @@ -1,4 +1,4 @@ -/* + /* * Copyright 2022 Stax * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/app/src/main/java/com/hover/stax/login/AbstractGoogleAuthActivity.kt b/app/src/main/java/com/hover/stax/login/AbstractGoogleAuthActivity.kt index c2ff223fc..48e1c10bc 100644 --- a/app/src/main/java/com/hover/stax/login/AbstractGoogleAuthActivity.kt +++ b/app/src/main/java/com/hover/stax/login/AbstractGoogleAuthActivity.kt @@ -43,12 +43,9 @@ import timber.log.Timber const val FORCED_VERSION = "force_update_app_version" -abstract class AbstractGoogleAuthActivity : - AppCompatActivity(), - StaxGoogleLoginInterface { +abstract class AbstractGoogleAuthActivity : AppCompatActivity() { private val loginViewModel: LoginViewModel by viewModel() - private lateinit var staxGoogleLoginInterface: StaxGoogleLoginInterface private lateinit var updateManager: AppUpdateManager private var installListener: InstallStateUpdatedListener? = null @@ -78,10 +75,6 @@ abstract class AbstractGoogleAuthActivity : } } - fun setGoogleLoginInterface(staxGoogleLoginInterface: StaxGoogleLoginInterface) { - this.staxGoogleLoginInterface = staxGoogleLoginInterface - } - private fun initGoogleAuth() { val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.google_server_client_id)).requestEmail().build() @@ -90,11 +83,11 @@ abstract class AbstractGoogleAuthActivity : private fun setLoginObserver() = with(loginViewModel) { error.observe(this@AbstractGoogleAuthActivity) { - it?.let { staxGoogleLoginInterface.googleLoginFailed() } + it?.let { googleLoginFailed() } } googleUser.observe(this@AbstractGoogleAuthActivity) { - it?.let { staxGoogleLoginInterface.googleLoginSuccessful() } + it?.let { googleLoginSuccessful() } } } @@ -106,7 +99,7 @@ abstract class AbstractGoogleAuthActivity : loginViewModel.signIntoGoogle(result.data) } else { Timber.e("Google sign in failed") - staxGoogleLoginInterface.googleLoginFailed() + googleLoginFailed() } } @@ -185,11 +178,11 @@ abstract class AbstractGoogleAuthActivity : } } - override fun googleLoginSuccessful() { + private fun googleLoginSuccessful() { if (loginViewModel.staxUser.value?.isMapper == true) BountyApplicationFragmentDirections.actionBountyApplicationFragmentToBountyListFragment() } - override fun googleLoginFailed() { + private fun googleLoginFailed() { UIHelper.flashAndReportMessage(this, R.string.login_google_err) } diff --git a/app/src/main/java/com/hover/stax/login/LoginViewModel.kt b/app/src/main/java/com/hover/stax/login/LoginViewModel.kt index 92f01afd8..822cda052 100644 --- a/app/src/main/java/com/hover/stax/login/LoginViewModel.kt +++ b/app/src/main/java/com/hover/stax/login/LoginViewModel.kt @@ -76,13 +76,14 @@ class LoginViewModel( val account = task.getResult(ApiException::class.java)!! setUser(account, account.idToken!!) } catch (e: ApiException) { - Timber.e(e, "Google sign in failed") + Timber.e(e, e.message) onError((getApplication() as Context).getString(R.string.login_google_err)) } } private fun loginUser(token: String, signInAccount: GoogleSignInAccount) = viewModelScope.launch { + Timber.e("logging in...") try { val authorization = authRepository.authorizeClient(token) val response = authRepository.fetchTokenInfo(authorization.redirectUri.code) @@ -110,7 +111,7 @@ class LoginViewModel( _loginState.value = LoginScreenUiState(LoginUiState.Success) } } catch (e: Exception) { - Timber.e("Login failed $e") + Timber.e(e, "Login failed ${e.message}") _loginState.value = LoginScreenUiState(LoginUiState.Error) } } diff --git a/app/src/main/java/com/hover/stax/login/StaxGoogleLoginInterface.kt b/app/src/main/java/com/hover/stax/login/StaxGoogleLoginInterface.kt deleted file mode 100644 index 7ef69dd38..000000000 --- a/app/src/main/java/com/hover/stax/login/StaxGoogleLoginInterface.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2022 Stax - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.hover.stax.login - -interface StaxGoogleLoginInterface { - fun googleLoginSuccessful() - fun googleLoginFailed() -} \ No newline at end of file diff --git a/app/src/main/java/com/hover/stax/onboarding/OnBoardingActivity.kt b/app/src/main/java/com/hover/stax/onboarding/OnBoardingActivity.kt index 214f7115d..ab699b57d 100644 --- a/app/src/main/java/com/hover/stax/onboarding/OnBoardingActivity.kt +++ b/app/src/main/java/com/hover/stax/onboarding/OnBoardingActivity.kt @@ -49,7 +49,6 @@ class OnBoardingActivity : AbstractGoogleAuthActivity() { setupNavigation() navigateNextScreen() - setGoogleLoginInterface(this) } private fun setupNavigation() { diff --git a/app/src/main/java/com/hover/stax/presentation/bounties/BountyApplicationFragment.kt b/app/src/main/java/com/hover/stax/presentation/bounties/BountyApplicationFragment.kt index 1ecd426fb..d821f5e6a 100644 --- a/app/src/main/java/com/hover/stax/presentation/bounties/BountyApplicationFragment.kt +++ b/app/src/main/java/com/hover/stax/presentation/bounties/BountyApplicationFragment.kt @@ -63,10 +63,10 @@ class BountyApplicationFragment : Fragment(), View.OnClickListener { super.onViewCreated(view, savedInstanceState) binding.progressIndicator.setVisibilityAfterHide(View.GONE) - binding.instructions.apply { - text = HtmlCompat.fromHtml(getString(R.string.bounty_email_stage_desc2), HtmlCompat.FROM_HTML_MODE_LEGACY) - movementMethod = LinkMovementMethod.getInstance() - } +// binding.instructions.apply { +// text = HtmlCompat.fromHtml(getString(R.string.bounty_email_stage_desc2), HtmlCompat.FROM_HTML_MODE_LEGACY) +// movementMethod = LinkMovementMethod.getInstance() +// } startObservers() } diff --git a/app/src/main/java/com/hover/stax/presentation/bounties/BountyListFragment.kt b/app/src/main/java/com/hover/stax/presentation/bounties/BountyListFragment.kt index 469fc4aaf..0cf97cefa 100644 --- a/app/src/main/java/com/hover/stax/presentation/bounties/BountyListFragment.kt +++ b/app/src/main/java/com/hover/stax/presentation/bounties/BountyListFragment.kt @@ -165,10 +165,10 @@ class BountyListFragment : Fragment() { .setDialogTitle( getString( R.string.bounty_claim_title, b.action.root_code, - HoverAction.getHumanFriendlyType(requireContext(), b.action.transaction_type), b.action.bounty_amount + HoverAction.getHumanFriendlyType(requireContext(), b.action.transaction_type) ) ) - .setDialogMessage(getString(R.string.bounty_claim_explained, b.action.bounty_amount, b.getInstructions(requireActivity()))) + .setDialogMessage(getString(R.string.bounty_claim_explained, b.getInstructions(requireActivity()))) .setPosButton(R.string.start_USSD_Flow) { startBounty(b) } dialog!!.showIt() } diff --git a/app/src/main/java/com/hover/stax/presentation/bounties/components/BountyLi.kt b/app/src/main/java/com/hover/stax/presentation/bounties/components/BountyLi.kt index ce3fc3ccf..5bdf07cc2 100644 --- a/app/src/main/java/com/hover/stax/presentation/bounties/components/BountyLi.kt +++ b/app/src/main/java/com/hover/stax/presentation/bounties/components/BountyLi.kt @@ -76,13 +76,13 @@ fun BountyLi(bounty: Bounty, bountyViewModel: BountyViewModel) { style = if (isOpen(bounty)) MaterialTheme.typography.body1 else strikeThrough ) - Text( - text = stringResource(R.string.bounty_amount_with_currency, bounty.action.bounty_amount), - modifier = Modifier - .padding(top = margin8, bottom = margin8), - style = if (isOpen(bounty)) MaterialTheme.typography.body1 else strikeThrough, - fontWeight = FontWeight.Medium - ) +// Text( +// text = stringResource(R.string.bounty_amount_with_currency, bounty.action.bounty_amount), +// modifier = Modifier +// .padding(top = margin8, bottom = margin8), +// style = if (isOpen(bounty)) MaterialTheme.typography.body1 else strikeThrough, +// fontWeight = FontWeight.Medium +// ) } if (getMsg(bounty) != 0) @@ -97,55 +97,58 @@ fun BountyLi(bounty: Bounty, bountyViewModel: BountyViewModel) { private fun getColor(bounty: Bounty): Int { return when { - bounty.hasSuccessfulTransactions() -> R.color.muted_green - bounty.isLastTransactionFailed() -> R.color.stax_bounty_red_bg - !bounty.action.bounty_is_open -> R.color.lighter_grey - bounty.transactionCount > 0 -> R.color.pending_brown +// bounty.hasSuccessfulTransactions() -> R.color.muted_green +// bounty.isLastTransactionFailed() -> R.color.stax_bounty_red_bg +// !bounty.action.bounty_is_open -> R.color.lighter_grey +// bounty.transactionCount > 0 -> R.color.pending_brown else -> R.color.colorSurface } } private fun getMsg(bounty: Bounty): Int { - return when { - bounty.hasSuccessfulTransactions() -> R.string.done - bounty.isLastTransactionFailed() && !bounty.action.bounty_is_open -> R.string.bounty_transaction_failed - bounty.isLastTransactionFailed() && bounty.action.bounty_is_open -> R.string.bounty_transaction_failed_try_again - bounty.transactionCount > 0 -> R.string.bounty_pending_short_desc - else -> 0 - } + return 0 +// return when { +// bounty.hasSuccessfulTransactions() -> R.string.done +// bounty.isLastTransactionFailed() && !bounty.action.bounty_is_open -> R.string.bounty_transaction_failed +// bounty.isLastTransactionFailed() && bounty.action.bounty_is_open -> R.string.bounty_transaction_failed_try_again +// bounty.transactionCount > 0 -> R.string.bounty_pending_short_desc +// else -> 0 +// } } private fun getIcon(bounty: Bounty): Int { - return when { - bounty.hasSuccessfulTransactions() -> R.drawable.ic_check - bounty.isLastTransactionFailed() -> R.drawable.ic_error - bounty.transactionCount > 0 -> R.drawable.ic_warning - else -> 0 - } + return 0 +// return when { +// bounty.hasSuccessfulTransactions() -> R.drawable.ic_check +// bounty.isLastTransactionFailed() -> R.drawable.ic_error +// bounty.transactionCount > 0 -> R.drawable.ic_warning +// else -> 0 +// } } private fun isOpen(bounty: Bounty): Boolean { - return when { - bounty.hasSuccessfulTransactions() -> false - bounty.isLastTransactionFailed() && !bounty.action.bounty_is_open -> false - bounty.isLastTransactionFailed() && bounty.action.bounty_is_open -> true - !bounty.action.bounty_is_open -> false - bounty.transactionCount > 0 -> true - else -> true - } + return true +// return when { +// bounty.hasSuccessfulTransactions() -> false +// bounty.isLastTransactionFailed() && !bounty.action.bounty_is_open -> false +// bounty.isLastTransactionFailed() && bounty.action.bounty_is_open -> true +// !bounty.action.bounty_is_open -> false +// bounty.transactionCount > 0 -> true +// else -> true +// } } private fun getTapAction(bounty: Bounty): BountySelectEvent? { return when { - bounty.hasSuccessfulTransactions() -> - BountySelectEvent.ViewTransactionDetail(bounty.transactions.last().uuid) - bounty.isLastTransactionFailed() && !bounty.action.bounty_is_open -> - BountySelectEvent.ViewTransactionDetail(bounty.transactions.last().uuid) - bounty.isLastTransactionFailed() && bounty.action.bounty_is_open -> - BountySelectEvent.ViewBountyDetail(bounty) - !bounty.action.bounty_is_open -> null - bounty.transactionCount > 0 -> - BountySelectEvent.ViewTransactionDetail(bounty.transactions.last().uuid) +// bounty.hasSuccessfulTransactions() -> +// BountySelectEvent.ViewTransactionDetail(bounty.transactions.last().uuid) +// bounty.isLastTransactionFailed() && !bounty.action.bounty_is_open -> +// BountySelectEvent.ViewTransactionDetail(bounty.transactions.last().uuid) +// bounty.isLastTransactionFailed() && bounty.action.bounty_is_open -> +// BountySelectEvent.ViewBountyDetail(bounty) +// !bounty.action.bounty_is_open -> null +// bounty.transactionCount > 0 -> +// BountySelectEvent.ViewTransactionDetail(bounty.transactions.last().uuid) else -> BountySelectEvent.ViewBountyDetail(bounty) } } @@ -174,13 +177,13 @@ fun BountyCardPreview() { style = MaterialTheme.typography.body1 ) - Text( - text = "USD $1", - modifier = Modifier - .padding(top = margin8, bottom = margin8), - style = MaterialTheme.typography.body1, - fontWeight = FontWeight.Medium - ) +// Text( +// text = "USD $1", +// modifier = Modifier +// .padding(top = margin8, bottom = margin8), +// style = MaterialTheme.typography.body1, +// fontWeight = FontWeight.Medium +// ) } SpannableImageTextView( diff --git a/app/src/main/res/layout/fragment_bounty_application.xml b/app/src/main/res/layout/fragment_bounty_application.xml index d0e33dc49..1eddbf79c 100644 --- a/app/src/main/res/layout/fragment_bounty_application.xml +++ b/app/src/main/res/layout/fragment_bounty_application.xml @@ -39,17 +39,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/intro" /> + app:layout_constraintTop_toBottomOf="@id/intro"> ሊገኙ የሚችሉ ፍሰቶች - %1$s - %2$s - $%3$d - - $ %1$d ዶላር ለመጠየቅ ፣ %2$s።\n\nልክ እንደጨረሱ ለክፍያ መረጃ ለመሰብሰብ ኢሜይል እንልክልዎታለን። በ1-5 የሥራ ቀናት ውስጥ ይከፈልዎታል + %1$s - %2$s ምንም ጉርሻዎች የሉም። እባክዎ ቆይተው እንደገና ያረጋግጡ። diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 3593b9a6f..b9c5a7071 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -684,9 +684,7 @@ FLUX DISPONIBLES - %1$s - %2$s - $%3$d - - Pour réclamer %1$d $USD, %2$s.\n\nDès que vous aurez terminé, nous vous enverrons un courriel pour collecter les informations nécessaires au paiement. Vous serez payé en 1 à 5 jours ouvrables + %1$s - %2$s Démarrer le flux USSD diff --git a/app/src/main/res/values-om/strings.xml b/app/src/main/res/values-om/strings.xml index f8a6d387b..607283676 100644 --- a/app/src/main/res/values-om/strings.xml +++ b/app/src/main/res/values-om/strings.xml @@ -539,8 +539,7 @@ our requirements and is no longer available]]> our requirements. Please try again]]> DHANGALA\'AA ARGAMU - %1$s - %2$s - $%3$d - USD $%1$d, %2$s himachuuf.\n\nAkkuma xumurtaniin, odeeffannoo kaffaltiidhaaf walitti qabuuf email isiniif ergina. Guyyoota hojii 7–10 keessatti kaffaltiin siif kaffalama + %1$s - %2$s Dhangala\'aa USSD jalqabi Dhangala\'aa kee sakatta\'uu
If you have questions, please email us at ussd@stax.me ]]>
diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index a083f71de..b71a9c3f4 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -540,8 +540,7 @@ our requirements and is no longer available]]> our requirements. Please try again]]> SOCODKA LA HELI KARO - %1$s - %2$s - $%3$d - Si aad u dalbato USD $%1$d, %2$s.\n\n Isla marka aad dhammayso, waxaanu kuu soo diri doonaa iimayl si aad u ururiso macluumaadka lacag bixinta. Waxa lagu siin doonaa 7–10 maalmood oo shaqo gudahood + %1$s - %2$s Billow khariidaynta USSD-ga Waxaa la xaqiijinyaa socdaalkaaga
If you have questions, please email us at ussd@stax.me ]]>
diff --git a/app/src/main/res/values-sw/strings.xml b/app/src/main/res/values-sw/strings.xml index 76e5a0955..8a1b532b6 100644 --- a/app/src/main/res/values-sw/strings.xml +++ b/app/src/main/res/values-sw/strings.xml @@ -684,9 +684,7 @@ MITIRIRIKO INAYOPATIKANA - %1$s - %2$s - $%3$d - - Ili kudai USD $%1$d, %2$s.\n\nMara tu utakapomaliza, tutakutumia barua pepe kukusanya habari kwa malipo. Utalipwa katika siku 1-5 za biashara + %1$s - %2$s Anza Mtiririko wa USSD diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ca8d9f03d..52b305eb0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -534,7 +534,7 @@ Check out Stax, an app that automates USSD. https://play.google.com/store/apps/details?id=com.hover.stax Connect your accounts - An error occurred while signing in to Google. Please try again. + Error signing in to Google. Your code: Agent\'s code By using Stax App, you\'ve read our privacy policy and agree to the terms of service. Click to read @@ -639,11 +639,11 @@ Bounty - 💸 Money Mapper - Stax will pay you USD $1 - $5 to go through a USSD flow. + USSD Recorder + You can help make USSD more reliable by recording USSD sessions. Get started - Welcome to Money Mapper - Stax wants to make USSD easier to use for everyone. To bring Stax to more people in more countries, we need to map every USSD menu globally. Money Mappers have the opportunity to earn USD $1 - $5 for every USSD transaction successfully completed. Please follow the instructions below to apply. + Welcome to USSD Recorder + Stax wants to make USSD easier to use for everyone. We need to record USSD sessions to measure their performance and reliability. You can help us by recording your sessions. Your data will only be used for research purposes, no personally identifiable information will be shared with anyone. 1. Sign in below with your Google account.

2. Fill out the application form.

3. You will receive an email notification when your application is accepted.

4. Come back to this screen to find the list of bounties and start earning money!]]>
Signed into Google account %1$s Buy airtime for any person %1$s @@ -676,8 +676,8 @@ our requirements
and is no longer available]]> our requirements. Please try again]]> AVAILABLE FLOWS - %1$s - %2$s - $%3$d - To claim USD $%1$d, %2$s.\n\nAs soon as you\’re done, we will send you an email to collect information for payment. You will be paid in 7–10 business days + %1$s - %2$s + This will dial the shortcode and record the USSD session. When you see the USSD menu please %1$s Start USSD Flow Checking your flow
If you have questions, please email us at ussd@stax.me ]]>