Skip to content

Commit

Permalink
added smooth prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppp15 authored and Okuro3499 committed Feb 3, 2025
1 parent f3b8222 commit 15e5085
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
<string name="date_is_required">التاريخ مطلوب</string>
<string name="transaction_added">تمت إضافة المعاملة</string>
<string name="thank_you_for_taking_this">"شكرًا لك على إجراء هذا "</string>
<string name="view_your_mySubmissions">عرض تقديماتك</string>
<string name="we_wish_you_all_the_best">. نتمنى لك كل التوفيق</string>
<string name="thank_you_for_taking_this_survey">شكرًا لك على إجراء هذا الاستبيان.</string>
<string name="complete">اكتمل</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@
<string name="date_is_required">Se requiere una fecha</string>
<string name="transaction_added">Transacción agregada</string>
<string name="thank_you_for_taking_this">"Gracias por realizar este "</string>
<string name="view_your_mySubmissions">Ver tus envíos</string>
<string name="we_wish_you_all_the_best">. Te deseamos lo mejor</string>
<string name="thank_you_for_taking_this_survey">Gracias por completar esta encuesta.</string>
<string name="complete">completa</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
<string name="date_is_required">La date est requise</string>
<string name="transaction_added">Transaction ajoutée</string>
<string name="thank_you_for_taking_this">Merci d\'avoir pris ce(s) "</string>
<string name="view_your_mySubmissions">Voir vos soumissions</string>
<string name="we_wish_you_all_the_best">. Nous vous souhaitons tout le meilleur</string>
<string name="thank_you_for_taking_this_survey">Merci d\'avoir participé à cette enquête.</string>
<string name="complete">complète</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ne/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
<string name="date_is_required">मिति आवश्यक छ</string>
<string name="transaction_added">लेखा थपियो</string>
<string name="thank_you_for_taking_this">"यो लिनुको लागि धन्यवाद "</string>
<string name="view_your_mySubmissions">तपाईंका पेशाहरू हेर्नुहोस्</string>
<string name="we_wish_you_all_the_best">। हामीले तपाईंलाई सबै भन्दा राम्रो शुभकामना दिन्छौं</string>
<string name="thank_you_for_taking_this_survey">यो सर्वेक्षण लिनको लागि धन्यवाद।</string>
<string name="complete">समाप्त</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-so/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
<string name="date_is_required">Taariikhdu waa loo baahan yahay</string>
<string name="transaction_added">Hawlasha lagu daray</string>
<string name="thank_you_for_taking_this">"Mahadsanid in aad la qaato "</string>
<string name="view_your_mySubmissions">Eeg soo gudbintaada</string>
<string name="we_wish_you_all_the_best">. Waxaan kugu rajaynaynaa dhammaan khayrka</string>
<string name="thank_you_for_taking_this_survey">Mahadsanid in aad iska soo qaatay suuragal</string>
<string name="complete">Buuxi</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
<string name="date_is_required">Date is required</string>
<string name="transaction_added">Transaction added</string>
<string name="thank_you_for_taking_this">"Thank you for taking this "</string>
<string name="view_your_mySubmissions">View your Submissions</string>
<string name="we_wish_you_all_the_best">. We wish you all the best</string>
<string name="thank_you_for_taking_this_survey">Thank you for taking this survey.</string>
<string name="complete">complete</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 15e5085

Please sign in to comment.