From 5f44c462231799d04b86ab2fc577e517c9699d86 Mon Sep 17 00:00:00 2001 From: Pronay Sarker Date: Tue, 24 Dec 2024 04:45:04 +0600 Subject: [PATCH] refactor: final cleanup (#2265) * Remove Unused XML, Resources, and Kotlin Code deleted themeHelper.kt deleted unused files * actions/upload-artifact version update * remove unused testFiles * applied spotless and detekt on whole project * added dependency guard * fix build failure --- .github/workflows/android.yml | 2 +- .../java/com/mifos/core/data/di/DataModule.kt | 6 +- .../pagingSource/CenterListPagingSource.kt | 19 +- .../pagingSource/ClientListPagingSource.kt | 19 +- .../data/repository/ActivateRepository.kt | 18 +- .../repository/ClientDetailsRepository.kt | 12 +- .../repository/ClientIdentifiersRepository.kt | 13 +- .../repository/DataTableDataRepository.kt | 14 +- .../data/repository/DataTableRepository.kt | 12 +- .../core/data/repository/LoginRepository.kt | 12 +- .../repositoryImp/ActivateRepositoryImp.kt | 21 +- .../ClientIdentifiersRepositoryImp.kt | 16 +- .../DataTableDataRepositoryImp.kt | 16 +- .../domain/useCases/ActivateCenterUseCase.kt | 13 +- .../domain/useCases/ActivateClientUseCase.kt | 13 +- .../useCases/DeleteDataTableEntryUseCase.kt | 14 +- .../useCases/DeleteIdentifierUseCase.kt | 13 +- .../useCases/GetClientDetailsUseCase.kt | 11 +- .../useCases/GetClientIdentifiersUseCase.kt | 11 +- .../domain/useCases/GetGroupOfficesUseCase.kt | 11 +- ...tStaffInOfficeForCreateNewClientUseCase.kt | 11 +- .../core/domain/useCases/LoginUseCase.kt | 1 - .../core/domain/GroupListPagingSourceTest.kt | 2 +- .../network/datamanager/DataManagerCenter.kt | 34 +- .../network/datamanager/DataManagerClient.kt | 58 +- .../datamanager/DataManagerDataTable.kt | 29 +- .../network/datamanager/DataManagerGroups.kt | 23 +- .../network/datamanager/DataManagerOffices.kt | 18 +- .../network/datamanager/DataManagerStaff.kt | 16 +- .../network/mappers/centers/CenterMapper.kt | 4 +- .../centers/GetCentersResponseMapper.kt | 2 +- .../network/mappers/clients/ClientMapper.kt | 4 +- .../clients/GetClientResponseMapper.kt | 2 +- .../GetClientsClientIdAccountMapper.kt | 14 +- .../clients/GetIdentifiersTemplateMapper.kt | 4 +- .../mappers/clients/IdentifierMapper.kt | 4 +- .../dataTable/GetDataTablesResponseMapper.kt | 4 +- .../mappers/groups/GetGroupsResponseMapper.kt | 2 +- .../network/mappers/groups/GroupMapper.kt | 4 +- .../offices/GetOfficeResponseMapper.kt | 13 +- .../network/mappers/staffs/StaffMapper.kt | 2 +- .../com/mifos/feature/about/AboutScreen.kt | 3 +- .../centerDetails/CenterDetailsScreen.kt | 22 +- .../SyncCentersDialogScreen.kt | 1 - .../SyncCentersDialogViewModel.kt | 173 ++- .../clientDetails/ui/ClientDetailsScreen.kt | 154 +- .../ClientIdentifiersScreen.kt | 33 +- .../client/clientSignature/SignatureScreen.kt | 12 +- .../CreateNewClientViewModel.kt | 54 +- .../SyncClientsDialogViewModel.kt | 53 +- .../navigation/CollectionSheetScreens.kt | 4 +- .../paymentDetails/PaymentDetailsScreen.kt | 2 +- .../groups/groupDetails/GroupDetailsScreen.kt | 66 +- .../groups/groupList/GroupsListScreen.kt | 2 +- .../SyncGroupsDialogViewModel.kt | 78 +- .../java/com/mifos/feature/note/NoteScreen.kt | 4 +- .../report/runReport/RunReportScreen.kt | 91 +- .../SavingsAccountSummaryScreen.kt | 22 +- .../settings/settings/SettingsScreen.kt | 2 +- .../settings/syncSurvey/SyncSurveysDialog.kt | 14 +- .../updateServer/UpdateServerConfigScreen.kt | 8 +- gradle/libs.versions.toml | 2 +- libs/country-code-picker/build.gradle.kts | 2 +- .../src/main/AndroidManifest.xml | 2 +- .../countrycodepicker/CountryCodePicker.kt | 2 +- .../countrycodepicker/component/Autofill.kt | 2 +- .../component/CountryCodeDialog.kt | 2 +- .../component/CountryDialog.kt | 2 +- .../countrycodepicker/data/CountryData.kt | 2 +- .../data/utils/CountryCodeUtils.kt | 2 +- .../data/utils/CountryNameMap.kt | 2 +- .../data/utils/NumberHintMap.kt | 2 +- .../data/utils/SearchCountryList.kt | 2 +- .../data/utils/ValidatePhoneNumber.kt | 2 +- .../PhoneNumberTransformation.kt | 2 +- .../src/main/res/values-ar/strings.xml | 2 +- .../src/main/res/values-es/strings.xml | 2 +- .../src/main/res/values-fr/strings.xml | 2 +- .../src/main/res/values-hi/strings.xml | 2 +- .../src/main/res/values-it-rIT/strings.xml | 2 +- .../src/main/res/values-nl/strings.xml | 2 +- .../src/main/res/values-ru-rRU/strings.xml | 2 +- .../src/main/res/values-so/strings.xml | 2 +- .../src/main/res/values-tr-rTR/strings.xml | 2 +- .../src/main/res/values-zh/strings.xml | 2 +- .../src/main/res/values/strings.xml | 2 +- libs/mifos-passcode/build.gradle.kts | 2 +- .../src/main/AndroidManifest.xml | 2 +- .../mifos/library/passcode/PassCodeScreen.kt | 2 +- .../library/passcode/PasscodeNavigation.kt | 2 +- .../library/passcode/component/MifosIcon.kt | 2 +- .../passcode/component/PasscodeButton.kt | 2 +- .../passcode/component/PasscodeHeader.kt | 2 +- .../passcode/component/PasscodeKeys.kt | 2 +- .../component/PasscodeMismatchedDialog.kt | 2 +- .../component/PasscodeStepIndicator.kt | 2 +- .../passcode/component/PasscodeToolbar.kt | 2 +- .../library/passcode/data/PasscodeManager.kt | 2 +- .../passcode/data/PasscodeRepository.kt | 2 +- .../passcode/data/PasscodeRepositoryImpl.kt | 2 +- .../library/passcode/di/ApplicationModule.kt | 2 +- .../org/mifos/library/passcode/theme/Color.kt | 2 +- .../org/mifos/library/passcode/theme/Font.kt | 2 +- .../org/mifos/library/passcode/theme/Theme.kt | 2 +- .../org/mifos/library/passcode/theme/Type.kt | 2 +- .../library/passcode/utility/Constants.kt | 2 +- .../passcode/utility/PreferenceManager.kt | 2 +- .../passcode/utility/ShakeAnimation.kt | 2 +- .../mifos/library/passcode/utility/Step.kt | 2 +- .../passcode/utility/VibrationFeedback.kt | 2 +- .../passcode/viewmodels/PasscodeViewModel.kt | 2 +- .../lib_mifos_passcode_delete_forever.xml | 2 +- .../drawable/lib_mifos_passcode_ic_delete.xml | 2 +- .../src/main/res/values/strings.xml | 2 +- libs/pullrefresh/build.gradle.kts | 2 +- libs/pullrefresh/src/main/AndroidManifest.xml | 2 +- .../PullRefresh.kt | 2 +- .../PullRefreshIndicator.kt | 2 +- .../PullRefreshIndicatorTransform.kt | 2 +- .../PullRefreshState.kt | 2 +- mifosng-android/build.gradle.kts | 18 +- .../demoDebugCompileClasspath.txt | 207 +++ .../demoReleaseCompileClasspath.txt | 202 +++ .../prodDebugCompileClasspath.txt | 207 +++ .../prodReleaseCompileClasspath.txt | 202 +++ .../com/mifos/mifosxdroid/FakeJsonName.kt | 11 +- .../mifos/mifosxdroid/FakeRemoteDataSource.kt | 81 +- .../com/mifos/mifosxdroid/TestDataFactory.kt | 25 +- .../src/debug/res/values/google_maps_api.xml | 10 + .../tests/CenterListFragmentTest.kt | 104 -- .../mifosxdroid/tests/ClientChargesTest.kt | 137 -- .../tests/ClientDetailsFragmentTest.kt | 102 -- .../tests/ClientListFragmentTest.kt | 789 ----------- .../tests/ClientSearchFragmentTest.kt | 70 - .../tests/CreateNewCenterFragmentTest.kt | 145 -- .../tests/CreateNewClientFragmentTest.kt | 114 -- .../tests/CreateNewGroupFragmentTest.kt | 163 --- .../tests/DashboardFragmentActivityTest.kt | 207 --- .../mifosxdroid/tests/LoginActivityTest.kt | 166 --- .../SavingsAccountSummaryFragmentTest.kt | 194 --- .../SurveyQuestionViewPagerActivityTest.kt | 284 ---- .../tests/action/NavigationViewActions.kt | 114 -- mifosng-android/src/main/AndroidManifest.xml | 34 +- .../main/java/com/mifos/application/App.kt | 26 +- .../com/mifos/mifosxdroid/AndroidClient.kt | 20 +- .../mifosxdroid/AndroidClientActivity.kt | 12 +- .../mifosxdroid/HomeDestinationsScreen.kt | 37 +- .../mifosxdroid/activity/home/HomeActivity.kt | 208 --- .../activity/login/LoginActivity.kt | 0 .../activity/setting/SettingsActivity.kt | 0 .../activity/setting/SettingsFragment.kt | 0 .../adapters/ChargeNameListAdapter.kt | 46 - .../mifosxdroid/adapters/FragmentAdapter.kt | 25 - .../adapters/IdentifierListAdapter.kt | 89 -- .../adapters/LoanAccountsListAdapter.kt | 86 -- .../mifosxdroid/adapters/LoanListAdapter.kt | 51 - .../adapters/LoanRepaymentScheduleAdapter.kt | 93 -- .../adapters/LoanTransactionAdapter.kt | 179 --- .../adapters/PinpointClientAdapter.kt | 125 -- .../mifosxdroid/adapters/SurveyListAdapter.kt | 59 - .../adapters/SurveyPagerAdapter.kt | 27 - .../components/MifosNavigationBar.kt | 25 +- .../mifosxdroid/components/Navigation.kt | 62 +- .../components/NavigationConstants.kt | 13 +- .../mifosxdroid/core/BaseActivityCallback.kt | 18 - .../core/EndlessRecyclerOnScrollListener.kt | 49 - .../core/EndlessRecyclerViewScrollListener.kt | 108 -- .../mifos/mifosxdroid/core/MaterialDialog.kt | 178 --- .../mifosxdroid/core/MifosBaseActivity.kt | 161 --- .../mifosxdroid/core/MifosBaseFragment.kt | 97 -- .../core/MifosProgressBarHandler.kt | 40 - .../core/ProgressableDialogFragment.kt | 61 - .../mifosxdroid/core/ProgressableFragment.kt | 48 - .../mifosxdroid/core/SelectableAdapter.kt | 68 - .../core/adapters/MifosBaseListAdapter.kt | 173 --- .../mifos/mifosxdroid/core/util/Toaster.kt | 47 - .../chargedialog/OnChargeCreateListener.kt | 11 - .../CheckerTaskFilterDialogFragment.kt | 212 --- .../SyncSurveysDialogFragment.kt | 248 ---- .../injection/module/ApplicationModule.kt | 27 - .../injection/module/RepositoryModule.kt | 43 +- .../mifosxdroid/navigation/HomeNavigation.kt | 65 +- .../mifosxdroid/navigation/HomeScreens.kt | 12 +- .../mifosxdroid/navigation/MifosNavGraph.kt | 2 +- .../navigation/PasscodeNavGraph.kt | 2 +- .../mifosxdroid/online/CentersActivity.kt | 0 .../centerdetails/CenterDetailsFragment.kt | 0 .../online/centerlist/CenterListRepository.kt | 18 - .../centerlist/CenterListRepositoryImp.kt | 29 - .../online/centerlist/CenterListUiState.kt | 30 - .../online/centerlist/CenterListViewModel.kt | 169 --- .../CheckerInboxPendingTasksActivity.kt | 0 .../online/loanaccount/LoanAccountFragment.kt | 202 --- .../surveysubmit/SurveySubmitFragment.kt | 151 -- .../mifosxdroid/uihelpers/MFDatePicker.kt | 68 - .../mifosxdroid/views/CircularImageView.kt | 188 --- .../mifos/mifosxdroid/views/CustomSpinner.kt | 96 -- .../java/com/mifos/mifosxdroid/views/Font.kt | 41 - .../mifos/mifosxdroid/views/FontTextView.kt | 42 - .../mifos/mifosxdroid/views/SignatureView.kt | 136 -- .../views/scrollview/CustomScrollView.kt | 28 - .../views/scrollview/ScrollChangeListener.kt | 5 - .../com/mifos/utils/AndroidVersionUtil.kt | 17 - .../utils/CheckSelfPermissionAndRequest.kt | 159 --- .../main/java/com/mifos/utils/Constants.kt | 54 - .../main/java/com/mifos/utils/DateHelper.kt | 283 ---- .../com/mifos/utils/EspressoIdlingResource.kt | 37 - .../main/java/com/mifos/utils/FileUtils.kt | 209 --- .../java/com/mifos/utils/FragmentConstants.kt | 30 - .../java/com/mifos/utils/ImageLoaderUtils.kt | 51 - .../com/mifos/utils/ItemOffsetDecoration.kt | 27 - .../com/mifos/utils/JsonDateSerializer.kt | 28 - .../java/com/mifos/utils/LanguageHelper.kt | 64 - .../java/com/mifos/utils/MapDeserializer.kt | 54 - .../java/com/mifos/utils/MifosDatePicker.kt | 44 - .../com/mifos/utils/MifosResponseHandler.kt | 20 +- .../src/main/java/com/mifos/utils/Network.kt | 44 - .../com/mifos/utils/NetworkUtilsWrapper.kt | 26 - .../main/java/com/mifos/utils/PrefManager.kt | 57 - .../com/mifos/utils/SafeUIBlockingUtility.kt | 59 - .../utils/SimpleCountingIdlingResource.kt | 89 -- .../src/main/java/com/mifos/utils/Tags.kt | 12 - .../main/java/com/mifos/utils/ThemeHelper.kt | 11 +- .../src/main/java/com/mifos/utils/Utils.kt | 126 -- .../java/com/mifos/utils/ValidationUtil.kt | 97 -- .../src/main/res/anim/fab_close.xml | 17 - .../src/main/res/anim/fab_open.xml | 18 - .../src/main/res/anim/rotate_backward.xml | 10 - .../src/main/res/anim/rotate_forward.xml | 10 - .../baseline_calendar_today_black_24.png | Bin 179 -> 0 bytes .../baseline_expand_more_black_18dp.png | Bin 172 -> 0 bytes ...baseline_keyboard_arrow_right_black_36.png | Bin 182 -> 0 bytes .../ic_content_import_export.png | Bin 789 -> 0 bytes .../ic_content_import_export.png | Bin 546 -> 0 bytes .../res/drawable-xhdpi/ic_backspace_48px.xml | 4 - .../ic_content_import_export.png | Bin 976 -> 0 bytes .../res/drawable-xhdpi/ic_visibility_48px.xml | 5 - .../ic_content_import_export.png | Bin 1459 -> 0 bytes .../src/main/res/drawable/background.xml | 10 - .../res/drawable/badge_rounded_corner.xml | 5 - .../drawable/baseline_arrow_drop_down_24.xml | 5 - .../drawable/button_bg_rounded_corners.xml | 9 - .../main/res/drawable/card_blueborder.9.png | Bin 340 -> 0 bytes .../main/res/drawable/circular_background.xml | 6 - .../main/res/drawable/circular_bg_gray.xml | 12 - .../main/res/drawable/gradient_repayment.xml | 18 - .../main/res/drawable/gradient_spinner.xml | 18 - .../drawable/ic_account_circle_black_24dp.xml | 9 - .../main/res/drawable/ic_add_white_24dp.xml | 9 - .../res/drawable/ic_assignment_black_24dp.xml | 9 - .../ic_assignment_turned_in_black_24dp.xml | 9 - .../main/res/drawable/ic_baseline_edit_24.xml | 10 - .../src/main/res/drawable/ic_centers_24dp.xml | 9 - .../res/drawable/ic_check_box_black_24dp.xml | 9 - .../main/res/drawable/ic_check_green_24dp.xml | 5 - .../res/drawable/ic_clear_yellow_24dp.xml | 5 - .../drawable/ic_cloud_upload_black_24dp.xml | 5 - .../src/main/res/drawable/ic_dark_mode.xml | 10 - .../res/drawable/ic_dashboard_black_24dp.xml | 9 - .../main/res/drawable/ic_delete_red_24dp.xml | 5 - .../main/res/drawable/ic_done_all_24dp.xml | 5 - .../res/drawable/ic_done_all_black_24dp.xml | 9 - .../main/res/drawable/ic_error_black_24dp.xml | 9 - .../main/res/drawable/ic_event_black_24dp.xml | 9 - .../drawable/ic_filter_list_black_24dp.xml | 9 - .../res/drawable/ic_folder_black_24dp.xml | 9 - .../ic_indeterminate_check_box_blue_24dp.xml | 5 - .../src/main/res/drawable/ic_lang.xml | 10 - .../src/main/res/drawable/ic_logout.xml | 12 - .../res/drawable/ic_mail_outline_24dp.xml | 5 - .../res/drawable/ic_more_vert_black_24dp.xml | 9 - .../drawable/ic_my_location_white_24dp.xml | 9 - .../src/main/res/drawable/ic_passcode.xml | 10 - .../res/drawable/ic_person_black_24dp.xml | 9 - .../src/main/res/drawable/ic_report_item.xml | 9 - .../src/main/res/drawable/ic_restore_24dp.xml | 5 - .../res/drawable/ic_search_black_24dp.xml | 9 - .../src/main/res/drawable/ic_settings.xml | 9 - .../src/main/res/drawable/ic_source_code.xml | 13 - .../main/res/drawable/ic_stop_white_24dp.xml | 9 - .../drawable/ic_supervisor_account_24dp.xml | 5 - .../src/main/res/drawable/ic_website.xml | 5 - .../res/drawable/login_button_rounded.xml | 11 - .../main/res/drawable/round_outline_bg.xml | 8 - .../main/res/drawable/rounded_background.xml | 12 - .../main/res/drawable/table_row_round_bg.xml | 7 - .../src/main/res/drawable/triangle_bottom.xml | 11 - .../activity_global_container_layout.xml | 14 - .../src/main/res/layout/activity_home.xml | 73 - .../res/layout/activity_pinpoint_location.xml | 55 - .../res/layout/activity_survey_question.xml | 43 - .../res/layout/activity_toolbar_container.xml | 23 - .../layout/dash_board_row_progress_bar.xml | 51 - ...dialog_fragment_add_entry_to_datatable.xml | 32 - .../layout/dialog_fragment_approve_loan.xml | 94 -- .../res/layout/dialog_fragment_charge.xml | 133 -- .../layout/dialog_fragment_disburse_loan.xml | 73 - .../res/layout/dialog_fragment_identifier.xml | 136 -- .../src/main/res/layout/fragment_add_loan.xml | 387 ----- .../main/res/layout/fragment_charge_list.xml | 49 - .../src/main/res/layout/fragment_groups.xml | 56 - .../layout/fragment_individual_recycler.xml | 26 - .../src/main/res/layout/fragment_sign.xml | 29 - .../main/res/layout/fragment_survey_last.xml | 41 - .../main/res/layout/fragment_survey_list.xml | 54 - .../res/layout/fragment_survey_question.xml | 54 - .../main/res/layout/fragment_syncpayload.xml | 50 - .../res/layout/item_pinpoint_location.xml | 44 - .../src/main/res/layout/row_account_item.xml | 38 - .../src/main/res/layout/row_center_item.xml | 49 - .../main/res/layout/row_center_list_item.xml | 150 -- .../src/main/res/layout/row_charge_name.xml | 100 -- .../main/res/layout/row_identifier_list.xml | 134 -- .../main/res/layout/row_loan_list_item.xml | 246 ---- .../layout/row_loan_repayment_schedule.xml | 52 - .../res/layout/row_loan_transaction_item.xml | 60 - .../row_loan_transaction_item_detail.xml | 197 --- .../main/res/layout/row_surveys_list_item.xml | 45 - .../src/main/res/layout/row_sync_payload.xml | 53 - .../main/res/layout/simple_spinner_item.xml | 6 - .../src/main/res/layout/sync_progress.xml | 15 - .../src/main/res/layout/toolbar.xml | 17 - .../transaction_detail_dialog_layout.xml | 115 -- .../layout/view_account_accordion_section.xml | 60 - .../view_account_accordion_section_loan.xml | 51 - ...ew_account_accordion_section_recurring.xml | 51 - .../res/layout/view_nav_drawer_header.xml | 50 - .../main/res/menu/bottom_navigation_menu.xml | 33 - .../src/main/res/menu/menu_add.xml | 19 - .../src/main/res/menu/menu_login.xml | 7 - .../src/main/res/menu/menu_main.xml | 10 - .../src/main/res/menu/menu_nav_drawer.xml | 43 - .../src/main/res/menu/menu_sync.xml | 16 - .../src/main/res/menu/sign_bottom_navbar.xml | 16 - .../main/res/navigation/home_nav_graph.xml | 30 - .../src/main/res/navigation/nav_graph.xml | 18 - .../src/main/res/values-ca/strings.xml | 9 + .../src/main/res/values-en/strings.xml | 10 +- .../src/main/res/values-es/strings.xml | 9 + .../src/main/res/values-fr/strings.xml | 1243 +++++++++-------- .../src/main/res/values-hi/strings.xml | 9 + .../src/main/res/values-kn/strings.xml | 9 + .../src/main/res/values-large/refs.xml | 14 - .../src/main/res/values-night/colors.xml | 13 +- .../src/main/res/values-small/dimens.xml | 13 - .../src/main/res/values-sw/strings.xml | 13 +- .../src/main/res/values-sw600dp/refs.xml | 14 - .../src/main/res/values-v19/styles.xml | 7 - .../src/main/res/values-w820dp/dimens.xml | 11 - .../src/main/res/values-zh/strings.xml | 13 +- mifosng-android/src/main/res/values/attr.xml | 23 - .../src/main/res/values/colors.xml | 13 +- .../src/main/res/values/dimens.xml | 43 - mifosng-android/src/main/res/values/ids.xml | 9 - .../src/main/res/values/strings.xml | 13 +- .../src/main/res/values/styles.xml | 131 -- .../src/main/res/values/styles_button.xml | 34 - .../src/main/res/values/styles_custom.xml | 14 - .../src/main/res/values/styles_edit.xml | 59 - .../src/main/res/values/styles_frame.xml | 20 - .../src/main/res/values/styles_image.xml | 21 - .../src/main/res/values/styles_linear.xml | 29 - .../src/main/res/values/styles_progress.xml | 15 - .../src/main/res/values/styles_relative.xml | 21 - .../src/main/res/values/styles_scroll.xml | 21 - .../src/main/res/values/styles_table.xml | 32 - .../src/main/res/values/styles_text.xml | 135 -- .../src/main/res/values/styles_text_input.xml | 30 - .../src/main/res/values/styles_toolbar.xml | 27 - .../src/main/res/values/themes.xml | 13 + .../src/main/res/xml/path_provider.xml | 4 - .../src/main/res/xml/preferences.xml | 40 - .../release/res/values/google_maps_api.xml | 10 + .../mifosxdroid/tests/DateHelpersTest.kt | 56 - .../util/RxSchedulersOverrideRule.kt | 65 - 375 files changed, 2780 insertions(+), 13838 deletions(-) create mode 100644 mifosng-android/dependencies/demoDebugCompileClasspath.txt create mode 100644 mifosng-android/dependencies/demoReleaseCompileClasspath.txt create mode 100644 mifosng-android/dependencies/prodDebugCompileClasspath.txt create mode 100644 mifosng-android/dependencies/prodReleaseCompileClasspath.txt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/CenterListFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/ClientChargesTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/ClientDetailsFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/ClientListFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/ClientSearchFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/CreateNewCenterFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/CreateNewClientFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/CreateNewGroupFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/DashboardFragmentActivityTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/LoginActivityTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/SavingsAccountSummaryFragmentTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/SurveyQuestionViewPagerActivityTest.kt delete mode 100644 mifosng-android/src/instrumentTest/java/com/mifos/mifosxdroid/tests/action/NavigationViewActions.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/home/HomeActivity.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/login/LoginActivity.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/setting/SettingsActivity.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/setting/SettingsFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/ChargeNameListAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/FragmentAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/IdentifierListAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanAccountsListAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanListAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanRepaymentScheduleAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanTransactionAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/PinpointClientAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyListAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyPagerAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/BaseActivityCallback.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerOnScrollListener.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerViewScrollListener.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MaterialDialog.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseActivity.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosProgressBarHandler.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableDialogFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/SelectableAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/adapters/MifosBaseListAdapter.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/core/util/Toaster.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/chargedialog/OnChargeCreateListener.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/checkertaskfilterdialog/CheckerTaskFilterDialogFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/syncsurveysdialog/SyncSurveysDialogFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/ApplicationModule.kt delete mode 100755 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/CentersActivity.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepository.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepositoryImp.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListUiState.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListViewModel.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/checkerinbox/CheckerInboxPendingTasksActivity.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/loanaccount/LoanAccountFragment.kt delete mode 100755 mifosng-android/src/main/java/com/mifos/mifosxdroid/online/surveysubmit/SurveySubmitFragment.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/uihelpers/MFDatePicker.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CircularImageView.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CustomSpinner.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/Font.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/FontTextView.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/SignatureView.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/CustomScrollView.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/ScrollChangeListener.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/AndroidVersionUtil.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/CheckSelfPermissionAndRequest.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/Constants.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/DateHelper.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/EspressoIdlingResource.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/FileUtils.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/FragmentConstants.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/ImageLoaderUtils.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/ItemOffsetDecoration.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/JsonDateSerializer.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/LanguageHelper.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/MapDeserializer.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/MifosDatePicker.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/Network.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/NetworkUtilsWrapper.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/PrefManager.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/SafeUIBlockingUtility.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/SimpleCountingIdlingResource.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/Tags.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/Utils.kt delete mode 100644 mifosng-android/src/main/java/com/mifos/utils/ValidationUtil.kt delete mode 100644 mifosng-android/src/main/res/anim/fab_close.xml delete mode 100644 mifosng-android/src/main/res/anim/fab_open.xml delete mode 100644 mifosng-android/src/main/res/anim/rotate_backward.xml delete mode 100644 mifosng-android/src/main/res/anim/rotate_forward.xml delete mode 100755 mifosng-android/src/main/res/drawable-hdpi/baseline_calendar_today_black_24.png delete mode 100755 mifosng-android/src/main/res/drawable-hdpi/baseline_expand_more_black_18dp.png delete mode 100755 mifosng-android/src/main/res/drawable-hdpi/baseline_keyboard_arrow_right_black_36.png delete mode 100755 mifosng-android/src/main/res/drawable-hdpi/ic_content_import_export.png delete mode 100755 mifosng-android/src/main/res/drawable-mdpi/ic_content_import_export.png delete mode 100644 mifosng-android/src/main/res/drawable-xhdpi/ic_backspace_48px.xml delete mode 100755 mifosng-android/src/main/res/drawable-xhdpi/ic_content_import_export.png delete mode 100644 mifosng-android/src/main/res/drawable-xhdpi/ic_visibility_48px.xml delete mode 100755 mifosng-android/src/main/res/drawable-xxhdpi/ic_content_import_export.png delete mode 100644 mifosng-android/src/main/res/drawable/background.xml delete mode 100644 mifosng-android/src/main/res/drawable/badge_rounded_corner.xml delete mode 100644 mifosng-android/src/main/res/drawable/baseline_arrow_drop_down_24.xml delete mode 100644 mifosng-android/src/main/res/drawable/button_bg_rounded_corners.xml delete mode 100755 mifosng-android/src/main/res/drawable/card_blueborder.9.png delete mode 100644 mifosng-android/src/main/res/drawable/circular_background.xml delete mode 100644 mifosng-android/src/main/res/drawable/circular_bg_gray.xml delete mode 100644 mifosng-android/src/main/res/drawable/gradient_repayment.xml delete mode 100644 mifosng-android/src/main/res/drawable/gradient_spinner.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_account_circle_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_add_white_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_assignment_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_baseline_edit_24.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_centers_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_check_box_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_check_green_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_clear_yellow_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_cloud_upload_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_dark_mode.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_dashboard_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_delete_red_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_done_all_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_done_all_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_error_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_event_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_filter_list_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_folder_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_indeterminate_check_box_blue_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_lang.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_logout.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_mail_outline_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_more_vert_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_my_location_white_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_passcode.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_person_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_report_item.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_restore_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_search_black_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_settings.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_source_code.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_stop_white_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_supervisor_account_24dp.xml delete mode 100644 mifosng-android/src/main/res/drawable/ic_website.xml delete mode 100644 mifosng-android/src/main/res/drawable/login_button_rounded.xml delete mode 100644 mifosng-android/src/main/res/drawable/round_outline_bg.xml delete mode 100755 mifosng-android/src/main/res/drawable/rounded_background.xml delete mode 100644 mifosng-android/src/main/res/drawable/table_row_round_bg.xml delete mode 100644 mifosng-android/src/main/res/drawable/triangle_bottom.xml delete mode 100755 mifosng-android/src/main/res/layout/activity_global_container_layout.xml delete mode 100644 mifosng-android/src/main/res/layout/activity_home.xml delete mode 100644 mifosng-android/src/main/res/layout/activity_pinpoint_location.xml delete mode 100755 mifosng-android/src/main/res/layout/activity_survey_question.xml delete mode 100755 mifosng-android/src/main/res/layout/activity_toolbar_container.xml delete mode 100755 mifosng-android/src/main/res/layout/dash_board_row_progress_bar.xml delete mode 100755 mifosng-android/src/main/res/layout/dialog_fragment_add_entry_to_datatable.xml delete mode 100644 mifosng-android/src/main/res/layout/dialog_fragment_approve_loan.xml delete mode 100755 mifosng-android/src/main/res/layout/dialog_fragment_charge.xml delete mode 100644 mifosng-android/src/main/res/layout/dialog_fragment_disburse_loan.xml delete mode 100644 mifosng-android/src/main/res/layout/dialog_fragment_identifier.xml delete mode 100644 mifosng-android/src/main/res/layout/fragment_add_loan.xml delete mode 100755 mifosng-android/src/main/res/layout/fragment_charge_list.xml delete mode 100644 mifosng-android/src/main/res/layout/fragment_groups.xml delete mode 100644 mifosng-android/src/main/res/layout/fragment_individual_recycler.xml delete mode 100644 mifosng-android/src/main/res/layout/fragment_sign.xml delete mode 100755 mifosng-android/src/main/res/layout/fragment_survey_last.xml delete mode 100755 mifosng-android/src/main/res/layout/fragment_survey_list.xml delete mode 100755 mifosng-android/src/main/res/layout/fragment_survey_question.xml delete mode 100644 mifosng-android/src/main/res/layout/fragment_syncpayload.xml delete mode 100644 mifosng-android/src/main/res/layout/item_pinpoint_location.xml delete mode 100755 mifosng-android/src/main/res/layout/row_account_item.xml delete mode 100755 mifosng-android/src/main/res/layout/row_center_item.xml delete mode 100755 mifosng-android/src/main/res/layout/row_center_list_item.xml delete mode 100755 mifosng-android/src/main/res/layout/row_charge_name.xml delete mode 100755 mifosng-android/src/main/res/layout/row_identifier_list.xml delete mode 100755 mifosng-android/src/main/res/layout/row_loan_list_item.xml delete mode 100755 mifosng-android/src/main/res/layout/row_loan_repayment_schedule.xml delete mode 100755 mifosng-android/src/main/res/layout/row_loan_transaction_item.xml delete mode 100755 mifosng-android/src/main/res/layout/row_loan_transaction_item_detail.xml delete mode 100755 mifosng-android/src/main/res/layout/row_surveys_list_item.xml delete mode 100644 mifosng-android/src/main/res/layout/row_sync_payload.xml delete mode 100644 mifosng-android/src/main/res/layout/simple_spinner_item.xml delete mode 100755 mifosng-android/src/main/res/layout/sync_progress.xml delete mode 100755 mifosng-android/src/main/res/layout/toolbar.xml delete mode 100644 mifosng-android/src/main/res/layout/transaction_detail_dialog_layout.xml delete mode 100755 mifosng-android/src/main/res/layout/view_account_accordion_section.xml delete mode 100755 mifosng-android/src/main/res/layout/view_account_accordion_section_loan.xml delete mode 100755 mifosng-android/src/main/res/layout/view_account_accordion_section_recurring.xml delete mode 100644 mifosng-android/src/main/res/layout/view_nav_drawer_header.xml delete mode 100644 mifosng-android/src/main/res/menu/bottom_navigation_menu.xml delete mode 100644 mifosng-android/src/main/res/menu/menu_add.xml delete mode 100644 mifosng-android/src/main/res/menu/menu_login.xml delete mode 100755 mifosng-android/src/main/res/menu/menu_main.xml delete mode 100644 mifosng-android/src/main/res/menu/menu_nav_drawer.xml delete mode 100755 mifosng-android/src/main/res/menu/menu_sync.xml delete mode 100644 mifosng-android/src/main/res/menu/sign_bottom_navbar.xml delete mode 100644 mifosng-android/src/main/res/navigation/home_nav_graph.xml delete mode 100644 mifosng-android/src/main/res/navigation/nav_graph.xml delete mode 100755 mifosng-android/src/main/res/values-large/refs.xml delete mode 100755 mifosng-android/src/main/res/values-small/dimens.xml delete mode 100755 mifosng-android/src/main/res/values-sw600dp/refs.xml delete mode 100644 mifosng-android/src/main/res/values-v19/styles.xml delete mode 100755 mifosng-android/src/main/res/values-w820dp/dimens.xml delete mode 100755 mifosng-android/src/main/res/values/attr.xml delete mode 100755 mifosng-android/src/main/res/values/dimens.xml delete mode 100755 mifosng-android/src/main/res/values/ids.xml delete mode 100755 mifosng-android/src/main/res/values/styles.xml delete mode 100755 mifosng-android/src/main/res/values/styles_button.xml delete mode 100755 mifosng-android/src/main/res/values/styles_custom.xml delete mode 100755 mifosng-android/src/main/res/values/styles_edit.xml delete mode 100644 mifosng-android/src/main/res/values/styles_frame.xml delete mode 100755 mifosng-android/src/main/res/values/styles_image.xml delete mode 100755 mifosng-android/src/main/res/values/styles_linear.xml delete mode 100755 mifosng-android/src/main/res/values/styles_progress.xml delete mode 100755 mifosng-android/src/main/res/values/styles_relative.xml delete mode 100755 mifosng-android/src/main/res/values/styles_scroll.xml delete mode 100755 mifosng-android/src/main/res/values/styles_table.xml delete mode 100755 mifosng-android/src/main/res/values/styles_text.xml delete mode 100755 mifosng-android/src/main/res/values/styles_text_input.xml delete mode 100755 mifosng-android/src/main/res/values/styles_toolbar.xml create mode 100755 mifosng-android/src/main/res/values/themes.xml delete mode 100644 mifosng-android/src/main/res/xml/path_provider.xml delete mode 100644 mifosng-android/src/main/res/xml/preferences.xml delete mode 100644 mifosng-android/src/test/java/com/mifos/mifosxdroid/tests/DateHelpersTest.kt delete mode 100644 mifosng-android/src/test/java/com/mifos/mifosxdroid/util/RxSchedulersOverrideRule.kt diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 66bb9e95dd2..e73d0b1799c 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -23,7 +23,7 @@ jobs: # Upload APK - name: Upload APK - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v4 with: # Artifact name name: android-client-app diff --git a/core/data/src/main/java/com/mifos/core/data/di/DataModule.kt b/core/data/src/main/java/com/mifos/core/data/di/DataModule.kt index f2f155f3437..a8b95ee8562 100644 --- a/core/data/src/main/java/com/mifos/core/data/di/DataModule.kt +++ b/core/data/src/main/java/com/mifos/core/data/di/DataModule.kt @@ -49,6 +49,7 @@ import com.mifos.core.data.repository.SearchRepository import com.mifos.core.data.repository.SignatureRepository import com.mifos.core.data.repository.SurveyListRepository import com.mifos.core.data.repository.SurveySubmitRepository +import com.mifos.core.data.repositoryImp.ActivateRepositoryImp import com.mifos.core.data.repositoryImp.CenterDetailsRepositoryImp import com.mifos.core.data.repositoryImp.CenterListRepositoryImp import com.mifos.core.data.repositoryImp.ChargeDialogRepositoryImp @@ -56,8 +57,10 @@ import com.mifos.core.data.repositoryImp.CheckerInboxRepositoryImp import com.mifos.core.data.repositoryImp.CheckerInboxTasksRepositoryImp import com.mifos.core.data.repositoryImp.ClientChargeRepositoryImp import com.mifos.core.data.repositoryImp.ClientIdentifierDialogRepositoryImp +import com.mifos.core.data.repositoryImp.ClientIdentifiersRepositoryImp import com.mifos.core.data.repositoryImp.CreateNewCenterRepositoryImp import com.mifos.core.data.repositoryImp.CreateNewGroupRepositoryImp +import com.mifos.core.data.repositoryImp.DataTableDataRepositoryImp import com.mifos.core.data.repositoryImp.DataTableListRepositoryImp import com.mifos.core.data.repositoryImp.DataTableRepositoryImp import com.mifos.core.data.repositoryImp.DataTableRowDialogRepositoryImp @@ -86,9 +89,6 @@ import com.mifos.core.data.repositoryImp.SearchRepositoryImp import com.mifos.core.data.repositoryImp.SignatureRepositoryImp import com.mifos.core.data.repositoryImp.SurveyListRepositoryImp import com.mifos.core.data.repositoryImp.SurveySubmitRepositoryImp -import com.mifos.core.data.repository_imp.ActivateRepositoryImp -import com.mifos.core.data.repository_imp.ClientIdentifiersRepositoryImp -import com.mifos.core.data.repository_imp.DataTableDataRepositoryImp import dagger.Binds import dagger.Module import dagger.hilt.InstallIn diff --git a/core/data/src/main/java/com/mifos/core/data/pagingSource/CenterListPagingSource.kt b/core/data/src/main/java/com/mifos/core/data/pagingSource/CenterListPagingSource.kt index 9160114e557..8ff2a544489 100644 --- a/core/data/src/main/java/com/mifos/core/data/pagingSource/CenterListPagingSource.kt +++ b/core/data/src/main/java/com/mifos/core/data/pagingSource/CenterListPagingSource.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.pagingSource import androidx.paging.PagingSource @@ -18,7 +27,7 @@ class CenterListPagingSource(private val dataManagerCenter: DataManagerCenter) : override fun getRefreshKey(state: PagingState): Int? { return state.anchorPosition?.let { position -> state.closestPageToPosition(position)?.prevKey?.plus(10) ?: state.closestPageToPosition( - position + position, )?.nextKey?.minus(10) } } @@ -34,7 +43,7 @@ class CenterListPagingSource(private val dataManagerCenter: DataManagerCenter) : LoadResult.Page( data = centerListWithSync, prevKey = if (position <= 0) null else position - 10, - nextKey = if (position >= totalCenters) null else position + 10 + nextKey = if (position >= totalCenters) null else position + 10, ) } catch (e: Exception) { LoadResult.Error(e) @@ -48,7 +57,6 @@ class CenterListPagingSource(private val dataManagerCenter: DataManagerCenter) : private suspend fun getCenterDbList(): List
= suspendCoroutine { continuation -> try { - dataManagerCenter.allDatabaseCenters .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) @@ -69,10 +77,9 @@ class CenterListPagingSource(private val dataManagerCenter: DataManagerCenter) : } } - private fun getCenterListWithSync( centerList: List
, - centerDbList: List
+ centerDbList: List
, ): List
{ if (centerDbList.isNotEmpty()) { centerList.forEach { center -> @@ -85,4 +92,4 @@ class CenterListPagingSource(private val dataManagerCenter: DataManagerCenter) : } return centerList } -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/pagingSource/ClientListPagingSource.kt b/core/data/src/main/java/com/mifos/core/data/pagingSource/ClientListPagingSource.kt index 896e609b77e..6f8243569d4 100644 --- a/core/data/src/main/java/com/mifos/core/data/pagingSource/ClientListPagingSource.kt +++ b/core/data/src/main/java/com/mifos/core/data/pagingSource/ClientListPagingSource.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.pagingSource import androidx.paging.PagingSource @@ -17,13 +26,13 @@ import kotlin.coroutines.suspendCoroutine */ class ClientListPagingSource( - private val dataManagerClient: DataManagerClient + private val dataManagerClient: DataManagerClient, ) : PagingSource() { override fun getRefreshKey(state: PagingState): Int? { return state.anchorPosition?.let { position -> state.closestPageToPosition(position)?.prevKey?.plus(10) ?: state.closestPageToPosition( - position + position, )?.nextKey?.minus(10) } } @@ -39,7 +48,7 @@ class ClientListPagingSource( LoadResult.Page( data = clientListWithSync, prevKey = if (position <= 0) null else position - 10, - nextKey = if (position >= totalClients) null else position + 10 + nextKey = if (position >= totalClients) null else position + 10, ) } catch (e: Exception) { LoadResult.Error(e) @@ -73,7 +82,7 @@ class ClientListPagingSource( private fun getClientListWithSync( clientList: List, - clientDbList: List + clientDbList: List, ): List { if (clientDbList.isNotEmpty()) { clientList.forEach { client -> @@ -86,4 +95,4 @@ class ClientListPagingSource( } return clientList } -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repository/ActivateRepository.kt b/core/data/src/main/java/com/mifos/core/data/repository/ActivateRepository.kt index e423e4a2529..8a6c49c3a6b 100644 --- a/core/data/src/main/java/com/mifos/core/data/repository/ActivateRepository.kt +++ b/core/data/src/main/java/com/mifos/core/data/repository/ActivateRepository.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.repository import com.mifos.core.network.GenericResponse @@ -14,17 +23,16 @@ interface ActivateRepository { suspend fun activateClient( clientId: Int, - clientActivate: ActivatePayload? + clientActivate: ActivatePayload?, ): PostClientsClientIdResponse suspend fun activateCenter( centerId: Int, - activatePayload: ActivatePayload? + activatePayload: ActivatePayload?, ): PostCentersCenterIdResponse fun activateGroup( groupId: Int, - activatePayload: ActivatePayload? + activatePayload: ActivatePayload?, ): Observable - -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repository/ClientDetailsRepository.kt b/core/data/src/main/java/com/mifos/core/data/repository/ClientDetailsRepository.kt index 780b99c0f4a..7dd9862b774 100644 --- a/core/data/src/main/java/com/mifos/core/data/repository/ClientDetailsRepository.kt +++ b/core/data/src/main/java/com/mifos/core/data/repository/ClientDetailsRepository.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.repository import com.mifos.core.objects.accounts.ClientAccounts @@ -18,5 +27,4 @@ interface ClientDetailsRepository { suspend fun getClientAccounts(clientId: Int): ClientAccounts suspend fun getClient(clientId: Int): Client - -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repository/ClientIdentifiersRepository.kt b/core/data/src/main/java/com/mifos/core/data/repository/ClientIdentifiersRepository.kt index d7d84de7c58..108181f690b 100644 --- a/core/data/src/main/java/com/mifos/core/data/repository/ClientIdentifiersRepository.kt +++ b/core/data/src/main/java/com/mifos/core/data/repository/ClientIdentifiersRepository.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.repository import com.mifos.core.objects.noncore.Identifier @@ -12,6 +21,6 @@ interface ClientIdentifiersRepository { suspend fun deleteClientIdentifier( clientId: Int, - identifierId: Int + identifierId: Int, ): DeleteClientsClientIdIdentifiersIdentifierIdResponse -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repository/DataTableDataRepository.kt b/core/data/src/main/java/com/mifos/core/data/repository/DataTableDataRepository.kt index f798fd2d0db..bd7293c770f 100644 --- a/core/data/src/main/java/com/mifos/core/data/repository/DataTableDataRepository.kt +++ b/core/data/src/main/java/com/mifos/core/data/repository/DataTableDataRepository.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.repository import com.google.gson.JsonArray @@ -13,7 +22,6 @@ interface DataTableDataRepository { suspend fun deleteDataTableEntry( table: String, entity: Int, - rowId: Int + rowId: Int, ): DeleteDataTablesDatatableAppTableIdDatatableIdResponse - -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repository/DataTableRepository.kt b/core/data/src/main/java/com/mifos/core/data/repository/DataTableRepository.kt index 8b61e82da6b..6f1255b43aa 100644 --- a/core/data/src/main/java/com/mifos/core/data/repository/DataTableRepository.kt +++ b/core/data/src/main/java/com/mifos/core/data/repository/DataTableRepository.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.repository import com.mifos.core.objects.noncore.DataTable @@ -8,5 +17,4 @@ import com.mifos.core.objects.noncore.DataTable interface DataTableRepository { suspend fun getDataTable(tableName: String?): List - -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repository/LoginRepository.kt b/core/data/src/main/java/com/mifos/core/data/repository/LoginRepository.kt index 1568efb6c78..1a4f29e9856 100644 --- a/core/data/src/main/java/com/mifos/core/data/repository/LoginRepository.kt +++ b/core/data/src/main/java/com/mifos/core/data/repository/LoginRepository.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.data.repository import org.openapitools.client.models.PostAuthenticationResponse @@ -9,5 +18,4 @@ import org.openapitools.client.models.PostAuthenticationResponse interface LoginRepository { suspend fun login(username: String, password: String): PostAuthenticationResponse - -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repositoryImp/ActivateRepositoryImp.kt b/core/data/src/main/java/com/mifos/core/data/repositoryImp/ActivateRepositoryImp.kt index 262d3561def..c57e5f4e762 100644 --- a/core/data/src/main/java/com/mifos/core/data/repositoryImp/ActivateRepositoryImp.kt +++ b/core/data/src/main/java/com/mifos/core/data/repositoryImp/ActivateRepositoryImp.kt @@ -1,4 +1,13 @@ -package com.mifos.core.data.repository_imp +/* + * 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/android-client/blob/master/LICENSE.md + */ +package com.mifos.core.data.repositoryImp import com.mifos.core.data.repository.ActivateRepository import com.mifos.core.network.GenericResponse @@ -17,27 +26,27 @@ import javax.inject.Inject class ActivateRepositoryImp @Inject constructor( private val dataManagerClient: DataManagerClient, private val dataManagerCenter: DataManagerCenter, - private val dataManagerGroups: DataManagerGroups + private val dataManagerGroups: DataManagerGroups, ) : ActivateRepository { override suspend fun activateClient( clientId: Int, - clientActivate: ActivatePayload? + clientActivate: ActivatePayload?, ): PostClientsClientIdResponse { return dataManagerClient.activateClient(clientId, clientActivate) } override suspend fun activateCenter( centerId: Int, - activatePayload: ActivatePayload? + activatePayload: ActivatePayload?, ): PostCentersCenterIdResponse { return dataManagerCenter.activateCenter(centerId, activatePayload) } override fun activateGroup( groupId: Int, - activatePayload: ActivatePayload? + activatePayload: ActivatePayload?, ): Observable { return dataManagerGroups.activateGroup(groupId, activatePayload) } -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repositoryImp/ClientIdentifiersRepositoryImp.kt b/core/data/src/main/java/com/mifos/core/data/repositoryImp/ClientIdentifiersRepositoryImp.kt index a1443f235d7..e8b1ba95e61 100644 --- a/core/data/src/main/java/com/mifos/core/data/repositoryImp/ClientIdentifiersRepositoryImp.kt +++ b/core/data/src/main/java/com/mifos/core/data/repositoryImp/ClientIdentifiersRepositoryImp.kt @@ -1,4 +1,13 @@ -package com.mifos.core.data.repository_imp +/* + * 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/android-client/blob/master/LICENSE.md + */ +package com.mifos.core.data.repositoryImp import com.mifos.core.data.repository.ClientIdentifiersRepository import com.mifos.core.network.datamanager.DataManagerClient @@ -18,9 +27,8 @@ class ClientIdentifiersRepositoryImp @Inject constructor(private val dataManager override suspend fun deleteClientIdentifier( clientId: Int, - identifierId: Int + identifierId: Int, ): DeleteClientsClientIdIdentifiersIdentifierIdResponse { return dataManagerClient.deleteClientIdentifier(clientId, identifierId) } - -} \ No newline at end of file +} diff --git a/core/data/src/main/java/com/mifos/core/data/repositoryImp/DataTableDataRepositoryImp.kt b/core/data/src/main/java/com/mifos/core/data/repositoryImp/DataTableDataRepositoryImp.kt index a1f5fc9a446..6a1751b8056 100644 --- a/core/data/src/main/java/com/mifos/core/data/repositoryImp/DataTableDataRepositoryImp.kt +++ b/core/data/src/main/java/com/mifos/core/data/repositoryImp/DataTableDataRepositoryImp.kt @@ -1,4 +1,13 @@ -package com.mifos.core.data.repository_imp +/* + * 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/android-client/blob/master/LICENSE.md + */ +package com.mifos.core.data.repositoryImp import com.google.gson.JsonArray import com.mifos.core.data.repository.DataTableDataRepository @@ -19,9 +28,8 @@ class DataTableDataRepositoryImp @Inject constructor(private val dataManagerData override suspend fun deleteDataTableEntry( table: String, entity: Int, - rowId: Int + rowId: Int, ): DeleteDataTablesDatatableAppTableIdDatatableIdResponse { return dataManagerDataTable.deleteDataTableEntry(table, entity, rowId) } - -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateCenterUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateCenterUseCase.kt index bd566997dd9..73c2a1e3854 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateCenterUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateCenterUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -12,7 +21,7 @@ class ActivateCenterUseCase @Inject constructor(private val activateRepository: suspend operator fun invoke( centerId: Int, - centerPayload: ActivatePayload + centerPayload: ActivatePayload, ): Flow> = flow { try { emit(Resource.Loading()) @@ -22,4 +31,4 @@ class ActivateCenterUseCase @Inject constructor(private val activateRepository: emit(Resource.Error(exception.message.toString())) } } -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateClientUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateClientUseCase.kt index a42844c6562..f65d55f5cbf 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateClientUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/ActivateClientUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -12,7 +21,7 @@ class ActivateClientUseCase @Inject constructor(private val activateRepository: suspend operator fun invoke( clientId: Int, - clientPayload: ActivatePayload + clientPayload: ActivatePayload, ): Flow> = flow { try { emit(Resource.Loading()) @@ -22,4 +31,4 @@ class ActivateClientUseCase @Inject constructor(private val activateRepository: emit(Resource.Error(exception.message.toString())) } } -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteDataTableEntryUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteDataTableEntryUseCase.kt index 21b38206b74..75d1536cc2b 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteDataTableEntryUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteDataTableEntryUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -12,7 +21,7 @@ class DeleteDataTableEntryUseCase @Inject constructor(private val repository: Da suspend operator fun invoke( table: String, entity: Int, - rowId: Int + rowId: Int, ): Flow> = flow { try { emit(Resource.Loading()) @@ -22,5 +31,4 @@ class DeleteDataTableEntryUseCase @Inject constructor(private val repository: Da emit(Resource.Error(exception.message.toString())) } } - -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteIdentifierUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteIdentifierUseCase.kt index f8b31ad02c4..dfd134051d7 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteIdentifierUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/DeleteIdentifierUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -11,7 +20,7 @@ class DeleteIdentifierUseCase @Inject constructor(private val repository: Client suspend operator fun invoke( clientId: Int, - identifierId: Int + identifierId: Int, ): Flow> = flow { try { emit(Resource.Loading()) @@ -22,4 +31,4 @@ class DeleteIdentifierUseCase @Inject constructor(private val repository: Client emit(Resource.Error(exception.message.toString())) } } -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientDetailsUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientDetailsUseCase.kt index a0bf14b2880..a2075259bdc 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientDetailsUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientDetailsUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -36,4 +45,4 @@ class GetClientDetailsUseCase @Inject constructor(private val repository: Client emit(Resource.Error(e.message.toString())) } } -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientIdentifiersUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientIdentifiersUseCase.kt index 49dfcb21db0..c2e2257f3f2 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientIdentifiersUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetClientIdentifiersUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -18,4 +27,4 @@ class GetClientIdentifiersUseCase @Inject constructor(private val clientIdentifi emit(Resource.Error(exception.message.toString())) } } -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetGroupOfficesUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetGroupOfficesUseCase.kt index 9e48f1cd6a2..974f53507fe 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetGroupOfficesUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetGroupOfficesUseCase.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource @@ -22,4 +31,4 @@ class GetGroupOfficesUseCase @Inject constructor(private val repository: CreateN emit(Resource.Error(e.message.toString())) } } -} \ No newline at end of file +} diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetStaffInOfficeForCreateNewClientUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetStaffInOfficeForCreateNewClientUseCase.kt index 0ab3aec137c..39ad8e9886f 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/GetStaffInOfficeForCreateNewClientUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/GetStaffInOfficeForCreateNewClientUseCase.kt @@ -1,4 +1,13 @@ -package com.mifos.core.domain.use_cases +/* + * 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/android-client/blob/master/LICENSE.md + */ +package com.mifos.core.domain.useCases import com.mifos.core.common.utils.Resource import com.mifos.core.data.repository.CreateNewClientRepository diff --git a/core/domain/src/main/java/com/mifos/core/domain/useCases/LoginUseCase.kt b/core/domain/src/main/java/com/mifos/core/domain/useCases/LoginUseCase.kt index 8248470eb48..8d6ea671efd 100644 --- a/core/domain/src/main/java/com/mifos/core/domain/useCases/LoginUseCase.kt +++ b/core/domain/src/main/java/com/mifos/core/domain/useCases/LoginUseCase.kt @@ -33,5 +33,4 @@ class LoginUseCase(private val loginRepository: LoginRepository) { emit(Resource.Error(e.message.toString())) } } - } diff --git a/core/domain/src/test/java/com/mifos/core/domain/GroupListPagingSourceTest.kt b/core/domain/src/test/java/com/mifos/core/domain/GroupListPagingSourceTest.kt index 2a1f8190e97..4a53c43b8f7 100644 --- a/core/domain/src/test/java/com/mifos/core/domain/GroupListPagingSourceTest.kt +++ b/core/domain/src/test/java/com/mifos/core/domain/GroupListPagingSourceTest.kt @@ -13,8 +13,8 @@ import androidx.paging.PagingConfig import androidx.paging.PagingSource import androidx.paging.testing.TestPager import com.mifos.core.objects.group.Group -import com.mifos.core.testing.repository.TestGroupsListRepository import com.mifos.core.testing.repository.ERROR_MESSAGE +import com.mifos.core.testing.repository.TestGroupsListRepository import com.mifos.core.testing.repository.getPagedData import com.mifos.core.testing.repository.sampleGroups import com.mifos.core.testing.util.MainDispatcherRule diff --git a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerCenter.kt b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerCenter.kt index 2f76d0adbb2..6445b05ccb4 100644 --- a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerCenter.kt +++ b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerCenter.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.datamanager import com.mifos.core.data.CenterPayload @@ -29,7 +38,7 @@ class DataManagerCenter @Inject constructor( val mBaseApiManager: BaseApiManager, private val mDatabaseHelperCenter: DatabaseHelperCenter, private val baseApiManager: org.mifos.core.apimanager.BaseApiManager, - private val prefManager: com.mifos.core.datastore.PrefManager + private val prefManager: com.mifos.core.datastore.PrefManager, ) { /** * This Method sending the Request to REST API if UserStatus is 0 and @@ -49,11 +58,11 @@ class DataManagerCenter @Inject constructor( */ suspend fun getCenters(paged: Boolean, offset: Int, limit: Int): Page
{ return baseApiManager.getCenterApi() - .retrieveAll23( - null, null, null, null, null, paged, - offset, limit, null, null, null, null, null - ).let(GetCentersResponseMapper::mapFromEntity) - } + .retrieveAll23( + null, null, null, null, null, paged, + offset, limit, null, null, null, null, null, + ).let(GetCentersResponseMapper::mapFromEntity) + } // suspend fun getCenters(paged: Boolean, offset: Int, limit: Int): Observable> { // return when (prefManager.userStatus) { // false -> baseApiManager.getCenterApi() @@ -95,7 +104,7 @@ class DataManagerCenter @Inject constructor( .concatMap { centerAccounts -> mDatabaseHelperCenter.saveCenterAccounts( centerAccounts, - centerId + centerId, ) } } @@ -159,7 +168,7 @@ class DataManagerCenter @Inject constructor( * This method loading the all CenterPayloads from the Database. * * @return List - */ + */ val allDatabaseCenterPayload: Observable> get() = mDatabaseHelperCenter.readAllCenterPayload() @@ -193,15 +202,16 @@ class DataManagerCenter @Inject constructor( */ suspend fun activateCenter( centerId: Int, - activatePayload: ActivatePayload? + activatePayload: ActivatePayload?, ): PostCentersCenterIdResponse { return baseApiManager.getCenterApi().activate2( centerId.toLong(), PostCentersCenterIdRequest( closureDate = activatePayload?.activationDate, dateFormat = activatePayload?.dateFormat, - locale = activatePayload?.locale - ), "activate" + locale = activatePayload?.locale, + ), + "activate", ) } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerClient.kt b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerClient.kt index b13d5a5f663..ed010833058 100644 --- a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerClient.kt +++ b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerClient.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.datamanager import com.mifos.core.databasehelper.DatabaseHelperClient @@ -38,7 +47,7 @@ class DataManagerClient @Inject constructor( val mBaseApiManager: BaseApiManager, private val mDatabaseHelperClient: DatabaseHelperClient, private val baseApiManager: org.mifos.core.apimanager.BaseApiManager, - private val prefManager: com.mifos.core.datastore.PrefManager + private val prefManager: com.mifos.core.datastore.PrefManager, ) { /** * This Method sending the Request to REST API if UserStatus is 0 and @@ -61,7 +70,7 @@ class DataManagerClient @Inject constructor( null, null, null, null, null, null, null, offset, - limit, null, null, null + limit, null, null, null, ).let(GetClientResponseMapper::mapFromEntity) } // fun getAllClients(offset: Int, limit: Int): Observable> { @@ -100,7 +109,7 @@ class DataManagerClient @Inject constructor( * @return The Client Details */ suspend fun getClient(clientId: Int): Client { - return mBaseApiManager.clientsApi.getClient(clientId) + return mBaseApiManager.clientsApi.getClient(clientId) } // fun getClient(clientId: Int): Observable { // return when (prefManager.userStatus) { @@ -208,12 +217,13 @@ class DataManagerClient @Inject constructor( */ val clientTemplate: Observable get() = when (prefManager.userStatus) { - false -> mBaseApiManager.clientsApi.clientTemplate - .concatMap { clientsTemplate -> - mDatabaseHelperClient.saveClientTemplate( - clientsTemplate - ) - } + false -> + mBaseApiManager.clientsApi.clientTemplate + .concatMap { clientsTemplate -> + mDatabaseHelperClient.saveClientTemplate( + clientsTemplate, + ) + } true -> /** @@ -265,7 +275,7 @@ class DataManagerClient @Inject constructor( */ fun deleteAndUpdatePayloads( id: Int, - clientCreationTIme: Long + clientCreationTIme: Long, ): Observable> { return mDatabaseHelperClient.deleteAndUpdatePayloads(id, clientCreationTIme) } @@ -285,7 +295,7 @@ class DataManagerClient @Inject constructor( * * @param clientId Client Id * @return List - */ + */ suspend fun getClientIdentifiers(clientId: Int): List { return baseApiManager.getClient().clientIdentifiers.retrieveAllClientIdentifiers(clientId.toLong()) .map(IdentifierMapper::mapFromEntity) @@ -299,7 +309,8 @@ class DataManagerClient @Inject constructor( * @return IdentifierCreationResponse */ suspend fun createClientIdentifier( - clientId: Int, identifierPayload: IdentifierPayload + clientId: Int, + identifierPayload: IdentifierPayload, ): IdentifierCreationResponse { return mBaseApiManager.clientsApi.createClientIdentifier(clientId, identifierPayload) } @@ -324,11 +335,11 @@ class DataManagerClient @Inject constructor( */ suspend fun deleteClientIdentifier( clientId: Int, - identifierId: Int + identifierId: Int, ): DeleteClientsClientIdIdentifiersIdentifierIdResponse { return baseApiManager.getClient().clientIdentifiers.deleteClientIdentifier( clientId.toLong(), - identifierId.toLong() + identifierId.toLong(), ) } @@ -352,7 +363,7 @@ class DataManagerClient @Inject constructor( */ suspend fun addClientPinpointLocation( clientId: Int, - address: ClientAddressRequest? + address: ClientAddressRequest?, ): GenericResponse { return mBaseApiManager.clientsApi.addClientPinpointLocation(clientId, address) } @@ -366,7 +377,7 @@ class DataManagerClient @Inject constructor( */ suspend fun deleteClientAddressPinpointLocation( apptableId: Int, - datatableId: Int + datatableId: Int, ): GenericResponse { return mBaseApiManager.clientsApi .deleteClientPinpointLocation(apptableId, datatableId) @@ -383,10 +394,12 @@ class DataManagerClient @Inject constructor( suspend fun updateClientPinpointLocation( apptableId: Int, datatableId: Int, - address: ClientAddressRequest? + address: ClientAddressRequest?, ): GenericResponse { return mBaseApiManager.clientsApi.updateClientPinpointLocation( - apptableId, datatableId, address + apptableId, + datatableId, + address, ) } @@ -398,15 +411,16 @@ class DataManagerClient @Inject constructor( */ suspend fun activateClient( clientId: Int, - clientActivate: ActivatePayload? + clientActivate: ActivatePayload?, ): PostClientsClientIdResponse { return baseApiManager.getClientsApi().activate1( clientId.toLong(), PostClientsClientIdRequest( activationDate = clientActivate?.activationDate, dateFormat = clientActivate?.dateFormat, - locale = clientActivate?.locale - ), "activate" + locale = clientActivate?.locale, + ), + "activate", ) } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerDataTable.kt b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerDataTable.kt index c34552b24ac..0548741a649 100644 --- a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerDataTable.kt +++ b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerDataTable.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.datamanager import com.google.gson.JsonArray @@ -22,7 +31,7 @@ import javax.inject.Singleton class DataManagerDataTable @Inject constructor( val mBaseApiManager: BaseApiManager, val mDatabaseHelperDataTable: DatabaseHelperDataTable, - private val baseApiManager: org.mifos.core.apimanager.BaseApiManager + private val baseApiManager: org.mifos.core.apimanager.BaseApiManager, ) { /** * This Method Request the REST API of Datatable and In response give the List of DataTable @@ -32,10 +41,10 @@ class DataManagerDataTable @Inject constructor( * 3. m_loan * @param tableName DataTable Name * @return List - */ + */ suspend fun getDataTable(tableName: String?): List { return baseApiManager.getDataTableApi().getDatatables(tableName).map( - GetDataTablesResponseMapper::mapFromEntity + GetDataTablesResponseMapper::mapFromEntity, ) } @@ -44,7 +53,9 @@ class DataManagerDataTable @Inject constructor( } suspend fun addDataTableEntry( - table: String, entityId: Int, payload: Map + table: String, + entityId: Int, + payload: Map, ): GenericResponse { return mBaseApiManager.dataTableApi .createEntryInDataTable(table, entityId, payload) @@ -53,12 +64,12 @@ class DataManagerDataTable @Inject constructor( suspend fun deleteDataTableEntry( table: String, entity: Int, - rowId: Int + rowId: Int, ): DeleteDataTablesDatatableAppTableIdDatatableIdResponse { return baseApiManager.getDataTableApi().deleteDatatableEntry( datatable = table, apptableId = entity.toLong(), - datatableId = rowId.toLong() + datatableId = rowId.toLong(), ) } @@ -71,7 +82,7 @@ class DataManagerDataTable @Inject constructor( */ fun addUserPathTracking( userId: Int, - userLocation: UserLocation? + userLocation: UserLocation?, ): Observable { return mBaseApiManager.dataTableApi.addUserPathTracking(userId, userLocation) } @@ -81,8 +92,8 @@ class DataManagerDataTable @Inject constructor( * * @param userId UserId Id * @return List - */ + */ suspend fun getUserPathTracking(userId: Int): List { return mBaseApiManager.dataTableApi.getUserPathTracking(userId) } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerGroups.kt b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerGroups.kt index bb005550ed8..40530b482fb 100644 --- a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerGroups.kt +++ b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerGroups.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.datamanager import com.mifos.core.databasehelper.DatabaseHelperClient @@ -28,7 +37,7 @@ class DataManagerGroups @Inject constructor( private val mDatabaseHelperGroups: DatabaseHelperGroups, private val mDatabaseHelperClient: DatabaseHelperClient, private val baseApiManager: org.mifos.core.apimanager.BaseApiManager, - private val prefManager: com.mifos.core.datastore.PrefManager + private val prefManager: com.mifos.core.datastore.PrefManager, ) { /** * This Method sending the Request to REST API if UserStatus is 0 and @@ -58,7 +67,7 @@ class DataManagerGroups @Inject constructor( limit, null, null, - null + null, ).let(GetGroupsResponseMapper::mapFromEntity) } // suspend fun getGroups(paged: Boolean, offset: Int, limit: Int): Observable> { @@ -95,7 +104,7 @@ class DataManagerGroups @Inject constructor( * read the all Groups from the Database Group table and returns the Page. * * @return Page - */ + */ val databaseGroups: Observable> get() = mDatabaseHelperGroups.readAllGroups() @@ -173,7 +182,7 @@ class DataManagerGroups @Inject constructor( .concatMap { groupAccounts -> mDatabaseHelperGroups.saveGroupAccounts( groupAccounts, - groupId + groupId, ) } } @@ -200,7 +209,7 @@ class DataManagerGroups @Inject constructor( * This method loading the all GroupPayloads from the Database. * * @return List - */ + */ val allDatabaseGroupPayload: Observable> get() = mDatabaseHelperGroups.realAllGroupPayload() @@ -234,8 +243,8 @@ class DataManagerGroups @Inject constructor( */ fun activateGroup( groupId: Int, - activatePayload: ActivatePayload? + activatePayload: ActivatePayload?, ): Observable { return mBaseApiManager.groupApi.activateGroup(groupId, activatePayload) } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerOffices.kt b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerOffices.kt index e455967f9ac..2f11a5929fc 100644 --- a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerOffices.kt +++ b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerOffices.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.datamanager -import com.mifos.core.databasehelper.DatabaseHelperOffices import com.mifos.core.network.BaseApiManager import com.mifos.core.network.mappers.offices.GetOfficeResponseMapper import com.mifos.core.objects.organisation.Office @@ -17,16 +25,16 @@ import javax.inject.Singleton @Singleton class DataManagerOffices @Inject constructor( val mBaseApiManager: BaseApiManager, - private val mDatabaseHelperOffices: DatabaseHelperOffices, +// private val mDatabaseHelperOffices: DatabaseHelperOffices, private val baseApiManager: org.mifos.core.apimanager.BaseApiManager, - private val prefManager: com.mifos.core.datastore.PrefManager +// private val prefManager: com.mifos.core.datastore.PrefManager, ) { /** * return all List of Offices from DatabaseHelperOffices */ suspend fun offices(): List { return baseApiManager.getOfficeApi().retrieveOffices(null, null, null).map( - GetOfficeResponseMapper::mapFromEntity + GetOfficeResponseMapper::mapFromEntity, ) } // val offices: Observable> @@ -43,4 +51,4 @@ class DataManagerOffices @Inject constructor( // */ // mDatabaseHelperOffices.readAllOffices() // } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerStaff.kt b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerStaff.kt index 317d3b1938a..bbc535b86c3 100644 --- a/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerStaff.kt +++ b/core/network/src/main/java/com/mifos/core/network/datamanager/DataManagerStaff.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.datamanager -import com.mifos.core.databasehelper.DatabaseHelperStaff import com.mifos.core.network.BaseApiManager import com.mifos.core.network.mappers.staffs.StaffMapper import com.mifos.core.objects.organisation.Staff @@ -13,9 +21,9 @@ import javax.inject.Singleton @Singleton class DataManagerStaff @Inject constructor( val mBaseApiManager: BaseApiManager, - private val mDatabaseHelperStaff: DatabaseHelperStaff, +// private val mDatabaseHelperStaff: DatabaseHelperStaff, private val baseApiManager: org.mifos.core.apimanager.BaseApiManager, - private val prefManager: com.mifos.core.datastore.PrefManager +// private val prefManager: com.mifos.core.datastore.PrefManager, ) { /** * @param officeId @@ -37,4 +45,4 @@ class DataManagerStaff @Inject constructor( // mDatabaseHelperStaff.readAllStaffOffices(officeId) // } // } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/centers/CenterMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/centers/CenterMapper.kt index c6e864f1ee9..064c2300939 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/centers/CenterMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/centers/CenterMapper.kt @@ -44,8 +44,8 @@ object CenterMapper : AbstractMapper() { status = GetCentersStatus( id = domainModel.status?.id?.toLong(), code = domainModel.status?.code, - description = domainModel.status?.value - ) + description = domainModel.status?.value, + ), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/centers/GetCentersResponseMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/centers/GetCentersResponseMapper.kt index f09b0539a27..c4e2f7ece0a 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/centers/GetCentersResponseMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/centers/GetCentersResponseMapper.kt @@ -26,7 +26,7 @@ object GetCentersResponseMapper : AbstractMapper): GetCentersResponse { return GetCentersResponse( totalFilteredRecords = domainModel.totalFilteredRecords, - pageItems = CenterMapper.mapToEntityList(domainModel.pageItems).toSet() + pageItems = CenterMapper.mapToEntityList(domainModel.pageItems).toSet(), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/clients/ClientMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/clients/ClientMapper.kt index cb41e7e12b1..3a8e0d0b922 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/clients/ClientMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/clients/ClientMapper.kt @@ -49,8 +49,8 @@ object ClientMapper : AbstractMapper() { status = GetClientStatus( id = domainModel.status?.id?.toLong(), code = domainModel.status?.code, - description = domainModel.status?.value - ) + description = domainModel.status?.value, + ), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientResponseMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientResponseMapper.kt index e0bc2caad32..4cd750f8f1b 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientResponseMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientResponseMapper.kt @@ -26,7 +26,7 @@ object GetClientResponseMapper : AbstractMapper override fun mapToEntity(domainModel: Page): GetClientsResponse { return GetClientsResponse( totalFilteredRecords = domainModel.totalFilteredRecords, - pageItems = ClientMapper.mapToEntityList(domainModel.pageItems).toSet() + pageItems = ClientMapper.mapToEntityList(domainModel.pageItems).toSet(), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientsClientIdAccountMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientsClientIdAccountMapper.kt index 38501d81f8d..fc07356625e 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientsClientIdAccountMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetClientsClientIdAccountMapper.kt @@ -109,7 +109,7 @@ object GetClientsClientIdAccountMapper : depositType = GetClientsSavingsAccountsDepositType( id = it.depositType?.id?.toLong(), code = it.depositType?.code, - value = it.depositType?.value + value = it.depositType?.value, ), status = GetClientsSavingsAccountsStatus( id = it.status?.id?.toLong(), @@ -120,15 +120,15 @@ object GetClientsClientIdAccountMapper : rejected = it.status?.rejected, withdrawnByApplicant = it.status?.withdrawnByApplicant, active = it.status?.active, - closed = it.status?.closed + closed = it.status?.closed, ), currency = GetClientsSavingsAccountsCurrency( code = it.currency!!.code, name = it.currency!!.name, nameCode = it.currency!!.nameCode, decimalPlaces = it.currency!!.decimalPlaces, - displaySymbol = it.currency!!.displaySymbol - ) + displaySymbol = it.currency!!.displaySymbol, + ), ) }.toSet(), loanAccounts = domainModel.loanAccounts.map { @@ -154,11 +154,11 @@ object GetClientsClientIdAccountMapper : loanType = GetClientsLoanAccountsType( id = it.loanType?.id?.toLong(), code = it.loanType?.code, - description = it.loanType?.value + description = it.loanType?.value, ), - loanCycle = it.loanCycle + loanCycle = it.loanCycle, ) - }.toSet() + }.toSet(), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetIdentifiersTemplateMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetIdentifiersTemplateMapper.kt index 40af78f54e7..5ff7e932b7e 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetIdentifiersTemplateMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/clients/GetIdentifiersTemplateMapper.kt @@ -40,9 +40,9 @@ object GetIdentifiersTemplateMapper : GetClientsAllowedDocumentTypes( id = it.id?.toLong(), name = it.name, - position = it.position + position = it.position, ) - }?.toSet() + }?.toSet(), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/clients/IdentifierMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/clients/IdentifierMapper.kt index e59f7c4d021..951b4c3c1a8 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/clients/IdentifierMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/clients/IdentifierMapper.kt @@ -43,9 +43,9 @@ object IdentifierMapper : AbstractMapper>( override fun mapToEntity(domainModel: Page): GetGroupsResponse { return GetGroupsResponse( totalFilteredRecords = domainModel.totalFilteredRecords, - pageItems = GroupMapper.mapToEntityList(domainModel.pageItems).toSet() + pageItems = GroupMapper.mapToEntityList(domainModel.pageItems).toSet(), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/groups/GroupMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/groups/GroupMapper.kt index 0fd30c20ae3..aec6db5051c 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/groups/GroupMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/groups/GroupMapper.kt @@ -44,8 +44,8 @@ object GroupMapper : AbstractMapper() { status = GetGroupsStatus( id = domainModel.status?.id?.toLong(), code = domainModel.status?.code, - description = domainModel.status?.value - ) + description = domainModel.status?.value, + ), ) } } diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/offices/GetOfficeResponseMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/offices/GetOfficeResponseMapper.kt index 3edfe21b1c5..b29863e97da 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/offices/GetOfficeResponseMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/offices/GetOfficeResponseMapper.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.core.network.mappers.offices import com.mifos.core.objects.organisation.Office @@ -20,7 +29,7 @@ object GetOfficeResponseMapper : AbstractMapper() { id = domainModel.id?.toLong(), name = domainModel.name, nameDecorated = domainModel.nameDecorated, - externalId = domainModel.externalId + externalId = domainModel.externalId, ) } -} \ No newline at end of file +} diff --git a/core/network/src/main/java/com/mifos/core/network/mappers/staffs/StaffMapper.kt b/core/network/src/main/java/com/mifos/core/network/mappers/staffs/StaffMapper.kt index daaafa7a1e5..d2f7eea7266 100644 --- a/core/network/src/main/java/com/mifos/core/network/mappers/staffs/StaffMapper.kt +++ b/core/network/src/main/java/com/mifos/core/network/mappers/staffs/StaffMapper.kt @@ -36,7 +36,7 @@ object StaffMapper : AbstractMapper() { officeId = domainModel.officeId?.toLong(), officeName = domainModel.officeName, isLoanOfficer = domainModel.isLoanOfficer, - isActive = domainModel.isActive + isActive = domainModel.isActive, ) } } diff --git a/feature/about/src/main/java/com/mifos/feature/about/AboutScreen.kt b/feature/about/src/main/java/com/mifos/feature/about/AboutScreen.kt index c0883cff854..a3a3f6d37a4 100644 --- a/feature/about/src/main/java/com/mifos/feature/about/AboutScreen.kt +++ b/feature/about/src/main/java/com/mifos/feature/about/AboutScreen.kt @@ -54,7 +54,7 @@ import com.mifos.core.designsystem.theme.aboutItemTextStyleBold @Composable internal fun AboutScreen( onBackPressed: () -> Unit, - viewModel: AboutViewModel = hiltViewModel() + viewModel: AboutViewModel = hiltViewModel(), ) { val state by viewModel.aboutUiState.collectAsStateWithLifecycle() val uriHandler = LocalUriHandler.current @@ -128,7 +128,6 @@ private fun AboutScreenContent( onOptionClick: (AboutItems) -> Unit, ) { Column { - Image( modifier = Modifier.size(100.dp), painter = painterResource(id = R.drawable.feature_about_ic_launcher), diff --git a/feature/center/src/main/java/com/mifos/feature/center/centerDetails/CenterDetailsScreen.kt b/feature/center/src/main/java/com/mifos/feature/center/centerDetails/CenterDetailsScreen.kt index fb15e3b30b2..919e4d0fa91 100644 --- a/feature/center/src/main/java/com/mifos/feature/center/centerDetails/CenterDetailsScreen.kt +++ b/feature/center/src/main/java/com/mifos/feature/center/centerDetails/CenterDetailsScreen.kt @@ -122,14 +122,20 @@ internal fun CenterDetailsScreen( expanded = showMenu, onDismissRequest = { showMenu = false }, ) { - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_center_add_savings_account)) { - onMenuClick(MenuItems.ADD_SAVINGS_ACCOUNT) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_center_group_list)) { - onMenuClick(MenuItems.GROUP_LIST) - showMenu = false - } + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_center_add_savings_account), + onClick = { + onMenuClick(MenuItems.ADD_SAVINGS_ACCOUNT) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_center_group_list), + onClick = { + onMenuClick(MenuItems.GROUP_LIST) + showMenu = false + }, + ) } }, snackbarHostState = snackbarHostState, diff --git a/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogScreen.kt b/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogScreen.kt index 7f2531da60b..867242b861b 100644 --- a/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogScreen.kt +++ b/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogScreen.kt @@ -40,7 +40,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.mifos.core.designsystem.component.MifosCircularProgress import com.mifos.core.objects.group.Center import com.mifos.feature.center.R -import com.mifos.feature.center.sync_centers_dialog.SyncCentersDialogViewModel @Composable internal fun SyncCenterDialogScreen( diff --git a/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogViewModel.kt b/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogViewModel.kt index ab99393a1e5..dcc146b1f47 100644 --- a/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogViewModel.kt +++ b/feature/center/src/main/java/com/mifos/feature/center/syncCentersDialog/SyncCentersDialogViewModel.kt @@ -1,4 +1,13 @@ -package com.mifos.feature.center.sync_centers_dialog +/* + * 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/android-client/blob/master/LICENSE.md + */ +package com.mifos.feature.center.syncCentersDialog import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -19,8 +28,6 @@ import com.mifos.core.objects.group.GroupWithAssociations import com.mifos.core.objects.zipmodels.LoanAndLoanRepayment import com.mifos.core.objects.zipmodels.SavingsAccountAndTransactionTemplate import com.mifos.feature.center.R -import com.mifos.feature.center.syncCentersDialog.SyncCentersDialogData -import com.mifos.feature.center.syncCentersDialog.SyncCentersDialogUiState import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow @@ -50,11 +57,10 @@ class SyncCentersDialogViewModel @Inject constructor( val syncCentersDialogUiState: StateFlow = _syncCentersDialogUiState private val _syncCenterData: MutableStateFlow = MutableStateFlow( - SyncCentersDialogData() + SyncCentersDialogData(), ) val syncCenterData: StateFlow = _syncCenterData - private var mLoanAccountList: List = ArrayList() private var mSavingsAccountList: List = ArrayList() private var mMemberLoanAccountsList: List = ArrayList() @@ -158,23 +164,24 @@ class SyncCentersDialogViewModel @Inject constructor( override fun onNext(centerAccounts: CenterAccounts) { mLoanAccountList = getActiveLoanAccounts( centerAccounts - .loanAccounts + .loanAccounts, ) mSavingsAccountList = getActiveSavingsAccounts( centerAccounts - .savingsAccounts + .savingsAccounts, ) mMemberLoanAccountsList = getActiveLoanAccounts( centerAccounts - .memberLoanAccounts + .memberLoanAccounts, ) - //Updating UI - maxSingleSyncCenterProgressBar = (mLoanAccountList.size + - mSavingsAccountList.size + mMemberLoanAccountsList.size) + // Updating UI + maxSingleSyncCenterProgressBar = ( + mLoanAccountList.size + + mSavingsAccountList.size + mMemberLoanAccountsList.size + ) checkAccountsSyncStatusAndSyncAccounts() } }) - } /** @@ -187,13 +194,13 @@ class SyncCentersDialogViewModel @Inject constructor( */ private fun checkAccountsSyncStatusAndSyncAccounts() { if (mLoanAccountList.isNotEmpty() && !mLoanAccountSyncStatus) { - //Sync the Active Loan and LoanRepayment + // Sync the Active Loan and LoanRepayment checkNetworkConnectionAndSyncLoanAndLoanRepayment() } else if (mSavingsAccountList.isNotEmpty() && !mSavingAccountSyncStatus) { - //Sync the Active Savings Account + // Sync the Active Savings Account checkNetworkConnectionAndSyncSavingsAccountAndTransactionTemplate() } else if (mMemberLoanAccountsList.isNotEmpty()) { - //Sync the Active member Loan Account + // Sync the Active member Loan Account checkNetworkConnectionAndSyncMemberLoanAndMemberLoanRepayment() } else { maxSingleSyncCenterProgressBar = 1 @@ -291,35 +298,34 @@ class SyncCentersDialogViewModel @Inject constructor( }) } - /** - * This Method Syncing the Member's Loan and their LoanRepayment. This is the - * Observable.combineLatest In Which two request is going to server Loans and LoanRepayment - * and This request will not complete till that both request completed successfully with - * response (200 OK). If one will fail then response will come in onError. and If both - * request is 200 response then response will come in onNext. - * - * @param loanId Loan Id - */ - private fun syncMemberLoanAndMemberLoanRepayment(loanId: Int) { - getLoanAndLoanRepayment(loanId) - .subscribe(object : Subscriber() { - override fun onCompleted() {} - override fun onError(e: Throwable) { - onAccountSyncFailed(e) - } - - override fun onNext(loanAndLoanRepayment: LoanAndLoanRepayment) { - mMemberLoanSyncIndex += 1 - _syncCenterData.update { it.copy(singleSyncCount = mLoanAndRepaymentSyncIndex + mSavingsAndTransactionSyncIndex + mMemberLoanSyncIndex) } - if (mMemberLoanSyncIndex != mMemberLoanAccountsList.size) { - checkNetworkConnectionAndSyncMemberLoanAndMemberLoanRepayment() - } else { - mCenterList[mCenterSyncIndex].id?.let { loadCenterAssociateGroups(it) } - } - } - }) - - } +// /** +// * This Method Syncing the Member's Loan and their LoanRepayment. This is the +// * Observable.combineLatest In Which two request is going to server Loans and LoanRepayment +// * and This request will not complete till that both request completed successfully with +// * response (200 OK). If one will fail then response will come in onError. and If both +// * request is 200 response then response will come in onNext. +// * +// * @param loanId Loan Id +// */ +// private fun syncMemberLoanAndMemberLoanRepayment(loanId: Int) { +// getLoanAndLoanRepayment(loanId) +// .subscribe(object : Subscriber() { +// override fun onCompleted() {} +// override fun onError(e: Throwable) { +// onAccountSyncFailed(e) +// } +// +// override fun onNext(loanAndLoanRepayment: LoanAndLoanRepayment) { +// mMemberLoanSyncIndex += 1 +// _syncCenterData.update { it.copy(singleSyncCount = mLoanAndRepaymentSyncIndex + mSavingsAndTransactionSyncIndex + mMemberLoanSyncIndex) } +// if (mMemberLoanSyncIndex != mMemberLoanAccountsList.size) { +// checkNetworkConnectionAndSyncMemberLoanAndMemberLoanRepayment() +// } else { +// mCenterList[mCenterSyncIndex].id?.let { loadCenterAssociateGroups(it) } +// } +// } +// }) +// } /** * This Method Fetching the SavingsAccount and SavingsAccountTransactionTemplate and Syncing @@ -347,7 +353,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -378,11 +383,11 @@ class SyncCentersDialogViewModel @Inject constructor( private fun getLoanAndLoanRepayment(loanId: Int): Observable { return Observable.combineLatest( repository.syncLoanById(loanId), - repository.syncLoanRepaymentTemplate(loanId) + repository.syncLoanRepaymentTemplate(loanId), ) { loanWithAssociations, loanRepaymentTemplate -> LoanAndLoanRepayment( loanWithAssociations, - loanRepaymentTemplate + loanRepaymentTemplate, ) } .observeOn(AndroidSchedulers.mainThread()) @@ -397,20 +402,24 @@ class SyncCentersDialogViewModel @Inject constructor( * @return SavingsAccountAndTransactionTemplate */ private fun getSavingsAccountAndTemplate( - savingsAccountType: String, savingsAccountId: Int + savingsAccountType: String, + savingsAccountId: Int, ): Observable { return Observable.combineLatest( repository.syncSavingsAccount( - savingsAccountType, savingsAccountId, - Constants.TRANSACTIONS + savingsAccountType, + savingsAccountId, + Constants.TRANSACTIONS, ), repository.syncSavingsAccountTransactionTemplate( savingsAccountType, - savingsAccountId, Constants.SAVINGS_ACCOUNT_TRANSACTION_DEPOSIT - ) + savingsAccountId, + Constants.SAVINGS_ACCOUNT_TRANSACTION_DEPOSIT, + ), ) { savingsAccountWithAssociations, savingsAccountTransactionTemplate -> SavingsAccountAndTransactionTemplate( - savingsAccountWithAssociations, savingsAccountTransactionTemplate + savingsAccountWithAssociations, + savingsAccountTransactionTemplate, ) } .observeOn(AndroidSchedulers.mainThread()) @@ -445,7 +454,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -476,7 +484,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -505,16 +512,15 @@ class SyncCentersDialogViewModel @Inject constructor( override fun onNext(groupAccounts: GroupAccounts) { mLoanAccountList = getActiveLoanAccounts( groupAccounts - .loanAccounts + .loanAccounts, ) mSavingsAccountList = getActiveSavingsAccounts( groupAccounts - .savingsAccounts + .savingsAccounts, ) checkAccountsSyncStatusAndSyncGroupAccounts() } }) - } /** @@ -534,11 +540,11 @@ class SyncCentersDialogViewModel @Inject constructor( val clientAccounts = repository.syncClientAccounts(clientId) mLoanAccountList = getActiveLoanAccounts( clientAccounts - .loanAccounts + .loanAccounts, ) mSavingsAccountList = getSyncableSavingsAccounts( clientAccounts - .savingsAccounts + .savingsAccounts, ) checkAccountsSyncStatusAndSyncClientAccounts() } @@ -551,19 +557,19 @@ class SyncCentersDialogViewModel @Inject constructor( */ private fun checkAccountsSyncStatusAndSyncGroupAccounts() { if (mLoanAccountList.isNotEmpty() && !mLoanAccountSyncStatus) { - //Sync the Active Loan and LoanRepayment + // Sync the Active Loan and LoanRepayment mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let { syncGroupLoanAndLoanRepayment( - it + it, ) } } else if (mSavingsAccountList.isNotEmpty()) { - //Sync the Active Savings Account + // Sync the Active Savings Account mSavingsAccountList[mSavingsAndTransactionSyncIndex].id?.let { mSavingsAccountList[mSavingsAndTransactionSyncIndex].depositType?.endpoint?.let { it1 -> syncGroupSavingsAccountAndTemplate( it1, - it + it, ) } } @@ -580,19 +586,19 @@ class SyncCentersDialogViewModel @Inject constructor( */ private fun checkAccountsSyncStatusAndSyncClientAccounts() { if (mLoanAccountList.isNotEmpty() && !mLoanAccountSyncStatus) { - //Sync the Active Loan and LoanRepayment + // Sync the Active Loan and LoanRepayment mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let { syncClientLoanAndLoanRepayment( - it + it, ) } } else if (mSavingsAccountList.isNotEmpty()) { - //Sync the Active Savings Account + // Sync the Active Savings Account mSavingsAccountList[mSavingsAndTransactionSyncIndex].id?.let { mSavingsAccountList[mSavingsAndTransactionSyncIndex].depositType?.endpoint?.let { it1 -> syncClientSavingsAccountAndTemplate( it1, - it + it, ) } } @@ -630,7 +636,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -662,7 +667,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -687,7 +691,7 @@ class SyncCentersDialogViewModel @Inject constructor( if (mLoanAndRepaymentSyncIndex != mLoanAccountList.size) { mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let { syncGroupLoanAndLoanRepayment( - it + it, ) } } else { @@ -696,7 +700,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -721,7 +724,7 @@ class SyncCentersDialogViewModel @Inject constructor( if (mLoanAndRepaymentSyncIndex != mLoanAccountList.size) { mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let { syncClientLoanAndLoanRepayment( - it + it, ) } } else { @@ -730,7 +733,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -742,7 +744,7 @@ class SyncCentersDialogViewModel @Inject constructor( */ private fun syncGroupSavingsAccountAndTemplate( savingsAccountType: String, - savingsAccountId: Int + savingsAccountId: Int, ) { getSavingsAccountAndTemplate(savingsAccountType, savingsAccountId) .subscribe(object : Subscriber() { @@ -759,7 +761,7 @@ class SyncCentersDialogViewModel @Inject constructor( mSavingsAccountList[mSavingsAndTransactionSyncIndex].id?.let { it1 -> syncGroupSavingsAccountAndTemplate( it, - it1 + it1, ) } } @@ -768,7 +770,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } /** @@ -780,7 +781,7 @@ class SyncCentersDialogViewModel @Inject constructor( */ private fun syncClientSavingsAccountAndTemplate( savingsAccountType: String, - savingsAccountId: Int + savingsAccountId: Int, ) { getSavingsAccountAndTemplate(savingsAccountType, savingsAccountId) .subscribe(object : Subscriber() { @@ -797,7 +798,7 @@ class SyncCentersDialogViewModel @Inject constructor( .depositType?.endpoint?.let { it1 -> syncClientSavingsAccountAndTemplate( it1, - it + it, ) } } @@ -806,7 +807,6 @@ class SyncCentersDialogViewModel @Inject constructor( } } }) - } private fun updateTotalSyncProgressBarAndCount() { @@ -821,14 +821,14 @@ class SyncCentersDialogViewModel @Inject constructor( } private fun checkNetworkConnection( - taskWhenOnline: () -> Unit + taskWhenOnline: () -> Unit, ) { if (networkUtilsWrapper.isNetworkConnected()) { taskWhenOnline.invoke() } else { _syncCentersDialogUiState.value = SyncCentersDialogUiState.Error( messageResId = R.string.feature_center_error_not_connected_internet, - imageVector = MifosIcons.WifiOff + imageVector = MifosIcons.WifiOff, ) } } @@ -846,7 +846,7 @@ class SyncCentersDialogViewModel @Inject constructor( Observable.from(savingsAccounts) .filter { savingsAccount -> savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring + !savingsAccount.depositType!!.isRecurring } .subscribe { savingsAccount -> accounts.add(savingsAccount) } return accounts @@ -865,11 +865,10 @@ class SyncCentersDialogViewModel @Inject constructor( Observable.from(savingsAccounts) .filter { savingsAccount -> savingsAccount.depositType?.value == "Savings" && - savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring + savingsAccount.status?.active == true && + !savingsAccount.depositType!!.isRecurring } .subscribe { savingsAccount -> accounts.add(savingsAccount) } return accounts } - -} \ No newline at end of file +} diff --git a/feature/client/src/main/java/com/mifos/feature/client/clientDetails/ui/ClientDetailsScreen.kt b/feature/client/src/main/java/com/mifos/feature/client/clientDetails/ui/ClientDetailsScreen.kt index ef62d7ad6d5..557be30a455 100644 --- a/feature/client/src/main/java/com/mifos/feature/client/clientDetails/ui/ClientDetailsScreen.kt +++ b/feature/client/src/main/java/com/mifos/feature/client/clientDetails/ui/ClientDetailsScreen.kt @@ -236,46 +236,76 @@ internal fun ClientDetailsScreen( expanded = showMenu, onDismissRequest = { showMenu = false }, ) { - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_add_loan_account)) { - addLoanAccount(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_add_savings_account)) { - addSavingsAccount(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_charges)) { - charges(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_documents)) { - documents(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_identifiers)) { - identifiers(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_more_client_info)) { - moreClientInfo(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_notes)) { - notes(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_pinpoint_location)) { - pinpointLocation(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_survey)) { - survey(clientId) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_upload_signature)) { - uploadSignature(clientId) - showMenu = false - } + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_add_loan_account), + onClick = { + addLoanAccount(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_add_savings_account), + onClick = { + addSavingsAccount(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_charges), + onClick = { + charges(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_documents), + onClick = { + documents(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_identifiers), + onClick = { + identifiers(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_more_client_info), + onClick = { + moreClientInfo(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_notes), + onClick = { + notes(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_pinpoint_location), + onClick = { + pinpointLocation(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_survey), + onClick = { + survey(clientId) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_upload_signature), + onClick = { + uploadSignature(clientId) + showMenu = false + }, + ) } }, snackbarHostState = snackbarHostState, @@ -378,9 +408,11 @@ private fun MifosClientDetailsScreen( modifier = Modifier .size(75.dp) .clip(RoundedCornerShape(100)) - .clickable(onClick = { - showSelectImageDialog = true - }), + .clickable( + onClick = { + showSelectImageDialog = true + }, + ), model = if (client?.imagePresent == true) { client.clientId?.let { scope.launch { @@ -581,13 +613,15 @@ private fun MifosLoanAccountsLazyColumn( Row( modifier = Modifier .padding(5.dp) - .clickable(onClick = { - loanAccount.id?.let { - loanAccountSelected( - it, - ) - } - }), + .clickable( + onClick = { + loanAccount.id?.let { + loanAccountSelected( + it, + ) + } + }, + ), verticalAlignment = Alignment.CenterVertically, ) { Canvas( @@ -754,16 +788,18 @@ private fun MifosSavingsAccountsLazyColumn( Row( modifier = Modifier .padding(5.dp) - .clickable(onClick = { - savingsAccount.id?.let { - savingsAccount.depositType?.let { it1 -> - savingsAccountSelected( - it, - it1, - ) + .clickable( + onClick = { + savingsAccount.id?.let { + savingsAccount.depositType?.let { it1 -> + savingsAccountSelected( + it, + it1, + ) + } } - } - }), + }, + ), verticalAlignment = Alignment.CenterVertically, ) { Canvas( diff --git a/feature/client/src/main/java/com/mifos/feature/client/clientIdentifiers/ClientIdentifiersScreen.kt b/feature/client/src/main/java/com/mifos/feature/client/clientIdentifiers/ClientIdentifiersScreen.kt index ab6f75e31bc..07b53d27a30 100644 --- a/feature/client/src/main/java/com/mifos/feature/client/clientIdentifiers/ClientIdentifiersScreen.kt +++ b/feature/client/src/main/java/com/mifos/feature/client/clientIdentifiers/ClientIdentifiersScreen.kt @@ -136,9 +136,11 @@ internal fun ClientIdentifiersScreen( title = stringResource(id = R.string.feature_client_identifiers), onBackPressed = onBackPressed, actions = { - IconButton(onClick = { - showCreateIdentifierDialog = true - }) { + IconButton( + onClick = { + showCreateIdentifierDialog = true + }, + ) { Icon( imageVector = MifosIcons.Add, contentDescription = null, @@ -260,14 +262,20 @@ private fun ClientIdentifiersItem( expanded = showMenu, onDismissRequest = { showMenu = false }, ) { - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_remove)) { - identifier.id?.let { onDeleteIdentifier(it) } - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_client_documents)) { - identifier.id?.let { onDocumentClicked(it) } - showMenu = false - } + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_remove), + onClick = { + identifier.id?.let { onDeleteIdentifier(it) } + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_client_documents), + onClick = { + identifier.id?.let { onDocumentClicked(it) } + showMenu = false + }, + ) } } } @@ -297,7 +305,8 @@ private fun MifosIdentifierDetailsText(field: String, value: String) { } } -private class ClientIdentifiersUiStateProvider : PreviewParameterProvider { +private class ClientIdentifiersUiStateProvider : + PreviewParameterProvider { override val values: Sequence get() = sequenceOf( diff --git a/feature/client/src/main/java/com/mifos/feature/client/clientSignature/SignatureScreen.kt b/feature/client/src/main/java/com/mifos/feature/client/clientSignature/SignatureScreen.kt index 3e0b91a0f6a..63b7a5fce3e 100644 --- a/feature/client/src/main/java/com/mifos/feature/client/clientSignature/SignatureScreen.kt +++ b/feature/client/src/main/java/com/mifos/feature/client/clientSignature/SignatureScreen.kt @@ -111,15 +111,7 @@ internal fun SignatureScreen( var imageUri by remember { mutableStateOf(null) } val drawColor by remember { mutableStateOf(Color.Black) } val drawBrush by remember { mutableFloatStateOf(5f) } - val usedColors by remember { - mutableStateOf( - mutableSetOf( - Color.Black, - Color.White, - Color.Gray, - ), - ) - } + var paths by remember { mutableStateOf(mutableListOf()) } val galleryLauncher = rememberLauncherForActivityResult( @@ -218,8 +210,6 @@ internal fun SignatureScreen( MifosDrawingCanvas( drawColor = drawColor, drawBrush = drawBrush, - usedColors = usedColors, - paths = paths, ) } } diff --git a/feature/client/src/main/java/com/mifos/feature/client/createNewClient/CreateNewClientViewModel.kt b/feature/client/src/main/java/com/mifos/feature/client/createNewClient/CreateNewClientViewModel.kt index 408eeec42cb..25b54c67a0d 100644 --- a/feature/client/src/main/java/com/mifos/feature/client/createNewClient/CreateNewClientViewModel.kt +++ b/feature/client/src/main/java/com/mifos/feature/client/createNewClient/CreateNewClientViewModel.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.feature.client.createNewClient import android.util.Log @@ -5,14 +14,12 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.mifos.core.common.utils.Resource import com.mifos.core.data.repository.CreateNewClientRepository -import com.mifos.core.domain.useCases.ClientTemplateUseCase import com.mifos.core.domain.useCases.GetOfficeListUseCase -import com.mifos.core.domain.use_cases.GetStaffInOfficeForCreateNewClientUseCase +import com.mifos.core.domain.useCases.GetStaffInOfficeForCreateNewClientUseCase import com.mifos.core.objects.client.Client import com.mifos.core.objects.client.ClientPayload import com.mifos.core.objects.organisation.Office import com.mifos.core.objects.organisation.Staff -import com.mifos.core.objects.templates.clients.ClientsTemplate import com.mifos.feature.client.R import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.Dispatchers @@ -37,7 +44,7 @@ import javax.inject.Inject @HiltViewModel class CreateNewClientViewModel @Inject constructor( private val repository: CreateNewClientRepository, - private val clientTemplateUseCase: ClientTemplateUseCase, +// private val clientTemplateUseCase: ClientTemplateUseCase, private val getStaffInOffice: GetStaffInOfficeForCreateNewClientUseCase, private val getOfficeListUseCase: GetOfficeListUseCase, ) : ViewModel() { @@ -57,19 +64,21 @@ class CreateNewClientViewModel @Inject constructor( loadOffices() } - private fun loadClientTemplate() = viewModelScope.launch(Dispatchers.IO) { - clientTemplateUseCase().collect { result -> - when (result) { - is Resource.Error -> _createNewClientUiState.value = - CreateNewClientUiState.ShowError(R.string.feature_client_failed_to_fetch_client_template) - - is Resource.Loading -> Unit - - is Resource.Success -> _createNewClientUiState.value = - CreateNewClientUiState.ShowClientTemplate(result.data ?: ClientsTemplate()) - } - } - } +// private fun loadClientTemplate() = viewModelScope.launch(Dispatchers.IO) { +// clientTemplateUseCase().collect { result -> +// when (result) { +// is Resource.Error -> +// _createNewClientUiState.value = +// CreateNewClientUiState.ShowError(R.string.feature_client_failed_to_fetch_client_template) +// +// is Resource.Loading -> Unit +// +// is Resource.Success -> +// _createNewClientUiState.value = +// CreateNewClientUiState.ShowClientTemplate(result.data ?: ClientsTemplate()) +// } +// } +// } private fun loadOffices() = viewModelScope.launch(Dispatchers.IO) { getOfficeListUseCase().collect { result -> @@ -80,7 +89,6 @@ class CreateNewClientViewModel @Inject constructor( } is Resource.Loading -> { - } is Resource.Success -> { @@ -94,8 +102,9 @@ class CreateNewClientViewModel @Inject constructor( viewModelScope.launch(Dispatchers.IO) { getStaffInOffice(officeId).collect { result -> when (result) { - is Resource.Error -> _createNewClientUiState.value = - CreateNewClientUiState.ShowError(R.string.feature_client_failed_to_fetch_staffs) + is Resource.Error -> + _createNewClientUiState.value = + CreateNewClientUiState.ShowError(R.string.feature_client_failed_to_fetch_staffs) is Resource.Loading -> Unit @@ -122,7 +131,6 @@ class CreateNewClientViewModel @Inject constructor( Log.d("error", errorMessage) _createNewClientUiState.value = CreateNewClientUiState.ShowStringError(errorMessage) - } } catch (throwable: Throwable) { RxJavaPlugins.getInstance().errorHandler.handleError(e) @@ -156,7 +164,7 @@ class CreateNewClientViewModel @Inject constructor( fun uploadImage(id: Int, pngFile: File) { _createNewClientUiState.value = CreateNewClientUiState.ShowProgress("Uploading Client's Picture...") - val imagePath = pngFile.absolutePath +// val imagePath = pngFile.absolutePath // create RequestBody instance from file val requestFile = pngFile.asRequestBody("image/png".toMediaTypeOrNull()) @@ -183,4 +191,4 @@ class CreateNewClientViewModel @Inject constructor( }, ) } -} \ No newline at end of file +} diff --git a/feature/client/src/main/java/com/mifos/feature/client/syncClientDialog/SyncClientsDialogViewModel.kt b/feature/client/src/main/java/com/mifos/feature/client/syncClientDialog/SyncClientsDialogViewModel.kt index 7e18c8a89a8..5b0959964bf 100644 --- a/feature/client/src/main/java/com/mifos/feature/client/syncClientDialog/SyncClientsDialogViewModel.kt +++ b/feature/client/src/main/java/com/mifos/feature/client/syncClientDialog/SyncClientsDialogViewModel.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.feature.client.syncClientDialog import androidx.lifecycle.ViewModel @@ -34,7 +43,7 @@ import javax.inject.Inject class SyncClientsDialogViewModel @Inject constructor( private val repository: SyncClientsDialogRepository, private val networkUtilsWrapper: NetworkUtilsWrapper, - private val prefManager: PrefManager + private val prefManager: PrefManager, ) : ViewModel() { private var mClientList: List = ArrayList() @@ -52,7 +61,7 @@ class SyncClientsDialogViewModel @Inject constructor( val syncClientsDialogUiState: StateFlow = _syncClientsDialogUiState private val _syncClientData: MutableStateFlow = MutableStateFlow( - SyncClientsDialogData() + SyncClientsDialogData(), ) val syncClientData: StateFlow = _syncClientData @@ -105,10 +114,10 @@ class SyncClientsDialogViewModel @Inject constructor( fun checkAccountsSyncStatusAndSyncAccounts() { if (mLoanAccountList.isNotEmpty() && !mLoanAccountSyncStatus) { - //Sync the Active Loan and LoanRepayment + // Sync the Active Loan and LoanRepayment checkNetworkConnectionAndSyncLoanAndLoanRepayment() } else if (mSavingsAccountList.isNotEmpty()) { - //Sync the Active Savings Account + // Sync the Active Savings Account checkNetworkConnectionAndSyncSavingsAccountAndTransactionTemplate() } else { // If LoanAccounts and SavingsAccount are null then sync Client to Database @@ -155,16 +164,16 @@ class SyncClientsDialogViewModel @Inject constructor( val clientAccounts = repository.syncClientAccounts(clientId) mLoanAccountList = getActiveLoanAccounts( clientAccounts - .loanAccounts + .loanAccounts, ) mSavingsAccountList = getSyncableSavingsAccounts( clientAccounts - .savingsAccounts + .savingsAccounts, ) - //Updating UI + // Updating UI maxSingleSyncClientProgressBar = mLoanAccountList.size + - mSavingsAccountList.size + mSavingsAccountList.size checkAccountsSyncStatusAndSyncAccounts() } @@ -180,7 +189,7 @@ class SyncClientsDialogViewModel @Inject constructor( private fun syncLoanAndLoanRepayment(loanId: Int) { Observable.combineLatest( repository.syncLoanById(loanId), - repository.syncLoanRepaymentTemplate(loanId) + repository.syncLoanRepaymentTemplate(loanId), ) { loanWithAssociations, loanRepaymentTemplate -> val loanAndLoanRepayment = LoanAndLoanRepayment() loanAndLoanRepayment.loanWithAssociations = loanWithAssociations @@ -206,7 +215,6 @@ class SyncClientsDialogViewModel @Inject constructor( } } }) - } /** @@ -217,16 +225,17 @@ class SyncClientsDialogViewModel @Inject constructor( * @param savingsAccountId SavingsAccount Id */ private fun syncSavingsAccountAndTemplate(savingsAccountType: String?, savingsAccountId: Int) { - Observable.combineLatest( repository.syncSavingsAccount( - savingsAccountType, savingsAccountId, - Constants.TRANSACTIONS + savingsAccountType, + savingsAccountId, + Constants.TRANSACTIONS, ), repository.syncSavingsAccountTransactionTemplate( savingsAccountType, - savingsAccountId, Constants.SAVINGS_ACCOUNT_TRANSACTION_DEPOSIT - ) + savingsAccountId, + Constants.SAVINGS_ACCOUNT_TRANSACTION_DEPOSIT, + ), ) { savingsAccountWithAssociations, savingsAccountTransactionTemplate -> val accountAndTransactionTemplate = SavingsAccountAndTransactionTemplate() accountAndTransactionTemplate.savingsAccountTransactionTemplate = @@ -253,7 +262,6 @@ class SyncClientsDialogViewModel @Inject constructor( } } }) - } /** @@ -282,7 +290,6 @@ class SyncClientsDialogViewModel @Inject constructor( syncClient() } }) - } private fun updateTotalSyncProgressBarAndCount() { @@ -291,19 +298,19 @@ class SyncClientsDialogViewModel @Inject constructor( private fun updateClientName() { val clientName = mClientList[mClientSyncIndex].firstname + - mClientList[mClientSyncIndex].lastname + mClientList[mClientSyncIndex].lastname _syncClientData.update { it.copy(clientName = clientName) } } private fun checkNetworkConnection( - taskWhenOnline: () -> Unit + taskWhenOnline: () -> Unit, ) { if (networkUtilsWrapper.isNetworkConnected()) { taskWhenOnline.invoke() } else { _syncClientsDialogUiState.value = SyncClientsDialogUiState.Error( messageResId = R.string.feature_client_error_network_not_available, - imageVector = MifosIcons.WifiOff + imageVector = MifosIcons.WifiOff, ) } } @@ -321,10 +328,10 @@ class SyncClientsDialogViewModel @Inject constructor( Observable.from(savingsAccounts) .filter { savingsAccount -> savingsAccount.depositType?.value == "Savings" && - savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring + savingsAccount.status?.active == true && + !savingsAccount.depositType!!.isRecurring } .subscribe { savingsAccount -> accounts.add(savingsAccount) } return accounts } -} \ No newline at end of file +} diff --git a/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/navigation/CollectionSheetScreens.kt b/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/navigation/CollectionSheetScreens.kt index bf5a2cb9dc2..609bbf8186a 100644 --- a/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/navigation/CollectionSheetScreens.kt +++ b/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/navigation/CollectionSheetScreens.kt @@ -27,8 +27,8 @@ sealed class CollectionSheetScreens(val route: String) { data object PaymentDetailsScreen : CollectionSheetScreens( "payment_details_route/{${Constants.ADAPTER_POSITION}}/" + - "{${Constants.PAYLOAD}}/{${Constants.PAYMENT_LIST}}/{${Constants.LOAN_AND_CLIENT}}" + - "/{${Constants.PAYMENT_OPTIONS}}/{${Constants.CLIENT_ID}}", + "{${Constants.PAYLOAD}}/{${Constants.PAYMENT_LIST}}/{${Constants.LOAN_AND_CLIENT}}" + + "/{${Constants.PAYMENT_OPTIONS}}/{${Constants.CLIENT_ID}}", ) { fun argument( position: Int, diff --git a/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/paymentDetails/PaymentDetailsScreen.kt b/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/paymentDetails/PaymentDetailsScreen.kt index ddf2136ecc2..f3c13a79efd 100644 --- a/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/paymentDetails/PaymentDetailsScreen.kt +++ b/feature/collectionSheet/src/main/java/com/mifos/feature/individualCollectionSheet/paymentDetails/PaymentDetailsScreen.kt @@ -208,7 +208,7 @@ internal fun PaymentsDetailsScreen( .padding(16.dp), verticalAlignment = Alignment.CenterVertically, - ) { + ) { Column( modifier = Modifier .weight(1f) diff --git a/feature/groups/src/main/java/com/mifos/feature/groups/groupDetails/GroupDetailsScreen.kt b/feature/groups/src/main/java/com/mifos/feature/groups/groupDetails/GroupDetailsScreen.kt index e10a8c1e93e..ed143f7db79 100644 --- a/feature/groups/src/main/java/com/mifos/feature/groups/groupDetails/GroupDetailsScreen.kt +++ b/feature/groups/src/main/java/com/mifos/feature/groups/groupDetails/GroupDetailsScreen.kt @@ -174,30 +174,48 @@ internal fun GroupDetailsScreen( expanded = showMenu, onDismissRequest = { showMenu = false }, ) { - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_groups_add_loan_account)) { - onMenuClick(MenuItems.ADD_LOAN_ACCOUNT) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_groups_add_savings_account)) { - onMenuClick(MenuItems.ADD_SAVINGS_ACCOUNT) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_groups_documents)) { - onMenuClick(MenuItems.DOCUMENTS) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_groups_group_clients)) { - onMenuClick(MenuItems.GROUP_CLIENTS) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_groups_more_group_info)) { - onMenuClick(MenuItems.MORE_GROUP_INFO) - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_groups_notes)) { - onMenuClick(MenuItems.NOTES) - showMenu = false - } + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_groups_add_loan_account), + onClick = { + onMenuClick(MenuItems.ADD_LOAN_ACCOUNT) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_groups_add_savings_account), + onClick = { + onMenuClick(MenuItems.ADD_SAVINGS_ACCOUNT) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_groups_documents), + onClick = { + onMenuClick(MenuItems.DOCUMENTS) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_groups_group_clients), + onClick = { + onMenuClick(MenuItems.GROUP_CLIENTS) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_groups_more_group_info), + onClick = { + onMenuClick(MenuItems.MORE_GROUP_INFO) + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_groups_notes), + onClick = { + onMenuClick(MenuItems.NOTES) + showMenu = false + }, + ) } }, snackbarHostState = snackbarHostState, diff --git a/feature/groups/src/main/java/com/mifos/feature/groups/groupList/GroupsListScreen.kt b/feature/groups/src/main/java/com/mifos/feature/groups/groupList/GroupsListScreen.kt index 3971dda8ca7..13056900b70 100644 --- a/feature/groups/src/main/java/com/mifos/feature/groups/groupList/GroupsListScreen.kt +++ b/feature/groups/src/main/java/com/mifos/feature/groups/groupList/GroupsListScreen.kt @@ -241,7 +241,7 @@ private fun LazyListScope.refreshState(data: LazyPagingItems) { is LoadState.Loading -> { item { - MifosCircularProgress("GroupItems::Loading") + MifosCircularProgress(text = "GroupItems::Loading") } } diff --git a/feature/groups/src/main/java/com/mifos/feature/groups/syncGroupDialog/SyncGroupsDialogViewModel.kt b/feature/groups/src/main/java/com/mifos/feature/groups/syncGroupDialog/SyncGroupsDialogViewModel.kt index aba02cf0730..535d7b40c96 100644 --- a/feature/groups/src/main/java/com/mifos/feature/groups/syncGroupDialog/SyncGroupsDialogViewModel.kt +++ b/feature/groups/src/main/java/com/mifos/feature/groups/syncGroupDialog/SyncGroupsDialogViewModel.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.feature.groups.syncGroupDialog import androidx.lifecycle.ViewModel @@ -37,7 +46,7 @@ import javax.inject.Inject class SyncGroupsDialogViewModel @Inject constructor( private val repository: SyncGroupsDialogRepository, private val networkUtilsWrapper: NetworkUtilsWrapper, - private val prefManager: PrefManager + private val prefManager: PrefManager, ) : ViewModel() { private var mGroupList: List = ArrayList() @@ -53,12 +62,12 @@ class SyncGroupsDialogViewModel @Inject constructor( private var maxSingleSyncGroupProgressBar = 0 private val _syncGroupsDialogUiState = MutableStateFlow( - SyncGroupsDialogUiState.Loading + SyncGroupsDialogUiState.Loading, ) val syncGroupsDialogUiState: StateFlow = _syncGroupsDialogUiState private val _syncGroupData: MutableStateFlow = MutableStateFlow( - SyncGroupDialogData() + SyncGroupDialogData(), ) val syncGroupData: StateFlow = _syncGroupData @@ -93,7 +102,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } - /** * This Method Checking network connection and Syncing the LoanAndLoanRepayment. * If found no internet connection then stop syncing the groups and dismiss the dialog. @@ -127,10 +135,10 @@ class SyncGroupsDialogViewModel @Inject constructor( */ private fun checkAccountsSyncStatusAndSyncAccounts() { if (mLoanAccountList.isNotEmpty() && !mLoanAccountSyncStatus) { - //Sync the Active Loan and LoanRepayment + // Sync the Active Loan and LoanRepayment checkNetworkConnectionAndSyncLoanAndLoanRepayment() } else if (mSavingsAccountList.isNotEmpty()) { - //Sync the Active Savings Account + // Sync the Active Savings Account checkNetworkConnectionAndSyncSavingsAccountAndTransactionTemplate() } else { // If LoanAccounts and SavingsAccount are null then sync Client to Database @@ -204,18 +212,17 @@ class SyncGroupsDialogViewModel @Inject constructor( override fun onNext(groupAccounts: GroupAccounts) { mLoanAccountList = getActiveLoanAccounts( - groupAccounts.loanAccounts + groupAccounts.loanAccounts, ) mSavingsAccountList = getActiveSavingsAccounts( - groupAccounts.savingsAccounts + groupAccounts.savingsAccounts, ) - //Updating UI + // Updating UI maxSingleSyncGroupProgressBar = mLoanAccountList.size + mSavingsAccountList.size checkAccountsSyncStatusAndSyncAccounts() } }) - } /** @@ -247,7 +254,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } }) - } /** @@ -275,7 +281,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } }) - } /** @@ -306,7 +311,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } }) - } /** @@ -339,7 +343,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } }) - } /** @@ -350,12 +353,12 @@ class SyncGroupsDialogViewModel @Inject constructor( */ private fun checkAccountsSyncStatusAndSyncClientAccounts() { if (mLoanAccountList.isNotEmpty() && !mLoanAccountSyncStatus) { - //Sync the Active Loan and LoanRepayment + // Sync the Active Loan and LoanRepayment mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let { syncClientLoanAndLoanRepayment(it) } } else if (mSavingsAccountList.isNotEmpty()) { - //Sync the Active Savings Account + // Sync the Active Savings Account mSavingsAccountList[mSavingsAndTransactionSyncIndex].depositType?.endpoint?.let { mSavingsAccountList[mSavingsAndTransactionSyncIndex].id?.let { it1 -> syncClientSavingsAccountAndTemplate(it, it1) @@ -383,11 +386,11 @@ class SyncGroupsDialogViewModel @Inject constructor( val clientAccounts = repository.syncClientAccounts(clientId) mLoanAccountList = getActiveLoanAccounts( clientAccounts - .loanAccounts + .loanAccounts, ) mSavingsAccountList = getSyncableSavingsAccounts( clientAccounts - .savingsAccounts + .savingsAccounts, ) checkAccountsSyncStatusAndSyncClientAccounts() } @@ -421,7 +424,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } }) - } /** @@ -433,7 +435,7 @@ class SyncGroupsDialogViewModel @Inject constructor( */ private fun syncClientSavingsAccountAndTemplate( savingsAccountType: String, - savingsAccountId: Int + savingsAccountId: Int, ) { getSavingsAccountAndTemplate(savingsAccountType, savingsAccountId) .subscribe(object : Subscriber() { @@ -450,7 +452,7 @@ class SyncGroupsDialogViewModel @Inject constructor( mSavingsAccountList[mSavingsAndTransactionSyncIndex].id?.let { it1 -> syncClientSavingsAccountAndTemplate( it, - it1 + it1, ) } } @@ -459,7 +461,6 @@ class SyncGroupsDialogViewModel @Inject constructor( } } }) - } /** @@ -479,7 +480,6 @@ class SyncGroupsDialogViewModel @Inject constructor( mGroupSyncIndex += 1 syncGroups() } - } /** @@ -491,11 +491,11 @@ class SyncGroupsDialogViewModel @Inject constructor( private fun getLoanAndLoanRepayment(loanId: Int): Observable { return Observable.combineLatest( repository.syncLoanById(loanId), - repository.syncLoanRepaymentTemplate(loanId) + repository.syncLoanRepaymentTemplate(loanId), ) { loanWithAssociations, loanRepaymentTemplate -> LoanAndLoanRepayment( loanWithAssociations, - loanRepaymentTemplate + loanRepaymentTemplate, ) } .observeOn(AndroidSchedulers.mainThread()) @@ -510,20 +510,24 @@ class SyncGroupsDialogViewModel @Inject constructor( * @return SavingsAccountAndTransactionTemplate */ private fun getSavingsAccountAndTemplate( - savingsAccountType: String, savingsAccountId: Int + savingsAccountType: String, + savingsAccountId: Int, ): Observable { return Observable.combineLatest( repository.syncSavingsAccount( - savingsAccountType, savingsAccountId, - Constants.TRANSACTIONS + savingsAccountType, + savingsAccountId, + Constants.TRANSACTIONS, ), repository.syncSavingsAccountTransactionTemplate( savingsAccountType, - savingsAccountId, Constants.SAVINGS_ACCOUNT_TRANSACTION_DEPOSIT - ) + savingsAccountId, + Constants.SAVINGS_ACCOUNT_TRANSACTION_DEPOSIT, + ), ) { savingsAccountWithAssociations, savingsAccountTransactionTemplate -> SavingsAccountAndTransactionTemplate( - savingsAccountWithAssociations, savingsAccountTransactionTemplate + savingsAccountWithAssociations, + savingsAccountTransactionTemplate, ) } .observeOn(AndroidSchedulers.mainThread()) @@ -542,14 +546,14 @@ class SyncGroupsDialogViewModel @Inject constructor( } private fun checkNetworkConnection( - taskWhenOnline: () -> Unit + taskWhenOnline: () -> Unit, ) { if (networkUtilsWrapper.isNetworkConnected()) { taskWhenOnline.invoke() } else { _syncGroupsDialogUiState.value = SyncGroupsDialogUiState.Error( messageResId = R.string.feature_groups_error_not_connected_internet, - imageVector = MifosIcons.WifiOff + imageVector = MifosIcons.WifiOff, ) } } @@ -567,7 +571,7 @@ class SyncGroupsDialogViewModel @Inject constructor( Observable.from(savingsAccounts) .filter { savingsAccount -> savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring + !savingsAccount.depositType!!.isRecurring } .subscribe { savingsAccount -> accounts.add(savingsAccount) } return accounts @@ -578,10 +582,10 @@ class SyncGroupsDialogViewModel @Inject constructor( Observable.from(savingsAccounts) .filter { savingsAccount -> savingsAccount.depositType?.value == "Savings" && - savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring + savingsAccount.status?.active == true && + !savingsAccount.depositType!!.isRecurring } .subscribe { savingsAccount -> accounts.add(savingsAccount) } return accounts } -} \ No newline at end of file +} diff --git a/feature/note/src/main/java/com/mifos/feature/note/NoteScreen.kt b/feature/note/src/main/java/com/mifos/feature/note/NoteScreen.kt index d05277cf553..88504adcd5a 100644 --- a/feature/note/src/main/java/com/mifos/feature/note/NoteScreen.kt +++ b/feature/note/src/main/java/com/mifos/feature/note/NoteScreen.kt @@ -87,7 +87,7 @@ internal fun NoteScreen( title = stringResource(id = R.string.feature_note_Note), onBackPressed = onBackPressed, snackbarHostState = snackBarHostState, - modifier = modifier + modifier = modifier, ) { paddingValues -> Box( modifier = Modifier @@ -150,7 +150,7 @@ private fun NoteContent( notes: List, modifier: Modifier = Modifier, ) { - LazyColumn (modifier = modifier) { + LazyColumn(modifier = modifier) { items(notes) { note -> note.noteContent?.let { NoteItem(noteTitle = it) } } diff --git a/feature/report/src/main/java/com/mifos/feature/report/runReport/RunReportScreen.kt b/feature/report/src/main/java/com/mifos/feature/report/runReport/RunReportScreen.kt index cf3f09eb74e..89315132c69 100644 --- a/feature/report/src/main/java/com/mifos/feature/report/runReport/RunReportScreen.kt +++ b/feature/report/src/main/java/com/mifos/feature/report/runReport/RunReportScreen.kt @@ -163,41 +163,62 @@ internal fun RunReportScreen( expanded = showMenu, onDismissRequest = { showMenu = false }, ) { - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_client)) { - onMenuClick(MenuItems.Client) - menuTitle = MenuItems.Client.name - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_loan)) { - onMenuClick(MenuItems.Loan) - menuTitle = MenuItems.Loan.name - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_savings)) { - onMenuClick(MenuItems.Savings) - menuTitle = MenuItems.Savings.name - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_fund)) { - onMenuClick(MenuItems.Fund) - menuTitle = MenuItems.Fund.name - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_accounting)) { - onMenuClick(MenuItems.Accounting) - menuTitle = MenuItems.Accounting.name - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_xbrl)) { - onMenuClick(MenuItems.XBRL) - menuTitle = MenuItems.XBRL.name - showMenu = false - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_report_all)) { - onMenuClick(MenuItems.All) - menuTitle = MenuItems.All.name - showMenu = false - } + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_client), + onClick = { + onMenuClick(MenuItems.Client) + menuTitle = MenuItems.Client.name + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_loan), + onClick = { + onMenuClick(MenuItems.Loan) + menuTitle = MenuItems.Loan.name + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_savings), + onClick = { + onMenuClick(MenuItems.Savings) + menuTitle = MenuItems.Savings.name + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_fund), + onClick = { + onMenuClick(MenuItems.Fund) + menuTitle = MenuItems.Fund.name + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_accounting), + onClick = { + onMenuClick(MenuItems.Accounting) + menuTitle = MenuItems.Accounting.name + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_xbrl), + onClick = { + onMenuClick(MenuItems.XBRL) + menuTitle = MenuItems.XBRL.name + showMenu = false + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_report_all), + onClick = { + onMenuClick(MenuItems.All) + menuTitle = MenuItems.All.name + showMenu = false + }, + ) } }, actions = {}, diff --git a/feature/savings/src/main/java/com/mifos/feature/savings/savingsAccountSummary/SavingsAccountSummaryScreen.kt b/feature/savings/src/main/java/com/mifos/feature/savings/savingsAccountSummary/SavingsAccountSummaryScreen.kt index e586372a47b..fbfc9168cec 100644 --- a/feature/savings/src/main/java/com/mifos/feature/savings/savingsAccountSummary/SavingsAccountSummaryScreen.kt +++ b/feature/savings/src/main/java/com/mifos/feature/savings/savingsAccountSummary/SavingsAccountSummaryScreen.kt @@ -159,14 +159,20 @@ internal fun SavingsAccountSummaryScreen( if (showDropdown) { DropdownMenu(expanded = showDropdown, onDismissRequest = { showDropdown = false }) { - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_savings_more_savings_account_info)) { - showDropdown = false - loadMoreSavingsAccountInfo.invoke() - } - MifosMenuDropDownItem(option = stringResource(id = R.string.feature_savings_documents)) { - showDropdown = false - loadDocuments.invoke() - } + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_savings_more_savings_account_info), + onClick = { + showDropdown = false + loadMoreSavingsAccountInfo.invoke() + }, + ) + MifosMenuDropDownItem( + option = stringResource(id = R.string.feature_savings_documents), + onClick = { + showDropdown = false + loadDocuments.invoke() + }, + ) } } }, diff --git a/feature/settings/src/main/java/com/mifos/feature/settings/settings/SettingsScreen.kt b/feature/settings/src/main/java/com/mifos/feature/settings/settings/SettingsScreen.kt index ca74b702c4d..a29377970fa 100644 --- a/feature/settings/src/main/java/com/mifos/feature/settings/settings/SettingsScreen.kt +++ b/feature/settings/src/main/java/com/mifos/feature/settings/settings/SettingsScreen.kt @@ -66,8 +66,8 @@ internal fun SettingsScreen( navigateToLoginScreen: () -> Unit, changePasscode: (String) -> Unit, languageChanged: () -> Unit, + viewModel: SettingsViewModel = hiltViewModel(), ) { - val viewModel: SettingsViewModel = hiltViewModel() val baseURL by viewModel.baseUrl.collectAsStateWithLifecycle() val tenant by viewModel.tenant.collectAsStateWithLifecycle() val passcode by viewModel.passcode.collectAsStateWithLifecycle() diff --git a/feature/settings/src/main/java/com/mifos/feature/settings/syncSurvey/SyncSurveysDialog.kt b/feature/settings/src/main/java/com/mifos/feature/settings/syncSurvey/SyncSurveysDialog.kt index 90c23283de3..0318d0e95cf 100644 --- a/feature/settings/src/main/java/com/mifos/feature/settings/syncSurvey/SyncSurveysDialog.kt +++ b/feature/settings/src/main/java/com/mifos/feature/settings/syncSurvey/SyncSurveysDialog.kt @@ -150,7 +150,8 @@ internal fun SyncSurveysDialog( is SyncSurveysDialogUiState.ShowSurveysSyncSuccessfully -> { showCancelButton = false LaunchedEffect(key1 = true) { - Toast.makeText(context, R.string.feature_settings_sync_success, Toast.LENGTH_SHORT).show() + Toast.makeText(context, R.string.feature_settings_sync_success, Toast.LENGTH_SHORT) + .show() } } @@ -162,8 +163,9 @@ internal fun SyncSurveysDialog( totalListSize = uiState.total surveySyncProgressMax = uiState.total totalSyncProgressMax = uiState.total - val totalSurveys = uiState.total.toString() + stringResource(R.string.feature_settings_space) + - stringResource(R.string.feature_settings_surveys) + val totalSurveys = + uiState.total.toString() + stringResource(R.string.feature_settings_space) + + stringResource(R.string.feature_settings_surveys) totalSurveysText = totalSurveys syncFailedText = 0.toString() } @@ -174,7 +176,9 @@ internal fun SyncSurveysDialog( surveyName = uiState.name questionSyncProgressMax = uiState.questionTotal val totalSyncCount = - context.getString(R.string.feature_settings_space) + uiState.index + context.getString(R.string.feature_settings_slash) + totalListSize + context.getString(R.string.feature_settings_space) + uiState.index + context.getString( + R.string.feature_settings_slash, + ) + totalListSize totalProgressText = totalSyncCount } @@ -367,8 +371,8 @@ private fun SyncSurveysDialogContent( private fun SyncSurveyButton( text: String, onClick: () -> Unit, - modifier: Modifier = Modifier, isEnabled: Boolean, + modifier: Modifier = Modifier, ) { Button( onClick = onClick, diff --git a/feature/settings/src/main/java/com/mifos/feature/settings/updateServer/UpdateServerConfigScreen.kt b/feature/settings/src/main/java/com/mifos/feature/settings/updateServer/UpdateServerConfigScreen.kt index 867c4af57e4..814215837c0 100644 --- a/feature/settings/src/main/java/com/mifos/feature/settings/updateServer/UpdateServerConfigScreen.kt +++ b/feature/settings/src/main/java/com/mifos/feature/settings/updateServer/UpdateServerConfigScreen.kt @@ -95,14 +95,14 @@ internal fun UpdateServerConfigScreenRoute( @VisibleForTesting @Composable internal fun UpdateServerConfigScreenContent( - modifier: Modifier = Modifier, serverConfig: ServerConfig, + onEvent: (UpdateServerConfigEvent) -> Unit, + modifier: Modifier = Modifier, protocolError: Int? = null, apiPathError: Int? = null, endPointError: Int? = null, portError: Int? = null, tenantError: Int? = null, - onEvent: (UpdateServerConfigEvent) -> Unit, onCloseClick: () -> Unit, ) { val lazyListState = rememberLazyListState() @@ -160,7 +160,7 @@ internal fun UpdateServerConfigScreenContent( } LazyColumn( - modifier = modifier + modifier = Modifier .fillMaxWidth() .padding(horizontal = 12.dp), contentPadding = PaddingValues(4.dp), @@ -277,7 +277,7 @@ internal fun UpdateServerConfigScreenContent( ) } - Spacer(modifier.height(8.dp)) + Spacer(Modifier.height(8.dp)) } item { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 19985107f46..d4145fb90b7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ androidDesugarJdkLibs = "2.0.4" androidIconifyMaterial = "2.2.2" androidJob = "1.2.6" androidMapsUtils = "0.4.2" -androidGradlePlugin = "8.7.3" +androidGradlePlugin = "8.5.0" androidTools = "31.6.0" androidxActivity = "1.8.2" androidxAppCompat = "1.6.1" diff --git a/libs/country-code-picker/build.gradle.kts b/libs/country-code-picker/build.gradle.kts index f6b28408ec7..8d0fd881bd0 100644 --- a/libs/country-code-picker/build.gradle.kts +++ b/libs/country-code-picker/build.gradle.kts @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ plugins { alias(libs.plugins.mifos.android.library) diff --git a/libs/country-code-picker/src/main/AndroidManifest.xml b/libs/country-code-picker/src/main/AndroidManifest.xml index 4ee22a4fb15..b1f5dbb779f 100644 --- a/libs/country-code-picker/src/main/AndroidManifest.xml +++ b/libs/country-code-picker/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/CountryCodePicker.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/CountryCodePicker.kt index 133b7dd9a89..f2ee73c7610 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/CountryCodePicker.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/CountryCodePicker.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/Autofill.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/Autofill.kt index d52d6d75110..b8019b23109 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/Autofill.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/Autofill.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.component diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryCodeDialog.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryCodeDialog.kt index e15e92a6eb4..f5170bedc6b 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryCodeDialog.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryCodeDialog.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.component diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryDialog.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryDialog.kt index f9490bd7104..69382877cf4 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryDialog.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/component/CountryDialog.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.component diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/CountryData.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/CountryData.kt index b54877c9d2d..0d5c7bfa512 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/CountryData.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/CountryData.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.data diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryCodeUtils.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryCodeUtils.kt index 7a6bab35272..52db5150c8f 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryCodeUtils.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryCodeUtils.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.data.utils diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryNameMap.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryNameMap.kt index bd5311b5451..bc1d947f7b5 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryNameMap.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/CountryNameMap.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.data.utils diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/NumberHintMap.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/NumberHintMap.kt index da65203382d..a618e702e70 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/NumberHintMap.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/NumberHintMap.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.data.utils diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/SearchCountryList.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/SearchCountryList.kt index fe6517da157..a8fa0419707 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/SearchCountryList.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/SearchCountryList.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.data.utils diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/ValidatePhoneNumber.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/ValidatePhoneNumber.kt index accc7ac1afc..cbd270d5642 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/ValidatePhoneNumber.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/data/utils/ValidatePhoneNumber.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.data.utils diff --git a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/transformation/PhoneNumberTransformation.kt b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/transformation/PhoneNumberTransformation.kt index 22071a69616..012dac93eb4 100644 --- a/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/transformation/PhoneNumberTransformation.kt +++ b/libs/country-code-picker/src/main/kotlin/com/mifos/library/countrycodepicker/transformation/PhoneNumberTransformation.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.library.countrycodepicker.transformation diff --git a/libs/country-code-picker/src/main/res/values-ar/strings.xml b/libs/country-code-picker/src/main/res/values-ar/strings.xml index 1d50880d393..8fe665044d3 100644 --- a/libs/country-code-picker/src/main/res/values-ar/strings.xml +++ b/libs/country-code-picker/src/main/res/values-ar/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> أفغانستان diff --git a/libs/country-code-picker/src/main/res/values-es/strings.xml b/libs/country-code-picker/src/main/res/values-es/strings.xml index 5c42e6d7267..41fe938cc72 100644 --- a/libs/country-code-picker/src/main/res/values-es/strings.xml +++ b/libs/country-code-picker/src/main/res/values-es/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Afganistán diff --git a/libs/country-code-picker/src/main/res/values-fr/strings.xml b/libs/country-code-picker/src/main/res/values-fr/strings.xml index dcc9a00754a..39cdbed589c 100644 --- a/libs/country-code-picker/src/main/res/values-fr/strings.xml +++ b/libs/country-code-picker/src/main/res/values-fr/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Afghanistan diff --git a/libs/country-code-picker/src/main/res/values-hi/strings.xml b/libs/country-code-picker/src/main/res/values-hi/strings.xml index a5ac82bbf65..5c1daf48ec5 100644 --- a/libs/country-code-picker/src/main/res/values-hi/strings.xml +++ b/libs/country-code-picker/src/main/res/values-hi/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> अफ़ग़ानिस्तान diff --git a/libs/country-code-picker/src/main/res/values-it-rIT/strings.xml b/libs/country-code-picker/src/main/res/values-it-rIT/strings.xml index 2fea5982c73..d81513bb4f3 100644 --- a/libs/country-code-picker/src/main/res/values-it-rIT/strings.xml +++ b/libs/country-code-picker/src/main/res/values-it-rIT/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> "Afghanistan " diff --git a/libs/country-code-picker/src/main/res/values-nl/strings.xml b/libs/country-code-picker/src/main/res/values-nl/strings.xml index 4d40e24dd14..fb895b5c2fe 100644 --- a/libs/country-code-picker/src/main/res/values-nl/strings.xml +++ b/libs/country-code-picker/src/main/res/values-nl/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Afghanistan diff --git a/libs/country-code-picker/src/main/res/values-ru-rRU/strings.xml b/libs/country-code-picker/src/main/res/values-ru-rRU/strings.xml index 6c7705708a3..d145798cddc 100644 --- a/libs/country-code-picker/src/main/res/values-ru-rRU/strings.xml +++ b/libs/country-code-picker/src/main/res/values-ru-rRU/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Афганистан diff --git a/libs/country-code-picker/src/main/res/values-so/strings.xml b/libs/country-code-picker/src/main/res/values-so/strings.xml index acb641a7656..f39cc1379d0 100644 --- a/libs/country-code-picker/src/main/res/values-so/strings.xml +++ b/libs/country-code-picker/src/main/res/values-so/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Afgaanistaan diff --git a/libs/country-code-picker/src/main/res/values-tr-rTR/strings.xml b/libs/country-code-picker/src/main/res/values-tr-rTR/strings.xml index 5f110954451..a254de74f6d 100644 --- a/libs/country-code-picker/src/main/res/values-tr-rTR/strings.xml +++ b/libs/country-code-picker/src/main/res/values-tr-rTR/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Afganistan diff --git a/libs/country-code-picker/src/main/res/values-zh/strings.xml b/libs/country-code-picker/src/main/res/values-zh/strings.xml index cfb6193a7bb..1ad7f5a0351 100644 --- a/libs/country-code-picker/src/main/res/values-zh/strings.xml +++ b/libs/country-code-picker/src/main/res/values-zh/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> 阿富汗 diff --git a/libs/country-code-picker/src/main/res/values/strings.xml b/libs/country-code-picker/src/main/res/values/strings.xml index bbf2d124c0d..3e37f7b4d89 100644 --- a/libs/country-code-picker/src/main/res/values/strings.xml +++ b/libs/country-code-picker/src/main/res/values/strings.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Afghanistan diff --git a/libs/mifos-passcode/build.gradle.kts b/libs/mifos-passcode/build.gradle.kts index daf33a0fba8..db1623b89f4 100644 --- a/libs/mifos-passcode/build.gradle.kts +++ b/libs/mifos-passcode/build.gradle.kts @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ plugins { alias(libs.plugins.mifos.android.library) diff --git a/libs/mifos-passcode/src/main/AndroidManifest.xml b/libs/mifos-passcode/src/main/AndroidManifest.xml index 8951201ecaa..b6445bf0aef 100644 --- a/libs/mifos-passcode/src/main/AndroidManifest.xml +++ b/libs/mifos-passcode/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PassCodeScreen.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PassCodeScreen.kt index 06178d81875..099fddf2da3 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PassCodeScreen.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PassCodeScreen.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PasscodeNavigation.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PasscodeNavigation.kt index 40e13b5d239..7557ffd728b 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PasscodeNavigation.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/PasscodeNavigation.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/MifosIcon.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/MifosIcon.kt index c5f5de8ab14..72718b423e7 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/MifosIcon.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/MifosIcon.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeButton.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeButton.kt index 6827424393a..e351ce76f65 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeButton.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeButton.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeHeader.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeHeader.kt index 8bcce7ab032..48d511786ba 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeHeader.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeHeader.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeKeys.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeKeys.kt index a3c73790340..afbc83cebac 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeKeys.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeKeys.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeMismatchedDialog.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeMismatchedDialog.kt index aea895fe7a5..63183a98d4b 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeMismatchedDialog.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeMismatchedDialog.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeStepIndicator.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeStepIndicator.kt index 5fd7c24d25c..489432e220d 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeStepIndicator.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeStepIndicator.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeToolbar.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeToolbar.kt index 2bbd418a54f..834f9e9695d 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeToolbar.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/component/PasscodeToolbar.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.component diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeManager.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeManager.kt index 3c2bebba5e3..446f4ed56b7 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeManager.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeManager.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.data diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepository.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepository.kt index fc6bbf1d2fb..1ca4fa99e53 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepository.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepository.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.data diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepositoryImpl.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepositoryImpl.kt index 49a8c676bec..91d92809583 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepositoryImpl.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/data/PasscodeRepositoryImpl.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.data diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/di/ApplicationModule.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/di/ApplicationModule.kt index 3631545e333..bec4e5edbed 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/di/ApplicationModule.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/di/ApplicationModule.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.di diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Color.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Color.kt index ff877a70d52..636aeedd4e9 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Color.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Color.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.theme diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Font.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Font.kt index 9cbfba4d56a..8497a0bc1aa 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Font.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Font.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.theme diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Theme.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Theme.kt index 11a7a24ae15..d083f6865eb 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Theme.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Theme.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.theme diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Type.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Type.kt index b0cd4c1ca68..01f6f3203bc 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Type.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/theme/Type.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.theme diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Constants.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Constants.kt index 3e548137ecc..93a4da2a6cb 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Constants.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Constants.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.utility diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/PreferenceManager.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/PreferenceManager.kt index 39a9890f6db..3190b8d0fb2 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/PreferenceManager.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/PreferenceManager.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.utility diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/ShakeAnimation.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/ShakeAnimation.kt index d67c772a402..595f8ed6fae 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/ShakeAnimation.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/ShakeAnimation.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.utility diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Step.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Step.kt index 205a96b14f4..553c12ffff5 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Step.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/Step.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.utility diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/VibrationFeedback.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/VibrationFeedback.kt index 5ae88425508..37cc0815575 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/VibrationFeedback.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/utility/VibrationFeedback.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.utility diff --git a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/viewmodels/PasscodeViewModel.kt b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/viewmodels/PasscodeViewModel.kt index fd1ab4d968d..22bcb4f9df3 100644 --- a/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/viewmodels/PasscodeViewModel.kt +++ b/libs/mifos-passcode/src/main/kotlin/org/mifos/library/passcode/viewmodels/PasscodeViewModel.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package org.mifos.library.passcode.viewmodels diff --git a/libs/mifos-passcode/src/main/res/drawable/lib_mifos_passcode_delete_forever.xml b/libs/mifos-passcode/src/main/res/drawable/lib_mifos_passcode_delete_forever.xml index ff49c209c19..2698edaa25d 100644 --- a/libs/mifos-passcode/src/main/res/drawable/lib_mifos_passcode_delete_forever.xml +++ b/libs/mifos-passcode/src/main/res/drawable/lib_mifos_passcode_delete_forever.xml @@ -6,7 +6,7 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> Passcode will be reset, are you sure? diff --git a/libs/pullrefresh/build.gradle.kts b/libs/pullrefresh/build.gradle.kts index 49b96c380f1..48b925a4976 100644 --- a/libs/pullrefresh/build.gradle.kts +++ b/libs/pullrefresh/build.gradle.kts @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ plugins { alias(libs.plugins.mifos.android.library) diff --git a/libs/pullrefresh/src/main/AndroidManifest.xml b/libs/pullrefresh/src/main/AndroidManifest.xml index c04f75ad024..e3bbec2c3a7 100644 --- a/libs/pullrefresh/src/main/AndroidManifest.xml +++ b/libs/pullrefresh/src/main/AndroidManifest.xml @@ -6,6 +6,6 @@ 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 + See https://github.com/openMF/android-client/blob/master/LICENSE.md --> \ No newline at end of file diff --git a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefresh.kt b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefresh.kt index 0f015468a70..e93fdf00736 100644 --- a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefresh.kt +++ b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefresh.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ @file:Suppress("InvalidPackageDeclaration") diff --git a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicator.kt b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicator.kt index 420774be5d0..8ea207a45f5 100644 --- a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicator.kt +++ b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicator.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ @file:Suppress("InvalidPackageDeclaration") diff --git a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicatorTransform.kt b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicatorTransform.kt index 08b24bcf041..254c160c6dd 100644 --- a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicatorTransform.kt +++ b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshIndicatorTransform.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ @file:Suppress("InvalidPackageDeclaration") diff --git a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshState.kt b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshState.kt index cae2b925f57..d9f4834950c 100644 --- a/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshState.kt +++ b/libs/pullrefresh/src/main/kotlin/com.mifos.library.pullrefresh/PullRefreshState.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ @file:Suppress("InvalidPackageDeclaration") diff --git a/mifosng-android/build.gradle.kts b/mifosng-android/build.gradle.kts index 5753205358f..9344617c017 100644 --- a/mifosng-android/build.gradle.kts +++ b/mifosng-android/build.gradle.kts @@ -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/android-client/blob/master/LICENSE.md + */ import org.gradle.api.tasks.testing.logging.TestLogEvent import org.mifos.MifosBuildType @@ -262,4 +271,11 @@ dependencies { //coil implementation(libs.coil.kt.compose) -} \ No newline at end of file +} + +dependencyGuard { + configuration("demoDebugCompileClasspath") + configuration("demoReleaseCompileClasspath") + configuration("prodDebugCompileClasspath") + configuration("prodReleaseCompileClasspath") +} diff --git a/mifosng-android/dependencies/demoDebugCompileClasspath.txt b/mifosng-android/dependencies/demoDebugCompileClasspath.txt new file mode 100644 index 00000000000..b110e25982f --- /dev/null +++ b/mifosng-android/dependencies/demoDebugCompileClasspath.txt @@ -0,0 +1,207 @@ +androidx.activity:activity-compose:1.8.2 +androidx.activity:activity-ktx:1.8.2 +androidx.activity:activity:1.8.2 +androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-jvm:1.7.1 +androidx.annotation:annotation:1.7.1 +androidx.appcompat:appcompat-resources:1.7.0 +androidx.appcompat:appcompat:1.7.0 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.asynclayoutinflater:asynclayoutinflater:1.0.0 +androidx.cardview:cardview:1.0.0 +androidx.collection:collection-jvm:1.4.0 +androidx.collection:collection-ktx:1.4.0 +androidx.collection:collection:1.4.0 +androidx.compose.animation:animation-android:1.6.8 +androidx.compose.animation:animation-core-android:1.6.8 +androidx.compose.animation:animation-core:1.6.8 +androidx.compose.animation:animation:1.6.8 +androidx.compose.compiler:compiler:1.5.10 +androidx.compose.foundation:foundation-android:1.6.8 +androidx.compose.foundation:foundation-layout-android:1.6.8 +androidx.compose.foundation:foundation-layout:1.6.8 +androidx.compose.foundation:foundation:1.6.8 +androidx.compose.material3:material3-android:1.2.1 +androidx.compose.material3:material3:1.2.1 +androidx.compose.material:material-android:1.6.8 +androidx.compose.material:material-icons-core-android:1.6.8 +androidx.compose.material:material-icons-core:1.6.8 +androidx.compose.material:material-icons-extended-android:1.6.8 +androidx.compose.material:material-icons-extended:1.6.8 +androidx.compose.material:material-ripple-android:1.6.8 +androidx.compose.material:material-ripple:1.6.8 +androidx.compose.material:material:1.6.8 +androidx.compose.runtime:runtime-android:1.6.8 +androidx.compose.runtime:runtime-saveable-android:1.6.8 +androidx.compose.runtime:runtime-saveable:1.6.8 +androidx.compose.runtime:runtime:1.6.8 +androidx.compose.ui:ui-android:1.6.8 +androidx.compose.ui:ui-geometry-android:1.6.8 +androidx.compose.ui:ui-geometry:1.6.8 +androidx.compose.ui:ui-graphics-android:1.6.8 +androidx.compose.ui:ui-graphics:1.6.8 +androidx.compose.ui:ui-test-android:1.6.8 +androidx.compose.ui:ui-test-junit4-android:1.6.8 +androidx.compose.ui:ui-test-junit4:1.6.8 +androidx.compose.ui:ui-test-manifest:1.6.8 +androidx.compose.ui:ui-test:1.6.8 +androidx.compose.ui:ui-text-android:1.6.8 +androidx.compose.ui:ui-text:1.6.8 +androidx.compose.ui:ui-tooling-android:1.6.8 +androidx.compose.ui:ui-tooling-data-android:1.6.8 +androidx.compose.ui:ui-tooling-data:1.6.8 +androidx.compose.ui:ui-tooling-preview-android:1.6.8 +androidx.compose.ui:ui-tooling-preview:1.6.8 +androidx.compose.ui:ui-tooling:1.6.8 +androidx.compose.ui:ui-unit-android:1.6.8 +androidx.compose.ui:ui-unit:1.6.8 +androidx.compose.ui:ui-util-android:1.6.8 +androidx.compose.ui:ui-util:1.6.8 +androidx.compose.ui:ui:1.6.8 +androidx.compose:compose-bom:2024.02.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.constraintlayout:constraintlayout-solver:2.0.1 +androidx.constraintlayout:constraintlayout:2.0.1 +androidx.coordinatorlayout:coordinatorlayout:1.1.0 +androidx.core:core-ktx:1.13.0 +androidx.core:core-splashscreen:1.0.1 +androidx.core:core:1.13.0 +androidx.cursoradapter:cursoradapter:1.0.0 +androidx.customview:customview:1.1.0 +androidx.databinding:viewbinding:8.5.0 +androidx.documentfile:documentfile:1.0.0 +androidx.drawerlayout:drawerlayout:1.1.1 +androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.exifinterface:exifinterface:1.3.6 +androidx.fragment:fragment-ktx:1.6.2 +androidx.fragment:fragment:1.6.2 +androidx.hilt:hilt-navigation-compose:1.2.0 +androidx.hilt:hilt-navigation:1.2.0 +androidx.interpolator:interpolator:1.0.0 +androidx.legacy:legacy-support-core-ui:1.0.0 +androidx.legacy:legacy-support-core-utils:1.0.0 +androidx.legacy:legacy-support-v4:1.0.0 +androidx.lifecycle:lifecycle-common-java8:2.7.0 +androidx.lifecycle:lifecycle-common:2.7.0 +androidx.lifecycle:lifecycle-extensions:2.2.0 +androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata-core:2.7.0 +androidx.lifecycle:lifecycle-livedata-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata:2.7.0 +androidx.lifecycle:lifecycle-process:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams-ktx:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams:2.7.0 +androidx.lifecycle:lifecycle-runtime-compose:2.7.0 +androidx.lifecycle:lifecycle-runtime-ktx:2.7.0 +androidx.lifecycle:lifecycle-runtime:2.7.0 +androidx.lifecycle:lifecycle-service:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0 +androidx.lifecycle:lifecycle-viewmodel:2.7.0 +androidx.loader:loader:1.0.0 +androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 +androidx.media:media:1.0.0 +androidx.metrics:metrics-performance:1.0.0-beta01 +androidx.multidex:multidex:2.0.1 +androidx.navigation:navigation-common-ktx:2.7.7 +androidx.navigation:navigation-common:2.7.7 +androidx.navigation:navigation-compose:2.7.7 +androidx.navigation:navigation-fragment-ktx:2.7.7 +androidx.navigation:navigation-fragment:2.7.7 +androidx.navigation:navigation-runtime-ktx:2.7.7 +androidx.navigation:navigation-runtime:2.7.7 +androidx.navigation:navigation-ui-ktx:2.7.7 +androidx.navigation:navigation-ui:2.7.7 +androidx.paging:paging-common-ktx:3.2.1 +androidx.paging:paging-common:3.2.1 +androidx.paging:paging-runtime-ktx:3.2.1 +androidx.paging:paging-runtime:3.2.1 +androidx.preference:preference-ktx:1.2.1 +androidx.preference:preference:1.2.1 +androidx.print:print:1.0.0 +androidx.recyclerview:recyclerview:1.3.2 +androidx.resourceinspection:resourceinspection-annotation:1.0.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.slidingpanelayout:slidingpanelayout:1.2.0 +androidx.startup:startup-runtime:1.1.1 +androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 +androidx.test.espresso:espresso-idling-resource:3.5.1 +androidx.test.ext:junit:1.1.5 +androidx.test.services:storage:1.4.2 +androidx.test:annotation:1.0.1 +androidx.test:core:1.5.0 +androidx.test:monitor:1.6.1 +androidx.tracing:tracing:1.2.0 +androidx.transition:transition:1.4.1 +androidx.vectordrawable:vectordrawable-animated:1.1.0 +androidx.vectordrawable:vectordrawable:1.1.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +androidx.viewpager2:viewpager2:1.1.0-beta02 +androidx.viewpager:viewpager:1.0.0 +com.evernote:android-job:1.2.6 +com.facebook.stetho:stetho-okhttp3:1.3.1 +com.facebook.stetho:stetho:1.3.1 +com.github.amulyakhare:TextDrawable:558677ea31 +com.github.bumptech.glide:annotations:4.15.1 +com.github.bumptech.glide:disklrucache:4.15.1 +com.github.bumptech.glide:gifdecoder:4.15.1 +com.github.bumptech.glide:glide:4.15.1 +com.github.deano2390:MaterialShowcaseView:1.3.7 +com.github.openMF:fineract-client-cmp:0.0.1 +com.github.openMF:fineract-client-sdk-cmp:0.0.1 +com.github.raizlabs.dbflow.dbflow:dbflow-core:3.1.1 +com.github.raizlabs.dbflow.dbflow:dbflow:3.1.1 +com.github.therajanmaurya:sweet-error:1.0.9 +com.google.android.gms:play-services-base:18.1.0 +com.google.android.gms:play-services-basement:18.1.0 +com.google.android.gms:play-services-location:21.1.0 +com.google.android.gms:play-services-maps:18.2.0 +com.google.android.gms:play-services-places-placereport:17.0.0 +com.google.android.gms:play-services-places:17.0.0 +com.google.android.gms:play-services-tasks:18.0.2 +com.google.android.material:material:1.11.0 +com.google.code.findbugs:jsr305:3.0.2 +com.google.code.gson:gson:2.10.1 +com.google.dagger:dagger-lint-aar:2.51 +com.google.dagger:dagger:2.51 +com.google.dagger:hilt-android:2.51 +com.google.dagger:hilt-core:2.51 +com.google.guava:listenablefuture:1.0 +com.google.maps.android:android-maps-utils:0.4.2 +com.jakewharton.fliptables:fliptables:1.0.1 +com.joanzapata.iconify:android-iconify-material:2.2.2 +com.joanzapata.iconify:android-iconify:2.2.2 +com.squareup.okhttp3:logging-interceptor:4.12.0 +com.squareup.okhttp3:okhttp:4.12.0 +com.squareup.okio:okio-jvm:3.7.0 +com.squareup.okio:okio:3.7.0 +com.squareup.retrofit2:adapter-rxjava:2.9.0 +com.squareup.retrofit2:converter-gson:2.10.0 +com.squareup.retrofit2:converter-scalars:2.10.0 +com.squareup.retrofit2:retrofit:2.10.0 +commons-cli:commons-cli:1.2 +io.coil-kt:coil-base:2.5.0 +io.coil-kt:coil-compose-base:2.5.0 +io.coil-kt:coil-compose:2.5.0 +io.coil-kt:coil:2.5.0 +io.reactivex:rxandroid:1.1.0 +io.reactivex:rxjava:1.3.8 +javax.inject:javax.inject:1 +junit:junit:4.13.2 +org.hamcrest:hamcrest-core:1.3 +org.jetbrains.kotlin:kotlin-stdlib-common:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib:2.0.0 +org.jetbrains.kotlin:kotlin-test:1.9.22 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0 +org.jetbrains:annotations:23.0.0 +org.reactivestreams:reactive-streams:1.0.0 diff --git a/mifosng-android/dependencies/demoReleaseCompileClasspath.txt b/mifosng-android/dependencies/demoReleaseCompileClasspath.txt new file mode 100644 index 00000000000..41e67601279 --- /dev/null +++ b/mifosng-android/dependencies/demoReleaseCompileClasspath.txt @@ -0,0 +1,202 @@ +androidx.activity:activity-compose:1.8.2 +androidx.activity:activity-ktx:1.8.2 +androidx.activity:activity:1.8.2 +androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-jvm:1.7.1 +androidx.annotation:annotation:1.7.1 +androidx.appcompat:appcompat-resources:1.7.0 +androidx.appcompat:appcompat:1.7.0 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.asynclayoutinflater:asynclayoutinflater:1.0.0 +androidx.cardview:cardview:1.0.0 +androidx.collection:collection-jvm:1.4.0 +androidx.collection:collection-ktx:1.4.0 +androidx.collection:collection:1.4.0 +androidx.compose.animation:animation-android:1.6.8 +androidx.compose.animation:animation-core-android:1.6.8 +androidx.compose.animation:animation-core:1.6.8 +androidx.compose.animation:animation:1.6.8 +androidx.compose.compiler:compiler:1.5.10 +androidx.compose.foundation:foundation-android:1.6.8 +androidx.compose.foundation:foundation-layout-android:1.6.8 +androidx.compose.foundation:foundation-layout:1.6.8 +androidx.compose.foundation:foundation:1.6.8 +androidx.compose.material3:material3-android:1.2.1 +androidx.compose.material3:material3:1.2.1 +androidx.compose.material:material-android:1.6.8 +androidx.compose.material:material-icons-core-android:1.6.8 +androidx.compose.material:material-icons-core:1.6.8 +androidx.compose.material:material-icons-extended-android:1.6.8 +androidx.compose.material:material-icons-extended:1.6.8 +androidx.compose.material:material-ripple-android:1.6.8 +androidx.compose.material:material-ripple:1.6.8 +androidx.compose.material:material:1.6.8 +androidx.compose.runtime:runtime-android:1.6.8 +androidx.compose.runtime:runtime-saveable-android:1.6.8 +androidx.compose.runtime:runtime-saveable:1.6.8 +androidx.compose.runtime:runtime:1.6.8 +androidx.compose.ui:ui-android:1.6.8 +androidx.compose.ui:ui-geometry-android:1.6.8 +androidx.compose.ui:ui-geometry:1.6.8 +androidx.compose.ui:ui-graphics-android:1.6.8 +androidx.compose.ui:ui-graphics:1.6.8 +androidx.compose.ui:ui-test-android:1.6.8 +androidx.compose.ui:ui-test-junit4-android:1.6.8 +androidx.compose.ui:ui-test-junit4:1.6.8 +androidx.compose.ui:ui-test:1.6.8 +androidx.compose.ui:ui-text-android:1.6.8 +androidx.compose.ui:ui-text:1.6.8 +androidx.compose.ui:ui-tooling-preview-android:1.6.8 +androidx.compose.ui:ui-tooling-preview:1.6.8 +androidx.compose.ui:ui-unit-android:1.6.8 +androidx.compose.ui:ui-unit:1.6.8 +androidx.compose.ui:ui-util-android:1.6.8 +androidx.compose.ui:ui-util:1.6.8 +androidx.compose.ui:ui:1.6.8 +androidx.compose:compose-bom:2024.02.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.constraintlayout:constraintlayout-solver:2.0.1 +androidx.constraintlayout:constraintlayout:2.0.1 +androidx.coordinatorlayout:coordinatorlayout:1.1.0 +androidx.core:core-ktx:1.13.0 +androidx.core:core-splashscreen:1.0.1 +androidx.core:core:1.13.0 +androidx.cursoradapter:cursoradapter:1.0.0 +androidx.customview:customview:1.1.0 +androidx.databinding:viewbinding:8.5.0 +androidx.documentfile:documentfile:1.0.0 +androidx.drawerlayout:drawerlayout:1.1.1 +androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.exifinterface:exifinterface:1.3.6 +androidx.fragment:fragment-ktx:1.6.2 +androidx.fragment:fragment:1.6.2 +androidx.hilt:hilt-navigation-compose:1.2.0 +androidx.hilt:hilt-navigation:1.2.0 +androidx.interpolator:interpolator:1.0.0 +androidx.legacy:legacy-support-core-ui:1.0.0 +androidx.legacy:legacy-support-core-utils:1.0.0 +androidx.legacy:legacy-support-v4:1.0.0 +androidx.lifecycle:lifecycle-common-java8:2.7.0 +androidx.lifecycle:lifecycle-common:2.7.0 +androidx.lifecycle:lifecycle-extensions:2.2.0 +androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata-core:2.7.0 +androidx.lifecycle:lifecycle-livedata-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata:2.7.0 +androidx.lifecycle:lifecycle-process:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams-ktx:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams:2.7.0 +androidx.lifecycle:lifecycle-runtime-compose:2.7.0 +androidx.lifecycle:lifecycle-runtime-ktx:2.7.0 +androidx.lifecycle:lifecycle-runtime:2.7.0 +androidx.lifecycle:lifecycle-service:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0 +androidx.lifecycle:lifecycle-viewmodel:2.7.0 +androidx.loader:loader:1.0.0 +androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 +androidx.media:media:1.0.0 +androidx.metrics:metrics-performance:1.0.0-beta01 +androidx.multidex:multidex:2.0.1 +androidx.navigation:navigation-common-ktx:2.7.7 +androidx.navigation:navigation-common:2.7.7 +androidx.navigation:navigation-compose:2.7.7 +androidx.navigation:navigation-fragment-ktx:2.7.7 +androidx.navigation:navigation-fragment:2.7.7 +androidx.navigation:navigation-runtime-ktx:2.7.7 +androidx.navigation:navigation-runtime:2.7.7 +androidx.navigation:navigation-ui-ktx:2.7.7 +androidx.navigation:navigation-ui:2.7.7 +androidx.paging:paging-common-ktx:3.2.1 +androidx.paging:paging-common:3.2.1 +androidx.paging:paging-runtime-ktx:3.2.1 +androidx.paging:paging-runtime:3.2.1 +androidx.preference:preference-ktx:1.2.1 +androidx.preference:preference:1.2.1 +androidx.print:print:1.0.0 +androidx.recyclerview:recyclerview:1.3.2 +androidx.resourceinspection:resourceinspection-annotation:1.0.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.slidingpanelayout:slidingpanelayout:1.2.0 +androidx.startup:startup-runtime:1.1.1 +androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 +androidx.test.espresso:espresso-idling-resource:3.5.1 +androidx.test.ext:junit:1.1.5 +androidx.test.services:storage:1.4.2 +androidx.test:annotation:1.0.1 +androidx.test:core:1.5.0 +androidx.test:monitor:1.6.1 +androidx.tracing:tracing:1.2.0 +androidx.transition:transition:1.4.1 +androidx.vectordrawable:vectordrawable-animated:1.1.0 +androidx.vectordrawable:vectordrawable:1.1.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +androidx.viewpager2:viewpager2:1.1.0-beta02 +androidx.viewpager:viewpager:1.0.0 +com.evernote:android-job:1.2.6 +com.facebook.stetho:stetho-okhttp3:1.3.1 +com.facebook.stetho:stetho:1.3.1 +com.github.amulyakhare:TextDrawable:558677ea31 +com.github.bumptech.glide:annotations:4.15.1 +com.github.bumptech.glide:disklrucache:4.15.1 +com.github.bumptech.glide:gifdecoder:4.15.1 +com.github.bumptech.glide:glide:4.15.1 +com.github.deano2390:MaterialShowcaseView:1.3.7 +com.github.openMF:fineract-client-cmp:0.0.1 +com.github.openMF:fineract-client-sdk-cmp:0.0.1 +com.github.raizlabs.dbflow.dbflow:dbflow-core:3.1.1 +com.github.raizlabs.dbflow.dbflow:dbflow:3.1.1 +com.github.therajanmaurya:sweet-error:1.0.9 +com.google.android.gms:play-services-base:18.1.0 +com.google.android.gms:play-services-basement:18.1.0 +com.google.android.gms:play-services-location:21.1.0 +com.google.android.gms:play-services-maps:18.2.0 +com.google.android.gms:play-services-places-placereport:17.0.0 +com.google.android.gms:play-services-places:17.0.0 +com.google.android.gms:play-services-tasks:18.0.2 +com.google.android.material:material:1.11.0 +com.google.code.findbugs:jsr305:3.0.2 +com.google.code.gson:gson:2.10.1 +com.google.dagger:dagger-lint-aar:2.51 +com.google.dagger:dagger:2.51 +com.google.dagger:hilt-android:2.51 +com.google.dagger:hilt-core:2.51 +com.google.guava:listenablefuture:1.0 +com.google.maps.android:android-maps-utils:0.4.2 +com.jakewharton.fliptables:fliptables:1.0.1 +com.joanzapata.iconify:android-iconify-material:2.2.2 +com.joanzapata.iconify:android-iconify:2.2.2 +com.squareup.okhttp3:logging-interceptor:4.12.0 +com.squareup.okhttp3:okhttp:4.12.0 +com.squareup.okio:okio-jvm:3.7.0 +com.squareup.okio:okio:3.7.0 +com.squareup.retrofit2:adapter-rxjava:2.9.0 +com.squareup.retrofit2:converter-gson:2.10.0 +com.squareup.retrofit2:converter-scalars:2.10.0 +com.squareup.retrofit2:retrofit:2.10.0 +commons-cli:commons-cli:1.2 +io.coil-kt:coil-base:2.5.0 +io.coil-kt:coil-compose-base:2.5.0 +io.coil-kt:coil-compose:2.5.0 +io.coil-kt:coil:2.5.0 +io.reactivex:rxandroid:1.1.0 +io.reactivex:rxjava:1.3.8 +javax.inject:javax.inject:1 +junit:junit:4.13.2 +org.hamcrest:hamcrest-core:1.3 +org.jetbrains.kotlin:kotlin-stdlib-common:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib:2.0.0 +org.jetbrains.kotlin:kotlin-test:1.9.22 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0 +org.jetbrains:annotations:23.0.0 +org.reactivestreams:reactive-streams:1.0.0 diff --git a/mifosng-android/dependencies/prodDebugCompileClasspath.txt b/mifosng-android/dependencies/prodDebugCompileClasspath.txt new file mode 100644 index 00000000000..b110e25982f --- /dev/null +++ b/mifosng-android/dependencies/prodDebugCompileClasspath.txt @@ -0,0 +1,207 @@ +androidx.activity:activity-compose:1.8.2 +androidx.activity:activity-ktx:1.8.2 +androidx.activity:activity:1.8.2 +androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-jvm:1.7.1 +androidx.annotation:annotation:1.7.1 +androidx.appcompat:appcompat-resources:1.7.0 +androidx.appcompat:appcompat:1.7.0 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.asynclayoutinflater:asynclayoutinflater:1.0.0 +androidx.cardview:cardview:1.0.0 +androidx.collection:collection-jvm:1.4.0 +androidx.collection:collection-ktx:1.4.0 +androidx.collection:collection:1.4.0 +androidx.compose.animation:animation-android:1.6.8 +androidx.compose.animation:animation-core-android:1.6.8 +androidx.compose.animation:animation-core:1.6.8 +androidx.compose.animation:animation:1.6.8 +androidx.compose.compiler:compiler:1.5.10 +androidx.compose.foundation:foundation-android:1.6.8 +androidx.compose.foundation:foundation-layout-android:1.6.8 +androidx.compose.foundation:foundation-layout:1.6.8 +androidx.compose.foundation:foundation:1.6.8 +androidx.compose.material3:material3-android:1.2.1 +androidx.compose.material3:material3:1.2.1 +androidx.compose.material:material-android:1.6.8 +androidx.compose.material:material-icons-core-android:1.6.8 +androidx.compose.material:material-icons-core:1.6.8 +androidx.compose.material:material-icons-extended-android:1.6.8 +androidx.compose.material:material-icons-extended:1.6.8 +androidx.compose.material:material-ripple-android:1.6.8 +androidx.compose.material:material-ripple:1.6.8 +androidx.compose.material:material:1.6.8 +androidx.compose.runtime:runtime-android:1.6.8 +androidx.compose.runtime:runtime-saveable-android:1.6.8 +androidx.compose.runtime:runtime-saveable:1.6.8 +androidx.compose.runtime:runtime:1.6.8 +androidx.compose.ui:ui-android:1.6.8 +androidx.compose.ui:ui-geometry-android:1.6.8 +androidx.compose.ui:ui-geometry:1.6.8 +androidx.compose.ui:ui-graphics-android:1.6.8 +androidx.compose.ui:ui-graphics:1.6.8 +androidx.compose.ui:ui-test-android:1.6.8 +androidx.compose.ui:ui-test-junit4-android:1.6.8 +androidx.compose.ui:ui-test-junit4:1.6.8 +androidx.compose.ui:ui-test-manifest:1.6.8 +androidx.compose.ui:ui-test:1.6.8 +androidx.compose.ui:ui-text-android:1.6.8 +androidx.compose.ui:ui-text:1.6.8 +androidx.compose.ui:ui-tooling-android:1.6.8 +androidx.compose.ui:ui-tooling-data-android:1.6.8 +androidx.compose.ui:ui-tooling-data:1.6.8 +androidx.compose.ui:ui-tooling-preview-android:1.6.8 +androidx.compose.ui:ui-tooling-preview:1.6.8 +androidx.compose.ui:ui-tooling:1.6.8 +androidx.compose.ui:ui-unit-android:1.6.8 +androidx.compose.ui:ui-unit:1.6.8 +androidx.compose.ui:ui-util-android:1.6.8 +androidx.compose.ui:ui-util:1.6.8 +androidx.compose.ui:ui:1.6.8 +androidx.compose:compose-bom:2024.02.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.constraintlayout:constraintlayout-solver:2.0.1 +androidx.constraintlayout:constraintlayout:2.0.1 +androidx.coordinatorlayout:coordinatorlayout:1.1.0 +androidx.core:core-ktx:1.13.0 +androidx.core:core-splashscreen:1.0.1 +androidx.core:core:1.13.0 +androidx.cursoradapter:cursoradapter:1.0.0 +androidx.customview:customview:1.1.0 +androidx.databinding:viewbinding:8.5.0 +androidx.documentfile:documentfile:1.0.0 +androidx.drawerlayout:drawerlayout:1.1.1 +androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.exifinterface:exifinterface:1.3.6 +androidx.fragment:fragment-ktx:1.6.2 +androidx.fragment:fragment:1.6.2 +androidx.hilt:hilt-navigation-compose:1.2.0 +androidx.hilt:hilt-navigation:1.2.0 +androidx.interpolator:interpolator:1.0.0 +androidx.legacy:legacy-support-core-ui:1.0.0 +androidx.legacy:legacy-support-core-utils:1.0.0 +androidx.legacy:legacy-support-v4:1.0.0 +androidx.lifecycle:lifecycle-common-java8:2.7.0 +androidx.lifecycle:lifecycle-common:2.7.0 +androidx.lifecycle:lifecycle-extensions:2.2.0 +androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata-core:2.7.0 +androidx.lifecycle:lifecycle-livedata-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata:2.7.0 +androidx.lifecycle:lifecycle-process:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams-ktx:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams:2.7.0 +androidx.lifecycle:lifecycle-runtime-compose:2.7.0 +androidx.lifecycle:lifecycle-runtime-ktx:2.7.0 +androidx.lifecycle:lifecycle-runtime:2.7.0 +androidx.lifecycle:lifecycle-service:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0 +androidx.lifecycle:lifecycle-viewmodel:2.7.0 +androidx.loader:loader:1.0.0 +androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 +androidx.media:media:1.0.0 +androidx.metrics:metrics-performance:1.0.0-beta01 +androidx.multidex:multidex:2.0.1 +androidx.navigation:navigation-common-ktx:2.7.7 +androidx.navigation:navigation-common:2.7.7 +androidx.navigation:navigation-compose:2.7.7 +androidx.navigation:navigation-fragment-ktx:2.7.7 +androidx.navigation:navigation-fragment:2.7.7 +androidx.navigation:navigation-runtime-ktx:2.7.7 +androidx.navigation:navigation-runtime:2.7.7 +androidx.navigation:navigation-ui-ktx:2.7.7 +androidx.navigation:navigation-ui:2.7.7 +androidx.paging:paging-common-ktx:3.2.1 +androidx.paging:paging-common:3.2.1 +androidx.paging:paging-runtime-ktx:3.2.1 +androidx.paging:paging-runtime:3.2.1 +androidx.preference:preference-ktx:1.2.1 +androidx.preference:preference:1.2.1 +androidx.print:print:1.0.0 +androidx.recyclerview:recyclerview:1.3.2 +androidx.resourceinspection:resourceinspection-annotation:1.0.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.slidingpanelayout:slidingpanelayout:1.2.0 +androidx.startup:startup-runtime:1.1.1 +androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 +androidx.test.espresso:espresso-idling-resource:3.5.1 +androidx.test.ext:junit:1.1.5 +androidx.test.services:storage:1.4.2 +androidx.test:annotation:1.0.1 +androidx.test:core:1.5.0 +androidx.test:monitor:1.6.1 +androidx.tracing:tracing:1.2.0 +androidx.transition:transition:1.4.1 +androidx.vectordrawable:vectordrawable-animated:1.1.0 +androidx.vectordrawable:vectordrawable:1.1.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +androidx.viewpager2:viewpager2:1.1.0-beta02 +androidx.viewpager:viewpager:1.0.0 +com.evernote:android-job:1.2.6 +com.facebook.stetho:stetho-okhttp3:1.3.1 +com.facebook.stetho:stetho:1.3.1 +com.github.amulyakhare:TextDrawable:558677ea31 +com.github.bumptech.glide:annotations:4.15.1 +com.github.bumptech.glide:disklrucache:4.15.1 +com.github.bumptech.glide:gifdecoder:4.15.1 +com.github.bumptech.glide:glide:4.15.1 +com.github.deano2390:MaterialShowcaseView:1.3.7 +com.github.openMF:fineract-client-cmp:0.0.1 +com.github.openMF:fineract-client-sdk-cmp:0.0.1 +com.github.raizlabs.dbflow.dbflow:dbflow-core:3.1.1 +com.github.raizlabs.dbflow.dbflow:dbflow:3.1.1 +com.github.therajanmaurya:sweet-error:1.0.9 +com.google.android.gms:play-services-base:18.1.0 +com.google.android.gms:play-services-basement:18.1.0 +com.google.android.gms:play-services-location:21.1.0 +com.google.android.gms:play-services-maps:18.2.0 +com.google.android.gms:play-services-places-placereport:17.0.0 +com.google.android.gms:play-services-places:17.0.0 +com.google.android.gms:play-services-tasks:18.0.2 +com.google.android.material:material:1.11.0 +com.google.code.findbugs:jsr305:3.0.2 +com.google.code.gson:gson:2.10.1 +com.google.dagger:dagger-lint-aar:2.51 +com.google.dagger:dagger:2.51 +com.google.dagger:hilt-android:2.51 +com.google.dagger:hilt-core:2.51 +com.google.guava:listenablefuture:1.0 +com.google.maps.android:android-maps-utils:0.4.2 +com.jakewharton.fliptables:fliptables:1.0.1 +com.joanzapata.iconify:android-iconify-material:2.2.2 +com.joanzapata.iconify:android-iconify:2.2.2 +com.squareup.okhttp3:logging-interceptor:4.12.0 +com.squareup.okhttp3:okhttp:4.12.0 +com.squareup.okio:okio-jvm:3.7.0 +com.squareup.okio:okio:3.7.0 +com.squareup.retrofit2:adapter-rxjava:2.9.0 +com.squareup.retrofit2:converter-gson:2.10.0 +com.squareup.retrofit2:converter-scalars:2.10.0 +com.squareup.retrofit2:retrofit:2.10.0 +commons-cli:commons-cli:1.2 +io.coil-kt:coil-base:2.5.0 +io.coil-kt:coil-compose-base:2.5.0 +io.coil-kt:coil-compose:2.5.0 +io.coil-kt:coil:2.5.0 +io.reactivex:rxandroid:1.1.0 +io.reactivex:rxjava:1.3.8 +javax.inject:javax.inject:1 +junit:junit:4.13.2 +org.hamcrest:hamcrest-core:1.3 +org.jetbrains.kotlin:kotlin-stdlib-common:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib:2.0.0 +org.jetbrains.kotlin:kotlin-test:1.9.22 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0 +org.jetbrains:annotations:23.0.0 +org.reactivestreams:reactive-streams:1.0.0 diff --git a/mifosng-android/dependencies/prodReleaseCompileClasspath.txt b/mifosng-android/dependencies/prodReleaseCompileClasspath.txt new file mode 100644 index 00000000000..41e67601279 --- /dev/null +++ b/mifosng-android/dependencies/prodReleaseCompileClasspath.txt @@ -0,0 +1,202 @@ +androidx.activity:activity-compose:1.8.2 +androidx.activity:activity-ktx:1.8.2 +androidx.activity:activity:1.8.2 +androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-jvm:1.7.1 +androidx.annotation:annotation:1.7.1 +androidx.appcompat:appcompat-resources:1.7.0 +androidx.appcompat:appcompat:1.7.0 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.asynclayoutinflater:asynclayoutinflater:1.0.0 +androidx.cardview:cardview:1.0.0 +androidx.collection:collection-jvm:1.4.0 +androidx.collection:collection-ktx:1.4.0 +androidx.collection:collection:1.4.0 +androidx.compose.animation:animation-android:1.6.8 +androidx.compose.animation:animation-core-android:1.6.8 +androidx.compose.animation:animation-core:1.6.8 +androidx.compose.animation:animation:1.6.8 +androidx.compose.compiler:compiler:1.5.10 +androidx.compose.foundation:foundation-android:1.6.8 +androidx.compose.foundation:foundation-layout-android:1.6.8 +androidx.compose.foundation:foundation-layout:1.6.8 +androidx.compose.foundation:foundation:1.6.8 +androidx.compose.material3:material3-android:1.2.1 +androidx.compose.material3:material3:1.2.1 +androidx.compose.material:material-android:1.6.8 +androidx.compose.material:material-icons-core-android:1.6.8 +androidx.compose.material:material-icons-core:1.6.8 +androidx.compose.material:material-icons-extended-android:1.6.8 +androidx.compose.material:material-icons-extended:1.6.8 +androidx.compose.material:material-ripple-android:1.6.8 +androidx.compose.material:material-ripple:1.6.8 +androidx.compose.material:material:1.6.8 +androidx.compose.runtime:runtime-android:1.6.8 +androidx.compose.runtime:runtime-saveable-android:1.6.8 +androidx.compose.runtime:runtime-saveable:1.6.8 +androidx.compose.runtime:runtime:1.6.8 +androidx.compose.ui:ui-android:1.6.8 +androidx.compose.ui:ui-geometry-android:1.6.8 +androidx.compose.ui:ui-geometry:1.6.8 +androidx.compose.ui:ui-graphics-android:1.6.8 +androidx.compose.ui:ui-graphics:1.6.8 +androidx.compose.ui:ui-test-android:1.6.8 +androidx.compose.ui:ui-test-junit4-android:1.6.8 +androidx.compose.ui:ui-test-junit4:1.6.8 +androidx.compose.ui:ui-test:1.6.8 +androidx.compose.ui:ui-text-android:1.6.8 +androidx.compose.ui:ui-text:1.6.8 +androidx.compose.ui:ui-tooling-preview-android:1.6.8 +androidx.compose.ui:ui-tooling-preview:1.6.8 +androidx.compose.ui:ui-unit-android:1.6.8 +androidx.compose.ui:ui-unit:1.6.8 +androidx.compose.ui:ui-util-android:1.6.8 +androidx.compose.ui:ui-util:1.6.8 +androidx.compose.ui:ui:1.6.8 +androidx.compose:compose-bom:2024.02.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.constraintlayout:constraintlayout-solver:2.0.1 +androidx.constraintlayout:constraintlayout:2.0.1 +androidx.coordinatorlayout:coordinatorlayout:1.1.0 +androidx.core:core-ktx:1.13.0 +androidx.core:core-splashscreen:1.0.1 +androidx.core:core:1.13.0 +androidx.cursoradapter:cursoradapter:1.0.0 +androidx.customview:customview:1.1.0 +androidx.databinding:viewbinding:8.5.0 +androidx.documentfile:documentfile:1.0.0 +androidx.drawerlayout:drawerlayout:1.1.1 +androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.exifinterface:exifinterface:1.3.6 +androidx.fragment:fragment-ktx:1.6.2 +androidx.fragment:fragment:1.6.2 +androidx.hilt:hilt-navigation-compose:1.2.0 +androidx.hilt:hilt-navigation:1.2.0 +androidx.interpolator:interpolator:1.0.0 +androidx.legacy:legacy-support-core-ui:1.0.0 +androidx.legacy:legacy-support-core-utils:1.0.0 +androidx.legacy:legacy-support-v4:1.0.0 +androidx.lifecycle:lifecycle-common-java8:2.7.0 +androidx.lifecycle:lifecycle-common:2.7.0 +androidx.lifecycle:lifecycle-extensions:2.2.0 +androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata-core:2.7.0 +androidx.lifecycle:lifecycle-livedata-ktx:2.7.0 +androidx.lifecycle:lifecycle-livedata:2.7.0 +androidx.lifecycle:lifecycle-process:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams-ktx:2.7.0 +androidx.lifecycle:lifecycle-reactivestreams:2.7.0 +androidx.lifecycle:lifecycle-runtime-compose:2.7.0 +androidx.lifecycle:lifecycle-runtime-ktx:2.7.0 +androidx.lifecycle:lifecycle-runtime:2.7.0 +androidx.lifecycle:lifecycle-service:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0 +androidx.lifecycle:lifecycle-viewmodel:2.7.0 +androidx.loader:loader:1.0.0 +androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 +androidx.media:media:1.0.0 +androidx.metrics:metrics-performance:1.0.0-beta01 +androidx.multidex:multidex:2.0.1 +androidx.navigation:navigation-common-ktx:2.7.7 +androidx.navigation:navigation-common:2.7.7 +androidx.navigation:navigation-compose:2.7.7 +androidx.navigation:navigation-fragment-ktx:2.7.7 +androidx.navigation:navigation-fragment:2.7.7 +androidx.navigation:navigation-runtime-ktx:2.7.7 +androidx.navigation:navigation-runtime:2.7.7 +androidx.navigation:navigation-ui-ktx:2.7.7 +androidx.navigation:navigation-ui:2.7.7 +androidx.paging:paging-common-ktx:3.2.1 +androidx.paging:paging-common:3.2.1 +androidx.paging:paging-runtime-ktx:3.2.1 +androidx.paging:paging-runtime:3.2.1 +androidx.preference:preference-ktx:1.2.1 +androidx.preference:preference:1.2.1 +androidx.print:print:1.0.0 +androidx.recyclerview:recyclerview:1.3.2 +androidx.resourceinspection:resourceinspection-annotation:1.0.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.slidingpanelayout:slidingpanelayout:1.2.0 +androidx.startup:startup-runtime:1.1.1 +androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 +androidx.test.espresso:espresso-idling-resource:3.5.1 +androidx.test.ext:junit:1.1.5 +androidx.test.services:storage:1.4.2 +androidx.test:annotation:1.0.1 +androidx.test:core:1.5.0 +androidx.test:monitor:1.6.1 +androidx.tracing:tracing:1.2.0 +androidx.transition:transition:1.4.1 +androidx.vectordrawable:vectordrawable-animated:1.1.0 +androidx.vectordrawable:vectordrawable:1.1.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +androidx.viewpager2:viewpager2:1.1.0-beta02 +androidx.viewpager:viewpager:1.0.0 +com.evernote:android-job:1.2.6 +com.facebook.stetho:stetho-okhttp3:1.3.1 +com.facebook.stetho:stetho:1.3.1 +com.github.amulyakhare:TextDrawable:558677ea31 +com.github.bumptech.glide:annotations:4.15.1 +com.github.bumptech.glide:disklrucache:4.15.1 +com.github.bumptech.glide:gifdecoder:4.15.1 +com.github.bumptech.glide:glide:4.15.1 +com.github.deano2390:MaterialShowcaseView:1.3.7 +com.github.openMF:fineract-client-cmp:0.0.1 +com.github.openMF:fineract-client-sdk-cmp:0.0.1 +com.github.raizlabs.dbflow.dbflow:dbflow-core:3.1.1 +com.github.raizlabs.dbflow.dbflow:dbflow:3.1.1 +com.github.therajanmaurya:sweet-error:1.0.9 +com.google.android.gms:play-services-base:18.1.0 +com.google.android.gms:play-services-basement:18.1.0 +com.google.android.gms:play-services-location:21.1.0 +com.google.android.gms:play-services-maps:18.2.0 +com.google.android.gms:play-services-places-placereport:17.0.0 +com.google.android.gms:play-services-places:17.0.0 +com.google.android.gms:play-services-tasks:18.0.2 +com.google.android.material:material:1.11.0 +com.google.code.findbugs:jsr305:3.0.2 +com.google.code.gson:gson:2.10.1 +com.google.dagger:dagger-lint-aar:2.51 +com.google.dagger:dagger:2.51 +com.google.dagger:hilt-android:2.51 +com.google.dagger:hilt-core:2.51 +com.google.guava:listenablefuture:1.0 +com.google.maps.android:android-maps-utils:0.4.2 +com.jakewharton.fliptables:fliptables:1.0.1 +com.joanzapata.iconify:android-iconify-material:2.2.2 +com.joanzapata.iconify:android-iconify:2.2.2 +com.squareup.okhttp3:logging-interceptor:4.12.0 +com.squareup.okhttp3:okhttp:4.12.0 +com.squareup.okio:okio-jvm:3.7.0 +com.squareup.okio:okio:3.7.0 +com.squareup.retrofit2:adapter-rxjava:2.9.0 +com.squareup.retrofit2:converter-gson:2.10.0 +com.squareup.retrofit2:converter-scalars:2.10.0 +com.squareup.retrofit2:retrofit:2.10.0 +commons-cli:commons-cli:1.2 +io.coil-kt:coil-base:2.5.0 +io.coil-kt:coil-compose-base:2.5.0 +io.coil-kt:coil-compose:2.5.0 +io.coil-kt:coil:2.5.0 +io.reactivex:rxandroid:1.1.0 +io.reactivex:rxjava:1.3.8 +javax.inject:javax.inject:1 +junit:junit:4.13.2 +org.hamcrest:hamcrest-core:1.3 +org.jetbrains.kotlin:kotlin-stdlib-common:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0 +org.jetbrains.kotlin:kotlin-stdlib:2.0.0 +org.jetbrains.kotlin:kotlin-test:1.9.22 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.8.0 +org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0 +org.jetbrains:annotations:23.0.0 +org.reactivestreams:reactive-streams:1.0.0 diff --git a/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeJsonName.kt b/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeJsonName.kt index 0dc3ab61add..ec7f0d26bcb 100644 --- a/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeJsonName.kt +++ b/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeJsonName.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid /** @@ -14,4 +23,4 @@ object FakeJsonName { const val GROUPS_JSON = "groups.json" const val CLIENT_PAYLOADS = "clientpayloads.json" const val FAILURE_SERVER_RESPONSE = "failureServerResponse.json" -} \ No newline at end of file +} diff --git a/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeRemoteDataSource.kt b/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeRemoteDataSource.kt index b3051ddc185..105d1286457 100644 --- a/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeRemoteDataSource.kt +++ b/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/FakeRemoteDataSource.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid import com.google.gson.reflect.TypeToken @@ -17,48 +26,82 @@ import com.mifos.objects.noncore.Document */ object FakeRemoteDataSource { private val mTestDataFactory = TestDataFactory() + @JvmStatic val clientList: Page - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.CLIENTS_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.CLIENTS_JSON, + ) + @JvmStatic val searchedEntity: List - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.SEARCHED_ENTITY_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.SEARCHED_ENTITY_JSON, + ) + @JvmStatic val centers: Page
- get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.CENTERS_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.CENTERS_JSON, + ) + @JvmStatic val centersGroupAndMeeting: CenterWithAssociations get() = mTestDataFactory.getObjectTypePojo( CenterWithAssociations::class.java, - FakeJsonName.CENTER_WITH_ASSOCIATIONS_JSON + FakeJsonName.CENTER_WITH_ASSOCIATIONS_JSON, ) + @JvmStatic val clientCharges: Page - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.CHARGES_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.CHARGES_JSON, + ) + @JvmStatic val loanCharges: List - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.LOAN_CHARGES_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.LOAN_CHARGES_JSON, + ) + @JvmStatic val documents: List - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.DOCUMENTS_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.DOCUMENTS_JSON, + ) + @JvmStatic val groups: Page - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.GROUPS_JSON) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.GROUPS_JSON, + ) + @JvmStatic val clientPayloads: List - get() = mTestDataFactory.getListTypePojo(object : - TypeToken>() {}, FakeJsonName.CLIENT_PAYLOADS) + get() = mTestDataFactory.getListTypePojo( + object : + TypeToken>() {}, + FakeJsonName.CLIENT_PAYLOADS, + ) + @JvmStatic val failureServerResponse: MifosError get() = mTestDataFactory.getObjectTypePojo( MifosError::class.java, - FakeJsonName.FAILURE_SERVER_RESPONSE + FakeJsonName.FAILURE_SERVER_RESPONSE, ) -} \ No newline at end of file +} diff --git a/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/TestDataFactory.kt b/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/TestDataFactory.kt index 0181b638cf2..bdbaeb16f03 100644 --- a/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/TestDataFactory.kt +++ b/mifosng-android/src/commonTest/java/com/mifos/mifosxdroid/TestDataFactory.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid import com.google.gson.Gson @@ -25,11 +34,11 @@ class TestDataFactory { * * Object object = mTestDataFactory.getListTypePojo( * new TypeToken(){}, "Object.json") - */ + */ fun getObjectTypePojo(model: Class?, jsonName: String?): T { - val `in` = javaClass.classLoader.getResourceAsStream(jsonName) + val value = javaClass.classLoader.getResourceAsStream(jsonName) val reader = - JsonReader(InputStreamReader(`in`)) + JsonReader(InputStreamReader(value)) return Gson().fromJson(reader, model) } @@ -57,14 +66,14 @@ class TestDataFactory { * * Object object = mTestDataFactory.getListTypePojo( * new TypeToken(){}, "Object.json") - */ + */ fun getListTypePojo( listModel: TypeToken, - jsonName: String? + jsonName: String?, ): T { - val `in` = javaClass.classLoader.getResourceAsStream(jsonName) + val value = javaClass.classLoader.getResourceAsStream(jsonName) val reader = - JsonReader(InputStreamReader(`in`)) + JsonReader(InputStreamReader(value)) return Gson().fromJson(reader, listModel.type) } -} \ No newline at end of file +} diff --git a/mifosng-android/src/debug/res/values/google_maps_api.xml b/mifosng-android/src/debug/res/values/google_maps_api.xml index 663ff6831c8..164fa11d212 100644 --- a/mifosng-android/src/debug/res/values/google_maps_api.xml +++ b/mifosng-android/src/debug/res/values/google_maps_api.xml @@ -1,3 +1,13 @@ + + - - - - - - - - @@ -25,7 +26,7 @@ android:label="@string/app_name" android:supportsRtl="true" android:windowSoftInputMode="adjustResize" - android:theme="@style/MaterialAppTheme"> + android:theme="@style/Theme.AndroidClientTheme"> - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/application/App.kt b/mifosng-android/src/main/java/com/mifos/application/App.kt index 2c1fd54a6e2..f874465d220 100644 --- a/mifosng-android/src/main/java/com/mifos/application/App.kt +++ b/mifosng-android/src/main/java/com/mifos/application/App.kt @@ -1,5 +1,10 @@ /* - * This project is licensed under the open source MPL V2. + * 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/android-client/blob/master/LICENSE.md */ package com.mifos.application @@ -8,14 +13,9 @@ import android.content.Context import android.graphics.Typeface import android.os.StrictMode import android.os.StrictMode.VmPolicy -import android.preference.PreferenceManager import androidx.multidex.MultiDexApplication -import com.evernote.android.job.JobManager import com.facebook.stetho.Stetho -import com.joanzapata.iconify.Iconify -import com.joanzapata.iconify.fonts.MaterialModule -import com.mifos.utils.LanguageHelper.onAttach -import com.mifos.utils.ThemeHelper +import com.mifos.core.common.utils.LanguageHelper.onAttach import com.raizlabs.android.dbflow.config.FlowConfig import com.raizlabs.android.dbflow.config.FlowManager import dagger.hilt.android.HiltAndroidApp @@ -27,15 +27,10 @@ import dagger.hilt.android.HiltAndroidApp class App : MultiDexApplication() { override fun onCreate() { super.onCreate() - val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this) - val themePref = sharedPreferences.getString("dark_mode", ThemeHelper.DEFAULT_MODE) - if (themePref != null) { - ThemeHelper.applyTheme(themePref) - } + instance = this - Iconify.with(MaterialModule()) // JobManager.create(this).addJobCreator(OfflineJobCreator()) - //Initializing the DBFlow and SQL Cipher Encryption + // Initializing the DBFlow and SQL Cipher Encryption FlowManager.init(FlowConfig.Builder(this).build()) Stetho.initializeWithDefaults(this) val policy = VmPolicy.Builder() @@ -44,7 +39,6 @@ class App : MultiDexApplication() { StrictMode.setVmPolicy(policy) } - override fun attachBaseContext(base: Context) { super.attachBaseContext(onAttach(base)) } @@ -65,4 +59,4 @@ class App : MultiDexApplication() { return context.applicationContext as App } } -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClient.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClient.kt index 08a49ef53ea..560dd411b6a 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClient.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClient.kt @@ -1,14 +1,21 @@ +/* + * 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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid import androidx.compose.runtime.Composable import androidx.navigation.compose.NavHost -import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import com.mifos.feature.auth.navigation.authNavGraph import com.mifos.feature.auth.navigation.navigateToLogin import com.mifos.feature.splash.navigation.SplashScreens import com.mifos.feature.splash.navigation.splashNavGraph -import com.mifos.mifosxdroid.navigation.MifosNavGraph import com.mifos.mifosxdroid.navigation.homeGraph import com.mifos.mifosxdroid.navigation.navigateHome import com.mifos.mifosxdroid.navigation.passcodeNavGraph @@ -16,26 +23,25 @@ import org.mifos.library.passcode.navigateToPasscodeScreen @Composable fun AndroidClient() { - val navController = rememberNavController() NavHost( navController = navController, - startDestination = SplashScreens.SplashScreenRoute.route + startDestination = SplashScreens.SplashScreenRoute.route, ) { splashNavGraph( navigatePasscode = navController::navigateHome, - navigateLogin = navController::navigateToLogin + navigateLogin = navController::navigateToLogin, ) passcodeNavGraph( - navController = navController + navController = navController, ) authNavGraph( navigatePasscode = navController::navigateToPasscodeScreen, navigateHome = navController::navigateHome, - updateServerConfig = {} + updateServerConfig = {}, ) homeGraph() diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientActivity.kt index 07aec95c3de..37434930fe9 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientActivity.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientActivity.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid import android.os.Bundle @@ -14,5 +23,4 @@ class AndroidClientActivity : ComponentActivity() { AndroidClient() } } - -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt index ff365ee185a..0e786acd36d 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid import androidx.compose.material.icons.Icons @@ -28,72 +37,72 @@ sealed class HomeDestinationsScreen( data object SearchScreen : HomeDestinationsScreen( title = "Search", route = SearchScreens.SearchScreen.route, - icon = Icons.Rounded.Dashboard + icon = Icons.Rounded.Dashboard, ) data object ClientListScreen : HomeDestinationsScreen( title = "Clients", route = "client_list_screen", - icon = Icons.Rounded.Person + icon = Icons.Rounded.Person, ) data object CenterListScreen : HomeDestinationsScreen( title = "Centers", route = "center_list_screen", - icon = Icons.Rounded.Business + icon = Icons.Rounded.Business, ) data object GroupListScreen : HomeDestinationsScreen( title = "Groups", route = GroupScreen.GroupListScreen.route, - icon = Icons.Rounded.Group + icon = Icons.Rounded.Group, ) data object CheckerInboxAndTasksScreen : HomeDestinationsScreen( title = "Checker Inbox & Tasks", route = CheckerInboxTaskScreens.CheckerInboxTaskScreen.route, - icon = Icons.Rounded.CheckBox + icon = Icons.Rounded.CheckBox, ) data object IndividualCollectionSheetScreen : HomeDestinationsScreen( title = "Individual Collection Sheet", route = "individual_collection_sheet_route", - icon = Icons.AutoMirrored.Rounded.Assignment + icon = Icons.AutoMirrored.Rounded.Assignment, ) data object CollectionSheetScreen : HomeDestinationsScreen( title = "Collection Sheet", route = "generate_collection_sheet", - icon = Icons.AutoMirrored.Rounded.Assignment + icon = Icons.AutoMirrored.Rounded.Assignment, ) data object RunReportsScreen : HomeDestinationsScreen( title = "Run Reports", route = "run_report_screen", - icon = Icons.Rounded.Task + icon = Icons.Rounded.Task, ) data object PathTrackerScreen : HomeDestinationsScreen( title = "Path Tracker", route = PathTrackingScreens.PathTrackingScreen.route, - icon = Icons.Rounded.PersonPinCircle + icon = Icons.Rounded.PersonPinCircle, ) data object SettingsScreen : HomeDestinationsScreen( title = "Settings", route = SettingsScreens.SettingsScreen.route, - icon = Icons.Rounded.Settings + icon = Icons.Rounded.Settings, ) data object AboutScreen : HomeDestinationsScreen( title = "About", route = "about_screen_route", - icon = Icons.Rounded.Info + icon = Icons.Rounded.Info, ) data object OfflineSyncScreen : HomeDestinationsScreen( title = "Offline Sync", - route = OfflineScreens.OfflineDashboardScreens.route , - icon = Icons.Rounded.PowerSettingsNew + route = OfflineScreens.OfflineDashboardScreens.route, + icon = Icons.Rounded.PowerSettingsNew, ) -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/home/HomeActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/home/HomeActivity.kt deleted file mode 100644 index d1452d6920c..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/home/HomeActivity.kt +++ /dev/null @@ -1,208 +0,0 @@ -package com.mifos.mifosxdroid.activity.home - -import android.os.Bundle -import android.view.Menu -import android.view.MenuItem -import android.view.View -import android.widget.Toast -import androidx.activity.ComponentActivity -import androidx.activity.OnBackPressedCallback -import androidx.annotation.VisibleForTesting -import androidx.appcompat.app.ActionBarDrawerToggle -import androidx.appcompat.app.AppCompatActivity -import androidx.appcompat.widget.SwitchCompat -import androidx.core.view.GravityCompat -import androidx.navigation.findNavController -import androidx.navigation.ui.AppBarConfiguration -import androidx.navigation.ui.setupWithNavController -import androidx.test.espresso.IdlingResource -import com.google.android.material.navigation.NavigationView -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.core.MifosBaseActivity -import com.mifos.mifosxdroid.databinding.ActivityHomeBinding -import com.mifos.mifosxdroid.databinding.ViewNavDrawerHeaderBinding -import com.mifos.utils.Constants -import com.mifos.utils.EspressoIdlingResource -import com.mifos.utils.PrefManager -import dagger.hilt.android.AndroidEntryPoint - -/** - * Created by shashankpriyadarshi on 19/06/20. - */ -@AndroidEntryPoint -open class HomeActivity : ComponentActivity(), NavigationView.OnNavigationItemSelectedListener { - - private lateinit var binding: ActivityHomeBinding - private lateinit var navHeaderBinding: ViewNavDrawerHeaderBinding - - private lateinit var menu: Menu - private lateinit var userStatusToggle: SwitchCompat - private var doubleBackToExitPressedOnce = false - private lateinit var appBarConfiguration: AppBarConfiguration - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - binding = ActivityHomeBinding.inflate(layoutInflater) - setContentView(binding.root) -// setSupportActionBar(toolbar) - appBarConfiguration = AppBarConfiguration.Builder() - .setDrawerLayout(binding.drawer) - .build() - - setupNavigationBar() - - onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) { - override fun handleOnBackPressed() { - if (binding.drawer.isDrawerOpen(GravityCompat.START)) { - binding.drawer.closeDrawer(GravityCompat.START) - } else if (binding.navView.selectedItemId == R.id.navigation_dashboard) { - doubleBackToExit() - } -// supportFragmentManager.popBackStackImmediate() - } - }) - } - - override fun onStart() { - super.onStart() - binding.navView.setupWithNavController(binding.navHostFragment.findNavController()) - } - - override fun onNavigationItemSelected(item: MenuItem): Boolean { - // ignore the current selected item - /*if (item.isChecked()) { - mDrawerLayout.closeDrawer(Gravity.LEFT); - return false; - }*/ -// clearFragmentBackStack() - when (item.itemId) { - - R.id.individual_collection_sheet -> { - val bundle = Bundle() - bundle.putString(Constants.COLLECTION_TYPE, Constants.EXTRA_COLLECTION_INDIVIDUAL) -// findNavController(R.id.nav_host_fragment).navigate( -// R.id.generateCollectionSheetActivity, -// bundle -// ) - } - - R.id.collection_sheet -> { - val bundle = Bundle() - bundle.putString( - Constants.COLLECTION_TYPE, - Constants.EXTRA_COLLECTION_COLLECTION - ) -// findNavController(R.id.nav_host_fragment).navigate( -// R.id.generateCollectionSheetActivity, -// bundle -// ) - } - - R.id.item_settings -> { - findNavController(R.id.nav_host_fragment).navigate(R.id.settingsActivity) - } - - R.id.runreport -> { -// findNavController(R.id.nav_host_fragment).navigate(R.id.runReportsActivity) - } - } - binding.drawer.closeDrawer(GravityCompat.START) - return false - } - - /** - * This SwitchCompat Toggle Handling the User Status. - * Setting the User Status to Offline or Online - */ - private fun setupUserStatusToggle(headerView: View) { - navHeaderBinding = ViewNavDrawerHeaderBinding.bind(headerView) - userStatusToggle = navHeaderBinding.userStatusToggle - - if (PrefManager.userStatus == Constants.USER_OFFLINE) { - userStatusToggle.isChecked = true - } - userStatusToggle.setOnClickListener { - if (PrefManager.userStatus == Constants.USER_OFFLINE) { - PrefManager.userStatus = Constants.USER_ONLINE - userStatusToggle.isChecked = false - } else { - PrefManager.userStatus = Constants.USER_OFFLINE - userStatusToggle.isChecked = true - } - } - } - - /** - * downloads the logged in user's username - * sets dummy profile picture as no profile picture attribute available - */ - private fun loadClientDetails() { - // download logged in user - val loggedInUser = PrefManager.getUser() - navHeaderBinding.tvUserName.text = loggedInUser.username - navHeaderBinding.ivUserPicture.setImageResource(R.drawable.ic_dp_placeholder) - } - - @get:VisibleForTesting - val countingIdlingResource: IdlingResource - get() = EspressoIdlingResource.idlingResource - - private fun setupNavigationBar() { -// mNavigationHeader = binding.navigationView.getHeaderView(0) - binding.navigationView.getHeaderView(0)?.let { setupUserStatusToggle(it) } - - - binding.navigationView.setNavigationItemSelectedListener(this as NavigationView.OnNavigationItemSelectedListener) - - // setup drawer layout and sync to toolbar -// val actionBarDrawerToggle: ActionBarDrawerToggle = object : ActionBarDrawerToggle( -// this, -// binding.drawer, toolbar, R.string.open_drawer, R.string.close_drawer -// ) { -// -// override fun onDrawerOpened(drawerView: View) { -// super.onDrawerOpened(drawerView) -// setUserStatus(userStatusToggle) -// hideKeyboard(binding.drawer) -// } -// -// override fun onDrawerSlide(drawerView: View, slideOffset: Float) { -// if (slideOffset != 0f) super.onDrawerSlide(drawerView, slideOffset) -// } -// } -// binding.drawer.addDrawerListener(actionBarDrawerToggle) -// actionBarDrawerToggle.syncState() - - // make an API call to fetch logged in client's details - loadClientDetails() - } - - override fun onCreateOptionsMenu(menu: Menu): Boolean { - this.menu = menu - menuInflater.inflate(R.menu.menu_main, menu) - return super.onCreateOptionsMenu(menu) - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - if (item.itemId == R.id.logout) { -// logout() - } - return super.onOptionsItemSelected(item) - } - - private fun doubleBackToExit() { - - if (doubleBackToExitPressedOnce) { - finish() - } else { - doubleBackToExitPressedOnce = true - Toast.makeText( - this@HomeActivity, - R.string.back_again, - Toast.LENGTH_SHORT - ).show() - // Reset the flag after a short delay - window.decorView.postDelayed({ doubleBackToExitPressedOnce = false }, 2000) - } - } -} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/login/LoginActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/login/LoginActivity.kt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/setting/SettingsActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/setting/SettingsActivity.kt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/setting/SettingsFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/activity/setting/SettingsFragment.kt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/ChargeNameListAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/ChargeNameListAdapter.kt deleted file mode 100644 index ba296d32afb..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/ChargeNameListAdapter.kt +++ /dev/null @@ -1,46 +0,0 @@ -package com.mifos.mifosxdroid.adapters - -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.recyclerview.widget.RecyclerView -import com.mifos.core.objects.client.Charges -import com.mifos.mifosxdroid.R - - -class ChargeNameListAdapter( - var pageItems: List, - var clientId: Int -) : RecyclerView.Adapter() { - - fun getItem(position: Int) = pageItems[position] - - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - val viewHolder = ViewHolder( - LayoutInflater.from(parent.context) - .inflate(R.layout.row_charge_name, parent, false) - ) - return viewHolder - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.tv_charger_id.text = pageItems[position].chargeId.toString() - holder.tv_charge_Name.text = pageItems[position].name - holder.tv_charge_amount.text = pageItems[position].amount.toString() - holder.tv_charge_duedate.text = pageItems[position].formattedDueDate - } - - override fun getItemId(i: Int) = 0L - - override fun getItemCount() = pageItems.size - - - class ViewHolder(v: View) : RecyclerView.ViewHolder(v) { - val tv_charger_id: TextView = v.findViewById(R.id.tv_charger_id) - val tv_charge_Name: TextView = v.findViewById(R.id.tv_chargeName) - val tv_charge_amount: TextView = v.findViewById(R.id.tv_charge_amount) - val tv_charge_duedate: TextView = v.findViewById(R.id.tv_charge_duedate) - } -} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/FragmentAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/FragmentAdapter.kt deleted file mode 100644 index 8577bd551a8..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/FragmentAdapter.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentManager -import androidx.fragment.app.FragmentPagerAdapter - -/** - * Created by ishankhanna on 11/03/14. - */ -class FragmentAdapter(fm: FragmentManager?, var fragmentList: List) : - FragmentPagerAdapter( - fm!! - ) { - override fun getItem(position: Int): Fragment { - return fragmentList[position] - } - - override fun getCount(): Int { - return fragmentList.size - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/IdentifierListAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/IdentifierListAdapter.kt deleted file mode 100644 index 032426f7d24..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/IdentifierListAdapter.kt +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.recyclerview.widget.RecyclerView -import com.mifos.application.App.Companion.context -import com.mifos.core.objects.noncore.Identifier -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.databinding.RowIdentifierListBinding -import javax.inject.Inject - -/** - * Created by ishankhanna on 03/07/14. - */ -class IdentifierListAdapter @Inject constructor() : - RecyclerView.Adapter() { - private var identifiers: List - private var identifierOptionsListener: IdentifierOptionsListener? = null - - init { - identifiers = ArrayList() - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - val view = LayoutInflater.from(parent.context) - .inflate(R.layout.row_identifier_list, parent, false) - return ViewHolder( - RowIdentifierListBinding.inflate( - LayoutInflater.from(parent.context), - parent, - false - ) - ) - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val identifier = identifiers[position] - holder.binding.tvIdentifierId.text = identifier.documentKey.toString() - var description = identifier.description - if (description == null) { - description = "-" - } - holder.binding.tvIdentifierDescription.text = description - holder.binding.tvIdentifierType.text = identifier.documentType?.name - val color: Int = if (identifier.status?.contains("inactive") == true) { - context!!.getColor(R.color.red_light) - } else { - context!!.getColor(R.color.green_light) - } - holder.binding.vStatus.setBackgroundColor(color) - } - - fun setIdentifiers(identifiers: List) { - this.identifiers = identifiers - notifyDataSetChanged() - } - - fun setIdentifierOptionsListener(identifierOptionsListener: IdentifierOptionsListener?) { - this.identifierOptionsListener = identifierOptionsListener - } - - override fun getItemId(i: Int): Long { - return 0 - } - - override fun getItemCount(): Int { - return identifiers.size - } - - inner class ViewHolder(val binding: RowIdentifierListBinding) : - RecyclerView.ViewHolder(binding.root), View.OnClickListener { - init { - binding.ivIdentifierOptions.setOnClickListener(this) - } - - override fun onClick(v: View) { - identifierOptionsListener?.onClickIdentifierOptions(adapterPosition, v) - } - } - - interface IdentifierOptionsListener { - fun onClickIdentifierOptions(position: Int, view: View) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanAccountsListAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanAccountsListAdapter.kt deleted file mode 100644 index 29961545f54..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanAccountsListAdapter.kt +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import android.content.Context -import android.text.TextUtils -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseAdapter -import androidx.core.content.ContextCompat -import com.mifos.core.objects.accounts.loan.LoanAccount -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.databinding.RowAccountItemBinding - -/** - * Created by ishankhanna on 01/03/14. - */ -class LoanAccountsListAdapter( - private val context: Context, - private val loanAccountList: List -) : BaseAdapter() { - - private val layoutInflater: LayoutInflater = LayoutInflater.from(context) - - override fun getCount(): Int { - return loanAccountList.size - } - - override fun getItem(i: Int): LoanAccount { - return loanAccountList[i] - } - - override fun getItemId(i: Int): Long { - return 0 - } - - override fun getView(i: Int, view: View?, viewGroup: ViewGroup): View { - val binding: RowAccountItemBinding - val convertView: View - if (view == null) { - binding = RowAccountItemBinding.inflate(layoutInflater, viewGroup, false) - convertView = binding.root - convertView.tag = binding - } else { - binding = view.tag as RowAccountItemBinding - convertView = view - } - - val loanAccount = loanAccountList[i] - - if (loanAccount.status?.active == true) { - binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor(context, R.color.loan_status_disbursed) - ) - } else if (loanAccount.status?.waitingForDisbursal == true) { - binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor(context, R.color.status_approved) - ) - } else if (loanAccount.status?.pendingApproval == true) { - binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor( - context, - R.color.status_submitted_and_pending_approval - ) - ) - } else if (loanAccount.status?.active == true && loanAccount.inArrears == true) { - binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor(context, R.color.red) - ) - } else { - binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor(context, R.color.status_closed) - ) - } - - // TODO: Change getProductName to Loan Amount Due - binding.tvAmount.text = loanAccount.productName - binding.tvAmount.ellipsize = TextUtils.TruncateAt.END - binding.tvAccountNumber.text = loanAccount.accountNo - - return convertView - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanListAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanListAdapter.kt deleted file mode 100644 index e112b32ac29..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanListAdapter.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import android.content.Context -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseAdapter -import com.mifos.core.objects.db.Loan -import com.mifos.mifosxdroid.databinding.RowLoanListItemBinding - -class LoanListAdapter(context: Context?, listLoans: List) : BaseAdapter() { - private val layoutInflater: LayoutInflater - private val listLoans: List - - init { - layoutInflater = LayoutInflater.from(context) - this.listLoans = listLoans - } - - override fun getCount(): Int { - return listLoans.size - } - - override fun getItem(i: Int): Loan { - return listLoans[i] - } - - override fun getItemId(i: Int): Long { - return 0 - } - - override fun getView(i: Int, view: View?, viewGroup: ViewGroup): View { - val binding: RowLoanListItemBinding - val convertView: View - if (view == null) { - binding = RowLoanListItemBinding.inflate(layoutInflater, viewGroup, false) - convertView = binding.root - convertView.tag = binding - } else { - binding = view.tag as RowLoanListItemBinding - convertView = view - } - val loan = listLoans[i] - binding.tvLoanAccountId.text = loan.loanId.toString() - return convertView - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanRepaymentScheduleAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanRepaymentScheduleAdapter.kt deleted file mode 100644 index 6a93a331602..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanRepaymentScheduleAdapter.kt +++ /dev/null @@ -1,93 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import android.content.Context -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseAdapter -import androidx.core.content.ContextCompat -import com.mifos.core.objects.accounts.loan.Period -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.databinding.RowLoanRepaymentScheduleBinding -import com.mifos.utils.DateHelper.getDateAsString - -/** - * Created by ishankhanna on 19/06/14. - */ -class LoanRepaymentScheduleAdapter( - private val context: Context, - private val periodList: List -) : BaseAdapter() { - - override fun getCount(): Int { - return periodList.size - } - - override fun getItem(i: Int): Any? { - return null - } - - override fun getItemId(i: Int): Long { - return 0 - } - - override fun getView(i: Int, view: View?, viewGroup: ViewGroup): View { - val viewHolder: ReusableViewHolder - val binding: RowLoanRepaymentScheduleBinding - - if (view == null) { - binding = RowLoanRepaymentScheduleBinding.inflate( - LayoutInflater.from(context), - viewGroup, - false - ) - viewHolder = ReusableViewHolder(binding) - binding.root.tag = viewHolder - } else { - binding = RowLoanRepaymentScheduleBinding.bind(view) - viewHolder = view.tag as ReusableViewHolder - } - - val period = periodList[i] - viewHolder.binding.tvRepaymentDueDate.text = period.dueDate?.let { getDateAsString(it) } - viewHolder.binding.tvRepaymentAmountDue.text = period.totalDueForPeriod.toString() - viewHolder.binding.tvRepaymentAmountPaid.text = period.totalPaidForPeriod.toString() - - when { - period.complete != null && period.complete!! -> { - viewHolder.binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor( - context, - R.color.light_green - ) - ) - } - - period.totalOverdue != null && period.totalOverdue!! > 0 -> { - viewHolder.binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor( - context, - R.color.light_red - ) - ) - } - - else -> { - viewHolder.binding.viewStatusIndicator.setBackgroundColor( - ContextCompat.getColor( - context, - R.color.light_blue - ) - ) - } - } - - return binding.root - } - - class ReusableViewHolder(val binding: RowLoanRepaymentScheduleBinding) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanTransactionAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanTransactionAdapter.kt deleted file mode 100644 index 2108b6fe145..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/LoanTransactionAdapter.kt +++ /dev/null @@ -1,179 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import android.content.Context -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseExpandableListAdapter -import com.joanzapata.iconify.fonts.MaterialIcons -import com.mifos.core.objects.accounts.loan.Transaction -import com.mifos.core.objects.accounts.loan.Type -import com.mifos.mifosxdroid.databinding.RowLoanTransactionItemBinding -import com.mifos.mifosxdroid.databinding.RowLoanTransactionItemDetailBinding -import com.mifos.utils.DateHelper.getDateAsString - -/** - * Created by ishankhanna on 21/06/14. - */ -class LoanTransactionAdapter( - private val context: Context, - private val transactionList: List -) : BaseExpandableListAdapter() { - private val layoutInflater: LayoutInflater = LayoutInflater.from(context) - private val parents: MutableList = ArrayList() - private val children: MutableList = ArrayList() - - init { - for (transaction in transactionList) { - val parent = transaction.type?.let { - transaction.amount?.let { it1 -> - Parent( - transaction.date, - it, - it1 - ) - } - } - val child = transaction.id?.let { - transaction.officeName?.let { it1 -> - transaction.principalPortion?.let { it2 -> - transaction.interestPortion?.let { it3 -> - transaction.feeChargesPortion?.let { it4 -> - transaction.penaltyChargesPortion?.let { it5 -> - Child( - it, - it1, - it2, - it3, - it4, - it5 - ) - } - } - } - } - } - } - if (parent != null) { - parents.add(parent) - } - if (child != null) { - children.add(child) - } - } - } - - override fun getGroupCount(): Int { - return transactionList.size - } - - override fun getChildrenCount(groupPosition: Int): Int { - return 1 - } - - override fun getGroup(groupPosition: Int): Parent { - return parents[groupPosition] - } - - override fun getChild(groupPosition: Int, childPosition: Int): Child { - return children[childPosition] - } - - override fun getGroupId(groupPosition: Int): Long { - return 0 - } - - override fun getChildId(groupPosition: Int, childPosition: Int): Long { - return 0 - } - - override fun hasStableIds(): Boolean { - return false - } - - override fun getGroupView( - groupPosition: Int, - isExpanded: Boolean, - convertView: View?, - parent: ViewGroup - ): View { - val binding: RowLoanTransactionItemBinding - val view: View - - if (convertView == null) { - binding = RowLoanTransactionItemBinding.inflate(layoutInflater, parent, false) - view = binding.root - view.tag = binding - } else { - binding = convertView.tag as RowLoanTransactionItemBinding - view = convertView - } - - val contractedIconValue = MaterialIcons.md_add_circle_outline - val expandedIconValue = MaterialIcons.md_remove_circle_outline - - if (!isExpanded) { - binding.tvArrow.text = contractedIconValue.character().toString() - } else { - binding.tvArrow.text = expandedIconValue.character().toString() - } - - binding.tvTransactionDate.text = getDateAsString(parents[groupPosition].date) - binding.tvTransactionType.text = parents[groupPosition].type.value - binding.tvTransactionAmount.text = parents[groupPosition].amount.toString() - - return view - } - - override fun getChildView( - groupPosition: Int, - childPosition: Int, - isLastChild: Boolean, - convertView: View?, - parent: ViewGroup - ): View { - val binding: RowLoanTransactionItemDetailBinding - val view: View - - if (convertView == null) { - binding = RowLoanTransactionItemDetailBinding.inflate(layoutInflater, parent, false) - view = binding.root - view.tag = binding - } else { - binding = convertView.tag as RowLoanTransactionItemDetailBinding - view = convertView - } - - binding.tvTransactionId.text = children[groupPosition].id.toString() - binding.tvOfficeName.text = children[groupPosition].officeName - binding.tvPrincipal.text = children[groupPosition].principalPortion.toString() - binding.tvInterest.text = children[groupPosition].interestPortion.toString() - binding.tvFees.text = children[groupPosition].feeChargesPortion.toString() - binding.tvPenalties.text = children[groupPosition].penaltyChargesPortion.toString() - - return view - } - - override fun isChildSelectable(groupPosition: Int, childPosition: Int): Boolean { - return true - } - - data class Parent( - val date: List, - val type: Type, - val amount: Double - ) - - data class Child( - val id: Int, - val officeName: String, - val principalPortion: Double, - val interestPortion: Double, - val feeChargesPortion: Double, - val penaltyChargesPortion: Double - ) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/PinpointClientAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/PinpointClientAdapter.kt deleted file mode 100644 index ce2be2ca513..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/PinpointClientAdapter.kt +++ /dev/null @@ -1,125 +0,0 @@ -package com.mifos.mifosxdroid.adapters - -import android.content.Context -import android.view.LayoutInflater -import android.view.ViewGroup -import androidx.recyclerview.widget.RecyclerView -import com.google.android.gms.maps.CameraUpdateFactory -import com.google.android.gms.maps.GoogleMap -import com.google.android.gms.maps.MapsInitializer -import com.google.android.gms.maps.OnMapReadyCallback -import com.google.android.gms.maps.model.LatLng -import com.google.android.gms.maps.model.MarkerOptions -import com.mifos.core.objects.client.ClientAddressResponse -import com.mifos.mifosxdroid.databinding.ItemPinpointLocationBinding -import javax.inject.Inject - -/** - * Created by Rajan Maurya on 16/01/17. - */ -class PinpointClientAdapter @Inject constructor() : - RecyclerView.Adapter() { - private var addressResponses: List - private var context: Context? = null - private var itemClick: OnItemClick? = null - - init { - addressResponses = ArrayList() - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - return ViewHolder( - ItemPinpointLocationBinding.inflate( - LayoutInflater.from(parent.context), - parent, - false - ) - ) - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val addressResponse = addressResponses[position] - holder.binding.tvAddress.text = addressResponse.placeAddress - holder.binding.mvClientLocation.tag = addressResponse - - // Ensure the map has been initialised by the on map ready callback in ViewHolder. - // If it is not ready yet, it will be initialised with the NamedLocation set as its tag - // when the callback is received. - setMapLocation(holder.map, addressResponse) - holder.binding.cardView.setOnLongClickListener { - itemClick!!.onItemLongClick(holder.adapterPosition) - false - } - } - - fun setContext(context: Context?) { - this.context = context - } - - fun setAddress(addressResponses: List) { - this.addressResponses = addressResponses - notifyDataSetChanged() - } - - fun getItem(position: Int): ClientAddressResponse { - return addressResponses[position] - } - - fun setItemClick(itemClick: OnItemClick?) { - this.itemClick = itemClick - } - - override fun getItemId(i: Int): Long { - return 0 - } - - override fun getItemCount(): Int { - return addressResponses.size - } - - override fun onViewRecycled(holder: ViewHolder) { - // Cleanup MapView here - holder.map.clear() - holder.map.mapType = GoogleMap.MAP_TYPE_NONE - } - - private fun setMapLocation(map: GoogleMap?, location: ClientAddressResponse) { - // Add a marker for this item and set the camera - val latLng = location.latitude?.let { location.longitude?.let { it1 -> LatLng(it, it1) } } - latLng?.let { CameraUpdateFactory.newLatLngZoom(it, 13f) }?.let { map!!.moveCamera(it) } - latLng?.let { MarkerOptions().position(it) }?.let { map?.addMarker(it) } - // Set the map type back to normal. - map?.mapType = GoogleMap.MAP_TYPE_NORMAL - } - - inner class ViewHolder(val binding: ItemPinpointLocationBinding) : - RecyclerView.ViewHolder(binding.root), OnMapReadyCallback { - lateinit var map: GoogleMap - - init { - initializeMapView() - } - - override fun onMapReady(googleMap: GoogleMap) { - context?.let { MapsInitializer.initialize(it) } - map = googleMap - val data = binding.mvClientLocation.tag as ClientAddressResponse - setMapLocation(map, data) - } - - /** - * Initialises the MapView by calling its lifecycle methods. - */ - private fun initializeMapView() { - // Initialise the MapView - binding.mvClientLocation.onCreate(null) - binding.mvClientLocation.onResume() - // Set the map ready callback to receive the GoogleMap object - binding.mvClientLocation.getMapAsync(this) - } - } - - interface OnItemClick { - fun onItemLongClick(position: Int) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyListAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyListAdapter.kt deleted file mode 100644 index dd45b9769e4..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyListAdapter.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import android.content.Context -import android.content.res.Resources -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseAdapter -import com.mifos.core.objects.survey.Survey -import com.mifos.mifosxdroid.databinding.RowSurveysListItemBinding - -/** - * Created by Nasim Banu on 27,January,2016. - */ -class SurveyListAdapter(context: Context, listSurvey: List) : BaseAdapter() { - private val layoutInflater: LayoutInflater - private val listSurvey: List - private val resources: Resources - - init { - layoutInflater = LayoutInflater.from(context) - this.listSurvey = listSurvey - resources = context.resources - } - - override fun getCount(): Int { - return listSurvey.size - } - - override fun getItem(i: Int): Survey { - return listSurvey[i] - } - - override fun getItemId(i: Int): Long { - return 0 - } - - override fun getView(i: Int, view: View?, viewGroup: ViewGroup): View { - val binding: RowSurveysListItemBinding - val convertView: View - if (view == null) { - binding = RowSurveysListItemBinding.inflate(layoutInflater, viewGroup, false) - convertView = binding.root - convertView.tag = binding - } else { - binding = view.tag as RowSurveysListItemBinding - convertView = view - } - val survey = listSurvey[i] - binding.tvSurveyName.text = survey.name - binding.tvDescription.text = survey.description - binding.ivSyncStatus.visibility = if (survey.isSync) View.VISIBLE else View.INVISIBLE - return convertView - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyPagerAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyPagerAdapter.kt deleted file mode 100644 index bc38fae51fa..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/adapters/SurveyPagerAdapter.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.adapters - -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentManager -import androidx.fragment.app.FragmentStatePagerAdapter - -/** - * Created by Nasim Banu on 28,January,2016. - */ -class SurveyPagerAdapter(fm: FragmentManager?, private val fragments: List) : - FragmentStatePagerAdapter( - fm!! - ) { - var currentPage = 0 - - override fun getItem(position: Int): Fragment { - return fragments[position] - } - - override fun getCount(): Int { - return fragments.size - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt index 7a1b2178a17..2fdc7fd2867 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid.components import androidx.compose.material3.Icon @@ -6,6 +15,7 @@ import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp @@ -14,18 +24,19 @@ import com.mifos.mifosxdroid.HomeDestinationsScreen @Composable fun MifosNavigationBar( route: String, - onRouteSelected: (targetRoute: String) -> Unit + modifier: Modifier = Modifier, + onRouteSelected: (targetRoute: String) -> Unit, ) { val tabs = rememberSaveable { listOf( HomeDestinationsScreen.SearchScreen, HomeDestinationsScreen.ClientListScreen, HomeDestinationsScreen.CenterListScreen, - HomeDestinationsScreen.GroupListScreen + HomeDestinationsScreen.GroupListScreen, ) } - NavigationBar { + NavigationBar(modifier = modifier) { tabs.forEach { item -> val targetRoute = item.route val selected = route.contains(targetRoute) @@ -35,7 +46,7 @@ fun MifosNavigationBar( Icon( imageVector = it, contentDescription = item.title, - tint = if (selected) Color.Black else Color.Black.copy(0.7f) + tint = if (selected) Color.Black else Color.Black.copy(0.7f), ) } }, @@ -45,12 +56,12 @@ fun MifosNavigationBar( maxLines = 1, fontSize = 12.sp, textAlign = TextAlign.Center, - color = if (selected) Color.Black else Color.Black.copy(0.7f) + color = if (selected) Color.Black else Color.Black.copy(0.7f), ) }, selected = selected, - onClick = { onRouteSelected(targetRoute) } + onClick = { onRouteSelected(targetRoute) }, ) } } -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt index 7fc6f9af688..66c615de19a 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid.components import android.widget.Toast @@ -20,12 +29,9 @@ import com.mifos.feature.client.navigation.clientNavGraph import com.mifos.feature.client.navigation.navigateClientDetailsScreen import com.mifos.feature.client.navigation.navigateCreateClientScreen import com.mifos.feature.client.navigation.navigateToClientListScreen - import com.mifos.feature.dataTable.navigation.dataTableNavGraph import com.mifos.feature.dataTable.navigation.navigateDataTableList import com.mifos.feature.dataTable.navigation.navigateToDataTable - - import com.mifos.feature.document.navigation.documentListScreen import com.mifos.feature.document.navigation.navigateToDocumentListScreen import com.mifos.feature.groups.navigation.groupNavGraph @@ -59,7 +65,7 @@ fun Navigation( navController: NavHostController, padding: PaddingValues, modifier: Modifier = Modifier, - startDestination: String = SearchScreens.SearchScreenRoute.route + startDestination: String = SearchScreens.SearchScreenRoute.route, ) { val context = LocalContext.current @@ -76,13 +82,13 @@ fun Navigation( documents = { navController.navigateToDocumentListScreen( it, - Constants.ENTITY_TYPE_CLIENTS + Constants.ENTITY_TYPE_CLIENTS, ) }, moreClientInfo = { navController.navigateToDataTable( Constants.DATA_TABLE_NAME_CLIENT, - it + it, ) }, notes = { navController.navigateToNoteScreen(it, Constants.ENTITY_TYPE_CLIENTS) }, @@ -93,11 +99,11 @@ fun Navigation( activateClient = { navController.navigateToActivateScreen( it, - Constants.ACTIVATE_CLIENT + Constants.ACTIVATE_CLIENT, ) }, - hasDatatables = navController :: navigateDataTableList, - onDocumentClicked = navController :: navigateToDocumentListScreen, + hasDatatables = navController::navigateDataTableList, + onDocumentClicked = navController::navigateToDocumentListScreen, onCardClicked = { position, survey -> // TODO }, @@ -114,7 +120,7 @@ fun Navigation( loadNotes = navController::navigateToNoteScreen, loadLoanAccountSummary = navController::navigateToLoanAccountSummaryScreen, loadSavingsAccountSummary = navController::navigateToSavingsAccountSummaryScreen, - activateGroup = navController::navigateToActivateScreen + activateGroup = navController::navigateToActivateScreen, ) groupLoanScreen { navController.popBackStack() } @@ -123,21 +129,21 @@ fun Navigation( navController = navController, onBackPressed = navController::popBackStack, loadMoreSavingsAccountInfo = navController::navigateToDataTable, - loadDocuments = navController::navigateToDocumentListScreen + loadDocuments = navController::navigateToDocumentListScreen, ) loanNavGraph( navController = navController, onMoreInfoClicked = navController::navigateToDataTable, - onDocumentsClicked = navController::navigateToDocumentListScreen + onDocumentsClicked = navController::navigateToDocumentListScreen, ) documentListScreen( - onBackPressed = navController::popBackStack + onBackPressed = navController::popBackStack, ) noteScreen( - onBackPressed = navController::popBackStack + onBackPressed = navController::popBackStack, ) addLoanAccountScreen( @@ -145,11 +151,11 @@ fun Navigation( dataTable = { dataTable, payload -> // navController.navigateDataTableList(dataTable, payload, Constants.CLIENT_LOAN) // TODO() - } + }, ) addSavingsAccountScreen( - onBackPressed = navController::popBackStack + onBackPressed = navController::popBackStack, ) activateScreen(onBackPressed = navController::popBackStack) @@ -163,7 +169,7 @@ fun Navigation( onClient = navController::navigateClientDetailsScreen, onLoan = navController::navigateToLoanAccountSummaryScreen, onGroup = navController::navigateToGroupDetailsScreen, - onSavings = navController::navigateClientDetailsScreen + onSavings = navController::navigateClientDetailsScreen, ) centerNavGraph( @@ -174,18 +180,18 @@ fun Navigation( navController.navigateToAddSavingsAccount(it, 0, true) }, - ) + ) reportNavGraph( - navController = navController + navController = navController, ) checkerInboxTaskGraph( - navController = navController + navController = navController, ) pathTrackingNavGraph( - navController = navController + navController = navController, ) settingsScreen( @@ -196,7 +202,7 @@ fun Navigation( ) aboutScreen( - onBackPressed = { navController.popBackStack() } + onBackPressed = { navController.popBackStack() }, ) individualCollectionSheetNavGraph( @@ -204,23 +210,23 @@ fun Navigation( navController = navController, ) - generateCollectionSheetScreen ( navController::popBackStack ) + generateCollectionSheetScreen(navController::popBackStack) dataTableNavGraph( navController = navController, clientCreated = { client, userStatus -> navController.popBackStack() navController.popBackStack() - Toast.makeText(context, context.resources.getString(R.string.client) + MifosResponseHandler.response, Toast.LENGTH_LONG).show() + Toast.makeText(context, context.resources.getString(R.string.client) + MifosResponseHandler.getResponse(userStatus), Toast.LENGTH_LONG).show() - if (userStatus == Constants.USER_ONLINE){ + if (userStatus == Constants.USER_ONLINE) { client.clientId?.let { navController.navigateClientDetailsScreen(it) } } - } + }, ) offlineNavGraph( - navController = navController + navController = navController, ) } -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt index ee0f380b732..f1825a6b9f1 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid.components import com.mifos.mifosxdroid.HomeDestinationsScreen @@ -11,9 +20,7 @@ object NavigationConstants { HomeDestinationsScreen.GroupListScreen.route, ) - fun isNavScreen(route: String?): Boolean { return NavScreenRoutes.contains(route) } - -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/BaseActivityCallback.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/BaseActivityCallback.kt deleted file mode 100644 index 8071b8eeec9..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/BaseActivityCallback.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.core - -import androidx.appcompat.widget.SwitchCompat - -/** - * @author fomenkoo - */ -interface BaseActivityCallback { - fun showProgress(message: String) - fun setToolbarTitle(title: String) - fun setUserStatus(userStatus: SwitchCompat) - fun hideProgress() - fun logout() -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerOnScrollListener.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerOnScrollListener.kt deleted file mode 100644 index c3cec0bebcc..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerOnScrollListener.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.mifos.mifosxdroid.core - -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView - -/** - * Created by rajanmaurya on 16/4/2016. - */ -abstract class EndlessRecyclerOnScrollListener(private val mLinearLayoutManager: LinearLayoutManager) : - RecyclerView.OnScrollListener() { - private var firstVisibleItem = 0 - private var visibleItemCount = 0 - private var totalItemCount = 0 - private var previousTotal = 0 // The total number of items in the dataset after the last load - private var loading = true // True if we are still waiting for the last set of data to - - // load. - private val visibleThreshold = 1 // The minimum amount of items to have below your current - - // scroll position before loading more. - private var currentPage = 1 - override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { - super.onScrolled(recyclerView, dx, dy) - visibleItemCount = recyclerView.childCount - totalItemCount = mLinearLayoutManager.itemCount - - // If user refreshed a layout - if (previousTotal > totalItemCount) { - previousTotal = 0 - } - firstVisibleItem = mLinearLayoutManager.findFirstVisibleItemPosition() - if (loading && totalItemCount > previousTotal + 1) { - loading = false - previousTotal = totalItemCount - } - if (!loading && totalItemCount - visibleItemCount <= firstVisibleItem + visibleThreshold) { - // End has been reached - currentPage++ - onLoadMore(currentPage) - loading = true - } - } - - abstract fun onLoadMore(current_page: Int) - - companion object { - val TAG = EndlessRecyclerOnScrollListener::class.java.simpleName - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerViewScrollListener.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerViewScrollListener.kt deleted file mode 100644 index 5fc3421f991..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/EndlessRecyclerViewScrollListener.kt +++ /dev/null @@ -1,108 +0,0 @@ -package com.mifos.mifosxdroid.core - -import androidx.recyclerview.widget.GridLayoutManager -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import androidx.recyclerview.widget.StaggeredGridLayoutManager - -/** - * Created by rajanmaurya on 09/09/2016 - */ -abstract class EndlessRecyclerViewScrollListener : RecyclerView.OnScrollListener { - // The minimum amount of items to have below your current scroll position - // before loading more. - private var visibleThreshold = 5 - - // The current offset index of data you have loaded - private var currentPage = 0 - - // The total number of items in the dataset after the last load - private var previousTotalItemCount = 0 - - // True if we are still waiting for the last set of data to load. - private var loading = true - - // Sets the starting page index - private val startingPageIndex = 0 - var mLayoutManager: RecyclerView.LayoutManager - - constructor(layoutManager: LinearLayoutManager) { - mLayoutManager = layoutManager - } - - constructor(layoutManager: GridLayoutManager) { - mLayoutManager = layoutManager - visibleThreshold *= layoutManager.spanCount - } - - constructor(layoutManager: StaggeredGridLayoutManager) { - mLayoutManager = layoutManager - visibleThreshold *= layoutManager.spanCount - } - - private fun getLastVisibleItem(lastVisibleItemPositions: IntArray): Int { - var maxSize = 0 - for (i in lastVisibleItemPositions.indices) { - if (i == 0) { - maxSize = lastVisibleItemPositions[i] - } else if (lastVisibleItemPositions[i] > maxSize) { - maxSize = lastVisibleItemPositions[i] - } - } - return maxSize - } - - // This happens many times a second during a scroll, so be wary of the code you place here. - // We are given a few useful parameters to help us work out if we need to load some more data, - // but first we check if we are waiting for the previous load to finish. - override fun onScrolled(view: RecyclerView, dx: Int, dy: Int) { - var lastVisibleItemPosition = 0 - val totalItemCount = mLayoutManager.itemCount - when (mLayoutManager) { - is StaggeredGridLayoutManager -> { - val lastVisibleItemPositions = (mLayoutManager as StaggeredGridLayoutManager) - .findLastVisibleItemPositions(null) - // get maximum element within the list - lastVisibleItemPosition = getLastVisibleItem(lastVisibleItemPositions) - } - - is LinearLayoutManager -> { - lastVisibleItemPosition = (mLayoutManager as LinearLayoutManager) - .findLastVisibleItemPosition() - } - - is GridLayoutManager -> { - lastVisibleItemPosition = (mLayoutManager as GridLayoutManager) - .findLastVisibleItemPosition() - } - } - - // If the total item count is zero and the previous isn't, assume the - // list is invalidated and should be reset back to initial state - if (totalItemCount < previousTotalItemCount) { - currentPage = startingPageIndex - previousTotalItemCount = totalItemCount - loading = totalItemCount == 0 - } - // If it’s still loading, we check to see if the dataset count has - // changed, if so we conclude it has finished loading and update the current page - // number and total item count. - if (loading && totalItemCount > previousTotalItemCount) { - loading = false - previousTotalItemCount = totalItemCount - } - - // If it isn’t currently loading, we check to see if we have breached - // the visibleThreshold and need to reload more data. - // If we do need to reload some more data, we execute onLoadMore to fetch the data. - // threshold should reflect how many total columns there are too - if (!loading && lastVisibleItemPosition + visibleThreshold > totalItemCount) { - currentPage++ - onLoadMore(currentPage, totalItemCount) - loading = true - } - } - - // Defines the process for actually loading more data based on page - abstract fun onLoadMore(page: Int, totalItemsCount: Int) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MaterialDialog.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MaterialDialog.kt deleted file mode 100644 index 4a0461b4e25..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MaterialDialog.kt +++ /dev/null @@ -1,178 +0,0 @@ -package com.mifos.mifosxdroid.core - -import android.content.Context -import android.content.DialogInterface -import androidx.annotation.StringRes -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.mifos.mifosxdroid.R - -/** - * This Class is the Material Dialog Builder Class - * Created by Rajan Maurya on 03/08/16. - */ -class MaterialDialog { - class Builder { - private var mMaterialDialogBuilder: MaterialAlertDialogBuilder? = null - - //This is the Default Builder Initialization with Material Style - fun init(context: Context?): Builder { - mMaterialDialogBuilder = - context?.let { MaterialAlertDialogBuilder(it, R.style.MaterialAlertDialogStyle) } - return this - } - - //This method set the custom Material Style - fun init(context: Context?, theme: Int): Builder { - mMaterialDialogBuilder = context?.let { MaterialAlertDialogBuilder(it, theme) } - return this - } - - //This method set the String Title - fun setTitle(title: String?): Builder { - mMaterialDialogBuilder?.setTitle(title) - return this - } - - //This Method set the String Resources to Title - fun setTitle(@StringRes title: Int): Builder { - mMaterialDialogBuilder?.setTitle(title) - return this - } - - //This Method set the String Message - fun setMessage(message: String?): Builder { - mMaterialDialogBuilder?.setMessage(message) - return this - } - - //This Method set the String Resources message - fun setMessage(@StringRes message: Int): Builder { - mMaterialDialogBuilder?.setMessage(message) - return this - } - - //This Method set String Test to the Positive Button and set the Onclick null - fun setPositiveButton(positiveText: String?): Builder { - mMaterialDialogBuilder?.setPositiveButton(positiveText, null) - return this - } - - //This Method Set the String Resources Text To Positive Button - fun setPositiveButton(@StringRes positiveText: Int): Builder { - mMaterialDialogBuilder?.setPositiveButton(positiveText, null) - return this - } - - //This Method set the String Text to Positive Button and set the OnClick Event to it - fun setPositiveButton( - positiveText: String?, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setPositiveButton(positiveText, listener) - return this - } - - //This method set the String Resources text To Positive button and set the Onclick Event - fun setPositiveButton( - @StringRes positiveText: Int, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setPositiveButton(positiveText, listener) - return this - } - - //This Method the String Text to Negative Button and Set the onclick event to null - fun setNegativeButton(negativeText: String?): Builder { - mMaterialDialogBuilder?.setNegativeButton(negativeText, null) - return this - } - - //This Method set the String Resources Text to Negative button - // and set the onclick event to null - fun setNegativeButton(@StringRes negativeText: Int): Builder { - mMaterialDialogBuilder?.setNegativeButton(negativeText, null) - return this - } - - //This Method set String Text to Negative Button and - //Set the Onclick event - fun setNegativeButton( - negativeText: String?, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setNegativeButton(negativeText, listener) - return this - } - - //This method set String Resources Text to Negative Button and set Onclick Event - fun setNegativeButton( - @StringRes negativeText: Int, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setNegativeButton(negativeText, listener) - return this - } - - //This Method the String Text to Neutral Button and Set the onclick event to null - fun setNeutralButton(neutralText: String?): Builder { - mMaterialDialogBuilder?.setNeutralButton(neutralText, null) - return this - } - - //This Method set the String Resources Text to Neutral button - // and set the onclick event to null - fun setNeutralButton(@StringRes neutralText: Int): Builder { - mMaterialDialogBuilder?.setNeutralButton(neutralText, null) - return this - } - - //This Method set String Text to Neutral Button and - //Set the Onclick event - fun setNeutralButton( - neutralText: String?, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setNeutralButton(neutralText, listener) - return this - } - - //This method set String Resources Text to Neutral Button and set Onclick Event - fun setNeutralButton( - @StringRes neutralText: Int, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setNeutralButton(neutralText, listener) - return this - } - - fun setCancelable(cancelable: Boolean?): Builder { - mMaterialDialogBuilder?.setCancelable(cancelable!!) - return this - } - - fun setItems(items: Int, listener: DialogInterface.OnClickListener?): Builder { - mMaterialDialogBuilder?.setItems(items, listener) - return this - } - - fun setItems( - items: Array, - listener: DialogInterface.OnClickListener? - ): Builder { - mMaterialDialogBuilder?.setItems(items, listener) - return this - } - - //This Method Create the Final Material Dialog - fun createMaterialDialog(): Builder { - mMaterialDialogBuilder?.create() - return this - } - - //This Method Show the Dialog - fun show(): Builder { - mMaterialDialogBuilder?.show() - return this - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseActivity.kt deleted file mode 100644 index 8c197dee467..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseActivity.kt +++ /dev/null @@ -1,161 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.core - -import android.app.ProgressDialog -import android.content.Context -import android.content.Intent -import android.view.MenuItem -import android.view.View -import android.view.inputmethod.InputMethodManager -import android.widget.Toast -import androidx.appcompat.app.AppCompatActivity -import androidx.appcompat.widget.SwitchCompat -import androidx.appcompat.widget.Toolbar -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentManager -import com.mifos.mifosxdroid.AndroidClientActivity -import com.mifos.mifosxdroid.R -import com.mifos.utils.Constants -import com.mifos.utils.LanguageHelper -import com.mifos.utils.PrefManager - -/** - * @author fomenkoo - */ -open class MifosBaseActivity : AppCompatActivity(), BaseActivityCallback { - var toolbar: Toolbar? = null - private var progress: ProgressDialog? = null - override fun setContentView(layoutResID: Int) { - super.setContentView(layoutResID) - toolbar = findViewById(R.id.toolbar) - if (toolbar != null) { - setSupportActionBar(toolbar) - } - } - - override fun setContentView(view: View) { - super.setContentView(view) - toolbar = findViewById(R.id.toolbar) - if (toolbar != null) { - setSupportActionBar(toolbar) - } - } - - private fun setActionBarTitle(title: String?) { - if (supportActionBar != null && getTitle() != null) { - setTitle(title) - } - } - - override fun attachBaseContext(base: Context) { - super.attachBaseContext(LanguageHelper.onAttach(base)) - } - - protected fun showBackButton() { - if (supportActionBar != null) { - supportActionBar?.setHomeButtonEnabled(true) - supportActionBar?.setDisplayHomeAsUpEnabled(true) - } - } - - protected fun setActionBarTitle(title: Int) { - setActionBarTitle(resources.getString(title)) - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - android.R.id.home -> { - onBackPressed() - true - } - - else -> super.onOptionsItemSelected(item) - } - } - - override fun showProgress(message: String) { - if (progress == null) { - progress = ProgressDialog(this, ProgressDialog.STYLE_SPINNER) - progress?.setCancelable(false) - } - progress?.setMessage(message) - progress?.show() - } - - override fun setToolbarTitle(title: String) { - setActionBarTitle(title) - } - - override fun setUserStatus(userStatus: SwitchCompat) { - if (PrefManager.userStatus == Constants.USER_ONLINE) { - userStatus.isChecked = false - } else if (PrefManager.userStatus == Constants.USER_OFFLINE) { - userStatus.isChecked = true - } - } - - override fun hideProgress() { - if (progress != null && progress?.isShowing == true) progress?.dismiss() - } - - fun hideKeyboard(view: View) { - val inputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager - inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) - } - - override fun logout() { - MaterialDialog.Builder().init(this@MifosBaseActivity) - .setMessage(R.string.dialog_logout) - .setPositiveButton( - getString(R.string.logout) - ) { dialog, which -> - PrefManager.clear() - startActivity( - Intent( - this@MifosBaseActivity, - AndroidClientActivity::class.java - ) - ) - Toast.makeText( - this@MifosBaseActivity, - R.string.logout_successfully, - Toast.LENGTH_SHORT - ).show() - finish() - } - .setNegativeButton(getString(R.string.cancel)) - .createMaterialDialog() - .show() - } - - fun replaceFragment(fragment: Fragment, addToBackStack: Boolean, containerId: Int) { - invalidateOptionsMenu() - val backStateName = fragment.javaClass.name - val fragmentPopped = supportFragmentManager.popBackStackImmediate( - backStateName, - 0 - ) - if (!fragmentPopped && supportFragmentManager.findFragmentByTag(backStateName) == - null - ) { - val transaction = supportFragmentManager.beginTransaction() - transaction.replace(containerId, fragment, backStateName) - if (addToBackStack) { - transaction.addToBackStack(backStateName) - } - transaction.commit() - } - } - - fun clearFragmentBackStack() { - val fm = supportFragmentManager - val backStackCount = supportFragmentManager.backStackEntryCount - for (i in 0 until backStackCount) { - val backStackId = supportFragmentManager.getBackStackEntryAt(i).id - fm.popBackStack(backStackId, FragmentManager.POP_BACK_STACK_INCLUSIVE) - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseFragment.kt deleted file mode 100644 index d19a32d9d36..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosBaseFragment.kt +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.core - -import android.app.Activity -import android.content.Context -import android.os.Bundle -import android.view.View -import android.view.inputmethod.InputMethodManager -import androidx.appcompat.widget.Toolbar -import androidx.fragment.app.Fragment -import com.mifos.mifosxdroid.R -import com.mifos.utils.LanguageHelper -import com.mifos.utils.Network - -/** - * @author fomenkoo - */ -open class MifosBaseFragment() : Fragment() { - private var callback: BaseActivityCallback? = null - private var activity: Activity? = null - private var inputManager: InputMethodManager? = null - private var mMifosProgressBarHandler: MifosProgressBarHandler? = null - override fun onAttach(context: Context) { - super.onAttach(LanguageHelper.onAttach(context)) - val activity = if (context is Activity) context else null - this.activity = activity - callback = try { - activity as BaseActivityCallback? - } catch (e: ClassCastException) { - throw ClassCastException( - activity.toString() + " must implement " + - "BaseActivityCallback" - ) - } - } - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - inputManager = - requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - mMifosProgressBarHandler = MifosProgressBarHandler(requireActivity()) - } - - fun showAlertDialog(title: String?, message: String?) { - MaterialDialog.Builder().init(getActivity()) - .setTitle(title) - .setMessage(message) - .setCancelable(false) - .setPositiveButton(getStringMessage(R.string.dialog_action_ok)) { dialog, id -> dialog.dismiss() } - .createMaterialDialog() - .show() - } - - val toolbar: Toolbar? - get() = (getActivity() as MifosBaseActivity).toolbar - - protected fun showMifosProgressDialog(message: String = "Working...") { - if (callback != null) callback?.showProgress(message) - } - - protected fun hideMifosProgressDialog() { - if (callback != null) callback?.hideProgress() - } - - protected fun logout() { - callback?.logout() - } - - protected fun setToolbarTitle(title: String) { - callback?.setToolbarTitle(title) - } - - fun hideKeyboard(view: View) { - inputManager?.hideSoftInputFromWindow( - view.windowToken, - InputMethodManager.RESULT_UNCHANGED_SHOWN - ) - } - - protected fun showMifosProgressBar() { - mMifosProgressBarHandler?.show() - } - - protected fun hideMifosProgressBar() { - mMifosProgressBarHandler?.hide() - } - - protected fun getStringMessage(message: Int): String { - return resources.getString(message) - } - - protected val isOnline: Boolean - get() = Network.isOnline(requireContext()) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosProgressBarHandler.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosProgressBarHandler.kt deleted file mode 100644 index 5ab09568ba1..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MifosProgressBarHandler.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.mifos.mifosxdroid.core - -import android.R -import android.app.Activity -import android.view.Gravity -import android.view.View -import android.view.ViewGroup -import android.widget.ProgressBar -import android.widget.RelativeLayout -import androidx.fragment.app.FragmentActivity - -/** - * @author Rajan Maurya - */ -class MifosProgressBarHandler(private val mContext: FragmentActivity) { - private val mProgressBar: ProgressBar - - init { - val layout = (mContext as Activity).findViewById(R.id.content).rootView as ViewGroup - mProgressBar = ProgressBar(mContext, null, R.attr.progressBarStyleInverse) - mProgressBar.isIndeterminate = true - val params = RelativeLayout.LayoutParams( - RelativeLayout.LayoutParams.MATCH_PARENT, - RelativeLayout.LayoutParams.MATCH_PARENT - ) - val rl = RelativeLayout(mContext) - rl.gravity = Gravity.CENTER - rl.addView(mProgressBar) - layout.addView(rl, params) - hide() - } - - fun show() { - mProgressBar.visibility = View.VISIBLE - } - - fun hide() { - mProgressBar.visibility = View.INVISIBLE - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableDialogFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableDialogFragment.kt deleted file mode 100644 index f56cbaf4fcc..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableDialogFragment.kt +++ /dev/null @@ -1,61 +0,0 @@ -package com.mifos.mifosxdroid.core - -import android.content.Context -import android.os.Bundle -import android.util.Log -import android.view.View -import android.view.inputmethod.InputMethodManager -import android.widget.ViewFlipper -import androidx.fragment.app.DialogFragment -import com.mifos.mifosxdroid.R - -/** - * A [DialogFragment] that provides progress viewing functionality - * with a ViewFlipper. - */ -open class ProgressableDialogFragment : DialogFragment() { - private var viewFlipper: ViewFlipper? = null - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - viewFlipper = view.findViewById(R.id.view_flipper) - if (viewFlipper == null) { - throw NullPointerException( - "Are you sure your Fragment has a ViewFlipper with id " + - "\"view_flipper\"?" - ) - } - } - - /** - * Switches the [ViewFlipper] either to the [ProgressBar] or to the content. - * - * @param show true to show [ProgressBar], false for content. - */ - fun showProgress(show: Boolean) { - try { - val childToFlipTo = if (show) VIEW_FLIPPER_PROGRESS else VIEW_FLIPPER_CONTENT - if (viewFlipper?.displayedChild != childToFlipTo) { - viewFlipper?.displayedChild = childToFlipTo - } - } catch (e: NullPointerException) { - Log.w( - javaClass.simpleName, "Couldn't show/hide progress bar. Are you sure your" + - " Fragment contains a ViewFlipper with ID \"view_flipper\"?" - ) - } - } - - fun hideKeyboard(view: View) { - val inputManager = requireActivity() - .getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - inputManager.hideSoftInputFromWindow( - view.windowToken, - InputMethodManager.RESULT_UNCHANGED_SHOWN - ) - } - - companion object { - const val VIEW_FLIPPER_PROGRESS = 0 - const val VIEW_FLIPPER_CONTENT = 1 - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableFragment.kt deleted file mode 100644 index dc4324f772d..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/ProgressableFragment.kt +++ /dev/null @@ -1,48 +0,0 @@ -package com.mifos.mifosxdroid.core - -import android.os.Bundle -import android.util.Log -import android.view.View -import android.widget.ViewFlipper -import com.mifos.mifosxdroid.R - -/** - * A [MifosBaseFragment] that provides progress viewing functionality with a ViewFlipper. - */ -open class ProgressableFragment : MifosBaseFragment() { - private var viewFlipper: ViewFlipper? = null - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - viewFlipper = view.findViewById(R.id.view_flipper) - if (viewFlipper == null) { - throw NullPointerException( - "Are you sure your Fragment has a ViewFlipper with id " + - "\"view_flipper\"?" - ) - } - } - - /** - * Switches the [ViewFlipper] either to the [ProgressBar] or to the content. - * - * @param show true to show [ProgressBar], false for content. - */ - fun showProgress(show: Boolean) { - try { - val childToFlipTo = if (show) VIEW_FLIPPER_PROGRESS else VIEW_FLIPPER_CONTENT - if (viewFlipper!!.displayedChild != childToFlipTo) { - viewFlipper!!.displayedChild = childToFlipTo - } - } catch (e: NullPointerException) { - Log.w( - javaClass.simpleName, "Couldn't show/hide progress bar. Are you sure your" + - " Fragment contains a ViewFlipper with ID \"view_flipper\"?" - ) - } - } - - companion object { - const val VIEW_FLIPPER_PROGRESS = 0 - const val VIEW_FLIPPER_CONTENT = 1 - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/SelectableAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/SelectableAdapter.kt deleted file mode 100644 index 976a0c4fa53..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/SelectableAdapter.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.mifos.mifosxdroid.core - -import android.util.SparseBooleanArray -import androidx.recyclerview.widget.RecyclerView - -abstract class SelectableAdapter : RecyclerView.Adapter() { - private val selectedItems: SparseBooleanArray = SparseBooleanArray() - - /** - * Indicates if the item at position position is selected - * - * @param position Position of the item to check - * @return true if the item is selected, false otherwise - */ - fun isSelected(position: Int): Boolean { - return getSelectedItems().contains(position) - } - - /** - * Toggle the selection status of the item at a given position - * - * @param position Position of the item to toggle the selection status for - */ - fun toggleSelection(position: Int) { - if (selectedItems[position, false]) { - selectedItems.delete(position) - } else { - selectedItems.put(position, true) - } - notifyItemChanged(position) - } - - /** - * Clear the selection status for all items - */ - fun clearSelection() { - val selection = getSelectedItems() - selectedItems.clear() - for (i in selection) { - notifyItemChanged(i) - } - } - - /** - * Count the selected items - * - * @return Selected items count - */ - val selectedItemCount: Int - get() = selectedItems.size() - - /** - * Indicates the list of selected items - * - * @return List of selected items ids - */ - fun getSelectedItems(): List { - val items: MutableList = ArrayList(selectedItems.size()) - for (i in 0 until selectedItems.size()) { - items.add(selectedItems.keyAt(i)) - } - return items - } - - companion object { - private val LOG_TAG = SelectableAdapter::class.java.simpleName - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/adapters/MifosBaseListAdapter.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/adapters/MifosBaseListAdapter.kt deleted file mode 100644 index 635d2e82f9e..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/adapters/MifosBaseListAdapter.kt +++ /dev/null @@ -1,173 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.core.adapters - -import android.content.Context -import android.content.res.Resources -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.BaseAdapter -import android.widget.ListView -import java.util.Collections - -/** - * @author fomenkoo - */ -abstract class MifosBaseListAdapter( - /** - * Returns the context associated with this array adapter. The context is used - * to create views from the resource passed to the constructor. - * - * @return The Context associated with this adapter. - */ - val context: Context, private var list: MutableList?, private val layoutId: Int -) : BaseAdapter() { - private val mLock = Any() - - /** - * Handler for button elements in listview - */ - var buttonListener = View.OnClickListener { v -> - val listView = v.parent as ListView - val position = listView.getPositionForView(v) - listView.performItemClick( - listView.getChildAt(position), position, listView - .getItemIdAtPosition(position) - ) - } - var inflater: LayoutInflater? = null - get() { - if (field == null) { - field = LayoutInflater.from(context) - } - return field - } - private set - - override fun getView(position: Int, convertView: View, parent: ViewGroup): View? { - return layout - } - - /** - * Adds the specified object at the end of the array. - * - * @param object The object to add at the end of the array. - */ - fun add(`object`: T) { - synchronized(mLock) { list?.add(`object`) } - notifyDataSetChanged() - } - - /** - * Adds the specified Collection at the end of the array. - * - * @param collection The Collection to add at the end of the array. - */ - fun addAll(collection: Collection?) { - synchronized(mLock) { - if (collection != null) { - list?.addAll(collection) - } - } - notifyDataSetChanged() - } - - /** - * Adds the specified items at the end of the array. - * - * @param items The items to add at the end of the array. - */ - fun addAll(vararg items: T) { - synchronized(mLock) { Collections.addAll(list, *items) } - notifyDataSetChanged() - } - - /** - * Inserts the specified object at the specified index in the array. - * - * @param object The object to insert into the array. - * @param index The index at which the object must be inserted. - */ - fun insert(`object`: T, index: Int) { - synchronized(mLock) { list?.add(index, `object`) } - notifyDataSetChanged() - } - - /** - * Removes the specified object from the array. - * - * @param object The object to remove. - */ - fun remove(`object`: T) { - synchronized(mLock) { list?.remove(`object`) } - notifyDataSetChanged() - } - - /** - * Remove all elements from the list. - */ - fun clear() { - synchronized(mLock) { list?.clear() } - notifyDataSetChanged() - } - - /** - * Sorts the content of this adapter using the specified comparator. - * - * @param comparator The comparator used to sort the objects contained - * in this adapter. - */ - fun sort(comparator: Comparator?) { - synchronized(mLock) { Collections.sort(list, comparator) } - notifyDataSetChanged() - } - - /** - * {@inheritDoc} - */ - override fun getCount(): Int { - return list?.size ?: 0 - } - - /** - * {@inheritDoc} - */ - override fun getItem(position: Int): T? { - return list?.getOrNull(position) - } - - /** - * Returns the position of the specified item in the array. - * - * @param item The item to retrieve the position of. - * @return The position of the specified item. - */ - fun getPosition(item: T): Int { - return list?.indexOf(item) ?: -1 - } - - /** - * {@inheritDoc} - */ - override fun getItemId(position: Int): Long { - return position.toLong() - } - - val resources: Resources - get() = context.resources - - fun getList(): List? { - return list - } - - fun setList(list: MutableList?) { - synchronized(mLock) { this.list = list } - notifyDataSetChanged() - } - - val layout: View? - get() = inflater?.inflate(layoutId, null) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/util/Toaster.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/util/Toaster.kt deleted file mode 100644 index fe36556b2fe..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/util/Toaster.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.core.util - -import android.view.View -import android.widget.TextView -import com.google.android.material.R -import com.google.android.material.snackbar.Snackbar -import com.mifos.application.App - -/** - * @author fomenkoo - */ -object Toaster { - const val INDEFINITE = Snackbar.LENGTH_INDEFINITE - const val LONG = Snackbar.LENGTH_LONG - const val SHORT = Snackbar.LENGTH_SHORT - - @JvmStatic - fun show(view: View?, text: String?, duration: Int) { - if (view != null && text != null) { - val snackbar = Snackbar.make(view, text, duration) - val sbView = snackbar.view - val textView = sbView.findViewById(R.id.snackbar_text) - textView.textSize = 12f - snackbar.setAction("OK") { snackbar.dismiss() } - snackbar.show() - } - } - - @JvmStatic - fun show(view: View?, res: Int, duration: Int) { - show(view, App.context?.resources?.getString(res), duration) - } - - @JvmStatic - fun show(view: View?, string: String?) { - show(view, string, Snackbar.LENGTH_LONG) - } - - @JvmStatic - fun show(view: View?, res: Int) { - show(view, App.context?.resources?.getString(res)) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/chargedialog/OnChargeCreateListener.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/chargedialog/OnChargeCreateListener.kt deleted file mode 100644 index 734ff237ae1..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/chargedialog/OnChargeCreateListener.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.mifos.mifosxdroid.dialogfragments.chargedialog - -import com.mifos.core.objects.client.Charges - -/** - * Created by Tarun on 13-08-17. - */ -interface OnChargeCreateListener { - fun onChargeCreatedSuccess(charge: Charges) - fun onChargeCreatedFailure(errorMessage: String) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/checkertaskfilterdialog/CheckerTaskFilterDialogFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/checkertaskfilterdialog/CheckerTaskFilterDialogFragment.kt deleted file mode 100644 index d6716ec3de0..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/checkertaskfilterdialog/CheckerTaskFilterDialogFragment.kt +++ /dev/null @@ -1,212 +0,0 @@ -package com.mifos.mifosxdroid.dialogfragments.checkertaskfilterdialog - -/* -import android.content.Context -import android.os.Bundle -import android.util.Log -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.AdapterView -import android.widget.ArrayAdapter -import androidx.fragment.app.DialogFragment -import androidx.lifecycle.Observer -import androidx.lifecycle.ViewModelProviders -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.databinding.DialogFragmentCheckerTaskFilterBinding -import com.mifos.feature.checker_inbox_task.checker_inbox_dialog.CheckerInboxViewModel -import com.mifos.feature.checker_inbox_task.dialog.CheckerInboxViewModelFactory -import com.mifos.mifosxdroid.uihelpers.MFDatePicker -import com.mifos.utils.FragmentConstants -import dagger.hilt.android.AndroidEntryPoint -import java.sql.Timestamp -import java.text.SimpleDateFormat -import javax.inject.Inject - -@AndroidEntryPoint -class CheckerTaskFilterDialogFragment : DialogFragment(), MFDatePicker.OnDatePickListener, - AdapterView.OnItemSelectedListener { - - private lateinit var binding: DialogFragmentCheckerTaskFilterBinding - - private lateinit var mOnInputSelected: OnInputSelected - - private lateinit var datePickerFromDate: DialogFragment - private lateinit var datePickerToDate: DialogFragment - private lateinit var mCurrentDateView: View - private lateinit var selectedAction: String - private lateinit var selectedEntity: String - - private lateinit var actionOptionsList: MutableList - private lateinit var entityOptionsList: MutableList - private lateinit var actionOptionsAdapter: ArrayAdapter - private lateinit var entityOptionsAdapter: ArrayAdapter - - private lateinit var fromDate: String - private lateinit var toDate: String - - private val ALL = "ALL" - private val TO_TIME = "23:59:59" - - @Inject - lateinit var factory: CheckerInboxViewModelFactory - private lateinit var viewModel: CheckerInboxViewModel - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - actionOptionsList = mutableListOf() - entityOptionsList = mutableListOf() - actionOptionsList.add(ALL) - entityOptionsList.add(ALL) - fromDate = "" - selectedAction = ALL - selectedEntity = ALL - datePickerFromDate = MFDatePicker.newInsance(this) - datePickerToDate = MFDatePicker.newInsance(this) - } - - override fun onCreateView( - inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? - ): View { - binding = DialogFragmentCheckerTaskFilterBinding.inflate(inflater, container, false) - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - binding.spAction.onItemSelectedListener = this - binding.spEntity.onItemSelectedListener = this - setOnClickListeners() - binding.tvFromDate.text = getString(R.string.select_from_date) - toDate = "${MFDatePicker.datePickedAsString} $TO_TIME" - binding.tvToDate.text = toDate.substringBefore(" ") - } - - private fun setOnClickListeners() { - binding.tvFromDate.setOnClickListener { - activity?.supportFragmentManager?.let { it1 -> - datePickerFromDate.show( - it1, - FragmentConstants.DFRAG_DATE_PICKER - ) - } - mCurrentDateView = binding.tvFromDate - } - - binding.tvToDate.setOnClickListener { - activity?.supportFragmentManager?.let { it1 -> - datePickerToDate.show( - it1, - FragmentConstants.DFRAG_DATE_PICKER - ) - } - mCurrentDateView = binding.tvToDate - } - - binding.btnApplyFilter.setOnClickListener { - val resourceId = binding.etResourceId.text.toString().trim() - var fromDateTimeStamp: Timestamp? = null - if (fromDate.isNotEmpty()) { - fromDateTimeStamp = Timestamp( - SimpleDateFormat("dd-MM-yyyy").parse(fromDate).time - ) - } - val toDateTimeStamp = Timestamp( - SimpleDateFormat("dd-MM-yyyy HH:mm:ss").parse(toDate).time - ) - mOnInputSelected.sendInput( - fromDateTimeStamp, toDateTimeStamp, - selectedAction, selectedEntity, resourceId - ) - dialog?.dismiss() - } - - binding.btnClearFilter.setOnClickListener { - mOnInputSelected.sendInput( - null, null, - selectedAction, selectedEntity, "" - ) - dialog?.dismiss() - } - } - - - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) - - viewModel = ViewModelProviders.of(this, factory)[CheckerInboxViewModel::class.java] - - viewModel.getSearchTemplate().observe(this, Observer { - val checkerInboxSearchTemplate = it - actionOptionsList.addAll(checkerInboxSearchTemplate.actionNames) - entityOptionsList.addAll(checkerInboxSearchTemplate.entityNames) - - actionOptionsAdapter = ArrayAdapter( - requireActivity(), - android.R.layout.simple_spinner_item, actionOptionsList - ) - actionOptionsAdapter.setDropDownViewResource( - android.R.layout.simple_spinner_dropdown_item - ) - - entityOptionsAdapter = ArrayAdapter( - requireActivity(), - android.R.layout.simple_spinner_item, entityOptionsList - ) - entityOptionsAdapter.setDropDownViewResource( - android.R.layout.simple_spinner_dropdown_item - ) - - binding.spAction.adapter = actionOptionsAdapter - binding.spEntity.adapter = entityOptionsAdapter - - selectedAction = checkerInboxSearchTemplate.actionNames[0] - selectedEntity = checkerInboxSearchTemplate.entityNames[0] - } - ) - } - - override fun onAttach(context: Context) { - super.onAttach(context) - try { - mOnInputSelected = targetFragment as OnInputSelected - } catch (e: ClassCastException) { - Log.e("TaskFilterDialog", e.message.toString()) - } - } - - override fun onNothingSelected(p0: AdapterView<*>?) { - } - - override fun onItemSelected(p0: AdapterView<*>?, p1: View?, p2: Int, p3: Long) { - when (p0?.id) { - R.id.sp_action -> { - selectedAction = p0.getItemAtPosition(p2) as String - } - - R.id.sp_entity -> { - selectedEntity = p0.getItemAtPosition(p2) as String - } - } - } - - interface OnInputSelected { - fun sendInput( - fromDate: Timestamp?, toDate: Timestamp?, action: String = "", - entity: String = "", resourceId: String = "" - ) - } - - override fun onDatePicked(date: String?) { - if (mCurrentDateView === binding.tvFromDate) { - if (date != null) { - fromDate = date - } - binding.tvFromDate.text = fromDate - } else if (mCurrentDateView === binding.tvToDate) { - toDate = "$date $TO_TIME" - binding.tvToDate.text = toDate.substringBefore(" ") - } - } -} -*/ \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/syncsurveysdialog/SyncSurveysDialogFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/syncsurveysdialog/SyncSurveysDialogFragment.kt deleted file mode 100644 index ca13b4e9d75..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/dialogfragments/syncsurveysdialog/SyncSurveysDialogFragment.kt +++ /dev/null @@ -1,248 +0,0 @@ -package com.mifos.mifosxdroid.dialogfragments.syncsurveysdialog - -/* -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.Toast -import androidx.fragment.app.DialogFragment -import androidx.lifecycle.ViewModelProvider -import com.mifos.core.objects.survey.Survey -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.core.util.Toaster.show -import com.mifos.mifosxdroid.databinding.DialogFragmentSyncSurveysBinding -import com.mifos.utils.Constants -import com.mifos.utils.Network.isOnline -import com.mifos.utils.PrefManager.userStatus -import dagger.hilt.android.AndroidEntryPoint - -@AndroidEntryPoint -class SyncSurveysDialogFragment : DialogFragment() { - - private lateinit var binding: DialogFragmentSyncSurveysBinding - - private lateinit var viewModel: SyncSurveysDialogViewModel - - private var mSurveyList: List? = null - override fun onCreate(savedInstanceState: Bundle?) { - mSurveyList = ArrayList() - super.onCreate(savedInstanceState) - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - binding = DialogFragmentSyncSurveysBinding.inflate(inflater, container, false) - viewModel = ViewModelProvider(this)[SyncSurveysDialogViewModel::class.java] - //Start Syncing Surveys - if (isOnline && userStatus == Constants.USER_ONLINE) { - viewModel.loadSurveyList() - } else { - showNetworkIsNotAvailable() - fragmentManager?.popBackStack() - } - - viewModel.syncSurveysDialogUiState.observe(viewLifecycleOwner) { - when (it) { - is SyncSurveysDialogUiState.DismissDialog -> hideDialog() - is SyncSurveysDialogUiState.SetQuestionSyncProgressBarMax -> { - showProgressbar(false) - setQuestionSyncProgressBarMax(it.total) - } - - is SyncSurveysDialogUiState.SetResponseSyncProgressBarMax -> { - showProgressbar(false) - setResponseSyncProgressBarMax(it.total) - } - - is SyncSurveysDialogUiState.ShowError -> { - showProgressbar(false) - showError(it.message) - } - - is SyncSurveysDialogUiState.ShowNetworkIsNotAvailable -> { - showProgressbar(false) - showNetworkIsNotAvailable() - } - - is SyncSurveysDialogUiState.ShowProgressbar -> showProgressbar(true) - is SyncSurveysDialogUiState.ShowSurveysSyncSuccessfully -> { - showProgressbar(false) - showSurveysSyncSuccessfully() - } - - is SyncSurveysDialogUiState.ShowSyncedFailedSurveys -> { - showProgressbar(false) - showSyncedFailedSurveys(it.failedCount) - } - - is SyncSurveysDialogUiState.ShowSyncingSurvey -> { - showProgressbar(false) - showSyncingSurvey(it.surveyName) - } - - is SyncSurveysDialogUiState.ShowUI -> { - showProgressbar(false) - showUI() - } - - is SyncSurveysDialogUiState.UpdateQuestionSyncProgressBar -> { - showProgressbar(false) - updateQuestionSyncProgressBar(it.index) - } - - is SyncSurveysDialogUiState.UpdateResponseSyncProgressBar -> { - showProgressbar(false) - updateResponseSyncProgressBar(it.index) - } - - is SyncSurveysDialogUiState.UpdateSingleSyncSurveyProgressBar -> { - showProgressbar(false) - updateSingleSyncSurveyProgressBar(it.index) - } - - is SyncSurveysDialogUiState.UpdateSurveyList -> { - showProgressbar(false) - updateSurveyList(it.surveys) - } - - is SyncSurveysDialogUiState.UpdateTotalSyncSurveyProgressBarAndCount -> { - showProgressbar(false) - updateTotalSyncSurveyProgressBarAndCount(it.total) - } - - SyncSurveysDialogUiState.Initial -> Unit - } - } - - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - binding.btnCancel.setOnClickListener { - onClickCancelButton() - } - - binding.btnHide.setOnClickListener { - onClickHideButton() - } - } - - private fun onClickCancelButton() { - dismissDialog() - } - - private fun onClickHideButton() { - if (binding.btnHide.text == resources.getString(R.string.dialog_action_ok)) { - dismissDialog() - } else { - hideDialog() - } - } - - private fun updateSurveyList(surveyList: List) { - mSurveyList = surveyList - } - - private fun showUI() { - binding.pbTotalSyncSurvey.max = mSurveyList!!.size - val totalSurveys = mSurveyList!!.size.toString() + resources.getString(R.string.space) + - resources.getString(R.string.surveys) - binding.tvTotalSurveys.text = totalSurveys - binding.tvSyncFailed.text = 0.toString() - } - - private fun showSyncingSurvey(surveyName: String?) { - binding.tvSyncingSurvey.text = surveyName - binding.tvSurveyName.text = surveyName - } - - private fun showSyncedFailedSurveys(failedCount: Int) { - binding.tvSyncFailed.text = failedCount.toString() - } - - private fun setQuestionSyncProgressBarMax(count: Int) { - binding.pbSyncQuestion.max = count - } - - private fun setResponseSyncProgressBarMax(count: Int) { - binding.pbSyncResponse.max = count - } - - private fun updateSingleSyncSurveyProgressBar(count: Int) { - binding.pbSyncSurvey.progress = count - } - - private fun updateQuestionSyncProgressBar(i: Int) { - binding.pbSyncQuestion.progress = i - } - - private fun updateResponseSyncProgressBar(i: Int) { - binding.pbSyncResponse.progress = i - } - - private fun updateTotalSyncSurveyProgressBarAndCount(count: Int) { - binding.pbTotalSyncSurvey.progress = count - val totalSyncCount = resources - .getString(R.string.space) + count + resources - .getString(R.string.slash) + mSurveyList!!.size - binding.tvTotalProgress.text = totalSyncCount - } - - private var maxSingleSyncSurveyProgressBar: Int - get() = binding.pbSyncSurvey.max - set(total) { - binding.pbSyncSurvey.max = total - } - - private fun showNetworkIsNotAvailable() { - Toast.makeText( - activity, - resources.getString(R.string.error_network_not_available), - Toast.LENGTH_SHORT - ).show() - } - - private fun showSurveysSyncSuccessfully() { - binding.btnCancel.visibility = View.INVISIBLE - dismissDialog() - Toast.makeText(activity, R.string.sync_success, Toast.LENGTH_SHORT).show() - } - - private val isOnline: Boolean - get() = activity?.let { isOnline(it) } == true - - private fun dismissDialog() { - dialog?.dismiss() - } - - private fun showDialog() { - dialog?.show() - } - - private fun hideDialog() { - dialog?.hide() - } - - private fun showError(s: String) { - show(binding.root, s) - } - - private fun showProgressbar(b: Boolean) {} - - companion object { - val LOG_TAG = SyncSurveysDialogFragment::class.java.simpleName - fun newInstance(): SyncSurveysDialogFragment { - val syncSurveysDialogFragment = SyncSurveysDialogFragment() - val args = Bundle() - syncSurveysDialogFragment.arguments = args - return syncSurveysDialogFragment - } - } -} - */ \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/ApplicationModule.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/ApplicationModule.kt deleted file mode 100644 index ed414912e82..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/ApplicationModule.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.mifos.mifosxdroid.injection.module - -import android.content.Context -import com.mifos.utils.NetworkUtilsWrapper -import dagger.Module -import dagger.Provides -import dagger.hilt.InstallIn -import dagger.hilt.android.qualifiers.ApplicationContext -import dagger.hilt.components.SingletonComponent -import javax.inject.Singleton - - -/** - * @author Rajan Maurya - * Provide application-level dependencies. - */ -@Module -@InstallIn(SingletonComponent::class) -class ApplicationModule { - - @Provides - @Singleton - fun provideNetworkUtilsWrapper(@ApplicationContext context: Context): NetworkUtilsWrapper { - return NetworkUtilsWrapper(context) - } - -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/RepositoryModule.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/RepositoryModule.kt index 76ac6fb1f27..2b55f418ebf 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/RepositoryModule.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/injection/module/RepositoryModule.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid.injection.module import com.mifos.core.data.repository.CreateNewClientRepository @@ -46,8 +55,6 @@ import com.mifos.core.network.datamanager.DataManagerStaff import com.mifos.core.network.datamanager.DataManagerSurveys import com.mifos.feature.settings.syncSurvey.SyncSurveysDialogRepository import com.mifos.feature.settings.syncSurvey.SyncSurveysDialogRepositoryImp -import com.mifos.mifosxdroid.online.centerlist.CenterListRepository -import com.mifos.mifosxdroid.online.centerlist.CenterListRepositoryImp import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -61,18 +68,11 @@ import dagger.hilt.components.SingletonComponent @InstallIn(SingletonComponent::class) class RepositoryModule { - - @Provides - fun providesCenterListRepository(dataManagerCenter: DataManagerCenter): CenterListRepository { - return CenterListRepositoryImp(dataManagerCenter) - } - @Provides fun providesSavingsAccountSummaryRepository(dataManagerSavings: DataManagerSavings): SavingsAccountSummaryRepository { return SavingsAccountSummaryRepositoryImp(dataManagerSavings) } - @Provides fun providesNoteRepository(dataManagerNote: DataManagerNote): NoteRepository { return NoteRepositoryImp(dataManagerNote) @@ -87,10 +87,10 @@ class RepositoryModule { fun providesCreateNewClientRepository( dataManagerClient: DataManagerClient, dataManagerOffices: DataManagerOffices, - dataManagerStaff: DataManagerStaff + dataManagerStaff: DataManagerStaff, ): CreateNewClientRepository { return CreateNewClientRepositoryImp(dataManagerClient, dataManagerOffices, dataManagerStaff) - } + } @Provides fun providesSavingsAccountTransactionRepository(dataManagerSavings: DataManagerSavings): SavingsAccountTransactionRepository { @@ -112,7 +112,6 @@ class RepositoryModule { return DocumentDialogRepositoryImp(dataManagerDocument) } - @Provides fun providesSyncSurveysDialogRepository(dataManagerSurvey: DataManagerSurveys): SyncSurveysDialogRepository { return SyncSurveysDialogRepositoryImp(dataManagerSurvey) @@ -123,13 +122,13 @@ class RepositoryModule { dataManagerGroups: DataManagerGroups, dataManagerLoan: DataManagerLoan, dataManagerSavings: DataManagerSavings, - dataManagerClient: DataManagerClient + dataManagerClient: DataManagerClient, ): SyncGroupsDialogRepository { return SyncGroupsDialogRepositoryImp( dataManagerGroups, dataManagerLoan, dataManagerSavings, - dataManagerClient + dataManagerClient, ) } @@ -137,12 +136,12 @@ class RepositoryModule { fun providesSyncClientsDialogRepository( dataManagerClient: DataManagerClient, dataManagerLoan: DataManagerLoan, - dataManagerSavings: DataManagerSavings + dataManagerSavings: DataManagerSavings, ): SyncClientsDialogRepository { return SyncClientsDialogRepositoryImp( dataManagerClient, dataManagerLoan, - dataManagerSavings + dataManagerSavings, ) } @@ -152,14 +151,14 @@ class RepositoryModule { dataManagerLoan: DataManagerLoan, dataManagerSavings: DataManagerSavings, dataManagerGroups: DataManagerGroups, - dataManagerClient: DataManagerClient + dataManagerClient: DataManagerClient, ): SyncCentersDialogRepository { return SyncCentersDialogRepositoryImp( dataManagerCenter, dataManagerLoan, dataManagerSavings, dataManagerGroups, - dataManagerClient + dataManagerClient, ) } @@ -169,14 +168,14 @@ class RepositoryModule { dataManagerGroups: DataManagerGroups, dataManagerCenter: DataManagerCenter, dataManagerLoan: DataManagerLoan, - dataManagerSavings: DataManagerSavings + dataManagerSavings: DataManagerSavings, ): OfflineDashboardRepository { return OfflineDashboardRepositoryImp( dataManagerClient, dataManagerGroups, dataManagerCenter, dataManagerLoan, - dataManagerSavings + dataManagerSavings, ) } @@ -188,7 +187,7 @@ class RepositoryModule { @Provides fun providesSyncSavingsAccountTransactionRepository( dataManagerSavings: DataManagerSavings, - dataManagerLoan: DataManagerLoan + dataManagerLoan: DataManagerLoan, ): SyncSavingsAccountTransactionRepository { return SyncSavingsAccountTransactionRepositoryImp(dataManagerSavings, dataManagerLoan) } @@ -207,4 +206,4 @@ class RepositoryModule { fun providesSyncClientPayloadsRepository(dataManagerClient: DataManagerClient): SyncClientPayloadsRepository { return SyncClientPayloadsRepositoryImp(dataManagerClient) } -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeNavigation.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeNavigation.kt index fc367a56a43..149504b8315 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeNavigation.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeNavigation.kt @@ -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/android-client/blob/master/LICENSE.md + */ @file:OptIn(ExperimentalMaterial3Api::class) package com.mifos.mifosxdroid.navigation @@ -70,7 +79,7 @@ import kotlinx.coroutines.launch fun NavGraphBuilder.homeGraph() { navigation( startDestination = HomeScreens.HomeScreen.route, - route = "home_screen_route" + route = "home_screen_route", ) { homeNavigate() } @@ -78,7 +87,7 @@ fun NavGraphBuilder.homeGraph() { fun NavGraphBuilder.homeNavigate() { composable( - route = HomeScreens.HomeScreen.route + route = HomeScreens.HomeScreen.route, ) { HomeNavigation() } @@ -91,8 +100,9 @@ fun NavController.navigateHome() { } @Composable -fun HomeNavigation() { - +fun HomeNavigation( + modifier: Modifier = Modifier, +) { val navController = rememberNavController() val navBackStackEntry by navController.currentBackStackEntryAsState() val route = navBackStackEntry?.destination?.route @@ -109,7 +119,7 @@ fun HomeNavigation() { HomeDestinationsScreen.PathTrackerScreen, HomeDestinationsScreen.SettingsScreen, HomeDestinationsScreen.AboutScreen, - HomeDestinationsScreen.OfflineSyncScreen + HomeDestinationsScreen.OfflineSyncScreen, ) } @@ -119,19 +129,20 @@ fun HomeNavigation() { val scope = rememberCoroutineScope() ModalNavigationDrawer( + modifier = modifier, drawerState = drawerState, drawerContent = { ModalDrawerSheet(modifier = Modifier.requiredWidth(320.dp)) { Box( modifier = Modifier .fillMaxWidth() - .height(200.dp) + .height(200.dp), ) { Image( modifier = Modifier.fillMaxSize(), contentScale = ContentScale.Crop, painter = painterResource(id = R.drawable.drawer_profile_header), - contentDescription = null + contentDescription = null, ) Column(modifier = Modifier.padding(32.dp)) { Image( @@ -139,35 +150,37 @@ fun HomeNavigation() { .size(64.dp) .clip(CircleShape), painter = painterResource(id = R.drawable.ic_dp_placeholder), - contentDescription = null + contentDescription = null, ) Text( - text = "Mifos", color = Color.White, + text = "Mifos", + color = Color.White, style = TextStyle( fontSize = 14.sp, fontWeight = FontWeight.Medium, - fontStyle = FontStyle.Normal - ) + fontStyle = FontStyle.Normal, + ), ) Spacer(modifier = Modifier.height(16.dp)) Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically + verticalAlignment = Alignment.CenterVertically, ) { Text( - text = "Offline Mode", color = Color.White, + text = "Offline Mode", + color = Color.White, style = TextStyle( fontSize = 14.sp, fontWeight = FontWeight.Medium, - fontStyle = FontStyle.Normal - ) + fontStyle = FontStyle.Normal, + ), ) Switch( checked = offline, onCheckedChange = { offline = it - } + }, ) } } @@ -181,7 +194,7 @@ fun HomeNavigation() { style = TextStyle( fontSize = 14.sp, fontWeight = FontWeight.Medium, - fontStyle = FontStyle.Normal + fontStyle = FontStyle.Normal, ), color = Black, ) @@ -211,12 +224,14 @@ fun HomeNavigation() { Icon( imageVector = if (index == selectedItemIndex) { it - } else it, - contentDescription = item.title + } else { + it + }, + contentDescription = item.title, ) } }, - modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding) + modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding), ) if (index == (navigationDrawerTabs.size - 2)) { HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp)) @@ -224,7 +239,7 @@ fun HomeNavigation() { } } }, - gesturesEnabled = isNavScreen + gesturesEnabled = isNavScreen, ) { Scaffold( topBar = { @@ -243,7 +258,7 @@ fun HomeNavigation() { }) { Icon( imageVector = Icons.Default.Menu, - contentDescription = "Menu" + contentDescription = "Menu", ) } }, @@ -251,11 +266,11 @@ fun HomeNavigation() { IconButton(onClick = { }) { Icon( imageVector = Icons.AutoMirrored.Rounded.Logout, - contentDescription = null + contentDescription = null, ) } }, - colors = TopAppBarDefaults.topAppBarColors(White) + colors = TopAppBarDefaults.topAppBarColors(White), ) } }, @@ -280,7 +295,7 @@ fun HomeNavigation() { } } }, - containerColor = White + containerColor = White, ) { paddingValues -> Navigation(navController = navController, padding = paddingValues) } diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeScreens.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeScreens.kt index 8b740caeb45..46fb12b353d 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeScreens.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/HomeScreens.kt @@ -1,7 +1,15 @@ +/* + * 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/android-client/blob/master/LICENSE.md + */ package com.mifos.mifosxdroid.navigation sealed class HomeScreens(val route: String) { data object HomeScreen : HomeScreens("home_screen") - -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/MifosNavGraph.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/MifosNavGraph.kt index d6b4658175d..43125acce06 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/MifosNavGraph.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/MifosNavGraph.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.mifosxdroid.navigation diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/PasscodeNavGraph.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/PasscodeNavGraph.kt index bc9a7e01d63..572454c68ef 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/PasscodeNavGraph.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/navigation/PasscodeNavGraph.kt @@ -5,7 +5,7 @@ * 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 + * See https://github.com/openMF/android-client/blob/master/LICENSE.md */ package com.mifos.mifosxdroid.navigation diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/CentersActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/CentersActivity.kt deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.kt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepository.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepository.kt deleted file mode 100644 index f9b62a99019..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepository.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.mifos.mifosxdroid.online.centerlist - -import com.mifos.core.objects.client.Page -import com.mifos.core.objects.group.Center -import com.mifos.core.objects.group.CenterWithAssociations -import rx.Observable - -/** - * Created by Aditya Gupta on 06/08/23. - */ -interface CenterListRepository { - - suspend fun getCenters(paged: Boolean, offset: Int, limit: Int): Page
- - suspend fun getCentersGroupAndMeeting(id: Int): CenterWithAssociations - - fun allDatabaseCenters(): Observable> -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepositoryImp.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepositoryImp.kt deleted file mode 100644 index 126e8c3847e..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListRepositoryImp.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.mifos.mifosxdroid.online.centerlist - -import com.mifos.core.network.datamanager.DataManagerCenter -import com.mifos.core.objects.client.Page -import com.mifos.core.objects.group.Center -import com.mifos.core.objects.group.CenterWithAssociations -import rx.Observable -import javax.inject.Inject - -/** - * Created by Aditya Gupta on 06/08/23. - */ -class CenterListRepositoryImp @Inject constructor(private val dataManagerCenter: DataManagerCenter) : - CenterListRepository { - - override suspend fun getCenters(paged: Boolean, offset: Int, limit: Int): Page
{ - return dataManagerCenter.getCenters(paged, offset, limit) - } - - override suspend fun getCentersGroupAndMeeting(id: Int): CenterWithAssociations { - return dataManagerCenter.getCentersGroupAndMeeting(id) - } - - override fun allDatabaseCenters(): Observable> { - return dataManagerCenter.allDatabaseCenters - } - - -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListUiState.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListUiState.kt deleted file mode 100644 index 4aa53ee2acf..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListUiState.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.mifos.mifosxdroid.online.centerlist - -import com.mifos.core.objects.group.Center -import com.mifos.core.objects.group.CenterWithAssociations - -/** - * Created by Aditya Gupta on 06/08/23. - */ -sealed class CenterListUiState { - - data class ShowProgressbar(val state: Boolean) : CenterListUiState() - - data class ShowMessage(val message: Int) : CenterListUiState() - - object ShowFetchingError : CenterListUiState() - - object UnregisterSwipeAndScrollListener : CenterListUiState() - - data class ShowEmptyCenters(val message: Int) : CenterListUiState() - - data class ShowMoreCenters(val centers: List
) : CenterListUiState() - - data class ShowCenters(val centers: List
) : CenterListUiState() - - data class ShowCentersGroupAndMeeting( - val centerWithAssociations: CenterWithAssociations?, - val id: Int - ) : CenterListUiState() - -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListViewModel.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListViewModel.kt deleted file mode 100644 index dfd8713840d..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerlist/CenterListViewModel.kt +++ /dev/null @@ -1,169 +0,0 @@ -package com.mifos.mifosxdroid.online.centerlist - -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.ViewModel -import androidx.lifecycle.viewModelScope -import com.mifos.core.objects.client.Page -import com.mifos.core.objects.group.Center -import com.mifos.mifosxdroid.R -import dagger.hilt.android.lifecycle.HiltViewModel -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import rx.Subscriber -import rx.android.schedulers.AndroidSchedulers -import rx.schedulers.Schedulers -import javax.inject.Inject - -/** - * Created by Aditya Gupta on 06/08/23. - */ -@HiltViewModel -class CenterListViewModel @Inject constructor(private val repository: CenterListRepository) : - ViewModel() { - - private val _centerListUiState = MutableLiveData() - val centerListUiState: LiveData - get() = _centerListUiState - - private var mDbCenterList: List
= ArrayList() - private var mSyncCenterList: List
= ArrayList() - private val limit = 100 - private var loadmore = false - private var mRestApiCenterSyncStatus = false - private var mDatabaseCenterSyncStatus = false - - /** - * This Method for loading the first 100 centers. - * - * @param loadmore - * @param offset - */ - fun loadCenters(loadmore: Boolean, offset: Int) { - this.loadmore = loadmore - loadCenters(true, offset, limit) - } - - /** - * This Method For showing Center List in UI. - * - * @param centers - */ - fun showCenters(centers: List
) { - if (loadmore) { - _centerListUiState.value = CenterListUiState.ShowMoreCenters(centers) - } else { - _centerListUiState.value = CenterListUiState.ShowCenters(centers) - } - } - - /** - * Setting CenterSync Status True when mRestApiCenterSyncStatus && mDatabaseCenterSyncStatus - * are true. - */ - fun setAlreadyCenterSyncStatus() { - if (mRestApiCenterSyncStatus && mDatabaseCenterSyncStatus) { - showCenters(checkCenterAlreadySyncedOrNot(mSyncCenterList)) - } - } - - /** - * @param paged True Enabling the Pagination of the API - * @param offset Value given from which position Center List will be fetched. - * @param limit Number of Centers to fetch. - */ - private fun loadCenters(paged: Boolean, offset: Int, limit: Int) { - _centerListUiState.value = CenterListUiState.ShowProgressbar(true) -// val response = repository.getCenters() -// repository.getCenters(paged, offset, limit) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribeOn(Schedulers.io()) -// .subscribe(object : Subscriber>() { -// override fun onCompleted() {} -// override fun onError(e: Throwable) { -// if (loadmore) { -// _centerListUiState.value = -// CenterListUiState.ShowMessage(R.string.failed_to_fetch_centers) -// } else { -// _centerListUiState.value = CenterListUiState.ShowFetchingError -// } -// } -// -// override fun onNext(centerPage: Page
) { -// mSyncCenterList = centerPage.pageItems -// if (mSyncCenterList.isEmpty() && !loadmore) { -// _centerListUiState.value = -// CenterListUiState.ShowEmptyCenters(R.string.center) -// _centerListUiState.value = -// CenterListUiState.UnregisterSwipeAndScrollListener -// } else if (mSyncCenterList.isEmpty() && loadmore) { -// _centerListUiState.value = -// CenterListUiState.ShowMessage(R.string.no_more_centers_available) -// } else { -// showCenters(mSyncCenterList) -// mRestApiCenterSyncStatus = true -// setAlreadyCenterSyncStatus() -// } -// } -// }) - } - - fun loadCentersGroupAndMeeting(id: Int) = viewModelScope.launch(Dispatchers.IO) { - _centerListUiState.value = CenterListUiState.ShowProgressbar(true) - try { - val centerWithAssociations = repository.getCentersGroupAndMeeting(id) - _centerListUiState.value = - CenterListUiState.ShowCentersGroupAndMeeting(centerWithAssociations, id) - } catch (exception: Exception) { - _centerListUiState.value = - CenterListUiState.ShowMessage(R.string.failed_to_fetch_Group_and_meeting) - } - } - - /** - * This Method Loading the Center From Database. It request Observable to DataManagerCenter - * and DataManagerCenter Request to DatabaseHelperCenter to load the Center List Page from the - * Center_Table and As the Center List Page is loaded DataManagerCenter gives the Center List - * Page after getting response from DatabaseHelperCenter - */ - fun loadDatabaseCenters() { - repository.allDatabaseCenters() - .observeOn(AndroidSchedulers.mainThread()) - .subscribeOn(Schedulers.io()) - .subscribe(object : Subscriber>() { - override fun onCompleted() {} - override fun onError(e: Throwable) { - _centerListUiState.value = - CenterListUiState.ShowMessage(R.string.failed_to_load_db_centers) - } - - override fun onNext(centerPage: Page
) { - mDatabaseCenterSyncStatus = true - mDbCenterList = centerPage.pageItems - setAlreadyCenterSyncStatus() - } - }) - } - - /** - * This Method Filtering the Centers Loaded from Server is already sync or not. If yes the - * put the center.setSync(true) and view will show those centers as sync already to user - * - * @param - * @return Page
-
*/ - private fun checkCenterAlreadySyncedOrNot(centers: List
): List
{ - if (mDbCenterList.isNotEmpty()) { - for (dbCenter in mDbCenterList) { - for (syncCenter in centers) { - if (dbCenter.id == syncCenter.id) { - syncCenter.sync = true - break - } - } - } - } - return centers - } - -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/checkerinbox/CheckerInboxPendingTasksActivity.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/checkerinbox/CheckerInboxPendingTasksActivity.kt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/loanaccount/LoanAccountFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/loanaccount/LoanAccountFragment.kt deleted file mode 100644 index dab99e2d06b..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/loanaccount/LoanAccountFragment.kt +++ /dev/null @@ -1,202 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.online.loanaccount - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.appcompat.app.AppCompatActivity -import androidx.compose.ui.platform.ComposeView -import androidx.fragment.app.Fragment -import androidx.navigation.findNavController -import com.mifos.core.data.LoansPayload -import com.mifos.core.objects.noncore.DataTable -import com.mifos.feature.loan.loanAccount.LoanAccountScreen -import dagger.hilt.android.AndroidEntryPoint - -/** - * Created by nellyk on 1/22/2016. - * - * - * Use this Fragment to Create and/or Update loan - */ -@AndroidEntryPoint -class LoanAccountFragment : Fragment() { - -// private val arg: LoanAccountFragmentArgs by navArgs() - private var clientId = 0 - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) -// clientId = arg.clientId - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - return ComposeView(requireActivity()).apply { - setContent { - LoanAccountScreen( -// clientId = clientId, - onBackPressed = { - findNavController().popBackStack() - }, dataTable = { dataTables, loansPayload -> - dataTables(dataTables, loansPayload) - } - ) - } - } - } - - override fun onResume() { - super.onResume() - (requireActivity() as AppCompatActivity).supportActionBar?.hide() - } - - override fun onStop() { - super.onStop() - (requireActivity() as AppCompatActivity).supportActionBar?.show() - } - - private fun dataTables(dataTables: List, loansPayload: LoansPayload) { -// val fragment = DataTableListFragment.newInstance( -// dataTables, -// loansPayload, Constants.CLIENT_LOAN -// ) -// val fragmentTransaction = requireActivity().supportFragmentManager -// .beginTransaction() -// fragmentTransaction.addToBackStack(FragmentConstants.DATA_TABLE_LIST) -// fragmentTransaction.replace(R.id.container, fragment).commit() - } - -// private fun submit() { -// val loansPayload = LoansPayload() -// loansPayload.allowPartialPeriodInterestCalcualtion = binding.cbCalculateinterest -// .isChecked -// loansPayload.amortizationType = amortizationTypeId -// loansPayload.clientId = clientId -// loansPayload.dateFormat = "dd MMMM yyyy" -// loansPayload.expectedDisbursementDate = disbursementDate -// loansPayload.interestCalculationPeriodType = interestCalculationPeriodTypeId -// loansPayload.loanType = "individual" -// loansPayload.locale = "en" -// loansPayload.numberOfRepayments = -// binding.etNumberofrepayments.editableText.toString().toInt() -// loansPayload.principal = binding.etPrincipal.editableText.toString().toDouble() -// loansPayload.productId = productId -// loansPayload.repaymentEvery = binding.etRepaidevery.editableText.toString().toInt() -// loansPayload.submittedOnDate = submissionDate -// loansPayload.loanPurposeId = loanPurposeId -// loansPayload.loanTermFrequency = binding.etLoanterm.editableText.toString().toInt() -// loansPayload.loanTermFrequencyType = loanTermFrequency -// -// //loanTermFrequencyType and repaymentFrequencyType should be the same. -// loansPayload.repaymentFrequencyType = loanTermFrequency -// loansPayload.repaymentFrequencyDayOfWeekType = -// if (repaymentFrequencyDayOfWeek != null) repaymentFrequencyDayOfWeek else null -// loansPayload.repaymentFrequencyNthDayType = -// if (repaymentFrequencyNthDayType != null) repaymentFrequencyNthDayType else null -// loansPayload.transactionProcessingStrategyId = transactionProcessingStrategyId -// loansPayload.fundId = fundId -// loansPayload.interestType = interestTypeId -// loansPayload.loanOfficerId = loanOfficerId -// loansPayload.linkAccountId = linkAccountId -// interestRatePerPeriod = -// binding.etNominalInterestRate.editableText.toString().toDouble() -// loansPayload.interestRatePerPeriod = interestRatePerPeriod -// if (hasDataTables) { -// val fragment = DataTableListFragment.newInstance( -// mLoanTemplate.dataTables, -// loansPayload, Constants.CLIENT_LOAN -// ) -// val fragmentTransaction = requireActivity().supportFragmentManager -// .beginTransaction() -// fragmentTransaction.addToBackStack(FragmentConstants.DATA_TABLE_LIST) -// fragmentTransaction.replace(R.id.container, fragment).commit() -// } else { -// initiateLoanCreation(loansPayload) -// } -// } - - -// override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) { -// when (parent.id) { -// R.id.sp_lproduct -> { -// productId = mLoanProducts[position].id -// inflateLoanPurposeSpinner() -// } -// -// R.id.sp_loan_purpose -> loanPurposeId = mLoanTemplate.loanPurposeOptions[position].id -// R.id.sp_amortization -> amortizationTypeId = -// mLoanTemplate.amortizationTypeOptions[position].id -// -// R.id.sp_interestcalculationperiod -> interestCalculationPeriodTypeId = mLoanTemplate -// .interestCalculationPeriodTypeOptions[position].id -// -// R.id.sp_repaymentstrategy -> transactionProcessingStrategyId = mLoanTemplate -// .transactionProcessingStrategyOptions[position].id -// -// R.id.sp_payment_periods -> { -// loanTermFrequency = mLoanTemplate.termFrequencyTypeOptions[position] -// .id -// loanTermFrequency?.let { binding.spLoanTermPeriods.setSelection(it) } -// if (loanTermFrequency == 2) { -// // Show and inflate Nth day and week spinners -// showHideRepaidMonthSpinners(View.VISIBLE) -// inflateRepaidMonthSpinners() -// } else { -// showHideRepaidMonthSpinners(View.GONE) -// } -// } -// -// R.id.sp_loan_term_periods -> { -// loanTermFrequency = mLoanTemplate.termFrequencyTypeOptions[position] -// .id -// loanTermFrequency?.let { binding.spPaymentPeriods.setSelection(it) } -// if (loanTermFrequency == 2) { -// // Show and inflate Nth day and week spinners -// showHideRepaidMonthSpinners(View.VISIBLE) -// inflateRepaidMonthSpinners() -// } else { -// showHideRepaidMonthSpinners(View.GONE) -// } -// } -// -// R.id.sp_repayment_freq_nth_day -> repaymentFrequencyNthDayType = -// if (mListRepaymentFrequencyNthDayTypeOptions[position] -// == resources.getString(R.string.select_week_hint) -// ) { -// null -// } else { -// mLoanTemplate -// .repaymentFrequencyNthDayTypeOptions[position].id -// } -// -// R.id.sp_repayment_freq_day_of_week -> repaymentFrequencyDayOfWeek = -// if (mListRepaymentFrequencyDayOfWeekTypeOptions[position] -// == resources.getString(R.string.select_day_hint) -// ) { -// null -// } else { -// mLoanTemplate -// .repaymentFrequencyDaysOfWeekTypeOptions[position].id -// } -// -// R.id.sp_fund -> fundId = mLoanTemplate.fundOptions[position].id -// R.id.sp_loan_officer -> loanOfficerId = mLoanTemplate.loanOfficerOptions[position].id -// R.id.sp_interest_type -> interestTypeId = mLoanTemplate.interestTypeOptions[position].id -// R.id.sp_linking_options -> linkAccountId = if (mListAccountLinkingOptions[position] -// == resources.getString(R.string.select_linkage_account_hint) -// ) { -// null -// } else { -// mLoanTemplate.accountLinkingOptions[position].id -// } -// } -// } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/surveysubmit/SurveySubmitFragment.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/surveysubmit/SurveySubmitFragment.kt deleted file mode 100755 index 67642cfb605..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/surveysubmit/SurveySubmitFragment.kt +++ /dev/null @@ -1,151 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.online.surveysubmit - -/* -import android.app.Activity -import android.content.Context -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.Toast -import androidx.lifecycle.ViewModelProvider -import com.mifos.core.objects.survey.Scorecard -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.core.MifosBaseFragment -import com.mifos.mifosxdroid.databinding.FragmentSurveyLastBinding -import com.mifos.mifosxdroid.online.surveyquestion.Communicator -import com.mifos.mifosxdroid.online.surveyquestion.SurveyQuestionActivity -import dagger.hilt.android.AndroidEntryPoint - -/** - * Created by Nasim Banu on 28,January,2016. - */ -@AndroidEntryPoint -class SurveySubmitFragment : MifosBaseFragment(), Communicator { - - private lateinit var binding: FragmentSurveyLastBinding - - private lateinit var viewModel: SurveySubmitViewModel - - private var mDetachFragment: DisableSwipe? = null - private var mScorecard: Scorecard? = null - private var mSurveyId = 0 - - override fun onCreateView( - inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - binding = FragmentSurveyLastBinding.inflate(inflater, container, false) - viewModel = ViewModelProvider(this)[SurveySubmitViewModel::class.java] - - viewModel.surveySubmitUiState.observe(viewLifecycleOwner) { - when (it) { - is SurveySubmitUiState.ShowError -> { - showProgressbar(false) - showError(it.message) - } - - is SurveySubmitUiState.ShowProgressbar -> showProgressbar(true) - - is SurveySubmitUiState.ShowSurveySubmittedSuccessfully -> { - showProgressbar(false) - showSurveySubmittedSuccessfully(it.scorecard) - } - } - } - - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - binding.btnSubmit.setOnClickListener { - submitScore() - } - } - - override fun passScoreCardData(scorecard: Scorecard, surveyId: Int) { - mScorecard = scorecard - mSurveyId = surveyId - if (isAdded) { - val submitText = resources.getString(R.string.attempt_question) + - mScorecard?.scorecardValues?.size - binding.surveySubmitTextView.text = submitText - binding.btnSubmit.text = resources.getString(R.string.submit_survey) - } - } - - private fun submitScore() { - if ((mScorecard?.scorecardValues?.size ?: 0) >= 1) { - mDetachFragment?.disableSwipe() - binding.btnSubmit.text = resources.getString(R.string.submitting_surveys) - binding.btnSubmit.isEnabled = false - binding.btnSubmit.visibility = View.GONE - viewModel.submitSurvey(mSurveyId, mScorecard) - } else { - Toast.makeText( - context, resources - .getString(R.string.please_attempt_atleast_one_question), Toast.LENGTH_SHORT - ) - .show() - } - } - - private fun showSurveySubmittedSuccessfully(scorecard: Scorecard?) { - Toast.makeText( - context, resources.getString(R.string.scorecard_created_successfully), - Toast.LENGTH_LONG - ).show() - binding.surveySubmitTextView.text = - resources.getString(R.string.survey_successfully_submitted) - binding.btnSubmit.visibility = View.GONE - } - - private fun showError(errorMessage: String) { - Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show() - binding.surveySubmitTextView.text = resources.getString(R.string.error_submitting_survey) - binding.btnSubmit.visibility = View.GONE - } - - private fun showProgressbar(b: Boolean) { - if (b) { - showMifosProgressBar() - } else { - hideMifosProgressBar() - } - } - - override fun onAttach(context: Context) { - super.onAttach(context) - (context as SurveyQuestionActivity).fragmentCommunicator = this - val activity = context as Activity - mDetachFragment = try { - activity as DisableSwipe - } catch (e: ClassCastException) { - throw ClassCastException( - activity.toString() - + " must implement OnAnswerSelectedListener" - ) - } - } - - interface DisableSwipe { - fun disableSwipe() - } - - companion object { - @JvmStatic - fun newInstance(): SurveySubmitFragment { - val fragment = SurveySubmitFragment() - val bundle = Bundle() - fragment.arguments = bundle - return fragment - } - } -} - */ \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/uihelpers/MFDatePicker.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/uihelpers/MFDatePicker.kt deleted file mode 100644 index cc83a09147e..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/uihelpers/MFDatePicker.kt +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.uihelpers - -import android.app.DatePickerDialog -import android.app.DatePickerDialog.OnDateSetListener -import android.app.Dialog -import android.os.Bundle -import android.text.format.DateFormat -import android.widget.DatePicker -import androidx.fragment.app.DialogFragment -import androidx.fragment.app.Fragment -import com.mifos.mifosxdroid.R -import java.util.Calendar -import java.util.Date - -/** - * Created by ishankhanna on 30/06/14. - */ -class MFDatePicker : DialogFragment(), OnDateSetListener { - var onDatePickListener: OnDatePickListener? = null - override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - val dialog = DatePickerDialog( - requireActivity(), - R.style.MaterialDatePickerTheme, - this, calendar!![Calendar.YEAR], - calendar!![Calendar.MONTH], - calendar!![Calendar.DAY_OF_MONTH] - ) - dialog.datePicker.minDate = Date().time - return dialog - } - - override fun onDateSet(datePicker: DatePicker, year: Int, month: Int, day: Int) { - val calendar = Calendar.getInstance() - calendar[year, month] = day - val date = calendar.time - onDatePickListener!!.onDatePicked(DateFormat.format("dd-MM-yyyy", date).toString()) - } - - fun setCustomOnDatePickListener(onDatePickListener: OnDatePickListener?) { - this.onDatePickListener = onDatePickListener - } - - interface OnDatePickListener { - fun onDatePicked(date: String?) - } - - companion object { - const val TAG = "MFDatePicker" - var datePickedAsString: String? = null - var calendar: Calendar? = null - - init { - calendar = Calendar.getInstance() - datePickedAsString = DateFormat.format("dd-MM-yyyy", calendar?.time).toString() - } - - @JvmStatic - fun newInsance(fragment: Fragment?): MFDatePicker { - val mfDatePicker = MFDatePicker() - mfDatePicker.onDatePickListener = fragment as OnDatePickListener? - return mfDatePicker - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CircularImageView.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CircularImageView.kt deleted file mode 100644 index 31a688486aa..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CircularImageView.kt +++ /dev/null @@ -1,188 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.views - -import android.content.Context -import android.graphics.Bitmap -import android.graphics.BitmapShader -import android.graphics.Canvas -import android.graphics.Color -import android.graphics.Paint -import android.graphics.Shader -import android.graphics.drawable.BitmapDrawable -import android.graphics.drawable.Drawable -import android.util.AttributeSet -import androidx.appcompat.widget.AppCompatImageView -import com.mifos.mifosxdroid.R - - -/** - * @author fomenkoo - */ -class CircularImageView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : - AppCompatImageView(context, attrs) { - private var borderWidth = width - private var canvasSize = width - private var image: Bitmap? = null - private val paint: Paint = Paint() - private val paintBorder: Paint? - - init { - - // init paint - paint.isAntiAlias = true - paintBorder = Paint() - paintBorder.isAntiAlias = true - - // load the styled attributes and set their properties - val attributes = context.obtainStyledAttributes(attrs, R.styleable.CircularImageView) - if (attributes.getBoolean(R.styleable.CircularImageView_border, true)) { - val defaultBorderSize = - (4 * getContext().resources.displayMetrics.density + 0.5f).toInt() - setBorderWidth( - attributes.getDimensionPixelOffset( - R.styleable.CircularImageView_border_width, - defaultBorderSize - ) - ) - setBorderColor( - attributes.getColor( - R.styleable.CircularImageView_border_color, - Color.WHITE - ) - ) - } - if (attributes.getBoolean(R.styleable.CircularImageView_shadow, false)) addShadow() - } - - private fun setBorderWidth(borderWidth: Int) { - this.borderWidth = borderWidth - requestLayout() - this.invalidate() - } - - private fun setBorderColor(borderColor: Int) { - if (paintBorder != null) paintBorder.color = borderColor - this.invalidate() - } - - private fun addShadow() { - setLayerType(LAYER_TYPE_SOFTWARE, paintBorder) - paintBorder!!.setShadowLayer(4.0f, 0.0f, 2.0f, Color.BLACK) - } - - public override fun onDraw(canvas: Canvas) { - // load the bitmap - image = drawableToBitmap(drawable) - - // init shader - if (image != null) { - canvasSize = width - if (height < canvasSize) canvasSize = height - val shader = BitmapShader( - Bitmap.createScaledBitmap( - image!!, canvasSize, - canvasSize, false - ), Shader.TileMode.CLAMP, Shader.TileMode.CLAMP - ) - paint.shader = shader - - // circleCenter is the x or y of the view's center - // radius is the radius in pixels of the cirle to be drawn - // paint contains the shader that will texture the shape - val circleCenter = (canvasSize - (borderWidth * 2)) / 2 - canvas.drawCircle( - (circleCenter + borderWidth).toFloat(), - (circleCenter + borderWidth).toFloat(), - ((canvasSize - (borderWidth * 2)) / 2) + borderWidth - 4.0f, - paintBorder!! - ) - canvas.drawCircle( - (circleCenter + borderWidth).toFloat(), - (circleCenter + borderWidth).toFloat(), - ((canvasSize - (borderWidth * 2)) / 2) - 4.0f, - paint - ) - } - } - - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { - val width = measureWidth(widthMeasureSpec) - val height = measureHeight(heightMeasureSpec) - setMeasuredDimension(width, height) - } - - private fun measureWidth(measureSpec: Int): Int { - var result = 0 - val specMode = MeasureSpec.getMode(measureSpec) - val specSize = MeasureSpec.getSize(measureSpec) - result = when (specMode) { - MeasureSpec.EXACTLY -> { - // The parent has determined an exact size for the child. - specSize - } - - MeasureSpec.AT_MOST -> { - // The child can be as large as it wants up to the specified size. - specSize - } - - else -> { - // The parent has not imposed any constraint on the child. - canvasSize - } - } - return result - } - - private fun measureHeight(measureSpecHeight: Int): Int { - var result = 0 - val specMode = MeasureSpec.getMode(measureSpecHeight) - val specSize = MeasureSpec.getSize(measureSpecHeight) - result = when (specMode) { - MeasureSpec.EXACTLY -> { - // We were told how big to be - specSize - } - - MeasureSpec.AT_MOST -> { - // The child can be as large as it wants up to the specified size. - specSize - } - - else -> { - // Measure the text (beware: ascent is a negative number) - canvasSize - } - } - return result + 2 - } - - private fun drawableToBitmap(drawable: Drawable?): Bitmap? { - if (drawable == null) { - return null - } else if (drawable is BitmapDrawable) { - return drawable.bitmap - } - val bitmap: Bitmap = if (drawable.intrinsicWidth > 0 && drawable - .intrinsicHeight > 0 - ) { - Bitmap.createBitmap( - drawable.intrinsicWidth, drawable - .intrinsicHeight, Bitmap.Config.ARGB_8888 - ) - } else { - Bitmap.createBitmap(20, 20, Bitmap.Config.ARGB_8888) - } - val bitmapScaled = Bitmap.createScaledBitmap( - bitmap, bitmap.height / 5, bitmap - .height / 5, true - ) - val canvas = Canvas(bitmapScaled) - drawable.setBounds(0, 0, canvas.width, canvas.height) - drawable.draw(canvas) - return bitmapScaled - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CustomSpinner.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CustomSpinner.kt deleted file mode 100644 index 1fb18eb3ad0..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/CustomSpinner.kt +++ /dev/null @@ -1,96 +0,0 @@ -package com.mifos.mifosxdroid.views - -import android.content.Context -import android.content.res.Resources.Theme -import android.util.AttributeSet -import android.widget.Spinner -import androidx.appcompat.widget.AppCompatSpinner - -class CustomSpinner : AppCompatSpinner { - interface OnSpinnerEventsListener { - /** - * Callback triggered when the spinner was opened. - */ - fun onSpinnerOpened(spinner: Spinner, isItemListLarge: Boolean) - - /** - * Callback triggered when the spinner was closed. - */ - fun onSpinnerClosed(spinner: Spinner) - } - - private var mListener: OnSpinnerEventsListener? = null - private var mOpenInitiated = false - override fun performClick(): Boolean { - // register that the Spinner was opened so we have a status - // indicator for when the container holding this Spinner may lose focus - mOpenInitiated = true - if (mListener != null) { - if (super.getAdapter().count >= 10) { - mListener!!.onSpinnerOpened(this, true) - return true - } else { - mListener!!.onSpinnerOpened(this, false) - } - } - return super.performClick() - } - - override fun onWindowFocusChanged(hasFocus: Boolean) { - if (hasBeenOpened() && hasFocus) { - performClosedEvent() - } - } - - /** - * Register the listener which will listen for events. - */ - fun setSpinnerEventsListener( - onSpinnerEventsListener: OnSpinnerEventsListener? - ) { - mListener = onSpinnerEventsListener - } - - /** - * Propagate the closed Spinner event to the listener from outside if needed. - */ - private fun performClosedEvent() { - mOpenInitiated = false - if (mListener != null) { - mListener!!.onSpinnerClosed(this) - } - } - - /** - * A boolean flag indicating that the Spinner triggered an open event. - * - * @return true for opened Spinner - */ - private fun hasBeenOpened(): Boolean { - return mOpenInitiated - } - - constructor(context: Context) : super(context) {} - constructor(context: Context, mode: Int) : super(context, mode) {} - constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {} - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super( - context, - attrs, - defStyleAttr - ) { - } - - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, mode: Int) : super( - context, - attrs, - defStyleAttr, - mode - ) { - } - - constructor( - context: Context, attrs: AttributeSet?, - defStyleAttr: Int, mode: Int, popupTheme: Theme? - ) : super(context, attrs, defStyleAttr, mode, popupTheme) { - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/Font.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/Font.kt deleted file mode 100644 index 1f5d0db0773..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/Font.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.views - -import android.graphics.Typeface -import com.mifos.application.App -import com.mifos.application.App.Companion.instance -import java.io.File - -/** - * @author fomenkoo - */ -enum class Font(pathToFont: String, val fontName: String) { - ROBOTO_LIGHT("fonts", "Roboto-Light.ttf"), ROBOTO_MEDIUM( - "fonts", - "Roboto-Regular.ttf" - ), - ROBOTO_BOLD("fonts", "Roboto-Bold.ttf"); - - var typeface: Typeface? - - init { - typeface = App.typefaceManager[fontName.hashCode()] - if (typeface == null) { - typeface = Typeface.createFromAsset( - instance!!.assets, - pathToFont + File.separator + fontName - ) - App.typefaceManager[fontName.hashCode()] = typeface - } - } - - companion object { - @JvmStatic - fun getFont(typeface: Int): Font { - return values()[typeface] - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/FontTextView.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/FontTextView.kt deleted file mode 100644 index f9644ca0655..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/FontTextView.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.mifosxdroid.views - -import android.content.Context -import android.util.AttributeSet -import androidx.appcompat.widget.AppCompatTextView -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.views.Font.Companion.getFont - -/** - * @author fomenkoo - */ -class FontTextView : AppCompatTextView { - constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super( - context, - attrs, - defStyle - ) { - parseAttributes(context, attrs) - } - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - parseAttributes(context, attrs) - } - - constructor(context: Context) : super(context) {} - - private fun parseAttributes(context: Context, attrs: AttributeSet) { - if (!isInEditMode) { - val values = context.obtainStyledAttributes(attrs, R.styleable.CustomFont) - val typeface = values.getInt( - R.styleable.CustomFont_typeface, Font.ROBOTO_MEDIUM - .ordinal - ) - val font = getFont(typeface) - setTypeface(font.typeface) - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/SignatureView.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/SignatureView.kt deleted file mode 100644 index cc6f08445cd..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/SignatureView.kt +++ /dev/null @@ -1,136 +0,0 @@ -package com.mifos.mifosxdroid.views - -import android.content.Context -import android.graphics.Bitmap -import android.graphics.Canvas -import android.graphics.Color -import android.graphics.Paint -import android.os.Environment -import android.util.AttributeSet -import android.util.TypedValue -import android.view.MotionEvent -import android.view.View -import com.mifos.mifosxdroid.R -import java.io.File -import java.io.FileNotFoundException -import java.io.FileOutputStream - -/** - * Created by Tarun on 28-06-2017. - */ -class SignatureView(context: Context, attrs: AttributeSet?) : View(context, attrs) { - private val LOG_TAG: String = javaClass.simpleName - private val signPaint: Paint - private val mXCoordinateList: ArrayList - private val mYCoordinateList: ArrayList - private var mOnSignatureSaveListener: OnSignatureSaveListener? = null - private val mContext: Context - - init { - mContext = context - isDrawingCacheEnabled = true - val r = resources - val strokeSize = TypedValue.applyDimension( - TypedValue.COMPLEX_UNIT_DIP, 5f, - r.displayMetrics - ).toInt() - signPaint = Paint() - signPaint.color = Color.BLACK - signPaint.strokeWidth = strokeSize.toFloat() - signPaint.isAntiAlias = true - mXCoordinateList = ArrayList() - mYCoordinateList = ArrayList() - } - - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec) - } - - override fun onDraw(canvas: Canvas) { - super.onDraw(canvas) - canvas.drawColor(Color.WHITE) - if (mXCoordinateList.size > 2) { - for (i in 1 until mXCoordinateList.size) { - if (!(mXCoordinateList[i - 1].toDouble() == -1.0 || mXCoordinateList[i] == -1f)) { - canvas.drawLine( - mXCoordinateList[i - 1], mYCoordinateList[i - 1], - mXCoordinateList[i], mYCoordinateList[i], signPaint - ) - } - } - } - } - - override fun onTouchEvent(event: MotionEvent): Boolean { - super.onTouchEvent(event) - when (event.action) { - MotionEvent.ACTION_DOWN -> { - mXCoordinateList.add(event.x) - mYCoordinateList.add(event.y) - } - - MotionEvent.ACTION_UP -> { - mXCoordinateList.add(-1.0.toFloat()) - mYCoordinateList.add(-1.0.toFloat()) - } - - MotionEvent.ACTION_MOVE -> { - mXCoordinateList.add(event.x) - mYCoordinateList.add(event.y) - invalidate() - } - } - return true - } - - interface OnSignatureSaveListener { - fun onSignSavedError(errorMsg: String) - fun onSignSavedSuccess(absoluteFilePath: String) - } - - fun setOnSignatureSaveListener(listener: OnSignatureSaveListener?) { - mOnSignatureSaveListener = listener - } - - fun saveSignature(id: Int) { - val path = Environment.getExternalStorageDirectory().toString() + - mContext.resources.getString(R.string.signature_image_directory) - val signatureStorageDirectory = File(path) - val signatureFile: File - if (!signatureStorageDirectory.exists()) { - val makeRequiredDirectories = signatureStorageDirectory.mkdirs() - if (!makeRequiredDirectories) { - mOnSignatureSaveListener?.onSignSavedError(mContext.resources.getString(R.string.sign_dir_not_created_msg)) - return - } - } - try { - val signatureBitmap = drawingCache - signatureFile = File(signatureStorageDirectory.path, "$id.jpeg") - signatureBitmap.compress( - Bitmap.CompressFormat.JPEG, 100, - FileOutputStream(signatureFile) - ) - } catch (e: FileNotFoundException) { - if (mOnSignatureSaveListener != null) { - e.message?.let { mOnSignatureSaveListener?.onSignSavedError(it) } - } - return - } - if (mOnSignatureSaveListener != null) { - mOnSignatureSaveListener?.onSignSavedSuccess(signatureFile.absolutePath) - } - } - - fun clear() { - mXCoordinateList.clear() - mYCoordinateList.clear() - destroyDrawingCache() - invalidate() - } - - val xCoordinateSize: Int - get() = mXCoordinateList.size - val yCoordinateSize: Int - get() = mYCoordinateList.size -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/CustomScrollView.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/CustomScrollView.kt deleted file mode 100644 index 17a62a5e6e1..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/CustomScrollView.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.mifos.mifosxdroid.views.scrollview - -import android.content.Context -import android.util.AttributeSet -import android.widget.ScrollView - -class CustomScrollView : ScrollView { - private var scrollChangeListener: ScrollChangeListener? = null - override fun onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int) { - super.onScrollChanged(l, t, oldl, oldt) - if (scrollChangeListener != null) { - scrollChangeListener!!.onScrollChanged(l, t, oldl, oldt) - } - } - - fun setScrollChangeListener(scrollChangeListener: ScrollChangeListener?) { - this.scrollChangeListener = scrollChangeListener - } - - constructor(context: Context?) : super(context) {} - constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {} - constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super( - context, - attrs, - defStyleAttr - ) { - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/ScrollChangeListener.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/ScrollChangeListener.kt deleted file mode 100644 index 27fa996e69d..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/views/scrollview/ScrollChangeListener.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.mifos.mifosxdroid.views.scrollview - -interface ScrollChangeListener { - fun onScrollChanged(x: Int, y: Int, oldx: Int, oldy: Int) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/AndroidVersionUtil.kt b/mifosng-android/src/main/java/com/mifos/utils/AndroidVersionUtil.kt deleted file mode 100644 index d5719e3922a..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/AndroidVersionUtil.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.mifos.utils - -import android.os.Build - -/** - * - * Created by Rajan Maurya on 04/09/16. - */ -object AndroidVersionUtil { - val apiVersion: Int - get() = Build.VERSION.SDK_INT - - @JvmStatic - fun isApiVersionGreaterOrEqual(thisVersion: Int): Boolean { - return Build.VERSION.SDK_INT >= thisVersion - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/CheckSelfPermissionAndRequest.kt b/mifosng-android/src/main/java/com/mifos/utils/CheckSelfPermissionAndRequest.kt deleted file mode 100644 index 87986cc7c1f..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/CheckSelfPermissionAndRequest.kt +++ /dev/null @@ -1,159 +0,0 @@ -package com.mifos.utils - -import android.annotation.TargetApi -import android.content.Context -import android.content.Intent -import android.content.pm.PackageManager -import android.net.Uri -import android.os.Build -import android.provider.Settings -import android.widget.Toast -import androidx.appcompat.app.AppCompatActivity -import androidx.core.app.ActivityCompat -import androidx.core.content.ContextCompat -import com.mifos.mifosxdroid.R -import com.mifos.mifosxdroid.core.MaterialDialog - -/** - * This Class is the Generic Class to Request the Dangerous permissions that are not granted - * during the installation of the app, that are only granted on RunTime. - * - * - * Here is the Dangerous permissions List that are granted during RunTime only. - * https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous - * - * - * Created by Rajan Maurya on 04/09/16. - */ -object CheckSelfPermissionAndRequest { - /** - * This Method Check the Permission is granted or not to the App. If the Permission granted, - * returns true and If not permission denied then returns false. - * - * @param context Context - * @param permission Manifest.permission...Permission... - * @return Boolean True or False. - */ - @JvmStatic - fun checkSelfPermission(context: Context?, permission: String?): Boolean { - return ContextCompat.checkSelfPermission(context!!, permission!!) == - PackageManager.PERMISSION_GRANTED - } - - /** - * This Method is requesting to device to grant the permission. When App is trying to - * request the device to grant the permission, then their is Three cases. - * 1. First case Device Prompt the Permission Dialog to user and user accepted or denied the - * Permission. - * 2. Second case will come, if user will denied the permission, after onclick dialog denied - * button and next time App ask for permission, It will show a Material Dialog and there - * will be a message to tell the user that you have denied the permission before, So do - * you want to give this permission to app or not, If yes then click on Re-Try dialog button - * and if not then click on Dialog button "I'M Sure", to not to give this permission to the - * app. - * - * - * And as user will click on "Re-Try" dialog button, he will be prompt with the with - * permission dialog with "[-] never ask again" and have two options first one to click on - * denied button again and put Un check the never ask check box. In this case, user will - * prompt with permission dialog with "[-] never ask again" in the loop, whenever app ask - * for that permission. - * - * - * and If user will click on "[_/] never ask again" check box then permission dialog with - * that permission will not prompt to the user. - * 3. Third case will came. when user have denied to accept permission with never ask again. - * then user will prompt with dialog and message that you have denied this permission with - * never ask again. but this is necessary permission to this app feature. and to grant - * this permission please click on dialog app settings button and give the permission to - * work with this feature. - * - * @param activity AppCompatActivity - * @param permission Manifest.permission...Permission... - * @param permissionRequestCode Permission Request Code. - * @param dialogMessageRetry Dialog Message Retry - * @param messageNeverAskAgain Dialog Message Never Ask Again - * @param permissionDeniedStatus Permission Denied Status - */ - @JvmStatic - @TargetApi(Build.VERSION_CODES.JELLY_BEAN) - fun requestPermission( - activity: AppCompatActivity, - permission: String, - permissionRequestCode: Int, - dialogMessageRetry: String?, - messageNeverAskAgain: String?, - permissionDeniedStatus: String - ) { - // Should we show an explanation? - if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { - - // Show an explanation to the user *asynchronously* -- don't block - // this thread waiting for the user's response! After the user - // sees the explanation, try again to request the permission. - MaterialDialog.Builder().init(activity) - .setTitle(R.string.permission_denied) - .setMessage(dialogMessageRetry) - .setPositiveButton(R.string.dialog_action_i_am_sure) - .setNegativeButton( - R.string.dialog_action_re_try - ) { dialog, which -> - ActivityCompat.requestPermissions( - activity, arrayOf(permission), - permissionRequestCode - ) - } - .createMaterialDialog() - .show() - } else { - - //Requesting Permission, first time to the device. - if (com.mifos.utils.PrefManager.getPermissionDeniedStatus( - permissionDeniedStatus - ) - ) { - com.mifos.utils.PrefManager.setPermissionDeniedStatus( - permissionDeniedStatus, - false - ) - ActivityCompat.requestPermissions( - activity, arrayOf(permission), - permissionRequestCode - ) - } else { - //Requesting Permission, more the one time and opening the setting to change - // the Permission in App Settings. - MaterialDialog.Builder().init(activity) - .setMessage(messageNeverAskAgain) - .setNegativeButton(R.string.dialog_action_cancel) - .setPositiveButton( - R.string.dialog_action_app_settings - ) { dialog, which -> //Making the Intent to grant the permission - val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) - val uri = Uri.fromParts( - activity.resources.getString( - R.string.package_name - ), activity.packageName, null - ) - intent.data = uri - val pm = activity.packageManager - if (intent.resolveActivity(pm) != null) { - activity.startActivityForResult( - intent, - com.mifos.utils.Constants.REQUEST_PERMISSION_SETTING - ) - } else { - Toast.makeText( - activity, - activity.getString( - R.string.msg_setting_activity_not_found - ), Toast.LENGTH_LONG - ).show() - } - } - .createMaterialDialog() - .show() - } - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/Constants.kt b/mifosng-android/src/main/java/com/mifos/utils/Constants.kt deleted file mode 100644 index 002f25705c1..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/Constants.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -/** - * Created by satya on 13/04/14. - */ -object Constants { - //Search Entities - const val SEARCH_ENTITY_CLIENT = "CLIENT" - const val SEARCH_ENTITY_GROUP = "GROUP" - const val SEARCH_ENTITY_LOAN = "LOAN" - const val SEARCH_ENTITY_SAVING = "SAVING" - const val SEARCH_ENTITY_CENTER = "CENTER" - const val CLIENT_NAME = "clientName" - const val CLIENT_ID = "clientId" - const val ID = "id" - const val CLIENT = "Client" - const val CENTER_ID = "centerId" - const val GROUP_ID = "groupId" - const val GROUP_NAME = "groupName" - const val GROUPS = "groups" - const val GROUP_ACCOUNT = "isGroupAccount" - const val CENTER = "center" - const val STOP_TRACKING = "stop_tracking" - const val SERVICE_STATUS = "service_status" - - //This needs to be 8 bits because validateRequestPermissionsRequestCode - // in FragmentActivity requires requestCode to be of 8 bits, meaning the range is from 0 to 255. - const val REQUEST_PERMISSION_SETTING = 254 - - /** - * User Logged In Status - * 0 for Online and 1 for Offline - */ - const val USER_ONLINE = false - const val USER_OFFLINE = true - - /** - * Constant to identify whether Simple Collection Sheet fragment has to be opened - * or the Individual Collection Sheet. - */ - const val COLLECTION_TYPE = "collection_type" - const val EXTRA_COLLECTION_INDIVIDUAL = "individual" - const val EXTRA_COLLECTION_COLLECTION = "collection" - - /** - * Constants related to RunReports - */ - - const val HAS_SETTING_CHANGED = "hasSettingsChanged" -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/DateHelper.kt b/mifosng-android/src/main/java/com/mifos/utils/DateHelper.kt deleted file mode 100644 index ff331a35c69..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/DateHelper.kt +++ /dev/null @@ -1,283 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Calendar -import java.util.Date -import java.util.Locale - -/** - * Created by ishankhanna on 30/05/14. - * - * This is a helper class that will be used to convert List Type Dates - * from MifosX into Simple Strings or Date Formats - */ -object DateHelper { - const val DATE_FORMAT_VALUE = "dd MMM yyyy" - const val DATE_TIME_FORMAT_VALUE = "dd MMMM yyyy HH:mm" - const val TIME_FORMAT_VALUE = "HH:mm a" - - /** - * @return current date formatted as day - month - year where month is a number from 1 to 12 - * (ex: 13 - 4 - 2014) - */ - val currentDateAsString: String - get() { - val calendar = Calendar.getInstance() - val year = calendar[Calendar.YEAR] - val month = calendar[Calendar.MONTH] - val day = calendar[Calendar.DAY_OF_MONTH] - return day.toString() + " - " + (month + 1) + " - " + year - } - - /** - * @return current date as [year-month-day] where month is a number from 1 to 12 (ex: [2014, - * 4, 14]) - */ - val currentDateAsListOfIntegers: List - get() { - val date: MutableList = ArrayList() - val calendar = Calendar.getInstance() - date.add(calendar[Calendar.YEAR]) - date.add(calendar[Calendar.MONTH] + 1) - date.add(calendar[Calendar.DAY_OF_MONTH]) - return date - } - - /** - * @param date formatted as day-month-year where month is an integer from 1 to 12 - * @return replaces month with a string like Jan or Feb..etc - */ - @JvmStatic - fun getDateAsStringUsedForCollectionSheetPayload(date: String?): String { - val builder = StringBuilder() - if (date != null) { - val splittedDate = date.split("-".toRegex()).dropLastWhile { it.isEmpty() } - .toTypedArray() - val month = splittedDate[1].toInt() - builder.append(splittedDate[0]) - builder.append('-') - builder.append(getMonthName(month)) - builder.append('-') - builder.append(splittedDate[2]) - } - return builder.toString() - //Return as dd-mmm-yyyy - } - - /** - * @param date formatted as day-month-year where month is an integer from 1 to 12 (ex: - * 14-4-2016) - * @return replaces month with a string like Jan or Feb...etc (ex: 14-Apr-2016) - */ - fun getDateAsStringUsedForDateofBirth(date: String?): String { - val builder = StringBuilder() - if (date != null) { - val splittedDate = date.split("-".toRegex()).dropLastWhile { it.isEmpty() } - .toTypedArray() - val month = splittedDate[1].toInt() - builder.append(splittedDate[0]) - builder.append('-') - builder.append(getMonthName(month)) - builder.append('-') - builder.append(splittedDate[2]) - } - return builder.toString() - //Return as dd-mmm-yyyy - } - - /** - * @return current date formatted as day month year where month is from 1 to 12 (ex 14 4 2016) - */ - val currentDateAsDateFormat: String - get() { - val calendar = Calendar.getInstance() - val year = calendar[Calendar.YEAR] - val month = calendar[Calendar.MONTH] - val day = calendar[Calendar.DAY_OF_MONTH] - return day.toString() + " " + (month + 1) + " " + year - } - - /** - * @return current date formatted as dd MMMM yyyy (ex: 14 April 2016) - */ - val currentDateAsNewDateFormat: String - get() { - val calendar = Calendar.getInstance() - val simpleDateFormat = SimpleDateFormat("dd MMMM yyyy") - val year = calendar[Calendar.YEAR] - val month = calendar[Calendar.MONTH] - val day = calendar[Calendar.DAY_OF_MONTH] - var date = day.toString() + " - " + (month + 1) + " - " + year - date = simpleDateFormat.format(calendar.time) - return date - } - - /** - * This method returns the String of date and time. Just need to pass the format in which you - * want. Example Pass the format "dd MMMM yyyy HH:mm" and you will get the date and time in - * this format "24 January 2017 18:32". - * - * @param format Format of Date and Time - * @return String of Date and Time - */ - @JvmStatic - fun getCurrentDateTime(format: String?): String { - val dateFormat: DateFormat = SimpleDateFormat(format, Locale.ENGLISH) - return dateFormat.format(Date()) - } - - /** - * the result string uses the list given in a reverse order ([x, y, z] results in "z y x") - * - * @param integersOfDate [year-month-day] (ex [2016, 4, 14]) - * @return date in the format day month year (ex 14 Apr 2016) - */ - @JvmStatic - fun getDateAsString(integersOfDate: List): String { - val stringBuilder = StringBuilder() - stringBuilder.append(integersOfDate[2]) - .append(' ') - .append(getMonthName(integersOfDate[1])) - .append(' ') - .append(integersOfDate[0]) - return stringBuilder.toString() - } - - /** - * @param date1 a list of 3 numbers [year, month, day] (Ex [2016, 4, 14]) - * @param date2 a list of 3 numbers [year, month, day] (Ex [2016, 3, 21]) - * @return zero if both date1 and date2 are equal, positive int if date1 > date2 - * and negative int if date1 < date2 - */ - fun dateComparator(date1: List, date2: List): Int { - - /* - * Each List contains 3 items - * index 0 = Year - * index 1 = Month - * index 2 = Day - * - * Format is YYYY - MM - DD - */ - - //comparing years - return if (date1[0] == date2[0]) { - - //now that years are equal lets compare months - if (date1[1] == date2[1]) { - - //now that months are also equal lets compare days - if (date1[2] == date2[2]) { - 0 - } else if (date1[2] > date2[2]) { - 1 - } else { - -1 - } - } else if (date1[1] > date2[1]) { - 1 - } else { - -1 - } - } else if (date1[0] > date2[0]) { - 1 - } else { - -1 - } - } - - /** - * @param month an integer from 1 to 12 - * @return string representation of the month like Jan or Feb..etc - */ - @JvmStatic - fun getMonthName(month: Int): String { - var monthName = "" - when (month) { - 1 -> monthName = "Jan" - 2 -> monthName = "Feb" - 3 -> monthName = "Mar" - 4 -> monthName = "Apr" - 5 -> monthName = "May" - 6 -> monthName = "Jun" - 7 -> monthName = "Jul" - 8 -> monthName = "Aug" - 9 -> monthName = "Sep" - 10 -> monthName = "Oct" - 11 -> monthName = "Nov" - 12 -> monthName = "Dec" - } - return monthName - } - - /** - * ex: date = 11,4,2016 separator = , result = [11, 4, 2016] - * - * @param date string with tokken seperated by a seperator - * @param separator the strings that separates the tokkens to be parsed - */ - fun getDateList(date: String, separator: String): List { - val splittedDate = date.split(separator.toRegex()).dropLastWhile { it.isEmpty() } - .toTypedArray() - val dateList: MutableList = ArrayList() - for (i in 0..2) { - dateList.add(splittedDate[i].toInt()) - } - return dateList - } - - /** - * Method to convert a given date in dd MMM YYYY format to [dd, mm, yyyy] format. - * - * @param date Date String. e.g. "20 Aug 2017" - * @return List of Integers. e.g. [20, 08, 2017] - */ - fun convertDateAsListOfInteger(date: String): List { - val splitDate = date.split(" ".toRegex()).dropLastWhile { it.isEmpty() } - .toTypedArray() - val dateList: MutableList = ArrayList() - dateList.add(splitDate[0].toInt()) - dateList.add(getMonthNumberFromName(splitDate[1])) - dateList.add(splitDate[2].toInt()) - return dateList - } - - /** - * Method to convert a date in dd MMM YYYY format to [yyyy, mm, dd] format. - * - * @param date Date String; e.g. "20 Aug 2017" - * @return List of Integers in reverse order; e.g. [2017, 08, 20] - */ - fun convertDateAsReverseInteger(date: String): List { - val splitDate = date.split(" ".toRegex()).dropLastWhile { it.isEmpty() } - .toTypedArray() - val dateList: MutableList = ArrayList() - dateList.add(splitDate[2].toInt()) - dateList.add(getMonthNumberFromName(splitDate[1])) - dateList.add(splitDate[0].toInt()) - return dateList - } - - fun getMonthNumberFromName(month: String?): Int { - return when (month) { - "Jan" -> 1 - "Feb" -> 2 - "Mar" -> 3 - "Apr" -> 4 - "May" -> 5 - "Jun" -> 6 - "Jul" -> 7 - "Aug" -> 8 - "Sep" -> 9 - "Oct" -> 10 - "Nov" -> 11 - "Dec" -> 12 - else -> -1 - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/EspressoIdlingResource.kt b/mifosng-android/src/main/java/com/mifos/utils/EspressoIdlingResource.kt deleted file mode 100644 index beaf0562ea2..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/EspressoIdlingResource.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015, The Android Open Source Project - * - * 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.mifos.utils - -import androidx.test.espresso.IdlingResource - -/** - * @author Rajan Maurya - * Contains a static reference to [IdlingResource]. - */ -object EspressoIdlingResource { - private const val RESOURCE = "GLOBAL" - private val mCountingIdlingResource = SimpleCountingIdlingResource(RESOURCE) - fun increment() { - mCountingIdlingResource.increment() - } - - fun decrement() { - mCountingIdlingResource.decrement() - } - - val idlingResource: IdlingResource - get() = mCountingIdlingResource -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/FileUtils.kt b/mifosng-android/src/main/java/com/mifos/utils/FileUtils.kt deleted file mode 100644 index 679967e4fd0..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/FileUtils.kt +++ /dev/null @@ -1,209 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -import android.annotation.TargetApi -import android.content.ContentUris -import android.content.Context -import android.database.Cursor -import android.net.Uri -import android.os.Build -import android.os.Environment -import android.provider.DocumentsContract -import android.provider.MediaStore -import android.util.Log -import android.webkit.MimeTypeMap -import com.mifos.utils.AndroidVersionUtil.isApiVersionGreaterOrEqual -import java.io.File -import java.io.FileOutputStream -import java.io.InputStream -import java.io.OutputStream - -/** - * Created by ishankhanna on 03/07/14. - */ -object FileUtils { - val LOG_TAG = FileUtils::class.java.simpleName - fun getPathReal(context: Context, uri: Uri): String? { - return if (isApiVersionGreaterOrEqual(Build.VERSION_CODES.KITKAT)) { - getPathRealOnKitkatAboveVersion(context, uri) - } else { - getPathOnKitkatBelowVersion(context, uri) - } - } - - private fun getPathOnKitkatBelowVersion(context: Context, uri: Uri): String? { - if ("content".equals(uri.scheme, ignoreCase = true)) { - val projection = arrayOf("_data") - var cursor: Cursor? = null - try { - cursor = context.contentResolver.query(uri, projection, null, null, null) - val column_index = cursor!!.getColumnIndexOrThrow("_data") - if (cursor.moveToFirst()) { - return cursor.getString(column_index) - } - } catch (e: Exception) { - // Eat it - } - } else if ("file".equals(uri.scheme, ignoreCase = true)) { - return uri.path - } - return null - } - - @TargetApi(Build.VERSION_CODES.KITKAT) - fun getPathRealOnKitkatAboveVersion(context: Context, uri: Uri): String? { - val isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT - - // DocumentProvider - if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { - // ExternalStorageProvider - if (isExternalStorageDocument(uri)) { - val docId = DocumentsContract.getDocumentId(uri) - val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - val type = split[0] - if ("primary".equals(type, ignoreCase = true)) { - return Environment.getExternalStorageDirectory().toString() + "/" + split[1] - } - // TODO handle non-primary volumes - - // DownloadsProvider - } else if (isDownloadsDocument(uri)) { - val id = DocumentsContract.getDocumentId(uri) - val contentUri = ContentUris.withAppendedId( - Uri.parse("content://downloads/public_downloads"), id.toLong() - ) - return getDataColumn(context, contentUri, null, null) - - // MediaProvider - } else if (isMediaDocument(uri)) { - val docId = DocumentsContract.getDocumentId(uri) - val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - val type = split[0] - var contentUri: Uri? = null - if ("image" == type) { - contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI - } else if ("video" == type) { - contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI - } else if ("audio" == type) { - contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI - } - val selection = "_id=?" - val selectionArgs = arrayOf( - split[1] - ) - return getDataColumn(context, contentUri, selection, selectionArgs) - } - - // MediaStore (and general) - } else if ("content".equals(uri.scheme, ignoreCase = true)) { - - // Return the remote address - return if (isGooglePhotosUri(uri)) uri.lastPathSegment else getDataColumn( - context, - uri, - null, - null - ) - - // File - } else if ("file".equals(uri.scheme, ignoreCase = true)) { - return uri.path - } - return null - } - - fun getDataColumn( - context: Context, uri: Uri?, selection: String?, - selectionArgs: Array? - ): String? { - var cursor: Cursor? = null - val column = "_data" - val projection = arrayOf( - column - ) - try { - cursor = context.contentResolver.query( - uri!!, projection, selection, selectionArgs, - null - ) - if (cursor != null && cursor.moveToFirst()) { - val index = cursor.getColumnIndexOrThrow(column) - return cursor.getString(index) - } - } finally { - cursor?.close() - } - return null - } - - /** - * @param uri The Uri to check. - * @return Whether the Uri authority is ExternalStorageProvider. - */ - fun isExternalStorageDocument(uri: Uri): Boolean { - return "com.android.externalstorage.documents" == uri.authority - } - - /** - * @param uri The Uri to check. - * @return Whether the Uri authority is DownloadsProvider. - */ - fun isDownloadsDocument(uri: Uri): Boolean { - return "com.android.providers.downloads.documents" == uri.authority - } - - /** - * @param uri The Uri to check. - * @return Whether the Uri authority is MediaProvider. - */ - fun isMediaDocument(uri: Uri): Boolean { - return "com.android.providers.media.documents" == uri.authority - } - - /** - * @param uri The Uri to check. - * @return Whether the Uri authority is Google Photos. - */ - fun isGooglePhotosUri(uri: Uri): Boolean { - return "com.google.android.apps.photos.content" == uri.authority - } - - /** - * This Method for getting File Mime Type - * - * @param filePath Path of the file - * @return String Mime Type - */ - fun getMimeType(filePath: String?): String? { - var type: String? = null - val extension = MimeTypeMap.getFileExtensionFromUrl(filePath) - if (extension != null) { - type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension) - } - return type - } - - /** - * This Method for writing InputStream into File. - * - * @param in InputStream - * @param file File - */ - fun writeInputStreamDataToFile(`in`: InputStream, file: File?) { - try { - val out: OutputStream = FileOutputStream(file) - val buf = ByteArray(1024) - var len: Int - while (`in`.read(buf).also { len = it } > 0) { - out.write(buf, 0, len) - } - out.close() - `in`.close() - } catch (e: Exception) { - Log.d(LOG_TAG, e.localizedMessage) - } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/FragmentConstants.kt b/mifosng-android/src/main/java/com/mifos/utils/FragmentConstants.kt deleted file mode 100644 index a2ed6f33526..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/FragmentConstants.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -/** - * Created by ishankhanna on 22/05/14. - */ -object FragmentConstants { - const val FRAG_DOCUMENT_LIST = "Document List Fragment" - const val FRAG_GROUP_SYNC = "Groups Sync" - const val FRAG_CLIENT_SYNC = "Clients Sync" - const val FRAG_SURVEYS_SYNC = "Surveys Sync" - const val FRAG_CHARGE_LIST = "Charge List Fragment" - const val FRAG_CLIENT_DETAILS = "Client Details Fragment" - const val FRAG_CLIENT_IDENTIFIER = "Client Identifier Fragment" - const val FRAG_GROUP_DETAILS = "Group Details Fragment" - const val FRAG_LOAN_ACCOUNT_SUMMARY = "Loan Account Summary Fragment" - const val FRAG_SAVINGS_ACCOUNT_SUMMARY = "Savings Account Summary Fragment" - const val FRAG_CENTER_LIST = "Centers List Fragment" - const val FRAG_CENTER_DETAIL = "Center Details" - const val FRAG_GROUP_LIST = "Group List Fragment" - const val DFRAG_DATE_PICKER = "Date Picker" - const val FRAG_CREATE_NEW_CLIENT = "Create new client fragment" - const val FRAG_CLIENT_SEARCH = "Client Search Fragment" - const val DFRAG_DATATABLE_ENTRY_FORM = "Data_Table_Entry_Form" - const val FRAG_DATA_TABLE = "Data Table Fragment" - const val DATA_TABLE_LIST = "Associated Datatables" -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/ImageLoaderUtils.kt b/mifosng-android/src/main/java/com/mifos/utils/ImageLoaderUtils.kt deleted file mode 100644 index a67c77e2b30..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/ImageLoaderUtils.kt +++ /dev/null @@ -1,51 +0,0 @@ -package com.mifos.utils - -import android.content.Context -import android.graphics.Bitmap -import android.widget.ImageView -import com.bumptech.glide.Glide -import com.bumptech.glide.load.model.GlideUrl -import com.bumptech.glide.load.model.LazyHeaders -import com.bumptech.glide.request.target.BitmapImageViewTarget -import com.bumptech.glide.signature.ObjectKey -import com.mifos.core.network.MifosInterceptor -import com.mifos.mifosxdroid.R - -/** - * Created by Rajan Maurya on 05/02/17. - */ -object ImageLoaderUtils { - private fun buildImageUrl(clientId: Int): String { - return (PrefManager.getInstanceUrl() - + "clients/" - + clientId - + "/images?maxHeight=120&maxWidth=120") - } - - private fun buildGlideUrl(clientId: Int): GlideUrl { - return GlideUrl( - buildImageUrl(clientId), LazyHeaders.Builder() - .addHeader(MifosInterceptor.HEADER_TENANT, PrefManager.getTenant()) - .addHeader(MifosInterceptor.HEADER_AUTH, PrefManager.getToken()) - .addHeader("Accept", "application/octet-stream") - .build() - ) - } - - fun loadImage(context: Context, clientId: Int, imageView: ImageView) { - Glide.with(context) - .asBitmap() - .load(buildGlideUrl(clientId)) - .placeholder(R.drawable.ic_dp_placeholder) - .error(R.drawable.ic_dp_placeholder) - .signature(ObjectKey(System.currentTimeMillis())) - .into(object : BitmapImageViewTarget(imageView) { - override fun setResource(result: Bitmap?) { - // check a valid bitmap is downloaded - if (result?.width == 0) return - // set to image view - imageView.setImageBitmap(result) - } - }) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/ItemOffsetDecoration.kt b/mifosng-android/src/main/java/com/mifos/utils/ItemOffsetDecoration.kt deleted file mode 100644 index f2392bb5c20..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/ItemOffsetDecoration.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.mifos.utils - -import android.content.Context -import android.graphics.Rect -import android.view.View -import androidx.annotation.DimenRes -import androidx.recyclerview.widget.RecyclerView -import androidx.recyclerview.widget.RecyclerView.ItemDecoration - -/** - * @author Rajan Maurya - */ -class ItemOffsetDecoration(private val mItemOffset: Int) : ItemDecoration() { - constructor( - context: Context, - @DimenRes itemOffsetId: Int - ) : this(context.resources.getDimensionPixelSize(itemOffsetId)) { - } - - override fun getItemOffsets( - outRect: Rect, view: View, parent: RecyclerView, - state: RecyclerView.State - ) { - super.getItemOffsets(outRect, view, parent, state) - outRect[mItemOffset, mItemOffset, mItemOffset] = mItemOffset - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/JsonDateSerializer.kt b/mifosng-android/src/main/java/com/mifos/utils/JsonDateSerializer.kt deleted file mode 100644 index 9ff5569ef7f..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/JsonDateSerializer.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -import com.google.gson.JsonElement -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type -import java.text.SimpleDateFormat -import java.util.Date - -/** - * Created by Rajan Maurya on 28,March,2016. - */ -class JsonDateSerializer : JsonSerializer { - override fun serialize( - src: Date?, - typeOfSrc: Type, - context: JsonSerializationContext - ): JsonElement { - val output = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - val formattedTime = output.format(src) - return JsonPrimitive(formattedTime) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/LanguageHelper.kt b/mifosng-android/src/main/java/com/mifos/utils/LanguageHelper.kt deleted file mode 100644 index 33283368a8b..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/LanguageHelper.kt +++ /dev/null @@ -1,64 +0,0 @@ -package com.mifos.utils - -import android.annotation.TargetApi -import android.content.Context -import android.os.Build -import android.preference.PreferenceManager -import com.mifos.mifosxdroid.R -import java.util.Locale - -/** - * Created by shashankpriyadarshi on 20/06/20. - */ -object LanguageHelper { - fun - onAttach(context: Context): Context { - val lang = getPersistedData(context, Locale.getDefault().language) - return setLocale(context, lang) - } - - fun onAttach(context: Context, defaultLanguage: String): Context { - val lang = getPersistedData(context, defaultLanguage) - return setLocale(context, lang) - } - - fun setLocale(context: Context, language: String?): Context { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - updateResources(context, language) - } else updateResourcesLegacy( - context, - language - ) - } - - private fun getPersistedData(context: Context, defaultLanguage: String): String? { - val preferences = PreferenceManager.getDefaultSharedPreferences(context) - return preferences.getString(context.getString(R.string.language_type), defaultLanguage) - } - - private fun updateResources(context: Context, language: String?): Context { - val locale = language?.lowercase(Locale.getDefault())?.let { Locale(it) } - if (locale != null) { - Locale.setDefault(locale) - } - val resources = context.resources - val configuration = resources.configuration - configuration.setLocale(locale) - configuration.setLayoutDirection(locale) - resources.updateConfiguration(configuration, resources.displayMetrics) - return context.createConfigurationContext(configuration) - } - - private fun updateResourcesLegacy(context: Context, language: String?): Context { - val locale = Locale(language) - Locale.setDefault(locale) - val resources = context.resources - val configuration = resources.configuration - configuration.locale = locale - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { - configuration.setLayoutDirection(locale) - } - resources.updateConfiguration(configuration, resources.displayMetrics) - return context - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/MapDeserializer.kt b/mifosng-android/src/main/java/com/mifos/utils/MapDeserializer.kt deleted file mode 100644 index 193fc478624..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/MapDeserializer.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.mifos.utils - -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonParseException -import java.lang.reflect.Type - -class MapDeserializer : JsonDeserializer?> { - @Throws(JsonParseException::class) - override fun deserialize( - json: JsonElement, typeOfT: Type, - context: JsonDeserializationContext - ): Map? { - return read(json) as Map? - } - - fun read(`in`: JsonElement): Any? { - if (`in`.isJsonArray) { - val list: MutableList = ArrayList() - val arr = `in`.asJsonArray - for (anArr in arr) { - list.add(read(anArr)) - } - return list - } else if (`in`.isJsonObject) { - val map: MutableMap = HashMap() - val obj = `in`.asJsonObject - val entitySet = obj.entrySet() - for ((key, value) in entitySet) { - map[key] = read(value) - } - return map - } else if (`in`.isJsonPrimitive) { - val prim = `in`.asJsonPrimitive - if (prim.isBoolean) { - return prim.asBoolean - } else if (prim.isString) { - return prim.asString - } else if (prim.isNumber) { - val num = prim.asNumber - // here you can handle double int/long values - // and return any type you want - // this solution will transform 3.0 float to long values - return if (Math.ceil(num.toDouble()) == num.toLong().toDouble()) { - num.toLong() - } else { - num.toDouble() - } - } - } - return null - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/MifosDatePicker.kt b/mifosng-android/src/main/java/com/mifos/utils/MifosDatePicker.kt deleted file mode 100644 index 1df9e99e494..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/MifosDatePicker.kt +++ /dev/null @@ -1,44 +0,0 @@ -package com.mifos.utils - -import com.google.android.material.datepicker.CalendarConstraints -import com.google.android.material.datepicker.DateValidatorPointBackward -import com.google.android.material.datepicker.DateValidatorPointForward -import com.google.android.material.datepicker.MaterialDatePicker -import java.text.SimpleDateFormat -import java.time.Instant -import java.util.Calendar -import java.util.Locale - -/* - created by Aditya Gupta on 02/08/2023 - */ - -enum class DatePickerConstrainType { - ONLY_FUTURE_DAYS, ONLY_PAST_DAYS, NONE -} - -fun getDatePickerDialog( - selectedInstant: Instant = Instant.now(), - constrainType: DatePickerConstrainType = DatePickerConstrainType.NONE, - onDatePick: (dateLong: Long) -> Unit = {}, -): MaterialDatePicker { - val constrainsBuilder = CalendarConstraints.Builder().apply { - when (constrainType) { - DatePickerConstrainType.ONLY_FUTURE_DAYS -> setValidator(DateValidatorPointForward.now()) - DatePickerConstrainType.ONLY_PAST_DAYS -> setValidator(DateValidatorPointBackward.now()) - DatePickerConstrainType.NONE -> {} - } - } - - val dialog = MaterialDatePicker.Builder.datePicker() - .setSelection(selectedInstant.toEpochMilli()) - .setCalendarConstraints(constrainsBuilder.build()) - .build() - dialog.addOnPositiveButtonClickListener { - onDatePick(it) - } - return dialog -} - -fun getTodayFormatted(): String = - SimpleDateFormat("dd MMMM yyyy", Locale.getDefault()).format(Calendar.getInstance().time) \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/MifosResponseHandler.kt b/mifosng-android/src/main/java/com/mifos/utils/MifosResponseHandler.kt index 0538d5a9c9e..89b35270a27 100644 --- a/mifosng-android/src/main/java/com/mifos/utils/MifosResponseHandler.kt +++ b/mifosng-android/src/main/java/com/mifos/utils/MifosResponseHandler.kt @@ -1,14 +1,22 @@ +/* + * 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/android-client/blob/master/LICENSE.md + */ package com.mifos.utils -import com.mifos.utils.PrefManager.userStatus - /** * Created by Rajan Maurya on 08/07/16. */ object MifosResponseHandler { - val response: String - get() = when (userStatus) { - false -> "created successfully" + fun getResponse(userStatus: Boolean): String { + return when (userStatus) { true -> "Saved into DB Successfully" + false -> "created successfully" } -} \ No newline at end of file + } +} diff --git a/mifosng-android/src/main/java/com/mifos/utils/Network.kt b/mifosng-android/src/main/java/com/mifos/utils/Network.kt deleted file mode 100644 index f9f79e5e5e5..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/Network.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -import android.content.Context -import android.net.ConnectivityManager - -object Network { - const val TYPE_WIFI = 1 - const val TYPE_MOBILE = 2 - const val TYPE_NOT_CONNECTED = 0 - private fun getConnectivityStatus(context: Context): Int { - val cm = context - .getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - val activeNetwork = cm.activeNetworkInfo - if (null != activeNetwork) { - if (activeNetwork.type == ConnectivityManager.TYPE_WIFI) return TYPE_WIFI - if (activeNetwork.type == ConnectivityManager.TYPE_MOBILE) return TYPE_MOBILE - } - return TYPE_NOT_CONNECTED - } - - fun getConnectivityStatusString(context: Context): String? { - val conn = getConnectivityStatus(context) - var status: String? = null - if (conn == TYPE_WIFI) { - status = "Wifi enabled" - } else if (conn == TYPE_MOBILE) { - status = "Mobile data enabled" - } else if (conn == TYPE_NOT_CONNECTED) { - status = "Not connected to Internet" - } - return status - } - - @JvmStatic - fun isOnline(context: Context): Boolean { - val connectivityStatus = getConnectivityStatus(context) - return connectivityStatus == TYPE_WIFI || - connectivityStatus == TYPE_MOBILE - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/NetworkUtilsWrapper.kt b/mifosng-android/src/main/java/com/mifos/utils/NetworkUtilsWrapper.kt deleted file mode 100644 index 2f6537e307d..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/NetworkUtilsWrapper.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.mifos.utils - -import android.content.Context -import android.net.ConnectivityManager -import android.net.NetworkCapabilities -import androidx.annotation.MainThread -import dagger.hilt.android.qualifiers.ApplicationContext -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class NetworkUtilsWrapper @Inject constructor( - @ApplicationContext private val context: Context -) { - - @MainThread - fun isNetworkConnected(): Boolean { - val connectivityManager = - context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - val network = connectivityManager.activeNetwork ?: return false - val networkCapabilities = - connectivityManager.getNetworkCapabilities(network) ?: return false - - return networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/PrefManager.kt b/mifosng-android/src/main/java/com/mifos/utils/PrefManager.kt deleted file mode 100644 index b5d904355d1..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/PrefManager.kt +++ /dev/null @@ -1,57 +0,0 @@ -package com.mifos.utils - -import android.content.SharedPreferences -import android.preference.PreferenceManager -import com.mifos.application.App -import com.mifos.core.objects.user.User -import org.mifos.core.sharedpreference.Key -import org.mifos.core.sharedpreference.UserPreferences -import org.openapitools.client.models.PostAuthenticationResponse - -/** - * Created by Aditya Gupta on 19/08/23. - */ - -object PrefManager : UserPreferences() { - - private const val USER_DETAILS = "user_details" - private const val AUTH_USERNAME = "auth_username" - private const val AUTH_PASSWORD = "auth_password" - - override val preference: SharedPreferences = - PreferenceManager.getDefaultSharedPreferences(App.instance?.applicationContext) - - override fun getUser(): User { - return get(Key.Custom(USER_DETAILS)) - } - - override fun saveUser(user: User) { - put(Key.Custom(USER_DETAILS), user) - } - - // Created this to store userDetails - fun savePostAuthenticationResponse(user: PostAuthenticationResponse) { - put(Key.Custom(USER_DETAILS), user) - } - - var userStatus: Boolean - get() = get(Key.Custom(Constants.SERVICE_STATUS), false) - set(status) { - put(Key.Custom(Constants.SERVICE_STATUS), status) - } - - fun setPermissionDeniedStatus(permissionDeniedStatus: String, status: Boolean) { - put(Key.Custom(permissionDeniedStatus), status) - } - - fun getPermissionDeniedStatus(permissionDeniedStatus: String): Boolean { - return get(Key.Custom(permissionDeniedStatus), true) - } - - var usernamePassword: Pair - get() = Pair(get(Key.Custom(AUTH_USERNAME)), get(Key.Custom(AUTH_PASSWORD))) - set(value) { - put(Key.Custom(AUTH_USERNAME), value.first) - put(Key.Custom(AUTH_PASSWORD), value.second) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/SafeUIBlockingUtility.kt b/mifosng-android/src/main/java/com/mifos/utils/SafeUIBlockingUtility.kt deleted file mode 100644 index 2018cab4804..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/SafeUIBlockingUtility.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -import android.app.ProgressDialog -import android.content.Context -import android.util.Log -import android.widget.Toast - -/** - * @author ishankhanna - * Class To Block User Interface Safely for Asynchronous Network Calls - * and/or Heavy Operations - */ -class SafeUIBlockingUtility { - private var progressDialog: ProgressDialog - private var context: Context - - constructor(context: Context) { - this.context = context - progressDialog = ProgressDialog(context) - progressDialog.setMessage(utilityMessage) - progressDialog.setCancelable(false) - progressDialog.isIndeterminate = true - progressDialog.setTitle(utilityTitle) - progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER) - } - - constructor(context: Context, message: String?) { - this.context = context - progressDialog = ProgressDialog(context) - progressDialog.setMessage(message) - progressDialog.setCancelable(false) - progressDialog.isIndeterminate = true - progressDialog.setTitle(utilityTitle) - progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER) - } - - fun safelyBlockUI() { - progressDialog.show() - } - - fun safelyUnBlockUI() { - progressDialog.dismiss() - } - - fun safelyUnblockUIForFailure(tag: String?, message: String?) { - progressDialog.dismiss() - Toast.makeText(context, "Some Problem Executing Request", Toast.LENGTH_SHORT).show() - Log.i(tag, message!!) - } - - companion object { - var utilityTitle = "Working" - var utilityMessage = "Message" - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/SimpleCountingIdlingResource.kt b/mifosng-android/src/main/java/com/mifos/utils/SimpleCountingIdlingResource.kt deleted file mode 100644 index ec957a4534f..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/SimpleCountingIdlingResource.kt +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * 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.mifos.utils - -import androidx.test.espresso.IdlingResource -import dagger.internal.Preconditions -import java.util.concurrent.atomic.AtomicInteger - -/** - * @author Rajan Maurya - * - * - * A simple counter implementation of [IdlingResource] that determines idleness by - * maintaining an internal counter. When the counter is 0 - it is considered to be idle, - * when it is - * non-zero it is not idle. This is very similar to the way a [ .Semaphore][java.util.concurrent] - * behaves. - * - * - * This class can then be used to wrap up operations that while in progress should block - * tests from - * accessing the UI. - */ -class SimpleCountingIdlingResource(resourceName: String) : IdlingResource { - private val mResourceName: String - private val counter = AtomicInteger(0) - - // written from main thread, read from any thread. - @Volatile - private var resourceCallback: IdlingResource.ResourceCallback? = null - - /** - * Creates a SimpleCountingIdlingResource - * - * @param resourceName the resource name this resource should report to Espresso. - */ - init { - mResourceName = Preconditions.checkNotNull(resourceName) - } - - override fun getName(): String { - return mResourceName - } - - override fun isIdleNow(): Boolean { - return counter.get() == 0 - } - - override fun registerIdleTransitionCallback(resourceCallback: IdlingResource.ResourceCallback) { - this.resourceCallback = resourceCallback - } - - /** - * Increments the count of in-flight transactions to the resource being monitored. - */ - fun increment() { - counter.getAndIncrement() - } - - /** - * Decrements the count of in-flight transactions to the resource being monitored. - * - * - * If this operation results in the counter falling below 0 - an exception is raised. - * - * @throws IllegalStateException if the counter is below 0. - */ - fun decrement() { - val counterVal = counter.decrementAndGet() - if (counterVal == 0 && null != resourceCallback) { - // we've gone from non-zero to zero. That means we're idle now! Tell espresso. - resourceCallback!!.onTransitionToIdle() - } - require(counterVal >= 0) { "Counter has been corrupted!" } - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/Tags.kt b/mifosng-android/src/main/java/com/mifos/utils/Tags.kt deleted file mode 100644 index f6e4ece7803..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/Tags.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.mifos.utils - -/** - * Created by aksh on 27/7/18. - */ -object Tags { - const val OfflineSyncCenter = "syncCenterTag" - const val OfflineSyncClient = "syncClientTag" - const val OfflineSyncGroup = "syncGroupTag" - const val OfflineSyncSavingsAccount = "syncSavingsAccountTag" - const val OfflineSyncLoanRepayment = "syncLoanRepaymentAccountTag" -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/ThemeHelper.kt b/mifosng-android/src/main/java/com/mifos/utils/ThemeHelper.kt index 9ede874f579..e2f0fcc0487 100644 --- a/mifosng-android/src/main/java/com/mifos/utils/ThemeHelper.kt +++ b/mifosng-android/src/main/java/com/mifos/utils/ThemeHelper.kt @@ -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/android-client/blob/master/LICENSE.md + */ package com.mifos.utils import androidx.appcompat.app.AppCompatDelegate @@ -24,4 +33,4 @@ object ThemeHelper { } } } -} \ No newline at end of file +} diff --git a/mifosng-android/src/main/java/com/mifos/utils/Utils.kt b/mifosng-android/src/main/java/com/mifos/utils/Utils.kt deleted file mode 100644 index 0d4cdc44a7e..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/Utils.kt +++ /dev/null @@ -1,126 +0,0 @@ -package com.mifos.utils - -import android.content.Context -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.graphics.drawable.LayerDrawable -import androidx.core.content.ContextCompat -import com.mifos.core.objects.accounts.loan.LoanAccount -import com.mifos.core.objects.accounts.savings.SavingsAccount -import com.mifos.core.objects.client.Client -import com.mifos.mifosxdroid.R -import rx.Observable -import java.text.DateFormat -import java.util.Calendar -import java.util.TimeZone - -/** - * Created by Rajan Maurya on 18/08/16. - */ -object Utils { - val LOG_TAG = Utils::class.java.simpleName - - /** - * This Method transforming the PaymentTypeOption to String(PaymentTypeName). - * In Which Observable.from takes the List and flatmap the - * PaymentTypeOptions one by one. finally returns the List paymentTypeNames - * - * @param paymentTypeOptions List - * @return List - */ - fun getPaymentTypeOptions(paymentTypeOptions: List?): List { - val paymentOptions: MutableList = ArrayList() - Observable.from(paymentTypeOptions) - .flatMap { (_, name) -> Observable.just(name) } - .subscribe { s -> paymentOptions.add(s) } - return paymentOptions - } - - /** - * This Method filtering the List and if any PaymentTypeOption id is equal to - * the paymentId. and return the match PaymentType Name. - * - * @param paymentId Payment Type Id - * @param paymentTypeOptions PaymentTypeOptions - * @return PaymentType Name - */ - @JvmStatic - fun getPaymentTypeName( - paymentId: Int, - paymentTypeOptions: List? - ): String? { - val paymentTypeName = arrayOfNulls(1) - Observable.from(paymentTypeOptions) - .filter { (id) -> id == paymentId } - .subscribe { (_, name) -> paymentTypeName[0] = name } - return paymentTypeName[0] - } - - fun getActiveLoanAccounts(loanAccountList: List?): List { - val loanAccounts: MutableList = ArrayList() - Observable.from(loanAccountList) - .filter { loanAccount -> loanAccount.status?.active } - .subscribe { loanAccount -> loanAccounts.add(loanAccount) } - return loanAccounts - } - - fun getActiveSavingsAccounts(savingsAccounts: List?): List { - val accounts: MutableList = ArrayList() - Observable.from(savingsAccounts) - .filter { savingsAccount -> - savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring - } - .subscribe { savingsAccount -> accounts.add(savingsAccount) } - return accounts - } - - fun getActiveClients(clients: List?): List { - val accounts: MutableList = ArrayList() - Observable.from(clients) - .filter { client -> client.active } - .subscribe { client -> accounts.add(client) } - return accounts - } - - fun getSyncableSavingsAccounts(savingsAccounts: List?): List { - val accounts: MutableList = ArrayList() - Observable.from(savingsAccounts) - .filter { savingsAccount -> - savingsAccount.depositType?.value == "Savings" && - savingsAccount.status?.active == true && - !savingsAccount.depositType!!.isRecurring - } - .subscribe { savingsAccount -> accounts.add(savingsAccount) } - return accounts - } - - /** - * This Method Converting the List of Activation Date to String. - * - * @param dateObj List of Date - * @return - */ - fun getStringOfDate(dateObj: List): String { - val calendar = Calendar.getInstance() - calendar.timeZone = TimeZone.getTimeZone("UTC") - calendar[Calendar.YEAR] = dateObj[0] - //in Calendar months are indexed from 0 to 11 - calendar[Calendar.MONTH] = dateObj[1] - 1 - calendar[Calendar.DAY_OF_MONTH] = dateObj[2] - val df = DateFormat.getDateInstance(DateFormat.MEDIUM) - return df.format(calendar.time) - } - - fun setCircularBackground( - colorId: Int, - context: Context? - ): LayerDrawable { - val color: Drawable = ColorDrawable(ContextCompat.getColor(context!!, colorId)) - val image = ContextCompat.getDrawable( - context, - R.drawable.circular_background - ) - return LayerDrawable(arrayOf(image, color)) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/utils/ValidationUtil.kt b/mifosng-android/src/main/java/com/mifos/utils/ValidationUtil.kt deleted file mode 100644 index 2a63101cc20..00000000000 --- a/mifosng-android/src/main/java/com/mifos/utils/ValidationUtil.kt +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This project is licensed under the open source MPL V2. - * See https://github.com/openMF/android-client/blob/master/LICENSE.md - */ -package com.mifos.utils - -import com.mifos.core.network.BaseUrl -import java.net.URL -import java.util.regex.Matcher -import java.util.regex.Pattern - -/** - * @author fomenkoo - */ -object ValidationUtil { - private const val DOMAIN_NAME_REGEX_PATTERN = "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\" + - ".[A-Za-z]{2,})$" - private const val IP_ADDRESS_REGEX_PATTERN = "^(\\d|[1-9]\\d|1\\d\\d|2" + - "([0-4]\\d|5[0-5]))\\.(\\d|[1-9]\\d|1\\d\\d|2([0-4]\\d|5[0-5]))\\." + - "(\\d|[1-9]\\d|1\\d\\d|2([0-4]\\d|5[0-5]))\\.(\\d|[1-9]\\d|1\\d\\d|2([0-4]\\d|5[0-5])" + - ")$" - private const val NAME_REGEX_PATTERN = "^[\\p{Alpha} .'-]+$" - private val domainNamePattern = Pattern.compile(DOMAIN_NAME_REGEX_PATTERN) - private lateinit var domainNameMatcher: Matcher - private val ipAddressPattern = Pattern.compile(IP_ADDRESS_REGEX_PATTERN) - private lateinit var ipAddressMatcher: Matcher - - /** - * Removing protocol names and trailing slashes - * from the user entered domain name. - * - * @param url - * @return filteredString - */ - private fun sanitizeDomainNameInput(url: String): String { - var filteredUrl: String - filteredUrl = if (url.contains("https://")) { - //Strip https:// from the URL - url.replace("https://", "") - } else if (url.contains("http://")) { - //String http:// from the URL - url.replace("http://", "") - } else { - //String URL doesn't include protocol - url - } - if (filteredUrl.length > 0 && filteredUrl[filteredUrl.length - 1] == '/') filteredUrl = - filteredUrl.replace("/", "") - return filteredUrl - } - - fun getInstanceUrl(validDomain: String, port: Int?): String { - var validDomain = validDomain - validDomain = sanitizeDomainNameInput(validDomain) - return if (port != null) { - BaseUrl.PROTOCOL_HTTPS + validDomain + ":" + port + BaseUrl.API_PATH - } else { - BaseUrl.PROTOCOL_HTTPS + validDomain + BaseUrl.API_PATH - } - } - - fun isValidUrl(url: String?): Boolean { - return try { - URL(url) - true - } catch (e: Exception) { - false - } - } - - /** - * Validates Domain name entered by user - * against valid domain name patterns - * and also IP address patterns. - * - * @param hex - * @return true if pattern is valid - * and false otherwise - */ - fun isValidDomain(hex: String?): Boolean { - domainNameMatcher = domainNamePattern.matcher(hex) - ipAddressMatcher = ipAddressPattern.matcher(hex) - if (domainNameMatcher.matches()) return true - return ipAddressMatcher.matches() - //TODO MAKE SURE YOU UPDATE THE REGEX to check for ports in the URL - } - - /** - * Validates the Name of Client, Group, Center etc. - * - * @param string Name - * @return Boolean - */ - fun isNameValid(string: String): Boolean { - return string.matches(Regex(NAME_REGEX_PATTERN)) - } -} \ No newline at end of file diff --git a/mifosng-android/src/main/res/anim/fab_close.xml b/mifosng-android/src/main/res/anim/fab_close.xml deleted file mode 100644 index a8e450d484b..00000000000 --- a/mifosng-android/src/main/res/anim/fab_close.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/anim/fab_open.xml b/mifosng-android/src/main/res/anim/fab_open.xml deleted file mode 100644 index 0cc5ee30821..00000000000 --- a/mifosng-android/src/main/res/anim/fab_open.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/anim/rotate_backward.xml b/mifosng-android/src/main/res/anim/rotate_backward.xml deleted file mode 100644 index 9bbb510ba6c..00000000000 --- a/mifosng-android/src/main/res/anim/rotate_backward.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/anim/rotate_forward.xml b/mifosng-android/src/main/res/anim/rotate_forward.xml deleted file mode 100644 index c1173e870bc..00000000000 --- a/mifosng-android/src/main/res/anim/rotate_forward.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable-hdpi/baseline_calendar_today_black_24.png b/mifosng-android/src/main/res/drawable-hdpi/baseline_calendar_today_black_24.png deleted file mode 100755 index f058ccdb66e552c85ea5591e4c952ad8871e4fe3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8m8XkiNCo5Do{hY%4m?Nq9P$15 z)7pS9XX3>bjkY@^CtO(U=UB+7m9%|YWw+en7y0HAP7w<#>p~<9)LLe2(2g|@IB+>I z@W3hg<4sNLEc!mYIIwVsytL^hqf>!>MN<~byyZyj<=XgoM&Jd>|k0wldT1B8K8v8Rh;NCo5DGm3l-1_CY@{TGNI zeRx5mM!)g!!mfu!s*1C@E~zPV-pp73{K4iuzi&>-l~*?;1fx%+eB-*h+5UFV6)&?@ z^@i=b+DRAr*qI}o6P2o3z1&zQo!hd);lZVuW~E&{4ljEgG{MN#=KOCDbMG>z$49^L(KK=jz diff --git a/mifosng-android/src/main/res/drawable-hdpi/baseline_keyboard_arrow_right_black_36.png b/mifosng-android/src/main/res/drawable-hdpi/baseline_keyboard_arrow_right_black_36.png deleted file mode 100755 index a77e2788453b3b92ba92b458a58e72a2e13c5674..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL0wmRZ7KH(+T2B|pkP61PXH6NI7z7+H_MbC3 zIG6RcGwUUThkojJ?xwo)?GAsia7xgt>Ilzd$CjCF(NRKkXDUT+Gm3pB;906x6n{H& z`ouRp@pm%Acb1A&XtK}E-m38P)~fYamG?}#8nD{EMP+qo2&>>Rp{r|WdxkO?vZ)9r gKc20*bjmHp7q!#R{LjjY0Xl@i)78&qol`;+05@Voi~s-t diff --git a/mifosng-android/src/main/res/drawable-hdpi/ic_content_import_export.png b/mifosng-android/src/main/res/drawable-hdpi/ic_content_import_export.png deleted file mode 100755 index 2cb850e33939a77699bd757750026e83bce9f5b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 789 zcmV+w1M2*VP)#J@m#)}y!HJnGs02NtSu+J1wk@lIPzu+i`mBT($KtEO3^-;s&QnTW)H0z< zGNFY4N6qGO0@Os%SqiR5gB{fF;d~wZ15D{7`8ND4wX-D(nhWs0{7eV}+Aap6JEV^ST>$wX6uLl8n|=tdkQbt2Z-^$E{wv@dIPpULu%i>r z{r%eB@a>yNiN(`xX}}EX`Re8uy!E(%^VI6+9d8Bfb)34*VdXF?pd#&c+^|12hrJe6 z&0&D{hlg($ts^(6@oBbk$W4xBQ>T)N+{#UW=F9hRw<*HTxO@-H=Ch&e(Zx-LhMS54 zwgavxxPqR*O$GbGhhzeU~F z+;-Y*jN|R}60m%=92$W!(movEaY=EQfh6;9*UTBMyBMCiQvuu>!Kg5go_C?4f*tER)}c*Fh^z-$mA|7epMX%UVt zt)YNrs4lXma#*C=GHNM@WvDK)rgB)M+A?Y>hh?ZPvZiuaq}noSDTigKF0$qiUc4(z T8L$Da00000NkvXXu0mjf$^w5c diff --git a/mifosng-android/src/main/res/drawable-mdpi/ic_content_import_export.png b/mifosng-android/src/main/res/drawable-mdpi/ic_content_import_export.png deleted file mode 100755 index 923da5d792779262491219a9829d42ab77bbbf98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 546 zcmV+-0^R+IP)T4}kERj|8cL%Oa<%#oq_IDsvFIgIL^M5Je}NeVzWby%TsNPbdp~~fx#uBh{DT_zfdKNJkVsG@$eRFfz34$r zBxsMln2hDV;_Zql&kO3T=Raa1bjEXWB6>}EEdk8|9g$oRk#=h^0@`5612vIc3EHDM zmjrapK!zqNPr9ljwJ`Re7E&>A@;E!J)AuLX+uYWUVGGIw#*+JL&RSFhsTj!mZU(C~ zPY4t2Y<+bMVi<|;5$Gi0wPgMk*xK9`dkV07a@g>ZU-npz)PS|tP@LdzKmz=LD(uw3 z09*3X=ot@KbzuEA6Na0KuCYWz0{B+~ojoWL?6zNAk>_Os*sj+}u*pWukfwUD^AE8j zU)3bg6??X`fxSYAHLbyhtvZZ@N95=BQFq_OoX8GHb{e`fCX1w_gb! zD&^8t#%Fz3vJ>|lY~R#z{%FIBlw!{Yo6n0?KzG_}mX+XCO|S)UM4#3XaKG^#gGsM> zPbsb^z}lh=8Ik}^vd8SHy`VJ*oIZUUEa*QCY0t_M=B>(^b diff --git a/mifosng-android/src/main/res/drawable-xhdpi/ic_backspace_48px.xml b/mifosng-android/src/main/res/drawable-xhdpi/ic_backspace_48px.xml deleted file mode 100644 index 7b8ee72bc33..00000000000 --- a/mifosng-android/src/main/res/drawable-xhdpi/ic_backspace_48px.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable-xhdpi/ic_content_import_export.png b/mifosng-android/src/main/res/drawable-xhdpi/ic_content_import_export.png deleted file mode 100755 index 70ddaec070b690ac4aa3cf747c6f9a6cd6378f9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 976 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdoh8V4m*j;uum9_jZ=Qhe)EtvHkhs zV%(~nO?N^MTd{afIOo(QJH_V8iW~BuZpd4eUY{-KVZOJVYxQDQwU<{8X6Snz>|;~B zxKO3EoZnGG?B=6)*R3xejJ-7XQuk<`&ohqvR*)~!5%hQ>6%o$9Rf6fp%XztXxe(G$++->hK z>`E7DXslt}kXd86W&J9(Wm7UX@42w#*rTc+%O(Ud-m{tbi)n$`R0*}L?c1%?%C0}E zx~uH3!O%QKCgF<5+;FYmJvJ=GwI}k!lrn8=_L(mx#m`+8SkV-j|WOk0oPg z_Drw1MQ>&OU!*>?)H2NY=Hk}vcGPk4p~=M;*4$V+Yof%$yHU*6Usaj)Gn6OAt?KpI z$9Cgm*2<#4=^4`$w&gGvs_ved8T%sJL+tm1n{S_IH%#kHQ!Z6naAl6bD~EY2d!{tr z+Y$Hs&bmnRS2g?>jATv2)?W&n)o#hKL}Hn(arvEwM@!Np8J2iUWh-B*z18vMxtq1^ z`M - - diff --git a/mifosng-android/src/main/res/drawable-xxhdpi/ic_content_import_export.png b/mifosng-android/src/main/res/drawable-xxhdpi/ic_content_import_export.png deleted file mode 100755 index d2f1b0579bdc34e699f991342ffe99765d70ade1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmeAS@N?(olHy`uVBq!ia0vp^6(G#P1|%(0%q}r7uvU4xIEGZjy`Afy5fdtL^nI=8 zWRt)k$H{4G3A|lS8?w?ibqOs}oitNZ??{eI!PQ*war>-6)} z@|HZ{-@+^uC3}>UiLG8xz<{yYnnAChQ!Sx@{lHVhgDgDn7oi?G2C z<_Di=*gn_H3KlQVDCi358XRiMxYQ*#4;LXqGrE6mSvL}?^X9(`>f0OY*bN{zwi31B=o^`PO zj@h{6Rb9=A^?xOp3M?kp#&CY!*mgUpMtj=ozQ;ZD>~8#De1BWkV@Cet;cPOMNB2&+ z70o#BZsF40H&>Fk|9z`|!i{;K@z3n)?XP^Y68OWJeYLSF{`b?)7}nUEaeW9#`k3i`qLy{Xl2>6~cJXP#vDd?I=f5uL=a99YCVvHJJ&8*l4pp1VK2!TIGEy^WX3;||{r z=1MrX>D`aSMek)8s}D3rRU0r?GeqgC3K-~b%KKqGgL9p#ot(sJ7UP3H8`zs7$~k=u zgwL>CmzC%DNoksypmu}Vam{WPwHcggO|Sd<+0~2=0u{VzRJaz)1XO2yu=MzGX5sg} z|LeSWXH+f>(L5#enpwPgeZ7%p@jHoqHyubnZkzdN01%rz>$9Hca>i`75xa+Pm9o79Ha_n3{l`y={F{FyTHulVL( z+hX@PdDX?zvLZX1gzIO332lSeEsYuL!=FYy*?uBc+M094#pj<`9~?~noclJmS}5vG zqZM!Twvg8zTGw_5Jpc1Qca}cG?ssMv`g>pRzP^7}4fBs(b#LUtvO;AwHRCobA3Pk| z|NVwTJY(5jes!bwub3m|t(??6vG)3Q&a&42ns3L?zFs?f^SgDijGH#rUccV3KJV&r z@%Ni`yyu@@xXat&+)HD7wdYBV{;Pd)z*38mpJE#>2=c0Ka{sD(TK%)n&(yue;T3gjo-Z;KIW6)k{y?6v-Mqb_5wEQOewe4* z|4(q5%yxCAU*FV@^{;1)-@D2$&F#x<{`gnzyT3+8>EGV?V75fY|KNw!2i9>$|E;*< z_wxT+166K5Z(~Ud#@$~^?C;elE&Y6Eakc(Tp3M<&S$f<|{P`KFSjG@lK<%k#)K$ou VenDKL1Xvg|c)I$ztaD0e0svH^n_K_@ diff --git a/mifosng-android/src/main/res/drawable/background.xml b/mifosng-android/src/main/res/drawable/background.xml deleted file mode 100644 index 137d02e7605..00000000000 --- a/mifosng-android/src/main/res/drawable/background.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/badge_rounded_corner.xml b/mifosng-android/src/main/res/drawable/badge_rounded_corner.xml deleted file mode 100644 index 5142730f558..00000000000 --- a/mifosng-android/src/main/res/drawable/badge_rounded_corner.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/baseline_arrow_drop_down_24.xml b/mifosng-android/src/main/res/drawable/baseline_arrow_drop_down_24.xml deleted file mode 100644 index c1c897af75a..00000000000 --- a/mifosng-android/src/main/res/drawable/baseline_arrow_drop_down_24.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/button_bg_rounded_corners.xml b/mifosng-android/src/main/res/drawable/button_bg_rounded_corners.xml deleted file mode 100644 index f39e2a2ef47..00000000000 --- a/mifosng-android/src/main/res/drawable/button_bg_rounded_corners.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/card_blueborder.9.png b/mifosng-android/src/main/res/drawable/card_blueborder.9.png deleted file mode 100755 index a44658e63e10cbe09fe0cd4e751d1327f77e7137..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmV-a0jvIrP)1P~(T&iiMcpO!0R0@GMRbpTtZ3hfB8bqfhY$%Wm~yA)8>5I>n}(@iK6tn9 z^DsE@jgs{FBogD1&H1@!E-qVZbtBg5ny|}_px2xpyWqSOFznNsEx0=1REfyOEa>wP z$kLevgR)4?u+KZ565xSblu)cCAv`6(1GgxlCSMqEi?{11B(yI{XhK3r2#LRtNW@79 z2_YdQ{zXEKYn$`Xp_c|)EO;L&Y6m%#q7`@X;7Apj0|l$%T7 zB~(w-a2#h$2suPi6tV=P552DIj=-Tjx%{BcL}1uV(@N83m=^8T3j)=TVtPah{b*Er mjXq7*rO>w5Z0000 - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/circular_bg_gray.xml b/mifosng-android/src/main/res/drawable/circular_bg_gray.xml deleted file mode 100644 index d160eada358..00000000000 --- a/mifosng-android/src/main/res/drawable/circular_bg_gray.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/gradient_repayment.xml b/mifosng-android/src/main/res/drawable/gradient_repayment.xml deleted file mode 100644 index 829296fc51b..00000000000 --- a/mifosng-android/src/main/res/drawable/gradient_repayment.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/gradient_spinner.xml b/mifosng-android/src/main/res/drawable/gradient_spinner.xml deleted file mode 100644 index faff0ab584c..00000000000 --- a/mifosng-android/src/main/res/drawable/gradient_spinner.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/ic_account_circle_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_account_circle_black_24dp.xml deleted file mode 100644 index 23fd52e82a2..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_account_circle_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_add_white_24dp.xml b/mifosng-android/src/main/res/drawable/ic_add_white_24dp.xml deleted file mode 100644 index b9b8eca8b90..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_add_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_assignment_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_assignment_black_24dp.xml deleted file mode 100644 index a156f002f4d..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_assignment_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml deleted file mode 100644 index 7ef6ee23a22..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_baseline_edit_24.xml b/mifosng-android/src/main/res/drawable/ic_baseline_edit_24.xml deleted file mode 100644 index 2844bafebe8..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_baseline_edit_24.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_centers_24dp.xml b/mifosng-android/src/main/res/drawable/ic_centers_24dp.xml deleted file mode 100644 index f9caf974f7b..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_centers_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_check_box_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_check_box_black_24dp.xml deleted file mode 100644 index 5e8e7701c10..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_check_box_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_check_green_24dp.xml b/mifosng-android/src/main/res/drawable/ic_check_green_24dp.xml deleted file mode 100644 index 3fd38568b30..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_check_green_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_clear_yellow_24dp.xml b/mifosng-android/src/main/res/drawable/ic_clear_yellow_24dp.xml deleted file mode 100644 index d906d7864b7..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_clear_yellow_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_cloud_upload_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_cloud_upload_black_24dp.xml deleted file mode 100644 index 55dbbae85cc..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_cloud_upload_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_dark_mode.xml b/mifosng-android/src/main/res/drawable/ic_dark_mode.xml deleted file mode 100644 index e5391167c40..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_dark_mode.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_dashboard_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_dashboard_black_24dp.xml deleted file mode 100644 index 52342f43c9b..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_dashboard_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_delete_red_24dp.xml b/mifosng-android/src/main/res/drawable/ic_delete_red_24dp.xml deleted file mode 100644 index bf6be2c28cd..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_delete_red_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_done_all_24dp.xml b/mifosng-android/src/main/res/drawable/ic_done_all_24dp.xml deleted file mode 100644 index a831c7a02cd..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_done_all_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_done_all_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_done_all_black_24dp.xml deleted file mode 100644 index 8f032656d5d..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_done_all_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_error_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_error_black_24dp.xml deleted file mode 100644 index 5c5fefb034a..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_error_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_event_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_event_black_24dp.xml deleted file mode 100644 index 36207f8018f..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_event_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_filter_list_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_filter_list_black_24dp.xml deleted file mode 100644 index 50237424128..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_filter_list_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_folder_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_folder_black_24dp.xml deleted file mode 100644 index 846a16841e0..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_folder_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_indeterminate_check_box_blue_24dp.xml b/mifosng-android/src/main/res/drawable/ic_indeterminate_check_box_blue_24dp.xml deleted file mode 100644 index 778f4dc4014..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_indeterminate_check_box_blue_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_lang.xml b/mifosng-android/src/main/res/drawable/ic_lang.xml deleted file mode 100644 index 79b414cd870..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_lang.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_logout.xml b/mifosng-android/src/main/res/drawable/ic_logout.xml deleted file mode 100644 index ae800a6caeb..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_logout.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/ic_mail_outline_24dp.xml b/mifosng-android/src/main/res/drawable/ic_mail_outline_24dp.xml deleted file mode 100644 index 4f343ca9250..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_mail_outline_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_more_vert_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_more_vert_black_24dp.xml deleted file mode 100644 index 83b13d90b1f..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_more_vert_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_my_location_white_24dp.xml b/mifosng-android/src/main/res/drawable/ic_my_location_white_24dp.xml deleted file mode 100644 index 17a41bc87db..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_my_location_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_passcode.xml b/mifosng-android/src/main/res/drawable/ic_passcode.xml deleted file mode 100644 index d6191026a48..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_passcode.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_person_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_person_black_24dp.xml deleted file mode 100644 index 4d29365929c..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_person_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_report_item.xml b/mifosng-android/src/main/res/drawable/ic_report_item.xml deleted file mode 100644 index 38c4f7a1656..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_report_item.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/ic_restore_24dp.xml b/mifosng-android/src/main/res/drawable/ic_restore_24dp.xml deleted file mode 100644 index b83b014de97..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_restore_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_search_black_24dp.xml b/mifosng-android/src/main/res/drawable/ic_search_black_24dp.xml deleted file mode 100644 index 41d21ed8471..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_search_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_settings.xml b/mifosng-android/src/main/res/drawable/ic_settings.xml deleted file mode 100644 index 52cbda601e1..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/ic_source_code.xml b/mifosng-android/src/main/res/drawable/ic_source_code.xml deleted file mode 100644 index f3ec2111057..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_source_code.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/ic_stop_white_24dp.xml b/mifosng-android/src/main/res/drawable/ic_stop_white_24dp.xml deleted file mode 100644 index c5b211a7776..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_stop_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_supervisor_account_24dp.xml b/mifosng-android/src/main/res/drawable/ic_supervisor_account_24dp.xml deleted file mode 100644 index 9bb443956a6..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_supervisor_account_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mifosng-android/src/main/res/drawable/ic_website.xml b/mifosng-android/src/main/res/drawable/ic_website.xml deleted file mode 100644 index c388cb8e8d3..00000000000 --- a/mifosng-android/src/main/res/drawable/ic_website.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/login_button_rounded.xml b/mifosng-android/src/main/res/drawable/login_button_rounded.xml deleted file mode 100644 index a5984cfc6d8..00000000000 --- a/mifosng-android/src/main/res/drawable/login_button_rounded.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/round_outline_bg.xml b/mifosng-android/src/main/res/drawable/round_outline_bg.xml deleted file mode 100644 index 65a32a0a901..00000000000 --- a/mifosng-android/src/main/res/drawable/round_outline_bg.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/rounded_background.xml b/mifosng-android/src/main/res/drawable/rounded_background.xml deleted file mode 100755 index 86b510f2978..00000000000 --- a/mifosng-android/src/main/res/drawable/rounded_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/mifosng-android/src/main/res/drawable/table_row_round_bg.xml b/mifosng-android/src/main/res/drawable/table_row_round_bg.xml deleted file mode 100644 index c3923a0b734..00000000000 --- a/mifosng-android/src/main/res/drawable/table_row_round_bg.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/drawable/triangle_bottom.xml b/mifosng-android/src/main/res/drawable/triangle_bottom.xml deleted file mode 100644 index b5e5de1a134..00000000000 --- a/mifosng-android/src/main/res/drawable/triangle_bottom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/layout/activity_global_container_layout.xml b/mifosng-android/src/main/res/layout/activity_global_container_layout.xml deleted file mode 100755 index 94405b8c195..00000000000 --- a/mifosng-android/src/main/res/layout/activity_global_container_layout.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/mifosng-android/src/main/res/layout/activity_home.xml b/mifosng-android/src/main/res/layout/activity_home.xml deleted file mode 100644 index 107e1e4e610..00000000000 --- a/mifosng-android/src/main/res/layout/activity_home.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/layout/activity_pinpoint_location.xml b/mifosng-android/src/main/res/layout/activity_pinpoint_location.xml deleted file mode 100644 index 7308c1f184c..00000000000 --- a/mifosng-android/src/main/res/layout/activity_pinpoint_location.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mifosng-android/src/main/res/layout/activity_survey_question.xml b/mifosng-android/src/main/res/layout/activity_survey_question.xml deleted file mode 100755 index ad36382769b..00000000000 --- a/mifosng-android/src/main/res/layout/activity_survey_question.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - -