From 9755e490f907ca5b44faac8b36163943c2f6349c Mon Sep 17 00:00:00 2001 From: Binay Shaw Date: Fri, 3 Jan 2025 09:06:41 +0530 Subject: [PATCH 1/6] updated the package 1/3 --- .../auth/sign_in}/SignInScreenTest.kt | 3 +-- .../justap/{helper => utils}/ValidatorTest.kt | 4 ++-- app/src/main/AndroidManifest.xml | 12 +++++----- .../justap/adapter/AccountsItemAdapter.kt | 6 ++--- .../shaw/justap/adapter/CustomizeQRAdapter.kt | 2 +- .../shaw/justap/adapter/HistoryAdapter.kt | 4 ++-- .../justap/adapter/LanguageItemAdapter.kt | 2 +- .../shaw/justap/adapter/ResultItemAdapter.kt | 4 ++-- .../justap/adapter/SettingsItemAdapter.kt | 4 ++-- .../binay/shaw/justap/base/BaseActivity.kt | 2 +- .../binay/shaw/justap/base/BaseFragment.kt | 2 +- .../shaw/justap/base/ViewModelFactory.kt | 12 +++++----- .../{ => local/database}/LocalUserDatabase.kt | 13 ++++++---- .../justap/data/{ => local/db}/AccountsDAO.kt | 4 ++-- .../data/{ => local/db}/LocalHistoryDAO.kt | 4 ++-- .../data/{ => local/db}/LocalUserDAO.kt | 4 ++-- .../justap/{ => domain}/model/Accounts.kt | 2 +- .../{ => domain}/model/CustomizeQROptions.kt | 2 +- .../justap/{ => domain}/model/Language.kt | 2 +- .../justap/{ => domain}/model/LocalHistory.kt | 2 +- .../justap/{ => domain}/model/LocalUser.kt | 2 +- .../shaw/justap/{ => domain}/model/QRCode.kt | 2 +- .../justap/{ => domain}/model/SettingsItem.kt | 10 ++++---- .../shaw/justap/{ => domain}/model/User.kt | 2 +- .../repository/AccountsRepository.kt | 6 ++--- .../repository/FirebaseRepository.kt | 4 ++-- .../repository/LocalHistoryRepository.kt | 6 ++--- .../repository/LocalUserRepository.kt | 6 ++--- .../auth}/ForgotPasswordScreen.kt | 6 ++--- .../auth/sign_in}/SignInScreen.kt | 12 +++++----- .../auth/sign_up}/SignUpScreen.kt | 6 ++--- .../common/ImagePickerFragment.kt | 6 ++--- .../intro}/SplashActivity.kt | 12 +++++----- .../onboarding/IntroViewPagerAdapter.kt | 2 +- .../intro}/onboarding/OnboardingScreen.kt | 6 ++--- .../intro}/onboarding/ScreenItem.kt | 2 +- .../main}/MainActivity.kt | 2 +- .../main}/historyScreen/HistoryFragment.kt | 13 +++++----- .../historyScreen/LocalHistoryViewModel.kt | 8 +++---- .../main}/homeScreen/HomeFragment.kt | 16 ++++++------- .../accountFragments/AddEditFragment.kt | 16 ++++++------- .../accountFragments/AddEditViewModel.kt | 8 +++---- .../main}/qrScreens/QRScannerFragment.kt | 11 ++++----- .../qrGeneratorScreen/QRGeneratorFragment.kt | 17 +++++++------ .../qrGeneratorScreen/QRGeneratorViewModel.kt | 9 ++++--- .../main}/resultScreen/ScanResultFragment.kt | 18 +++++++------- .../main}/resultScreen/ScanResultViewModel.kt | 14 +++++------ .../main}/settingsScreen/SettingsFragment.kt | 21 +++++++--------- .../customize_qr/CustomizeQRFragment.kt | 18 +++++++------- .../customize_qr/CustomizeQRViewModel.kt | 12 +++++----- .../editScreen/EditProfileFragment.kt | 14 +++++------ .../editScreen/EditProfileViewModel.kt | 6 ++--- .../profileScreen/ProfileFragment.kt | 10 ++++---- .../services/MyFirebaseMessagingService.kt | 4 ++-- .../justap/{helper => utils}/Constants.kt | 2 +- .../shaw/justap/{helper => utils}/DarkMode.kt | 2 +- .../justap/{helper => utils}/Encryption.java | 2 +- .../justap/{helper => utils}/ImageUtils.kt | 2 +- .../justap/{helper => utils}/LanguageUtils.kt | 5 ++-- .../justap/{helper => utils}/LifeCycle.kt | 2 +- .../justap/{helper => utils}/LinksUtils.kt | 4 ++-- .../shaw/justap/{helper => utils}/Logger.kt | 2 +- .../{helper => utils}/NotificationHelper.kt | 2 +- .../justap/{helper => utils}/QrExtensions.kt | 4 ++-- .../{helper => utils}/StringExtenstions.kt | 2 +- .../shaw/justap/{helper => utils}/Util.kt | 7 +++--- .../{helper => utils}/ValidationExtensions.kt | 2 +- .../justap/viewModel/AccountsViewModel.kt | 6 ++--- .../justap/viewModel/FirebaseViewModel.kt | 12 +++++----- .../justap/viewModel/LocalUserViewModel.kt | 6 ++--- .../activity_forgot_password_screen.xml | 2 +- app/src/main/res/layout/activity_main.xml | 2 +- .../res/layout/activity_onboarding_screen.xml | 2 +- .../res/layout/activity_sign_in_screen.xml | 2 +- .../res/layout/activity_sign_up_screen.xml | 2 +- app/src/main/res/layout/activity_splash.xml | 2 +- app/src/main/res/layout/fragment_add_edit.xml | 2 +- .../res/layout/fragment_customize_q_r.xml | 2 +- .../main/res/layout/fragment_edit_profile.xml | 2 +- app/src/main/res/layout/fragment_history.xml | 2 +- app/src/main/res/layout/fragment_home.xml | 2 +- .../main/res/layout/fragment_image_picker.xml | 2 +- app/src/main/res/layout/fragment_profile.xml | 2 +- .../res/layout/fragment_q_r_generator.xml | 2 +- .../main/res/layout/fragment_q_r_scanner.xml | 2 +- .../main/res/layout/fragment_scan_result.xml | 2 +- app/src/main/res/layout/fragment_settings.xml | 2 +- app/src/main/res/navigation/base_nav.xml | 24 +++++++++---------- 88 files changed, 255 insertions(+), 262 deletions(-) rename app/src/androidTest/java/com/binay/shaw/justap/{ui/authentication/signInScreen => presentation/auth/sign_in}/SignInScreenTest.kt (97%) rename app/src/androidTest/java/com/binay/shaw/justap/{helper => utils}/ValidatorTest.kt (91%) rename app/src/main/java/com/binay/shaw/justap/data/{ => local/database}/LocalUserDatabase.kt (77%) rename app/src/main/java/com/binay/shaw/justap/data/{ => local/db}/AccountsDAO.kt (81%) rename app/src/main/java/com/binay/shaw/justap/data/{ => local/db}/LocalHistoryDAO.kt (82%) rename app/src/main/java/com/binay/shaw/justap/data/{ => local/db}/LocalUserDAO.kt (90%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/Accounts.kt (87%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/CustomizeQROptions.kt (93%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/Language.kt (78%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/LocalHistory.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/LocalUser.kt (90%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/QRCode.kt (82%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/SettingsItem.kt (78%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/model/User.kt (84%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/repository/AccountsRepository.kt (76%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/repository/FirebaseRepository.kt (95%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/repository/LocalHistoryRepository.kt (77%) rename app/src/main/java/com/binay/shaw/justap/{ => domain}/repository/LocalUserRepository.kt (82%) rename app/src/main/java/com/binay/shaw/justap/{ui/authentication => presentation/auth}/ForgotPasswordScreen.kt (95%) rename app/src/main/java/com/binay/shaw/justap/{ui/authentication/signInScreen => presentation/auth/sign_in}/SignInScreen.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{ui/authentication/signUpScreen => presentation/auth/sign_up}/SignUpScreen.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{ui => presentation}/common/ImagePickerFragment.kt (95%) rename app/src/main/java/com/binay/shaw/justap/{ui/introduction => presentation/intro}/SplashActivity.kt (78%) rename app/src/main/java/com/binay/shaw/justap/{ui/introduction => presentation/intro}/onboarding/IntroViewPagerAdapter.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{ui/introduction => presentation/intro}/onboarding/OnboardingScreen.kt (95%) rename app/src/main/java/com/binay/shaw/justap/{ui/introduction => presentation/intro}/onboarding/ScreenItem.kt (57%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/MainActivity.kt (98%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/historyScreen/HistoryFragment.kt (97%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/historyScreen/LocalHistoryViewModel.kt (82%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/homeScreen/HomeFragment.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/homeScreen/accountFragments/AddEditFragment.kt (97%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/homeScreen/accountFragments/AddEditViewModel.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/qrScreens/QRScannerFragment.kt (97%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt (93%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt (82%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/resultScreen/ScanResultFragment.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/resultScreen/ScanResultViewModel.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/settingsScreen/SettingsFragment.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/settingsScreen/customize_qr/CustomizeQRFragment.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/settingsScreen/customize_qr/CustomizeQRViewModel.kt (87%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/settingsScreen/editScreen/EditProfileFragment.kt (97%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/settingsScreen/editScreen/EditProfileViewModel.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{ui/mainScreens => presentation/main}/settingsScreen/profileScreen/ProfileFragment.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/Constants.kt (97%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/DarkMode.kt (94%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/Encryption.java (99%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/ImageUtils.kt (99%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/LanguageUtils.kt (90%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/LifeCycle.kt (95%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/LinksUtils.kt (98%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/Logger.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/NotificationHelper.kt (96%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/QrExtensions.kt (98%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/StringExtenstions.kt (95%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/Util.kt (98%) rename app/src/main/java/com/binay/shaw/justap/{helper => utils}/ValidationExtensions.kt (99%) diff --git a/app/src/androidTest/java/com/binay/shaw/justap/ui/authentication/signInScreen/SignInScreenTest.kt b/app/src/androidTest/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreenTest.kt similarity index 97% rename from app/src/androidTest/java/com/binay/shaw/justap/ui/authentication/signInScreen/SignInScreenTest.kt rename to app/src/androidTest/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreenTest.kt index 7a96fa3..dd44a51 100644 --- a/app/src/androidTest/java/com/binay/shaw/justap/ui/authentication/signInScreen/SignInScreenTest.kt +++ b/app/src/androidTest/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreenTest.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.authentication.signInScreen +package com.binay.shaw.justap.presentation.auth.sign_in import androidx.test.espresso.Espresso.onView import androidx.test.espresso.ViewAssertion @@ -10,7 +10,6 @@ import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.ext.junit.rules.ActivityScenarioRule import com.binay.shaw.justap.R -import org.junit.Assert.* import org.junit.Rule import org.junit.Test diff --git a/app/src/androidTest/java/com/binay/shaw/justap/helper/ValidatorTest.kt b/app/src/androidTest/java/com/binay/shaw/justap/utils/ValidatorTest.kt similarity index 91% rename from app/src/androidTest/java/com/binay/shaw/justap/helper/ValidatorTest.kt rename to app/src/androidTest/java/com/binay/shaw/justap/utils/ValidatorTest.kt index d2afcc7..9d8c337 100644 --- a/app/src/androidTest/java/com/binay/shaw/justap/helper/ValidatorTest.kt +++ b/app/src/androidTest/java/com/binay/shaw/justap/utils/ValidatorTest.kt @@ -1,6 +1,6 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils -import com.binay.shaw.justap.helper.Validator.Companion.isValidEmail +import com.binay.shaw.justap.utils.Validator.Companion.isValidEmail import org.junit.Assert.* import org.junit.Test diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3b72f7f..f8e539c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,10 +25,10 @@ android:name="firebase_performance_logcat_enabled" android:value="true" /> @@ -43,7 +43,7 @@ android:value="" /> @@ -52,7 +52,7 @@ android:value="" /> @@ -61,7 +61,7 @@ android:value="" /> @@ -70,7 +70,7 @@ android:value="" /> = ArrayList() diff --git a/app/src/main/java/com/binay/shaw/justap/adapter/CustomizeQRAdapter.kt b/app/src/main/java/com/binay/shaw/justap/adapter/CustomizeQRAdapter.kt index ea982c7..d121fdf 100644 --- a/app/src/main/java/com/binay/shaw/justap/adapter/CustomizeQRAdapter.kt +++ b/app/src/main/java/com/binay/shaw/justap/adapter/CustomizeQRAdapter.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.binay.shaw.justap.databinding.LayoutCustomizeQrRecyclerViewItemBinding -import com.binay.shaw.justap.model.CustomizeQROptions +import com.binay.shaw.justap.domain.model.CustomizeQROptions private var options: List = ArrayList() diff --git a/app/src/main/java/com/binay/shaw/justap/adapter/HistoryAdapter.kt b/app/src/main/java/com/binay/shaw/justap/adapter/HistoryAdapter.kt index e62ec7c..ac43f3b 100644 --- a/app/src/main/java/com/binay/shaw/justap/adapter/HistoryAdapter.kt +++ b/app/src/main/java/com/binay/shaw/justap/adapter/HistoryAdapter.kt @@ -7,8 +7,8 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.binay.shaw.justap.databinding.HistoryItemLayoutBinding -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.LocalHistory +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.LocalHistory import com.bumptech.glide.Glide import com.bumptech.glide.load.engine.DiskCacheStrategy diff --git a/app/src/main/java/com/binay/shaw/justap/adapter/LanguageItemAdapter.kt b/app/src/main/java/com/binay/shaw/justap/adapter/LanguageItemAdapter.kt index e29ffb0..be4b375 100644 --- a/app/src/main/java/com/binay/shaw/justap/adapter/LanguageItemAdapter.kt +++ b/app/src/main/java/com/binay/shaw/justap/adapter/LanguageItemAdapter.kt @@ -5,7 +5,7 @@ import android.view.ViewGroup import androidx.core.content.res.ResourcesCompat import androidx.recyclerview.widget.RecyclerView import com.binay.shaw.justap.databinding.LanguageItemBinding -import com.binay.shaw.justap.model.Language +import com.binay.shaw.justap.domain.model.Language class LanguageItemAdapter( diff --git a/app/src/main/java/com/binay/shaw/justap/adapter/ResultItemAdapter.kt b/app/src/main/java/com/binay/shaw/justap/adapter/ResultItemAdapter.kt index bf8c395..a032491 100644 --- a/app/src/main/java/com/binay/shaw/justap/adapter/ResultItemAdapter.kt +++ b/app/src/main/java/com/binay/shaw/justap/adapter/ResultItemAdapter.kt @@ -6,8 +6,8 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.binay.shaw.justap.databinding.SocialAccountLayoutBinding -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.Accounts +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.Accounts class ResultItemAdapter( diff --git a/app/src/main/java/com/binay/shaw/justap/adapter/SettingsItemAdapter.kt b/app/src/main/java/com/binay/shaw/justap/adapter/SettingsItemAdapter.kt index 1adb4ba..f307854 100644 --- a/app/src/main/java/com/binay/shaw/justap/adapter/SettingsItemAdapter.kt +++ b/app/src/main/java/com/binay/shaw/justap/adapter/SettingsItemAdapter.kt @@ -11,8 +11,8 @@ import androidx.core.content.res.ResourcesCompat import androidx.recyclerview.widget.RecyclerView import com.binay.shaw.justap.R import com.binay.shaw.justap.databinding.SettingsItemBinding -import com.binay.shaw.justap.helper.DarkMode -import com.binay.shaw.justap.model.SettingsItem +import com.binay.shaw.justap.utils.DarkMode +import com.binay.shaw.justap.domain.model.SettingsItem class SettingsItemAdapter( val context: Context, diff --git a/app/src/main/java/com/binay/shaw/justap/base/BaseActivity.kt b/app/src/main/java/com/binay/shaw/justap/base/BaseActivity.kt index f0a5620..9225b77 100644 --- a/app/src/main/java/com/binay/shaw/justap/base/BaseActivity.kt +++ b/app/src/main/java/com/binay/shaw/justap/base/BaseActivity.kt @@ -8,7 +8,7 @@ import android.view.View import android.view.inputmethod.InputMethodManager import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate -import com.binay.shaw.justap.helper.DarkMode +import com.binay.shaw.justap.utils.DarkMode import com.google.firebase.perf.FirebasePerformance import com.google.firebase.perf.metrics.Trace import java.util.Locale diff --git a/app/src/main/java/com/binay/shaw/justap/base/BaseFragment.kt b/app/src/main/java/com/binay/shaw/justap/base/BaseFragment.kt index ecae23d..fdd856c 100644 --- a/app/src/main/java/com/binay/shaw/justap/base/BaseFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/base/BaseFragment.kt @@ -14,7 +14,7 @@ import androidx.core.content.res.ResourcesCompat import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import com.binay.shaw.justap.R -import com.binay.shaw.justap.helper.Util.clearDataAndLogout +import com.binay.shaw.justap.utils.Util.clearDataAndLogout import com.google.firebase.auth.FirebaseAuth import com.tapadoo.alerter.Alerter diff --git a/app/src/main/java/com/binay/shaw/justap/base/ViewModelFactory.kt b/app/src/main/java/com/binay/shaw/justap/base/ViewModelFactory.kt index 6843be5..7359dfe 100644 --- a/app/src/main/java/com/binay/shaw/justap/base/ViewModelFactory.kt +++ b/app/src/main/java/com/binay/shaw/justap/base/ViewModelFactory.kt @@ -5,12 +5,12 @@ import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewmodel.CreationExtras import com.binay.shaw.justap.viewModel.AccountsViewModel import com.binay.shaw.justap.viewModel.LocalUserViewModel -import com.binay.shaw.justap.ui.mainScreens.historyScreen.LocalHistoryViewModel -import com.binay.shaw.justap.ui.mainScreens.homeScreen.accountFragments.AddEditViewModel -import com.binay.shaw.justap.ui.mainScreens.qrScreens.qrGeneratorScreen.QRGeneratorViewModel -import com.binay.shaw.justap.ui.mainScreens.resultScreen.ScanResultViewModel -import com.binay.shaw.justap.ui.mainScreens.settingsScreen.customize_qr.CustomizeQRViewModel -import com.binay.shaw.justap.ui.mainScreens.settingsScreen.editScreen.EditProfileViewModel +import com.binay.shaw.justap.presentation.main.historyScreen.LocalHistoryViewModel +import com.binay.shaw.justap.presentation.main.homeScreen.accountFragments.AddEditViewModel +import com.binay.shaw.justap.presentation.main.qrScreens.qrGeneratorScreen.QRGeneratorViewModel +import com.binay.shaw.justap.presentation.main.resultScreen.ScanResultViewModel +import com.binay.shaw.justap.presentation.main.settingsScreen.customize_qr.CustomizeQRViewModel +import com.binay.shaw.justap.presentation.main.settingsScreen.editScreen.EditProfileViewModel import com.binay.shaw.justap.viewModel.FirebaseViewModel /** diff --git a/app/src/main/java/com/binay/shaw/justap/data/LocalUserDatabase.kt b/app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt similarity index 77% rename from app/src/main/java/com/binay/shaw/justap/data/LocalUserDatabase.kt rename to app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt index 0e0079d..409db0c 100644 --- a/app/src/main/java/com/binay/shaw/justap/data/LocalUserDatabase.kt +++ b/app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt @@ -1,14 +1,17 @@ -package com.binay.shaw.justap.data +package com.binay.shaw.justap.data.local.database import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase import androidx.room.TypeConverters -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.model.Converters -import com.binay.shaw.justap.model.LocalHistory -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.data.local.db.AccountsDAO +import com.binay.shaw.justap.data.local.db.LocalHistoryDAO +import com.binay.shaw.justap.data.local.db.LocalUserDAO +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.model.Converters +import com.binay.shaw.justap.domain.model.LocalHistory +import com.binay.shaw.justap.domain.model.LocalUser import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/binay/shaw/justap/data/AccountsDAO.kt b/app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt similarity index 81% rename from app/src/main/java/com/binay/shaw/justap/data/AccountsDAO.kt rename to app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt index 74c1cc7..b49fe30 100644 --- a/app/src/main/java/com/binay/shaw/justap/data/AccountsDAO.kt +++ b/app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt @@ -1,8 +1,8 @@ -package com.binay.shaw.justap.data +package com.binay.shaw.justap.data.local.db import androidx.lifecycle.LiveData import androidx.room.* -import com.binay.shaw.justap.model.Accounts +import com.binay.shaw.justap.domain.model.Accounts @Dao diff --git a/app/src/main/java/com/binay/shaw/justap/data/LocalHistoryDAO.kt b/app/src/main/java/com/binay/shaw/justap/data/local/db/LocalHistoryDAO.kt similarity index 82% rename from app/src/main/java/com/binay/shaw/justap/data/LocalHistoryDAO.kt rename to app/src/main/java/com/binay/shaw/justap/data/local/db/LocalHistoryDAO.kt index 707bff3..10e2550 100644 --- a/app/src/main/java/com/binay/shaw/justap/data/LocalHistoryDAO.kt +++ b/app/src/main/java/com/binay/shaw/justap/data/local/db/LocalHistoryDAO.kt @@ -1,9 +1,9 @@ -package com.binay.shaw.justap.data +package com.binay.shaw.justap.data.local.db import androidx.lifecycle.LiveData import androidx.room.* -import com.binay.shaw.justap.model.LocalHistory +import com.binay.shaw.justap.domain.model.LocalHistory @Dao diff --git a/app/src/main/java/com/binay/shaw/justap/data/LocalUserDAO.kt b/app/src/main/java/com/binay/shaw/justap/data/local/db/LocalUserDAO.kt similarity index 90% rename from app/src/main/java/com/binay/shaw/justap/data/LocalUserDAO.kt rename to app/src/main/java/com/binay/shaw/justap/data/local/db/LocalUserDAO.kt index afaab0f..4921180 100644 --- a/app/src/main/java/com/binay/shaw/justap/data/LocalUserDAO.kt +++ b/app/src/main/java/com/binay/shaw/justap/data/local/db/LocalUserDAO.kt @@ -1,8 +1,8 @@ -package com.binay.shaw.justap.data +package com.binay.shaw.justap.data.local.db import androidx.lifecycle.LiveData import androidx.room.* -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.domain.model.LocalUser /** * Created by binay on 02,January,2023 diff --git a/app/src/main/java/com/binay/shaw/justap/model/Accounts.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/Accounts.kt similarity index 87% rename from app/src/main/java/com/binay/shaw/justap/model/Accounts.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/Accounts.kt index 9809251..3b75685 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/Accounts.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/Accounts.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model import androidx.room.Entity import androidx.room.PrimaryKey diff --git a/app/src/main/java/com/binay/shaw/justap/model/CustomizeQROptions.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/CustomizeQROptions.kt similarity index 93% rename from app/src/main/java/com/binay/shaw/justap/model/CustomizeQROptions.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/CustomizeQROptions.kt index 96f2922..f8b3aef 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/CustomizeQROptions.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/CustomizeQROptions.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model import android.graphics.drawable.Drawable diff --git a/app/src/main/java/com/binay/shaw/justap/model/Language.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/Language.kt similarity index 78% rename from app/src/main/java/com/binay/shaw/justap/model/Language.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/Language.kt index 016dfa0..9db45cc 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/Language.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/Language.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model import androidx.annotation.DrawableRes diff --git a/app/src/main/java/com/binay/shaw/justap/model/LocalHistory.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/LocalHistory.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/model/LocalHistory.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/LocalHistory.kt index e9041fc..5c4aa24 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/LocalHistory.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/LocalHistory.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model import android.graphics.Bitmap import android.graphics.BitmapFactory diff --git a/app/src/main/java/com/binay/shaw/justap/model/LocalUser.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/LocalUser.kt similarity index 90% rename from app/src/main/java/com/binay/shaw/justap/model/LocalUser.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/LocalUser.kt index c81b517..9690dcf 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/LocalUser.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/LocalUser.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model import androidx.room.Entity import androidx.room.PrimaryKey diff --git a/app/src/main/java/com/binay/shaw/justap/model/QRCode.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/QRCode.kt similarity index 82% rename from app/src/main/java/com/binay/shaw/justap/model/QRCode.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/QRCode.kt index d7af4ff..c062e04 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/QRCode.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/QRCode.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model import android.graphics.Bitmap diff --git a/app/src/main/java/com/binay/shaw/justap/model/SettingsItem.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/SettingsItem.kt similarity index 78% rename from app/src/main/java/com/binay/shaw/justap/model/SettingsItem.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/SettingsItem.kt index 268ed9a..aecb8c1 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/SettingsItem.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/SettingsItem.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model data class SettingsItem( @@ -25,10 +25,10 @@ enum class SettingsState(int: Int) { TO_CUSTOMIZE_QR -> 1 TO_ABOUT_US -> 2 TO_NEED_HELP -> 3 - TO_DARK_MODE-> 4 - TO_TRANSLATE-> 5 - TO_RATE_APP-> 6 - TO_LOGOUT-> 7 + TO_DARK_MODE -> 4 + TO_TRANSLATE -> 5 + TO_RATE_APP -> 6 + TO_LOGOUT -> 7 } } } diff --git a/app/src/main/java/com/binay/shaw/justap/model/User.kt b/app/src/main/java/com/binay/shaw/justap/domain/model/User.kt similarity index 84% rename from app/src/main/java/com/binay/shaw/justap/model/User.kt rename to app/src/main/java/com/binay/shaw/justap/domain/model/User.kt index a38dd88..30d6bff 100644 --- a/app/src/main/java/com/binay/shaw/justap/model/User.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/model/User.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.model +package com.binay.shaw.justap.domain.model /** * Created by binay on 01,January,2023 diff --git a/app/src/main/java/com/binay/shaw/justap/repository/AccountsRepository.kt b/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt similarity index 76% rename from app/src/main/java/com/binay/shaw/justap/repository/AccountsRepository.kt rename to app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt index 102f6dc..fe66d60 100644 --- a/app/src/main/java/com/binay/shaw/justap/repository/AccountsRepository.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt @@ -1,8 +1,8 @@ -package com.binay.shaw.justap.repository +package com.binay.shaw.justap.domain.repository import androidx.lifecycle.LiveData -import com.binay.shaw.justap.data.AccountsDAO -import com.binay.shaw.justap.model.Accounts +import com.binay.shaw.justap.data.local.db.AccountsDAO +import com.binay.shaw.justap.domain.model.Accounts class AccountsRepository( diff --git a/app/src/main/java/com/binay/shaw/justap/repository/FirebaseRepository.kt b/app/src/main/java/com/binay/shaw/justap/domain/repository/FirebaseRepository.kt similarity index 95% rename from app/src/main/java/com/binay/shaw/justap/repository/FirebaseRepository.kt rename to app/src/main/java/com/binay/shaw/justap/domain/repository/FirebaseRepository.kt index 8b5aaf3..c091aa8 100644 --- a/app/src/main/java/com/binay/shaw/justap/repository/FirebaseRepository.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/repository/FirebaseRepository.kt @@ -1,6 +1,6 @@ -package com.binay.shaw.justap.repository +package com.binay.shaw.justap.domain.repository -import com.binay.shaw.justap.helper.Util +import com.binay.shaw.justap.utils.Util import com.google.firebase.auth.FirebaseAuth import com.google.firebase.auth.FirebaseAuthInvalidUserException import com.google.firebase.auth.FirebaseAuthUserCollisionException diff --git a/app/src/main/java/com/binay/shaw/justap/repository/LocalHistoryRepository.kt b/app/src/main/java/com/binay/shaw/justap/domain/repository/LocalHistoryRepository.kt similarity index 77% rename from app/src/main/java/com/binay/shaw/justap/repository/LocalHistoryRepository.kt rename to app/src/main/java/com/binay/shaw/justap/domain/repository/LocalHistoryRepository.kt index 83d77ca..ee41f9f 100644 --- a/app/src/main/java/com/binay/shaw/justap/repository/LocalHistoryRepository.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/repository/LocalHistoryRepository.kt @@ -1,8 +1,8 @@ -package com.binay.shaw.justap.repository +package com.binay.shaw.justap.domain.repository import androidx.lifecycle.LiveData -import com.binay.shaw.justap.data.LocalHistoryDAO -import com.binay.shaw.justap.model.LocalHistory +import com.binay.shaw.justap.data.local.db.LocalHistoryDAO +import com.binay.shaw.justap.domain.model.LocalHistory /** * Created by binay on 10,February,2023 diff --git a/app/src/main/java/com/binay/shaw/justap/repository/LocalUserRepository.kt b/app/src/main/java/com/binay/shaw/justap/domain/repository/LocalUserRepository.kt similarity index 82% rename from app/src/main/java/com/binay/shaw/justap/repository/LocalUserRepository.kt rename to app/src/main/java/com/binay/shaw/justap/domain/repository/LocalUserRepository.kt index c4cc725..eafadbd 100644 --- a/app/src/main/java/com/binay/shaw/justap/repository/LocalUserRepository.kt +++ b/app/src/main/java/com/binay/shaw/justap/domain/repository/LocalUserRepository.kt @@ -1,8 +1,8 @@ -package com.binay.shaw.justap.repository +package com.binay.shaw.justap.domain.repository import androidx.lifecycle.LiveData -import com.binay.shaw.justap.data.LocalUserDAO -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.data.local.db.LocalUserDAO +import com.binay.shaw.justap.domain.model.LocalUser /** * Created by binay on 03,January,2023 diff --git a/app/src/main/java/com/binay/shaw/justap/ui/authentication/ForgotPasswordScreen.kt b/app/src/main/java/com/binay/shaw/justap/presentation/auth/ForgotPasswordScreen.kt similarity index 95% rename from app/src/main/java/com/binay/shaw/justap/ui/authentication/ForgotPasswordScreen.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/auth/ForgotPasswordScreen.kt index c116008..a0f98c2 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/authentication/ForgotPasswordScreen.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/auth/ForgotPasswordScreen.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.authentication +package com.binay.shaw.justap.presentation.auth import android.content.Intent import android.os.Bundle @@ -9,8 +9,8 @@ import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseActivity import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.ActivityForgotPasswordScreenBinding -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.ui.authentication.signInScreen.SignInScreen +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.presentation.auth.sign_in.SignInScreen import com.binay.shaw.justap.viewModel.FirebaseViewModel diff --git a/app/src/main/java/com/binay/shaw/justap/ui/authentication/signInScreen/SignInScreen.kt b/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/authentication/signInScreen/SignInScreen.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt index bb6364b..fb1855e 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/authentication/signInScreen/SignInScreen.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.authentication.signInScreen +package com.binay.shaw.justap.presentation.auth.sign_in import android.content.Intent @@ -11,11 +11,11 @@ import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseActivity import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.ActivitySignInScreenBinding -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.ui.authentication.ForgotPasswordScreen -import com.binay.shaw.justap.ui.authentication.signUpScreen.SignUpScreen -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.presentation.auth.ForgotPasswordScreen +import com.binay.shaw.justap.presentation.auth.sign_up.SignUpScreen +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.viewModel.AccountsViewModel import com.binay.shaw.justap.viewModel.FirebaseViewModel import com.binay.shaw.justap.viewModel.LocalUserViewModel diff --git a/app/src/main/java/com/binay/shaw/justap/ui/authentication/signUpScreen/SignUpScreen.kt b/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_up/SignUpScreen.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/ui/authentication/signUpScreen/SignUpScreen.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_up/SignUpScreen.kt index ce5db83..451ff95 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/authentication/signUpScreen/SignUpScreen.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_up/SignUpScreen.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.authentication.signUpScreen +package com.binay.shaw.justap.presentation.auth.sign_up import android.content.Intent import android.os.Bundle @@ -9,9 +9,9 @@ import androidx.activity.viewModels import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseActivity import com.binay.shaw.justap.base.ViewModelFactory -import com.binay.shaw.justap.helper.Util +import com.binay.shaw.justap.utils.Util import com.binay.shaw.justap.databinding.ActivitySignUpScreenBinding -import com.binay.shaw.justap.ui.authentication.signInScreen.SignInScreen +import com.binay.shaw.justap.presentation.auth.sign_in.SignInScreen import com.binay.shaw.justap.viewModel.FirebaseViewModel diff --git a/app/src/main/java/com/binay/shaw/justap/ui/common/ImagePickerFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/common/ImagePickerFragment.kt similarity index 95% rename from app/src/main/java/com/binay/shaw/justap/ui/common/ImagePickerFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/common/ImagePickerFragment.kt index eebffec..ed61a12 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/common/ImagePickerFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/common/ImagePickerFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.common +package com.binay.shaw.justap.presentation.common import android.app.Activity import android.content.Intent @@ -16,8 +16,8 @@ import androidx.navigation.fragment.findNavController import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.databinding.FragmentImagePickerBinding -import com.binay.shaw.justap.helper.ImageUtils.getBitmapFromUri -import com.binay.shaw.justap.helper.Util +import com.binay.shaw.justap.utils.ImageUtils.getBitmapFromUri +import com.binay.shaw.justap.utils.Util import com.github.dhaval2404.imagepicker.ImagePicker diff --git a/app/src/main/java/com/binay/shaw/justap/ui/introduction/SplashActivity.kt b/app/src/main/java/com/binay/shaw/justap/presentation/intro/SplashActivity.kt similarity index 78% rename from app/src/main/java/com/binay/shaw/justap/ui/introduction/SplashActivity.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/intro/SplashActivity.kt index 853db55..60dd95d 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/introduction/SplashActivity.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/intro/SplashActivity.kt @@ -1,15 +1,15 @@ -package com.binay.shaw.justap.ui.introduction +package com.binay.shaw.justap.presentation.intro import android.annotation.SuppressLint import android.content.Intent import android.os.Bundle -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseActivity -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.ui.authentication.signInScreen.SignInScreen -import com.binay.shaw.justap.ui.introduction.onboarding.OnboardingScreen +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.presentation.auth.sign_in.SignInScreen +import com.binay.shaw.justap.presentation.intro.onboarding.OnboardingScreen import kotlinx.coroutines.* @SuppressLint("CustomSplashScreen") diff --git a/app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/IntroViewPagerAdapter.kt b/app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/IntroViewPagerAdapter.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/IntroViewPagerAdapter.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/IntroViewPagerAdapter.kt index d2d585f..e9b6e6a 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/IntroViewPagerAdapter.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/IntroViewPagerAdapter.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.introduction.onboarding +package com.binay.shaw.justap.presentation.intro.onboarding import android.content.Context import android.view.LayoutInflater diff --git a/app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/OnboardingScreen.kt b/app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/OnboardingScreen.kt similarity index 95% rename from app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/OnboardingScreen.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/OnboardingScreen.kt index 4e3726f..e31a698 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/OnboardingScreen.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/OnboardingScreen.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.introduction.onboarding +package com.binay.shaw.justap.presentation.intro.onboarding import android.content.Intent @@ -8,8 +8,8 @@ import android.view.animation.AnimationUtils import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseActivity import com.binay.shaw.justap.databinding.ActivityOnboardingScreenBinding -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.ui.authentication.signInScreen.SignInScreen +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.presentation.auth.sign_in.SignInScreen import com.google.android.material.tabs.TabLayout diff --git a/app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/ScreenItem.kt b/app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/ScreenItem.kt similarity index 57% rename from app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/ScreenItem.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/ScreenItem.kt index e34e0e7..57a0e81 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/introduction/onboarding/ScreenItem.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/intro/onboarding/ScreenItem.kt @@ -1,3 +1,3 @@ -package com.binay.shaw.justap.ui.introduction.onboarding +package com.binay.shaw.justap.presentation.intro.onboarding class ScreenItem(var title: String, var description: String, var screenImg: Int) \ No newline at end of file diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/MainActivity.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt similarity index 98% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/MainActivity.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt index c6cf074..94c522d 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/MainActivity.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens +package com.binay.shaw.justap.presentation.main import android.os.Bundle diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/historyScreen/HistoryFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/historyScreen/HistoryFragment.kt similarity index 97% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/historyScreen/HistoryFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/historyScreen/HistoryFragment.kt index 336d1f3..ecd93b4 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/historyScreen/HistoryFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/historyScreen/HistoryFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.historyScreen +package com.binay.shaw.justap.presentation.main.historyScreen import android.annotation.SuppressLint import android.os.Bundle @@ -15,7 +15,7 @@ import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.NavHostFragment import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.adapter.HistoryAdapter import com.binay.shaw.justap.base.BaseFragment @@ -23,11 +23,10 @@ import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentHistoryBinding import com.binay.shaw.justap.databinding.OptionsModalBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.setBottomSheet -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.model.LocalHistory +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.setBottomSheet +import com.binay.shaw.justap.domain.model.LocalHistory import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/historyScreen/LocalHistoryViewModel.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/historyScreen/LocalHistoryViewModel.kt similarity index 82% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/historyScreen/LocalHistoryViewModel.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/historyScreen/LocalHistoryViewModel.kt index e670278..ac46101 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/historyScreen/LocalHistoryViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/historyScreen/LocalHistoryViewModel.kt @@ -1,13 +1,13 @@ -package com.binay.shaw.justap.ui.mainScreens.historyScreen +package com.binay.shaw.justap.presentation.main.historyScreen import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope -import com.binay.shaw.justap.data.LocalUserDatabase -import com.binay.shaw.justap.model.LocalHistory -import com.binay.shaw.justap.repository.LocalHistoryRepository +import com.binay.shaw.justap.data.local.database.LocalUserDatabase +import com.binay.shaw.justap.domain.model.LocalHistory +import com.binay.shaw.justap.domain.repository.LocalHistoryRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/HomeFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/HomeFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt index d7db385..ce4226f 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/HomeFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.homeScreen +package com.binay.shaw.justap.presentation.main.homeScreen import android.annotation.SuppressLint import android.os.Bundle @@ -15,14 +15,14 @@ import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentHomeBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding -import com.binay.shaw.justap.helper.ImageUtils -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.setBottomSheet -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.utils.ImageUtils +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.setBottomSheet +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.model.LocalUser import com.binay.shaw.justap.viewModel.AccountsViewModel -import com.binay.shaw.justap.ui.mainScreens.homeScreen.accountFragments.AddEditViewModel +import com.binay.shaw.justap.presentation.main.homeScreen.accountFragments.AddEditViewModel import com.binay.shaw.justap.viewModel.LocalUserViewModel diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/accountFragments/AddEditFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt similarity index 97% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/accountFragments/AddEditFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt index bf33284..a01b412 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/accountFragments/AddEditFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.homeScreen.accountFragments +package com.binay.shaw.justap.presentation.main.homeScreen.accountFragments import android.os.Bundle import android.text.Editable @@ -13,20 +13,20 @@ import androidx.core.content.ContextCompat import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.navArgs -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentAddEditBinding import com.binay.shaw.justap.databinding.OptionsModalBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.setBottomSheet -import com.binay.shaw.justap.helper.Validator.Companion.isValidEmail -import com.binay.shaw.justap.helper.Validator.Companion.isValidPhone +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.setBottomSheet +import com.binay.shaw.justap.utils.Validator.Companion.isValidEmail +import com.binay.shaw.justap.utils.Validator.Companion.isValidPhone import com.binay.shaw.justap.viewModel.AccountsViewModel -import com.binay.shaw.justap.model.Accounts +import com.binay.shaw.justap.domain.model.Accounts class AddEditFragment : BaseFragment() { diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/accountFragments/AddEditViewModel.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditViewModel.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/accountFragments/AddEditViewModel.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditViewModel.kt index dba71c0..e7fe7ae 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/homeScreen/accountFragments/AddEditViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditViewModel.kt @@ -1,11 +1,11 @@ -package com.binay.shaw.justap.ui.mainScreens.homeScreen.accountFragments +package com.binay.shaw.justap.presentation.main.homeScreen.accountFragments import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.Accounts +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.Accounts import com.binay.shaw.justap.viewModel.AccountsViewModel import com.google.firebase.database.FirebaseDatabase import kotlinx.coroutines.* diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/QRScannerFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/QRScannerFragment.kt similarity index 97% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/QRScannerFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/QRScannerFragment.kt index 8e5a7bc..4b711f0 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/QRScannerFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/QRScannerFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.qrScreens +package com.binay.shaw.justap.presentation.main.qrScreens import android.Manifest import android.annotation.SuppressLint @@ -18,15 +18,14 @@ import androidx.camera.core.* import androidx.camera.lifecycle.ProcessCameraProvider import androidx.core.content.ContextCompat import androidx.navigation.fragment.findNavController -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.databinding.FragmentQRScannerBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding -import com.binay.shaw.justap.helper.Encryption -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.setBottomSheet +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.setBottomSheet import com.google.mlkit.vision.barcode.BarcodeScanner import com.google.mlkit.vision.barcode.BarcodeScanning import com.google.mlkit.vision.common.InputImage diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt similarity index 93% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt index 5f78ff5..9e1ef7b 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/qrGeneratorScreen/QRGeneratorFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.qrScreens.qrGeneratorScreen +package com.binay.shaw.justap.presentation.main.qrScreens.qrGeneratorScreen import android.annotation.SuppressLint import android.content.Context @@ -17,20 +17,19 @@ import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.drawable.toBitmap import androidx.fragment.app.viewModels import androidx.navigation.Navigation -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentQRGeneratorBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.dpToPx -import com.binay.shaw.justap.helper.Util.saveToStorageAndGetUri -import com.binay.shaw.justap.helper.Util.setBottomSheet -import com.binay.shaw.justap.helper.Util.shareImageAndText +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.dpToPx +import com.binay.shaw.justap.utils.Util.saveToStorageAndGetUri +import com.binay.shaw.justap.utils.Util.setBottomSheet +import com.binay.shaw.justap.utils.Util.shareImageAndText import com.binay.shaw.justap.viewModel.LocalUserViewModel -import java.util.* @SuppressLint("ClickableViewAccessibility") class QRGeneratorFragment : BaseFragment() { diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt similarity index 82% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt index c46e4f0..6452b64 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/qrScreens/qrGeneratorScreen/QRGeneratorViewModel.kt @@ -1,13 +1,12 @@ -package com.binay.shaw.justap.ui.mainScreens.qrScreens.qrGeneratorScreen +package com.binay.shaw.justap.presentation.main.qrScreens.qrGeneratorScreen import android.graphics.Bitmap import android.util.DisplayMetrics import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import com.binay.shaw.justap.helper.Encryption -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.encodeAsQrCodeBitmap -import com.binay.shaw.justap.helper.roundedQRGenerator +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.encodeAsQrCodeBitmap +import com.binay.shaw.justap.utils.roundedQRGenerator class QRGeneratorViewModel : ViewModel() { diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/resultScreen/ScanResultFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/resultScreen/ScanResultFragment.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/resultScreen/ScanResultFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/resultScreen/ScanResultFragment.kt index 6706b7f..4b1a64c 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/resultScreen/ScanResultFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/resultScreen/ScanResultFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.resultScreen +package com.binay.shaw.justap.presentation.main.resultScreen import android.content.Intent import android.graphics.Bitmap @@ -15,19 +15,19 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.ViewModelProvider import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.LinearLayoutManager -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.adapter.ResultItemAdapter import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentScanResultBinding -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.ImageUtils -import com.binay.shaw.justap.helper.LinksUtils -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.model.User -import com.binay.shaw.justap.ui.mainScreens.historyScreen.LocalHistoryViewModel +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.ImageUtils +import com.binay.shaw.justap.utils.LinksUtils +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.model.User +import com.binay.shaw.justap.presentation.main.historyScreen.LocalHistoryViewModel import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.CustomTarget diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/resultScreen/ScanResultViewModel.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/resultScreen/ScanResultViewModel.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/resultScreen/ScanResultViewModel.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/resultScreen/ScanResultViewModel.kt index 8b3c9bc..dce9646 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/resultScreen/ScanResultViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/resultScreen/ScanResultViewModel.kt @@ -1,16 +1,16 @@ -package com.binay.shaw.justap.ui.mainScreens.resultScreen +package com.binay.shaw.justap.presentation.main.resultScreen import android.app.Application import android.graphics.Bitmap import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope import com.binay.shaw.justap.base.BaseViewModel -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.model.LocalHistory -import com.binay.shaw.justap.model.User -import com.binay.shaw.justap.ui.mainScreens.historyScreen.LocalHistoryViewModel +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.model.LocalHistory +import com.binay.shaw.justap.domain.model.User +import com.binay.shaw.justap.presentation.main.historyScreen.LocalHistoryViewModel import com.google.firebase.database.* import com.google.firebase.database.ktx.database import com.google.firebase.ktx.Firebase diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/SettingsFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/SettingsFragment.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/SettingsFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/SettingsFragment.kt index aef5555..bb049b6 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/SettingsFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/SettingsFragment.kt @@ -1,7 +1,6 @@ -package com.binay.shaw.justap.ui.mainScreens.settingsScreen +package com.binay.shaw.justap.presentation.main.settingsScreen import android.annotation.SuppressLint -import android.content.Context import android.content.Intent import android.net.Uri import android.os.Bundle @@ -21,21 +20,19 @@ import com.binay.shaw.justap.adapter.LanguageItemAdapter import com.binay.shaw.justap.adapter.SettingsItemAdapter import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory -import com.binay.shaw.justap.data.LocalUserDatabase +import com.binay.shaw.justap.data.local.database.LocalUserDatabase import com.binay.shaw.justap.databinding.FragmentSettingsBinding import com.binay.shaw.justap.databinding.LanguageModalBinding import com.binay.shaw.justap.databinding.OptionsModalBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding -import com.binay.shaw.justap.helper.* -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.setBottomSheet -import com.binay.shaw.justap.model.LocalUser -import com.binay.shaw.justap.model.SettingsItem -import com.binay.shaw.justap.model.SettingsState -import com.binay.shaw.justap.ui.authentication.signInScreen.SignInScreen -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.utils.* +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.setBottomSheet +import com.binay.shaw.justap.domain.model.LocalUser +import com.binay.shaw.justap.domain.model.SettingsItem +import com.binay.shaw.justap.domain.model.SettingsState +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.viewModel.LocalUserViewModel -import com.google.firebase.auth.FirebaseAuth import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/customize_qr/CustomizeQRFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/customize_qr/CustomizeQRFragment.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/customize_qr/CustomizeQRFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/customize_qr/CustomizeQRFragment.kt index f165f58..ea65ef3 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/customize_qr/CustomizeQRFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/customize_qr/CustomizeQRFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.settingsScreen.customize_qr +package com.binay.shaw.justap.presentation.main.settingsScreen.customize_qr import android.content.Context import android.content.SharedPreferences @@ -21,14 +21,14 @@ import com.binay.shaw.justap.adapter.CustomizeQRAdapter import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentCustomizeQRBinding -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.ImageUtils -import com.binay.shaw.justap.helper.Logger -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.Util.dpToPx -import com.binay.shaw.justap.model.CustomizeQRItems -import com.binay.shaw.justap.model.CustomizeQROptions -import com.binay.shaw.justap.model.QRCode +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.ImageUtils +import com.binay.shaw.justap.utils.Logger +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.Util.dpToPx +import com.binay.shaw.justap.domain.model.CustomizeQRItems +import com.binay.shaw.justap.domain.model.CustomizeQROptions +import com.binay.shaw.justap.domain.model.QRCode import com.skydoves.colorpickerview.ColorPickerDialog import com.skydoves.colorpickerview.flag.BubbleFlag import com.skydoves.colorpickerview.flag.FlagMode diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/customize_qr/CustomizeQRViewModel.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/customize_qr/CustomizeQRViewModel.kt similarity index 87% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/customize_qr/CustomizeQRViewModel.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/customize_qr/CustomizeQRViewModel.kt index 90e8666..49e4da8 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/customize_qr/CustomizeQRViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/customize_qr/CustomizeQRViewModel.kt @@ -1,14 +1,14 @@ -package com.binay.shaw.justap.ui.mainScreens.settingsScreen.customize_qr +package com.binay.shaw.justap.presentation.main.settingsScreen.customize_qr import android.app.Application import android.graphics.Bitmap import androidx.lifecycle.MutableLiveData import com.binay.shaw.justap.base.BaseViewModel -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.Logger -import com.binay.shaw.justap.helper.encodeAsQrCodeBitmap -import com.binay.shaw.justap.helper.roundedQRGenerator -import com.binay.shaw.justap.model.QRCode +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.Logger +import com.binay.shaw.justap.utils.encodeAsQrCodeBitmap +import com.binay.shaw.justap.utils.roundedQRGenerator +import com.binay.shaw.justap.domain.model.QRCode class CustomizeQRViewModel(application: Application): BaseViewModel(application) { diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/editScreen/EditProfileFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/editScreen/EditProfileFragment.kt similarity index 97% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/editScreen/EditProfileFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/editScreen/EditProfileFragment.kt index bd4d76f..c6c5bee 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/editScreen/EditProfileFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/editScreen/EditProfileFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.settingsScreen.editScreen +package com.binay.shaw.justap.presentation.main.settingsScreen.editScreen import android.app.Activity import android.content.Intent @@ -15,17 +15,17 @@ import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.databinding.FragmentEditProfileBinding import com.binay.shaw.justap.databinding.MyToolbarBinding import com.binay.shaw.justap.databinding.OptionsModalBinding -import com.binay.shaw.justap.helper.ImageUtils -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.helper.Util.createBottomSheet -import com.binay.shaw.justap.helper.Util.setBottomSheet -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.utils.ImageUtils +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.utils.Util.createBottomSheet +import com.binay.shaw.justap.utils.Util.setBottomSheet +import com.binay.shaw.justap.domain.model.LocalUser import com.binay.shaw.justap.viewModel.LocalUserViewModel import com.bumptech.glide.Glide import com.github.dhaval2404.imagepicker.ImagePicker diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/editScreen/EditProfileViewModel.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/editScreen/EditProfileViewModel.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/editScreen/EditProfileViewModel.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/editScreen/EditProfileViewModel.kt index 7466cb4..45f334e 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/editScreen/EditProfileViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/editScreen/EditProfileViewModel.kt @@ -1,11 +1,11 @@ -package com.binay.shaw.justap.ui.mainScreens.settingsScreen.editScreen +package com.binay.shaw.justap.presentation.main.settingsScreen.editScreen import android.net.Uri import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.LocalUser import com.binay.shaw.justap.viewModel.LocalUserViewModel import com.google.firebase.database.FirebaseDatabase import com.google.firebase.storage.StorageReference diff --git a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/profileScreen/ProfileFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/profileScreen/ProfileFragment.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/profileScreen/ProfileFragment.kt rename to app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/profileScreen/ProfileFragment.kt index e06546e..dd668ad 100644 --- a/app/src/main/java/com/binay/shaw/justap/ui/mainScreens/settingsScreen/profileScreen/ProfileFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/settingsScreen/profileScreen/ProfileFragment.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.ui.mainScreens.settingsScreen.profileScreen +package com.binay.shaw.justap.presentation.main.settingsScreen.profileScreen import android.os.Bundle import android.view.LayoutInflater @@ -6,14 +6,14 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.viewModels import androidx.navigation.Navigation -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.presentation.main.MainActivity import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentProfileBinding -import com.binay.shaw.justap.helper.ImageUtils -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.LocalUser +import com.binay.shaw.justap.utils.ImageUtils +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.LocalUser import com.binay.shaw.justap.viewModel.LocalUserViewModel diff --git a/app/src/main/java/com/binay/shaw/justap/services/MyFirebaseMessagingService.kt b/app/src/main/java/com/binay/shaw/justap/services/MyFirebaseMessagingService.kt index 4671307..43afa7e 100644 --- a/app/src/main/java/com/binay/shaw/justap/services/MyFirebaseMessagingService.kt +++ b/app/src/main/java/com/binay/shaw/justap/services/MyFirebaseMessagingService.kt @@ -10,8 +10,8 @@ import android.media.RingtoneManager import android.os.Build import androidx.core.app.NotificationCompat import com.binay.shaw.justap.R -import com.binay.shaw.justap.helper.Logger -import com.binay.shaw.justap.ui.mainScreens.MainActivity +import com.binay.shaw.justap.utils.Logger +import com.binay.shaw.justap.presentation.main.MainActivity import com.google.firebase.messaging.FirebaseMessaging import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage diff --git a/app/src/main/java/com/binay/shaw/justap/helper/Constants.kt b/app/src/main/java/com/binay/shaw/justap/utils/Constants.kt similarity index 97% rename from app/src/main/java/com/binay/shaw/justap/helper/Constants.kt rename to app/src/main/java/com/binay/shaw/justap/utils/Constants.kt index 2904160..ae8eca1 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/Constants.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/Constants.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils object Constants { diff --git a/app/src/main/java/com/binay/shaw/justap/helper/DarkMode.kt b/app/src/main/java/com/binay/shaw/justap/utils/DarkMode.kt similarity index 94% rename from app/src/main/java/com/binay/shaw/justap/helper/DarkMode.kt rename to app/src/main/java/com/binay/shaw/justap/utils/DarkMode.kt index 0626477..66cf49b 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/DarkMode.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/DarkMode.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.content.Context diff --git a/app/src/main/java/com/binay/shaw/justap/helper/Encryption.java b/app/src/main/java/com/binay/shaw/justap/utils/Encryption.java similarity index 99% rename from app/src/main/java/com/binay/shaw/justap/helper/Encryption.java rename to app/src/main/java/com/binay/shaw/justap/utils/Encryption.java index bb54490..0779e92 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/Encryption.java +++ b/app/src/main/java/com/binay/shaw/justap/utils/Encryption.java @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper; +package com.binay.shaw.justap.utils; import android.util.Base64; diff --git a/app/src/main/java/com/binay/shaw/justap/helper/ImageUtils.kt b/app/src/main/java/com/binay/shaw/justap/utils/ImageUtils.kt similarity index 99% rename from app/src/main/java/com/binay/shaw/justap/helper/ImageUtils.kt rename to app/src/main/java/com/binay/shaw/justap/utils/ImageUtils.kt index 503a281..aba38c3 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/ImageUtils.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/ImageUtils.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.app.AlertDialog import android.app.Dialog diff --git a/app/src/main/java/com/binay/shaw/justap/helper/LanguageUtils.kt b/app/src/main/java/com/binay/shaw/justap/utils/LanguageUtils.kt similarity index 90% rename from app/src/main/java/com/binay/shaw/justap/helper/LanguageUtils.kt rename to app/src/main/java/com/binay/shaw/justap/utils/LanguageUtils.kt index 90b8898..39d72e7 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/LanguageUtils.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/LanguageUtils.kt @@ -1,12 +1,11 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.app.Activity import android.content.Context import android.content.res.Configuration -import androidx.core.app.ActivityCompat import androidx.fragment.app.Fragment import com.binay.shaw.justap.R -import com.binay.shaw.justap.model.Language +import com.binay.shaw.justap.domain.model.Language import java.util.Locale diff --git a/app/src/main/java/com/binay/shaw/justap/helper/LifeCycle.kt b/app/src/main/java/com/binay/shaw/justap/utils/LifeCycle.kt similarity index 95% rename from app/src/main/java/com/binay/shaw/justap/helper/LifeCycle.kt rename to app/src/main/java/com/binay/shaw/justap/utils/LifeCycle.kt index d5471ca..f58423b 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/LifeCycle.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/LifeCycle.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner diff --git a/app/src/main/java/com/binay/shaw/justap/helper/LinksUtils.kt b/app/src/main/java/com/binay/shaw/justap/utils/LinksUtils.kt similarity index 98% rename from app/src/main/java/com/binay/shaw/justap/helper/LinksUtils.kt rename to app/src/main/java/com/binay/shaw/justap/utils/LinksUtils.kt index 301be48..14f7b2a 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/LinksUtils.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/LinksUtils.kt @@ -1,11 +1,11 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.content.Context import android.content.Intent import android.net.Uri import android.provider.ContactsContract import com.binay.shaw.justap.R -import com.binay.shaw.justap.model.Accounts +import com.binay.shaw.justap.domain.model.Accounts object LinksUtils { diff --git a/app/src/main/java/com/binay/shaw/justap/helper/Logger.kt b/app/src/main/java/com/binay/shaw/justap/utils/Logger.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/helper/Logger.kt rename to app/src/main/java/com/binay/shaw/justap/utils/Logger.kt index a5fb687..9fe8ce0 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/Logger.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/Logger.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.util.Log import com.binay.shaw.justap.BuildConfig diff --git a/app/src/main/java/com/binay/shaw/justap/helper/NotificationHelper.kt b/app/src/main/java/com/binay/shaw/justap/utils/NotificationHelper.kt similarity index 96% rename from app/src/main/java/com/binay/shaw/justap/helper/NotificationHelper.kt rename to app/src/main/java/com/binay/shaw/justap/utils/NotificationHelper.kt index 891d474..05df5bf 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/NotificationHelper.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/NotificationHelper.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.app.NotificationChannel import android.app.NotificationManager diff --git a/app/src/main/java/com/binay/shaw/justap/helper/QrExtensions.kt b/app/src/main/java/com/binay/shaw/justap/utils/QrExtensions.kt similarity index 98% rename from app/src/main/java/com/binay/shaw/justap/helper/QrExtensions.kt rename to app/src/main/java/com/binay/shaw/justap/utils/QrExtensions.kt index ed8d1ca..77f8e88 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/QrExtensions.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/QrExtensions.kt @@ -1,10 +1,10 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.graphics.Bitmap import android.graphics.Canvas import android.graphics.Matrix import android.graphics.Paint -import com.binay.shaw.justap.helper.ImageUtils.addBitmapOverlay +import com.binay.shaw.justap.utils.ImageUtils.addBitmapOverlay import com.google.zxing.BarcodeFormat import com.google.zxing.EncodeHintType import com.google.zxing.MultiFormatWriter diff --git a/app/src/main/java/com/binay/shaw/justap/helper/StringExtenstions.kt b/app/src/main/java/com/binay/shaw/justap/utils/StringExtenstions.kt similarity index 95% rename from app/src/main/java/com/binay/shaw/justap/helper/StringExtenstions.kt rename to app/src/main/java/com/binay/shaw/justap/utils/StringExtenstions.kt index 74fe297..1f39b4e 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/StringExtenstions.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/StringExtenstions.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils fun String.compressString(): String { val output = StringBuilder() diff --git a/app/src/main/java/com/binay/shaw/justap/helper/Util.kt b/app/src/main/java/com/binay/shaw/justap/utils/Util.kt similarity index 98% rename from app/src/main/java/com/binay/shaw/justap/helper/Util.kt rename to app/src/main/java/com/binay/shaw/justap/utils/Util.kt index 14bca58..3347d81 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/Util.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/Util.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.annotation.SuppressLint import android.app.Activity @@ -20,10 +20,9 @@ import android.view.View import android.widget.ImageView import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat -import androidx.lifecycle.lifecycleScope import com.binay.shaw.justap.R -import com.binay.shaw.justap.data.LocalUserDatabase -import com.binay.shaw.justap.ui.authentication.signInScreen.SignInScreen +import com.binay.shaw.justap.data.local.database.LocalUserDatabase +import com.binay.shaw.justap.presentation.auth.sign_in.SignInScreen import com.bumptech.glide.Glide import com.bumptech.glide.load.engine.DiskCacheStrategy import com.google.android.material.bottomsheet.BottomSheetBehavior diff --git a/app/src/main/java/com/binay/shaw/justap/helper/ValidationExtensions.kt b/app/src/main/java/com/binay/shaw/justap/utils/ValidationExtensions.kt similarity index 99% rename from app/src/main/java/com/binay/shaw/justap/helper/ValidationExtensions.kt rename to app/src/main/java/com/binay/shaw/justap/utils/ValidationExtensions.kt index 89c88b2..8346eea 100644 --- a/app/src/main/java/com/binay/shaw/justap/helper/ValidationExtensions.kt +++ b/app/src/main/java/com/binay/shaw/justap/utils/ValidationExtensions.kt @@ -1,4 +1,4 @@ -package com.binay.shaw.justap.helper +package com.binay.shaw.justap.utils import android.widget.EditText diff --git a/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt b/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt index 9ec2155..7fb20d6 100644 --- a/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt @@ -4,9 +4,9 @@ import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.LiveData import androidx.lifecycle.viewModelScope -import com.binay.shaw.justap.data.LocalUserDatabase -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.repository.AccountsRepository +import com.binay.shaw.justap.data.local.database.LocalUserDatabase +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.repository.AccountsRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/binay/shaw/justap/viewModel/FirebaseViewModel.kt b/app/src/main/java/com/binay/shaw/justap/viewModel/FirebaseViewModel.kt index f3c6b5e..83bc939 100644 --- a/app/src/main/java/com/binay/shaw/justap/viewModel/FirebaseViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/viewModel/FirebaseViewModel.kt @@ -2,12 +2,12 @@ package com.binay.shaw.justap.viewModel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import com.binay.shaw.justap.helper.Constants -import com.binay.shaw.justap.helper.Util -import com.binay.shaw.justap.model.Accounts -import com.binay.shaw.justap.model.LocalUser -import com.binay.shaw.justap.model.User -import com.binay.shaw.justap.repository.FirebaseRepository +import com.binay.shaw.justap.utils.Constants +import com.binay.shaw.justap.utils.Util +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.model.LocalUser +import com.binay.shaw.justap.domain.model.User +import com.binay.shaw.justap.domain.repository.FirebaseRepository import com.google.firebase.auth.FirebaseAuth import com.google.firebase.auth.FirebaseUser import com.google.firebase.database.* diff --git a/app/src/main/java/com/binay/shaw/justap/viewModel/LocalUserViewModel.kt b/app/src/main/java/com/binay/shaw/justap/viewModel/LocalUserViewModel.kt index 38d1f65..1544648 100644 --- a/app/src/main/java/com/binay/shaw/justap/viewModel/LocalUserViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/viewModel/LocalUserViewModel.kt @@ -4,9 +4,9 @@ import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.LiveData import androidx.lifecycle.viewModelScope -import com.binay.shaw.justap.data.LocalUserDatabase -import com.binay.shaw.justap.model.LocalUser -import com.binay.shaw.justap.repository.LocalUserRepository +import com.binay.shaw.justap.data.local.database.LocalUserDatabase +import com.binay.shaw.justap.domain.model.LocalUser +import com.binay.shaw.justap.domain.repository.LocalUserRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/res/layout/activity_forgot_password_screen.xml b/app/src/main/res/layout/activity_forgot_password_screen.xml index 37b440f..e9c3408 100644 --- a/app/src/main/res/layout/activity_forgot_password_screen.xml +++ b/app/src/main/res/layout/activity_forgot_password_screen.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" - tools:context=".ui.authentication.ForgotPasswordScreen"> + tools:context=".presentation.auth.ForgotPasswordScreen"> + tools:context=".presentation.main.MainActivity"> + tools:context=".presentation.auth.sign_up.SignUpScreen"> + tools:context=".presentation.intro.SplashActivity"> + tools:context=".presentation.main.homeScreen.accountFragments.AddEditFragment"> + tools:context=".presentation.main.settingsScreen.customize_qr.CustomizeQRFragment"> + tools:context=".presentation.main.settingsScreen.editScreen.EditProfileFragment"> + tools:context=".presentation.main.historyScreen.HistoryFragment"> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index aa09cf1..0f8772f 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" - tools:context=".ui.mainScreens.homeScreen.HomeFragment"> + tools:context=".presentation.main.homeScreen.HomeFragment"> + tools:context=".presentation.common.ImagePickerFragment"> + tools:context=".presentation.main.settingsScreen.profileScreen.ProfileFragment"> + tools:context=".presentation.main.qrScreens.qrGeneratorScreen.QRGeneratorFragment"> + tools:context=".presentation.main.qrScreens.ScannerFragment"> + tools:context=".presentation.main.resultScreen.ResultFragment"> + tools:context=".presentation.main.settingsScreen.SettingsFragment"> From 8e0baef3fc03269975df381a735522172d02881a Mon Sep 17 00:00:00 2001 From: Binay Shaw Date: Fri, 3 Jan 2025 09:15:20 +0530 Subject: [PATCH 2/6] di + new google services json --- .gitignore | 1 + app/build.gradle.kts | 8 ++++++++ app/google-services.json | 15 +++++++-------- build.gradle.kts | 1 + 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index aa724b7..70efd07 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ .externalNativeBuild .cxx local.properties +google-services.json \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d2f40dd..b366783 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,6 +6,7 @@ plugins { id ("androidx.navigation.safeargs.kotlin") id ("com.google.firebase.crashlytics") id ("kotlin-kapt") + id("com.google.dagger.hilt.android") id ("com.google.firebase.firebase-perf") } @@ -25,6 +26,7 @@ android { buildFeatures { viewBinding = true + buildConfig = true } buildTypes { @@ -71,6 +73,8 @@ dependencies { testImplementation ("com.google.truth:truth:1.1.3") androidTestImplementation ("androidx.test:runner:1.5.2") androidTestImplementation ("androidx.test:rules:1.5.0") + androidTestImplementation ("com.google.dagger:hilt-android-testing:2.48") + kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.48") //Navigation @@ -139,4 +143,8 @@ dependencies { // In-app update implementation ("com.google.android.play:core:1.10.3") + + //DaggerHilt + implementation("com.google.dagger:hilt-android:2.48") + kapt("com.google.dagger:hilt-compiler:2.48") } \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json index c766432..165a377 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -14,14 +14,6 @@ } }, "oauth_client": [ - { - "client_id": "142637459628-u67hofek1bj0348v6lg6frs0llgei2tv.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.binay.shaw.justap", - "certificate_hash": "a55e4867e32354cd2474df831f56db37aa5c6d56" - } - }, { "client_id": "142637459628-7u4ere6j7qr84f9pa09qcgp4rt0deneo.apps.googleusercontent.com", "client_type": 3 @@ -38,6 +30,13 @@ { "client_id": "142637459628-7u4ere6j7qr84f9pa09qcgp4rt0deneo.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "142637459628-e8tbnq5em1m960hg0r97u7tiuredi5u8.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.binayshaw7777.JusTap-iOS" + } } ] } diff --git a/build.gradle.kts b/build.gradle.kts index ae4ca47..010a4fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,5 +10,6 @@ plugins { id ("com.android.application") version "7.4.0" apply false id ("com.android.library") version "7.4.0" apply false id ("org.jetbrains.kotlin.android") version "1.8.10" apply false + id ("com.google.dagger.hilt.android") version "2.48" apply false id ("com.google.firebase.firebase-perf") version "1.4.2" apply false } \ No newline at end of file From 31c2e175005659f0c64818d66e05e9561f9eb1d5 Mon Sep 17 00:00:00 2001 From: Binay Shaw Date: Fri, 3 Jan 2025 09:16:08 +0530 Subject: [PATCH 3/6] changes --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 70efd07..e674f04 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ .externalNativeBuild .cxx local.properties -google-services.json \ No newline at end of file +/app/google-services.json \ No newline at end of file From 83c55faf9c00b9fd24c6f9f49b1f3036acdfade1 Mon Sep 17 00:00:00 2001 From: Binay Shaw Date: Fri, 3 Jan 2025 09:22:34 +0530 Subject: [PATCH 4/6] removed gs.json --- app/google-services.json | 47 ---------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 app/google-services.json diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 165a377..0000000 --- a/app/google-services.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "project_info": { - "project_number": "142637459628", - "firebase_url": "https://justap-7777-default-rtdb.asia-southeast1.firebasedatabase.app", - "project_id": "justap-7777", - "storage_bucket": "justap-7777.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:142637459628:android:5d3653dde857ae49d21709", - "android_client_info": { - "package_name": "com.binay.shaw.justap" - } - }, - "oauth_client": [ - { - "client_id": "142637459628-7u4ere6j7qr84f9pa09qcgp4rt0deneo.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChZPBIq_1FzYJjAmlhloqLHKB4q9upqI8" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "142637459628-7u4ere6j7qr84f9pa09qcgp4rt0deneo.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "142637459628-e8tbnq5em1m960hg0r97u7tiuredi5u8.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.binayshaw7777.JusTap-iOS" - } - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file From 1dfa049338a648957e084dfde008842922b87ee1 Mon Sep 17 00:00:00 2001 From: Binay Shaw Date: Fri, 3 Jan 2025 09:28:32 +0530 Subject: [PATCH 5/6] Remove google-services.json from Git tracking --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e674f04..cf75fbd 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ .externalNativeBuild .cxx local.properties -/app/google-services.json \ No newline at end of file +/app/google-services.json +google-services.json \ No newline at end of file From 2f8a6d6da31bf2df03923505adc70903b52eb8ac Mon Sep 17 00:00:00 2001 From: Binay Shaw Date: Fri, 3 Jan 2025 11:20:42 +0530 Subject: [PATCH 6/6] added dagger hilt with module --- app/build.gradle.kts | 1 + app/src/main/AndroidManifest.xml | 1 + .../main/java/com/binay/shaw/justap/JusTap.kt | 13 +++++ .../shaw/justap/base/ViewModelFactory.kt | 3 - .../data/local/database/LocalUserDatabase.kt | 17 +----- .../shaw/justap/data/local/db/AccountsDAO.kt | 17 ++++-- .../local/repository/AccountRepositoryImpl.kt | 28 ++++++++++ .../binay/shaw/justap/di/modules/AppModule.kt | 26 +++++++++ .../shaw/justap/di/modules/DatabaseModule.kt | 48 ++++++++++++++++ .../justap/di/modules/RepositoryModule.kt | 19 +++++++ .../domain/repository/AccountRepository.kt | 15 +++++ .../domain/repository/AccountsRepository.kt | 26 --------- .../presentation/auth/sign_in/SignInScreen.kt | 2 +- .../justap/presentation/main/MainActivity.kt | 3 +- .../main/homeScreen/HomeFragment.kt | 55 ++++++++++++------- .../accountFragments/AddEditFragment.kt | 2 +- .../justap/viewModel/AccountsViewModel.kt | 46 +++++++++------- build.gradle.kts | 3 +- gradle/wrapper/gradle-wrapper.properties | 6 +- 19 files changed, 234 insertions(+), 97 deletions(-) create mode 100644 app/src/main/java/com/binay/shaw/justap/JusTap.kt create mode 100644 app/src/main/java/com/binay/shaw/justap/data/local/repository/AccountRepositoryImpl.kt create mode 100644 app/src/main/java/com/binay/shaw/justap/di/modules/AppModule.kt create mode 100644 app/src/main/java/com/binay/shaw/justap/di/modules/DatabaseModule.kt create mode 100644 app/src/main/java/com/binay/shaw/justap/di/modules/RepositoryModule.kt create mode 100644 app/src/main/java/com/binay/shaw/justap/domain/repository/AccountRepository.kt delete mode 100644 app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b366783..df489be 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,6 +7,7 @@ plugins { id ("com.google.firebase.crashlytics") id ("kotlin-kapt") id("com.google.dagger.hilt.android") +// id("dagger.hilt.android.plugin") id ("com.google.firebase.firebase-perf") } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f8e539c..cbde1b3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -10,6 +10,7 @@ { EditProfileViewModel() } - isAssignableFrom(AccountsViewModel::class.java) -> { - AccountsViewModel(application) - } isAssignableFrom(LocalUserViewModel::class.java) -> { LocalUserViewModel(application) } diff --git a/app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt b/app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt index 409db0c..fe9bc9d 100644 --- a/app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt +++ b/app/src/main/java/com/binay/shaw/justap/data/local/database/LocalUserDatabase.kt @@ -16,10 +16,6 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch -/** - * Created by binay on 02,January,2023 - */ - @Database(entities = [LocalUser::class, Accounts::class, LocalHistory::class], version = 4) @TypeConverters(Converters::class) abstract class LocalUserDatabase : RoomDatabase() { @@ -32,24 +28,17 @@ abstract class LocalUserDatabase : RoomDatabase() { companion object { @Volatile - var INSTANCE: LocalUserDatabase? = null + private var INSTANCE: LocalUserDatabase? = null - @Synchronized fun getDatabase(context: Context): LocalUserDatabase { - - val tempInstance = INSTANCE - - if (tempInstance != null) { - return tempInstance - } - synchronized(this) { + return INSTANCE ?: synchronized(this) { val instance = Room.databaseBuilder( context.applicationContext, LocalUserDatabase::class.java, "account_database" ).build() INSTANCE = instance - return instance + instance } } } diff --git a/app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt b/app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt index b49fe30..25e8985 100644 --- a/app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt +++ b/app/src/main/java/com/binay/shaw/justap/data/local/db/AccountsDAO.kt @@ -1,22 +1,27 @@ package com.binay.shaw.justap.data.local.db -import androidx.lifecycle.LiveData -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query +import androidx.room.Update import com.binay.shaw.justap.domain.model.Accounts +import kotlinx.coroutines.flow.Flow @Dao interface AccountsDAO { @Insert(onConflict = OnConflictStrategy.IGNORE) - suspend fun insertAccount(accounts: Accounts) + suspend fun insertAccount(accounts: Accounts): Long @Delete - suspend fun deleteAccount(accounts: Accounts) + suspend fun deleteAccount(accounts: Accounts): Int @Update - suspend fun updateAccount(accounts: Accounts) + suspend fun updateAccount(accounts: Accounts): Int @Query(value = "SELECT * FROM accountsDB") - fun getAccountsList() : LiveData> + fun getAccountsList(): Flow> } \ No newline at end of file diff --git a/app/src/main/java/com/binay/shaw/justap/data/local/repository/AccountRepositoryImpl.kt b/app/src/main/java/com/binay/shaw/justap/data/local/repository/AccountRepositoryImpl.kt new file mode 100644 index 0000000..127beef --- /dev/null +++ b/app/src/main/java/com/binay/shaw/justap/data/local/repository/AccountRepositoryImpl.kt @@ -0,0 +1,28 @@ +package com.binay.shaw.justap.data.local.repository + +import com.binay.shaw.justap.data.local.db.AccountsDAO +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.repository.AccountRepository +import kotlinx.coroutines.flow.Flow +import javax.inject.Inject + +class AccountRepositoryImpl @Inject constructor( + private val accountsDao: AccountsDAO +) : AccountRepository { + + override suspend fun getAccounts(): Flow> { + return accountsDao.getAccountsList() + } + + override suspend fun insertAccount(accounts: Accounts): Long { + return accountsDao.insertAccount(accounts) + } + + override suspend fun deleteAccount(accounts: Accounts): Int { + return accountsDao.deleteAccount(accounts) + } + + override suspend fun updateAccount(accounts: Accounts): Int { + return accountsDao.updateAccount(accounts) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/binay/shaw/justap/di/modules/AppModule.kt b/app/src/main/java/com/binay/shaw/justap/di/modules/AppModule.kt new file mode 100644 index 0000000..bca02f8 --- /dev/null +++ b/app/src/main/java/com/binay/shaw/justap/di/modules/AppModule.kt @@ -0,0 +1,26 @@ +package com.binay.shaw.justap.di.modules + +import android.app.Application +import android.content.Context +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +object AppModule { + + @Provides + @Singleton + fun provideAppContext(app: Application): Context { + return app.applicationContext + } + +// @Provides +// @Singleton +// fun provideSharedPreferences(app: Application): SharedPreferences { +// return app.getSharedPreferences("Settings", Context.MODE_PRIVATE) +// } +} diff --git a/app/src/main/java/com/binay/shaw/justap/di/modules/DatabaseModule.kt b/app/src/main/java/com/binay/shaw/justap/di/modules/DatabaseModule.kt new file mode 100644 index 0000000..a49f28a --- /dev/null +++ b/app/src/main/java/com/binay/shaw/justap/di/modules/DatabaseModule.kt @@ -0,0 +1,48 @@ +package com.binay.shaw.justap.di.modules + +import android.content.Context +import androidx.room.Room +import com.binay.shaw.justap.data.local.database.LocalUserDatabase +import com.binay.shaw.justap.data.local.db.AccountsDAO +import com.binay.shaw.justap.data.local.db.LocalHistoryDAO +import com.binay.shaw.justap.data.local.db.LocalUserDAO +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +object DatabaseModule { + + // Provides the LocalUserDatabase instance + @Provides + @Singleton + fun provideLocalUserDatabase(context: Context): LocalUserDatabase { + return Room.databaseBuilder( + context.applicationContext, + LocalUserDatabase::class.java, + "account_database" + ).fallbackToDestructiveMigration() + .build() + } + + // Provides LocalUserDAO from the database + @Provides + fun provideLocalUserDao(database: LocalUserDatabase): LocalUserDAO { + return database.localUserDao() + } + + // Provides AccountsDAO from the database + @Provides + fun provideAccountsDao(database: LocalUserDatabase): AccountsDAO { + return database.accountsDao() + } + + // Provides LocalHistoryDAO from the database + @Provides + fun provideLocalHistoryDao(database: LocalUserDatabase): LocalHistoryDAO { + return database.localUserHistoryDao() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/binay/shaw/justap/di/modules/RepositoryModule.kt b/app/src/main/java/com/binay/shaw/justap/di/modules/RepositoryModule.kt new file mode 100644 index 0000000..cc9fe22 --- /dev/null +++ b/app/src/main/java/com/binay/shaw/justap/di/modules/RepositoryModule.kt @@ -0,0 +1,19 @@ +package com.binay.shaw.justap.di.modules + +import com.binay.shaw.justap.data.local.db.AccountsDAO +import com.binay.shaw.justap.data.local.repository.AccountRepositoryImpl +import com.binay.shaw.justap.domain.repository.AccountRepository +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent + +@Module +@InstallIn(SingletonComponent::class) +object RepositoryModule { + + @Provides + fun provideAccountRepository(accountsDAO: AccountsDAO): AccountRepository { + return AccountRepositoryImpl(accountsDAO) + } +} diff --git a/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountRepository.kt b/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountRepository.kt new file mode 100644 index 0000000..c3fc2ac --- /dev/null +++ b/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountRepository.kt @@ -0,0 +1,15 @@ +package com.binay.shaw.justap.domain.repository + +import com.binay.shaw.justap.domain.model.Accounts +import kotlinx.coroutines.flow.Flow + +interface AccountRepository { + + suspend fun getAccounts(): Flow> + + suspend fun insertAccount(accounts: Accounts): Long + + suspend fun deleteAccount(accounts: Accounts): Int + + suspend fun updateAccount(accounts: Accounts): Int +} \ No newline at end of file diff --git a/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt b/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt deleted file mode 100644 index fe66d60..0000000 --- a/app/src/main/java/com/binay/shaw/justap/domain/repository/AccountsRepository.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.binay.shaw.justap.domain.repository - -import androidx.lifecycle.LiveData -import com.binay.shaw.justap.data.local.db.AccountsDAO -import com.binay.shaw.justap.domain.model.Accounts - - -class AccountsRepository( - private val accountsDAO: AccountsDAO -) { - - val getAccountsList: LiveData> = accountsDAO.getAccountsList() - - suspend fun insertAccount(accounts: Accounts) { - accountsDAO.insertAccount(accounts) - } - - suspend fun deleteAccount(accounts: Accounts) { - accountsDAO.deleteAccount(accounts) - } - - suspend fun updateAccount(accounts: Accounts) { - accountsDAO.updateAccount(accounts) - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt b/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt index fb1855e..00bb9de 100644 --- a/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/auth/sign_in/SignInScreen.kt @@ -24,7 +24,7 @@ import com.binay.shaw.justap.viewModel.LocalUserViewModel class SignInScreen : BaseActivity() { private lateinit var binding: ActivitySignInScreenBinding - private val accountsViewModel by viewModels { ViewModelFactory() } + private val accountsViewModel: AccountsViewModel by viewModels() private val localUserViewModel by viewModels { ViewModelFactory() } private val firebaseViewModel by viewModels { ViewModelFactory() } private var isPasswordVisible = false diff --git a/app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt index 94c522d..e85c752 100644 --- a/app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/MainActivity.kt @@ -13,8 +13,9 @@ import com.binay.shaw.justap.R import com.binay.shaw.justap.base.BaseActivity import com.binay.shaw.justap.databinding.ActivityMainBinding import com.google.android.material.bottomnavigation.BottomNavigationView +import dagger.hilt.android.AndroidEntryPoint - +@AndroidEntryPoint class MainActivity : BaseActivity() { private var timer = 0L diff --git a/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt index ce4226f..84a455c 100644 --- a/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/HomeFragment.kt @@ -7,6 +7,7 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import com.binay.shaw.justap.R @@ -15,24 +16,28 @@ import com.binay.shaw.justap.base.BaseFragment import com.binay.shaw.justap.base.ViewModelFactory import com.binay.shaw.justap.databinding.FragmentHomeBinding import com.binay.shaw.justap.databinding.ParagraphModalBinding +import com.binay.shaw.justap.domain.model.Accounts +import com.binay.shaw.justap.domain.model.LocalUser +import com.binay.shaw.justap.presentation.main.homeScreen.accountFragments.AddEditViewModel import com.binay.shaw.justap.utils.ImageUtils import com.binay.shaw.justap.utils.Util import com.binay.shaw.justap.utils.Util.createBottomSheet import com.binay.shaw.justap.utils.Util.setBottomSheet -import com.binay.shaw.justap.domain.model.Accounts -import com.binay.shaw.justap.domain.model.LocalUser import com.binay.shaw.justap.viewModel.AccountsViewModel -import com.binay.shaw.justap.presentation.main.homeScreen.accountFragments.AddEditViewModel import com.binay.shaw.justap.viewModel.LocalUserViewModel +import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch +@AndroidEntryPoint @SuppressLint("SetTextI18n", "NotifyDataSetChanged") class HomeFragment : BaseFragment() { private var _binding: FragmentHomeBinding? = null private val binding get() = _binding!! private val localUserViewModel by viewModels { ViewModelFactory() } - private val accountsViewModel by viewModels { ViewModelFactory() } + private val accountsViewModel: AccountsViewModel by viewModels() private lateinit var localUser: LocalUser private var accountsList = mutableListOf() private lateinit var recyclerViewAdapter: AccountsItemAdapter @@ -44,8 +49,8 @@ class HomeFragment : BaseFragment() { ): View { _binding = FragmentHomeBinding.inflate(layoutInflater, container, false) - initObservers() initialization() + initObservers() clickHandlers() return binding.root @@ -54,7 +59,11 @@ class HomeFragment : BaseFragment() { private fun initObservers() { addEditViewModel.updateStatus.observe(viewLifecycleOwner) { if (it == 3) { - Toast.makeText(requireContext(), resources.getString(R.string.data_added_successfully), Toast.LENGTH_SHORT).show() + Toast.makeText( + requireContext(), + resources.getString(R.string.data_added_successfully), + Toast.LENGTH_SHORT + ).show() addEditViewModel.updateStatus.value = 0 recyclerViewAdapter.notifyDataSetChanged() } @@ -80,13 +89,15 @@ class HomeFragment : BaseFragment() { } } - accountsViewModel.getAllUser.observe(viewLifecycleOwner) { - Util.log(it.toString()) - updateEmptyState(it) - accountsList.clear() - accountsList.addAll(it) - recyclerViewAdapter.setData(it) - recyclerViewAdapter.notifyDataSetChanged() + lifecycleScope.launch { + accountsViewModel.accounts.collect { + Util.log(it.toString()) + updateEmptyState(it) + accountsList.clear() + accountsList.addAll(it) + recyclerViewAdapter.setData(it) + recyclerViewAdapter.notifyDataSetChanged() + } } } @@ -151,15 +162,17 @@ class HomeFragment : BaseFragment() { val unusedAccounts = mutableListOf() val usedAccounts = mutableListOf() - accountsViewModel.getAllUser.observe(viewLifecycleOwner) { - val allAccounts = resources.getStringArray(R.array.account_names) - for (l in it) { - usedAccounts.add(l.accountName) - } + lifecycleScope.launch { + accountsViewModel.accounts.collectLatest { + val allAccounts = resources.getStringArray(R.array.account_names) + for (l in it) { + usedAccounts.add(l.accountName) + } - for (account in allAccounts) { - if (!usedAccounts.contains(account)) - unusedAccounts.add(account) + for (account in allAccounts) { + if (!usedAccounts.contains(account)) + unusedAccounts.add(account) + } } } Util.unusedAccounts = unusedAccounts diff --git a/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt index a01b412..32eb49e 100644 --- a/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt +++ b/app/src/main/java/com/binay/shaw/justap/presentation/main/homeScreen/accountFragments/AddEditFragment.kt @@ -35,7 +35,7 @@ class AddEditFragment : BaseFragment() { private val binding get() = _binding!! private val args: AddEditFragmentArgs by navArgs() private val viewModel by viewModels { ViewModelFactory() } - private val accountsViewModel by viewModels { ViewModelFactory() } + private val accountsViewModel: AccountsViewModel by viewModels() override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, diff --git a/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt b/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt index 7fb20d6..5488868 100644 --- a/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt +++ b/app/src/main/java/com/binay/shaw/justap/viewModel/AccountsViewModel.kt @@ -1,44 +1,50 @@ package com.binay.shaw.justap.viewModel -import android.app.Application -import androidx.lifecycle.AndroidViewModel -import androidx.lifecycle.LiveData +import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.binay.shaw.justap.data.local.database.LocalUserDatabase import com.binay.shaw.justap.domain.model.Accounts -import com.binay.shaw.justap.domain.repository.AccountsRepository +import com.binay.shaw.justap.domain.repository.AccountRepository +import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.launch +import javax.inject.Inject -class AccountsViewModel( - application: Application -) : AndroidViewModel(application) { +@HiltViewModel +class AccountsViewModel @Inject constructor( + private val repository: AccountRepository +) : ViewModel() { - val getAllUser : LiveData> - private val repository: AccountsRepository + var accounts = MutableStateFlow>(emptyList()) + private set init { - val dao = LocalUserDatabase.getDatabase(application).accountsDao() - repository = AccountsRepository(dao) - getAllUser = repository.getAccountsList + runIO { + repository.getAccounts().collect { + accounts.value = it + } + } } - fun deleteAccount(accounts: Accounts) = - viewModelScope.launch(Dispatchers.IO) { - repository.deleteAccount(accounts) - } + fun deleteAccount(accounts: Accounts) = runIO { + repository.deleteAccount(accounts) + } fun updateAccount(accounts: Accounts) = viewModelScope.launch(Dispatchers.IO) { repository.updateAccount(accounts) } - fun insertAccount(accounts: Accounts) = + fun insertAccount(accounts: Accounts) = runIO { + repository.insertAccount(accounts) + } + + private fun runIO(block: suspend () -> Unit) { viewModelScope.launch(Dispatchers.IO) { - repository.insertAccount(accounts) + block() } - + } } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 010a4fa..4f8bd07 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,10 +4,11 @@ buildscript { classpath ("com.google.gms:google-services:4.3.15") classpath ("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3") classpath ("com.google.firebase:firebase-crashlytics-gradle:2.9.4") + classpath ("com.google.dagger:hilt-android-gradle-plugin:2.48") } } plugins { - id ("com.android.application") version "7.4.0" apply false + id ("com.android.application") version "8.1.0" apply false id ("com.android.library") version "7.4.0" apply false id ("org.jetbrains.kotlin.android") version "1.8.10" apply false id ("com.google.dagger.hilt.android") version "2.48" apply false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 877ddbe..be53dae 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jan 16 01:25:17 IST 2023 +#Fri Jan 03 09:51:16 IST 2025 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists