Skip to content

Commit

Permalink
Merge branch 'development' into apply-rules-in-update-password-module
Browse files Browse the repository at this point in the history
  • Loading branch information
niyajali authored Sep 2, 2024
2 parents e6765e0 + 5bf2744 commit e8bcdeb
Show file tree
Hide file tree
Showing 88 changed files with 1,351 additions and 1,319 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ import org.mifos.mobile.feature.transaction.navigation.navigateToRecentTransacti
import org.mifos.mobile.feature.transaction.navigation.recentTransactionNavGraph
import org.mifos.mobile.feature.transfer.process.navigation.navigateToTransferProcessScreen
import org.mifos.mobile.feature.transfer.process.navigation.transferProcessNavGraph
import org.mifos.mobile.feature.update.password.navigation.navigateToUpdatePassword
import org.mifos.mobile.feature.update.password.navigation.updatePasswordNavGraph
import org.mifos.mobile.feature.user_profile.navigation.navigateToUserProfile
import org.mifos.mobile.feature.user_profile.navigation.userProfileNavGraph
import org.mifos.mobile.feature.update_password.navigation.navigateToUpdatePassword
import org.mifos.mobile.feature.update_password.navigation.updatePasswordNavGraph
import org.mifos.mobile.feature.user.profile.navigation.navigateToUserProfile
import org.mifos.mobile.feature.user.profile.navigation.userProfileNavGraph
import org.mifos.mobile.ui.activities.HomeActivity
import org.mifos.mobile.ui.activities.PassCodeActivity

Expand Down Expand Up @@ -105,7 +105,7 @@ fun RootNavGraph(
)

userProfileNavGraph(
navController = navController,
navigateBack = navController::popBackStack,
navigateToChangePassword = navController::navigateToUpdatePassword
)

Expand All @@ -118,7 +118,7 @@ fun RootNavGraph(
)

settingsNavGraph(
navController = navController,
navigateBack = navController::popBackStack,
changePassword = navController::navigateToUpdatePassword,
changePasscode = {}, // { navigateToUpdatePasscodeActivity(it, context) },
navigateToLoginScreen = navController::navigateToLoginScreen,
Expand Down Expand Up @@ -151,9 +151,7 @@ fun RootNavGraph(
navigateToOssLicense = { startActivity(context, OssLicensesMenuActivity::class.java) }
)

transferProcessNavGraph(
navController = navController
)
transferProcessNavGraph(navigateBack = navController::popBackStack)

beneficiaryNavGraph(
navController = navController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.mifos.mobile.R
import org.mifos.mobile.core.common.Constants
import org.mifos.mobile.core.designsystem.theme.MifosMobileTheme
import org.mifos.mobile.feature.home.navigation.HomeNavigation
import org.mifos.mobile.feature.user_profile.viewmodel.UserDetailViewModel
import org.mifos.mobile.feature.user.profile.viewmodel.UserDetailViewModel
import org.mifos.mobile.navigation.RootNavGraph
import org.mifos.mobile.utils.Toaster
import org.mifos.mobile.utils.fcm.RegistrationIntentService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mifos.mobile.R
import org.mifos.mobile.api.local.PreferencesHelper
import org.mifos.mobile.feature.user.profile.viewmodel.UserDetailViewModel
import org.mifos.mobile.models.client.Client
import org.mifos.mobile.repositories.HomeRepositoryImp
import org.mifos.mobile.repositories.UserDetailRepositoryImp
Expand Down Expand Up @@ -47,12 +48,12 @@ class UserDetailViewModelTest {
private lateinit var preferencesHelper: PreferencesHelper


private lateinit var viewModel: org.mifos.mobile.feature.user_profile.viewmodel.UserDetailViewModel
private lateinit var viewModel: UserDetailViewModel

@Before
fun setUp() {
MockitoAnnotations.openMocks(this)
viewModel = org.mifos.mobile.feature.user_profile.viewmodel.UserDetailViewModel(
viewModel = UserDetailViewModel(
userDetailRepositoryImp,
homeRepositoryImp
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ fun MifosOutlinedTextField(
text = supportingText ?: "",
color = MaterialTheme.colorScheme.error,
)
} else {
null
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.Notifications
import androidx.compose.material.icons.filled.Phone
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Share
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
import androidx.compose.material.icons.filled.WifiOff
import androidx.compose.material.icons.outlined.Mail
import androidx.compose.ui.graphics.vector.ImageVector

object MifosIcons {
val Share: ImageVector = Icons.Default.Share
val Mail: ImageVector = Icons.Outlined.Mail
val LocationOn: ImageVector = Icons.Filled.LocationOn
val Phone: ImageVector= Icons.Default.Phone
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
/*
* Copyright 2024 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.home.utils
package org.mifos.mobile.core.ui.utils

import android.graphics.Bitmap
import android.graphics.BitmapFactory
Expand All @@ -16,7 +7,7 @@ import android.graphics.Matrix
import android.graphics.Paint
import android.util.Log

internal object ImageUtil {
object ImageUtil {
private const val DEFAULT_MAX_WIDTH = 816f
private const val DEFAULT_MAX_HEIGHT = 612f

Expand Down Expand Up @@ -138,4 +129,4 @@ private fun createScaledBitmap(
}

return scaledBitmap
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import org.mifos.mobile.core.data.repository.HomeRepository
import org.mifos.mobile.core.datastore.PreferencesHelper
import org.mifos.mobile.core.model.entity.accounts.loan.LoanAccount
import org.mifos.mobile.core.model.entity.accounts.savings.SavingAccount
import org.mifos.mobile.core.ui.utils.ImageUtil
import org.mifos.mobile.feature.home.R
import org.mifos.mobile.feature.home.utils.HomeState
import org.mifos.mobile.feature.home.utils.HomeUiState
import org.mifos.mobile.feature.home.utils.ImageUtil
import javax.inject.Inject

@HiltViewModel
Expand Down
39 changes: 13 additions & 26 deletions feature/qr/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright 2024 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifos.android.feature)
alias(libs.plugins.mifos.android.library.compose)
Expand All @@ -8,31 +17,9 @@ android {
}

dependencies {
implementation(projects.core.ui)
implementation(projects.core.common)
implementation(projects.core.model)
implementation(projects.core.data)
implementation(projects.core.logs)
implementation(projects.core.qrcode)

//cameraX
implementation(libs.androidx.camera.camera2)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.view)
implementation(libs.androidx.camera.core)

//qr code
implementation("com.google.zxing:core:3.5.2")
// implementation("me.dm7.barcodescanner:zxing:1.9.13")

//gson
implementation(libs.squareup.retrofit.converter.gson)

//image cropper
implementation("com.github.CanHub:Android-Image-Cropper:4.0.0")

//guava for ListenableFuture
implementation ("com.google.guava:guava:33.0.0-android")

//permissions
implementation ("com.google.accompanist:accompanist-permissions:0.25.0")
implementation(libs.android.image.cropper)
implementation (libs.accompanist.permissions)
implementation(libs.camera.core)
}
9 changes: 9 additions & 0 deletions feature/qr/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Mifos Initiative
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/*
* Copyright 2024 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.qr.navigation

import android.icu.text.MessagePattern.ArgType
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -11,13 +19,12 @@ import androidx.navigation.navArgument
import org.mifos.mobile.core.model.entity.beneficiary.Beneficiary
import org.mifos.mobile.core.model.enums.BeneficiaryState
import org.mifos.mobile.feature.qr.qr.QrCodeReaderScreen
import org.mifos.mobile.feature.qr.qr_code_display.QrCodeDisplayScreen
import org.mifos.mobile.feature.qr.qr_code_import.QrCodeImportScreen

import org.mifos.mobile.feature.qr.qrCodeDisplay.QrCodeDisplayScreen
import org.mifos.mobile.feature.qr.qrCodeImport.QrCodeImportScreen

fun NavController.navigateToQrDisplayScreen(qrString: String) {
navigate(
QrNavigation.QrDisplayScreen.passArguments(qrString = qrString)
QrNavigation.QrDisplayScreen.passArguments(qrString = qrString),
)
}

Expand All @@ -35,11 +42,11 @@ fun NavGraphBuilder.qrNavGraph(
) {
navigation(
startDestination = QrNavigation.QrDisplayScreen.route,
route = QrNavigation.QrBase.route
route = QrNavigation.QrBase.route,
) {
readerRoute(
navigateBack = navController::popBackStack,
openBeneficiaryApplication = openBeneficiaryApplication
openBeneficiaryApplication = openBeneficiaryApplication,
)

displayRoute(
Expand All @@ -48,7 +55,7 @@ fun NavGraphBuilder.qrNavGraph(

importRoute(
navigateBack = navController::popBackStack,
openBeneficiaryApplication = openBeneficiaryApplication
openBeneficiaryApplication = openBeneficiaryApplication,
)
}
}
Expand All @@ -59,8 +66,8 @@ fun NavGraphBuilder.readerRoute(
) {
composable(route = QrNavigation.QrReaderScreen.route) {
QrCodeReaderScreen(
navigateBack= navigateBack,
openBeneficiaryApplication= openBeneficiaryApplication
navigateBack = navigateBack,
openBeneficiaryApplication = openBeneficiaryApplication,
)
}
}
Expand All @@ -71,9 +78,9 @@ fun NavGraphBuilder.displayRoute(
composable(
route = QrNavigation.QrDisplayScreen.route,
arguments = listOf(
navArgument(name = QR_ARGS) { type = NavType.StringType }
)
){
navArgument(name = QR_ARGS) { type = NavType.StringType },
),
) {
QrCodeDisplayScreen(
navigateBack = navigateBack,
)
Expand All @@ -82,12 +89,12 @@ fun NavGraphBuilder.displayRoute(

fun NavGraphBuilder.importRoute(
navigateBack: () -> Unit,
openBeneficiaryApplication: (Beneficiary, BeneficiaryState) -> Unit
openBeneficiaryApplication: (Beneficiary, BeneficiaryState) -> Unit,
) {
composable(route = QrNavigation.QrImportScreen.route){
composable(route = QrNavigation.QrImportScreen.route) {
QrCodeImportScreen(
navigateBack= navigateBack,
openBeneficiaryApplication = openBeneficiaryApplication
navigateBack = navigateBack,
openBeneficiaryApplication = openBeneficiaryApplication,
)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright 2024 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.qr.navigation

const val QR_NAVIGATION_ROUTE = "qr_route"
Expand All @@ -7,10 +16,11 @@ const val QR_IMPORT_SCREEN_ROUTE = "qr_import_screen"
const val QR_ARGS = "qr_args"

sealed class QrNavigation(val route: String) {
data object QrBase: QrNavigation(route = QR_NAVIGATION_ROUTE)
data object QrBase : QrNavigation(route = QR_NAVIGATION_ROUTE)
data object QrReaderScreen : QrNavigation(route = QR_READER_SCREEN_ROUTE)
data object QrDisplayScreen : QrNavigation(route = "$QR_DISPLAY_SCREEN_ROUTE/{$QR_ARGS}") {
fun passArguments(qrString: String) = "$QR_DISPLAY_SCREEN_ROUTE/{$qrString}"
}

data object QrImportScreen : QrNavigation(route = QR_IMPORT_SCREEN_ROUTE)
}
}
Loading

0 comments on commit e8bcdeb

Please sign in to comment.