From 6c054cdc5f4fe02689bc72c3f149d951a7245ee7 Mon Sep 17 00:00:00 2001 From: Deep Vora Date: Fri, 17 Jan 2025 09:25:42 -0500 Subject: [PATCH 1/3] added smooth prompt --- .../myplanet/ui/exam/BaseExamFragment.kt | 21 +++++++++++++++++-- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-ne/strings.xml | 1 + app/src/main/res/values-so/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 9 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/exam/BaseExamFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/exam/BaseExamFragment.kt index b0986ae8a7..bdc0c0ff85 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/exam/BaseExamFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/exam/BaseExamFragment.kt @@ -26,8 +26,11 @@ import org.ole.planet.myplanet.model.RealmStepExam import org.ole.planet.myplanet.model.RealmSubmission import org.ole.planet.myplanet.model.RealmSubmitPhotos import org.ole.planet.myplanet.model.RealmUserModel +import org.ole.planet.myplanet.ui.courses.TakeCourseFragment.Companion.userModel +import org.ole.planet.myplanet.ui.submission.MySubmissionFragment import org.ole.planet.myplanet.ui.survey.SurveyFragment import org.ole.planet.myplanet.utilities.CameraUtils.ImageCaptureCallback +import org.ole.planet.myplanet.utilities.DialogUtils import org.ole.planet.myplanet.utilities.NetworkUtils.getUniqueIdentifier import org.ole.planet.myplanet.utilities.Utilities import java.util.Date @@ -117,14 +120,28 @@ abstract class BaseExamFragment : Fragment(), ImageCaptureCallback { showUserInfoDialog() } else { saveCourseProgress() - AlertDialog.Builder(requireActivity(), R.style.AlertDialogTheme) + AlertDialog.Builder(requireActivity(), R.style.CustomAlertDialog) .setTitle(getString(R.string.thank_you_for_taking_this) + type + getString(R.string.we_wish_you_all_the_best)) - .setPositiveButton("Finish") { _: DialogInterface?, _: Int -> + .setNegativeButton("Finish") { _: DialogInterface?, _: Int -> parentFragmentManager.popBackStack() + } + .setPositiveButton(R.string.view_your_mySubmissions) { dialog: DialogInterface, _: Int -> + if (userModel?.id?.startsWith("guest") == true) { + DialogUtils.guestDialog(requireContext()) + } else { + redirectToMySubmissions(); + } }.show() } } + private fun redirectToMySubmissions(){ + val fragment = MySubmissionFragment.newInstance("exam") + parentFragmentManager.beginTransaction() + .replace(R.id.fragment_container, fragment) + .addToBackStack(null) + .commit() + } private fun saveCourseProgress() { val progress = mRealm.where(RealmCourseProgress::class.java) .equalTo("courseId", exam?.courseId) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 2a3b5eea2b..157ed073e9 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -713,6 +713,7 @@ التاريخ مطلوب تمت إضافة المعاملة "شكرًا لك على إجراء هذا " + عرض تقديماتك . نتمنى لك كل التوفيق شكرًا لك على إجراء هذا الاستبيان. اكتمل diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9b2cc819ac..b27526ae36 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -713,6 +713,7 @@ Se requiere una fecha Transacción agregada "Gracias por realizar este " + Ver tus envíos . Te deseamos lo mejor Gracias por completar esta encuesta. completa diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0efd6a03ee..2dce5ce05d 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -713,6 +713,7 @@ La date est requise Transaction ajoutée Merci d\'avoir pris ce(s) " + Voir vos soumissions . Nous vous souhaitons tout le meilleur Merci d\'avoir participé à cette enquête. complète diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 2a65bedbd0..276db0cc2d 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -713,6 +713,7 @@ मिति आवश्यक छ लेखा थपियो "यो लिनुको लागि धन्यवाद " + तपाईंका पेशाहरू हेर्नुहोस् । हामीले तपाईंलाई सबै भन्दा राम्रो शुभकामना दिन्छौं यो सर्वेक्षण लिनको लागि धन्यवाद। समाप्त diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index 813199cd8e..f30e0240a2 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -713,6 +713,7 @@ Taariikhdu waa loo baahan yahay Hawlasha lagu daray "Mahadsanid in aad la qaato " + Eeg soo gudbintaada . Waxaan kugu rajaynaynaa dhammaan khayrka Mahadsanid in aad iska soo qaatay suuragal Buuxi diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a13d1b6193..6a7b5d0341 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -713,6 +713,7 @@ Date is required Transaction added "Thank you for taking this " + View your Submissions . We wish you all the best Thank you for taking this survey. complete diff --git a/build.gradle b/build.gradle index 165ae40c79..7a939c10f0 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.7.3' + classpath 'com.android.tools.build:gradle:8.8.0' classpath "io.realm:realm-gradle-plugin:10.19.0" classpath "com.google.dagger:hilt-android-gradle-plugin:2.55" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 518e3f2f2a..b6be146f8e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Oct 02 15:46:08 EAT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 94518461d7d9bedf2a0777fda6118004a57cdb4e Mon Sep 17 00:00:00 2001 From: Deep Vora <70479785+deeppp15@users.noreply.github.com> Date: Fri, 17 Jan 2025 09:30:23 -0500 Subject: [PATCH 2/3] Update build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7a939c10f0..165ae40c79 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.8.0' + classpath 'com.android.tools.build:gradle:8.7.3' classpath "io.realm:realm-gradle-plugin:10.19.0" classpath "com.google.dagger:hilt-android-gradle-plugin:2.55" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" From 1e4e518d71602c586d0530ecf5013dc5ca9f1484 Mon Sep 17 00:00:00 2001 From: Deep Vora <70479785+deeppp15@users.noreply.github.com> Date: Fri, 17 Jan 2025 09:31:18 -0500 Subject: [PATCH 3/3] Update gradle-wrapper.properties --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b6be146f8e..518e3f2f2a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Oct 02 15:46:08 EAT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists