From 94c4a6b02d5bba65dd274246d32ffac087850d4a Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Wed, 15 Jan 2025 22:17:15 +0300 Subject: [PATCH 01/16] mylife: display myhealth records (fixes #5024) (#5025) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../org/ole/planet/myplanet/MainApplication.kt | 1 + .../myplanet/service/TransactionSyncManager.kt | 5 +++-- .../ui/dashboard/BellDashboardFragment.kt | 12 ++++++++++++ .../ui/myhealth/AdapterHealthExamination.kt | 4 ++-- .../myplanet/ui/myhealth/MyHealthFragment.kt | 12 ++++++------ .../ui/userprofile/UserProfileFragment.kt | 16 ++++++++-------- .../ole/planet/myplanet/utilities/Utilities.kt | 2 +- 8 files changed, 35 insertions(+), 21 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index beb39e5dab..56209eaf25 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2199 - versionName "0.21.99" + versionCode 2200 + versionName "0.22.0" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/MainApplication.kt b/app/src/main/java/org/ole/planet/myplanet/MainApplication.kt index 70c0049d1f..a2253cc769 100644 --- a/app/src/main/java/org/ole/planet/myplanet/MainApplication.kt +++ b/app/src/main/java/org/ole/planet/myplanet/MainApplication.kt @@ -64,6 +64,7 @@ class MainApplication : Application(), Application.ActivityLifecycleCallbacks { var isCollectionSwitchOn = false var showDownload = false var isSyncRunning = false + var showHealthDialog = true var listener: TeamPageListener? = null val androidId: String get() { try { diff --git a/app/src/main/java/org/ole/planet/myplanet/service/TransactionSyncManager.kt b/app/src/main/java/org/ole/planet/myplanet/service/TransactionSyncManager.kt index 607e118887..63c32c8f77 100644 --- a/app/src/main/java/org/ole/planet/myplanet/service/TransactionSyncManager.kt +++ b/app/src/main/java/org/ole/planet/myplanet/service/TransactionSyncManager.kt @@ -80,11 +80,12 @@ object TransactionSyncManager { val apiInterface = client?.create(ApiInterface::class.java) val response: Response? try { - response = apiInterface?.getDocuments(header, Utilities.getUrl() + "/" + table + "/_all_docs")?.execute() + response = apiInterface?.getDocuments(header, "${Utilities.getUrl()}/$table/_all_docs")?.execute() val ob = response?.body() if (ob != null && ob.rows?.isNotEmpty() == true) { val r = ob.rows!![0] - val jsonDoc = apiInterface?.getJsonObject(header, Utilities.getUrl() + "/" + table + "/" + r.id)?.execute()?.body() + val jsonDoc = apiInterface.getJsonObject(header, "${Utilities.getUrl()}/$table/${r.id}") + .execute().body() userModel?.key = getString("key", jsonDoc) userModel?.iv = getString("iv", jsonDoc) } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt index 2af41dabbe..8c30778460 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt @@ -1,6 +1,8 @@ package org.ole.planet.myplanet.ui.dashboard +import android.content.DialogInterface import android.os.Bundle +import android.text.TextUtils import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -17,6 +19,7 @@ import androidx.recyclerview.widget.RecyclerView import io.realm.Case import io.realm.Realm import kotlinx.coroutines.* +import org.ole.planet.myplanet.MainApplication import org.ole.planet.myplanet.R import org.ole.planet.myplanet.databinding.FragmentHomeBellBinding import org.ole.planet.myplanet.model.RealmCertification @@ -62,6 +65,15 @@ class BellDashboardFragment : BaseDashboardFragment() { (activity as DashboardActivity?)?.supportActionBar?.hide() showBadges() checkPendingSurveys() + + if (model?.id?.startsWith("guest") == false && TextUtils.isEmpty(model?.key) && MainApplication.showHealthDialog) { + AlertDialog.Builder(requireActivity()) + .setMessage(getString(R.string.health_record_not_available_sync_health_data)) + .setPositiveButton(getString(R.string.sync)) { _: DialogInterface?, _: Int -> + syncKeyId() + MainApplication.showHealthDialog = false + }.setNegativeButton(getString(R.string.cancel), null).show() + } } private fun setupNetworkStatusMonitoring() { diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/AdapterHealthExamination.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/AdapterHealthExamination.kt index e597a53c29..669750106e 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/AdapterHealthExamination.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/AdapterHealthExamination.kt @@ -61,7 +61,7 @@ class AdapterHealthExamination(private val context: Context, private val list: L rowExaminationBinding.txtPulse.text = list?.get(position)?.let { checkEmptyInt(it.pulse) } rowExaminationBinding.txtBp.text = list?.get(position)?.bp rowExaminationBinding.txtHearing.text = list?.get(position)?.hearing - rowExaminationBinding.txtHearing.text = list?.get(position)?.let { checkEmpty(it.height) } + rowExaminationBinding.txtHeight.text = list?.get(position)?.let { checkEmpty(it.height) } rowExaminationBinding.txtWeight.text = list?.get(position)?.let { checkEmpty(it.weight) } rowExaminationBinding.txtVision.text = list?.get(position)?.vision holder.itemView.setOnClickListener { @@ -97,7 +97,7 @@ class AdapterHealthExamination(private val context: Context, private val list: L if (realmExamination != null) { if (realmExamination.date >= time) { dialog.setButton(DialogInterface.BUTTON_NEUTRAL, context.getString(R.string.edit)) { _: DialogInterface?, _: Int -> context.startActivity(Intent(context, AddExaminationActivity::class.java) - .putExtra("id", list?.get(position)?._id) + .putExtra("id", list[position]._id) .putExtra("userId", mh._id)) } } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt index c4c73a94c1..51b0c4b61b 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt @@ -67,7 +67,7 @@ class MyHealthFragment : Fragment() { val now = Calendar.getInstance() val dpd = DatePickerDialog(requireContext(), { _, year, month, dayOfMonth -> val selectedDate = String.format(Locale.US, "%04d-%02d-%02dT00:00:00.000Z", year, month + 1, dayOfMonth) - fragmentVitalSignBinding.txtDob.setText(selectedDate) + fragmentVitalSignBinding.txtDob.text = selectedDate }, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH)) dpd.show() } @@ -205,11 +205,11 @@ class MyHealthFragment : Fragment() { return } val myHealths = mm.profile - fragmentVitalSignBinding.txtOtherNeed.text = Utilities.checkNA(myHealths?.notes!!) - fragmentVitalSignBinding.txtSpecialNeeds.text = Utilities.checkNA(myHealths.specialNeeds) - fragmentVitalSignBinding.txtBirthPlace.text = Utilities.checkNA(userModel?.birthPlace!!) - fragmentVitalSignBinding.txtEmergencyContact.text = getString(R.string.emergency_contact_details, Utilities.checkNA(myHealths.emergencyContactName), - Utilities.checkNA(myHealths.emergencyContactName), Utilities.checkNA(myHealths.emergencyContact)).trimIndent() + fragmentVitalSignBinding.txtOtherNeed.text = Utilities.checkNA("${myHealths?.notes}") + fragmentVitalSignBinding.txtSpecialNeeds.text = Utilities.checkNA("${myHealths?.specialNeeds}") + fragmentVitalSignBinding.txtBirthPlace.text = Utilities.checkNA("${userModel?.birthPlace}") + fragmentVitalSignBinding.txtEmergencyContact.text = getString(R.string.emergency_contact_details, Utilities.checkNA("${myHealths?.emergencyContactName}"), + Utilities.checkNA("${myHealths?.emergencyContactName}"), Utilities.checkNA("${myHealths?.emergencyContact}")).trimIndent() val list = getExaminations(mm) val adap = AdapterHealthExamination(requireActivity(), list, mh, userModel) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/UserProfileFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/UserProfileFragment.kt index 4782e89ee9..5c893870a1 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/UserProfileFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/UserProfileFragment.kt @@ -103,12 +103,12 @@ class UserProfileFragment : Fragment() { } else { model?.name ?: "" } - fragmentUserProfileBinding.txtEmail.text = getString(R.string.two_strings, getString(R.string.email_colon), Utilities.checkNA(model?.email)) + fragmentUserProfileBinding.txtEmail.text = getString(R.string.two_strings, getString(R.string.email_colon), Utilities.checkNA("${model?.email}")) val dob = if (TextUtils.isEmpty(model?.dob)) "N/A" else TimeUtils.getFormatedDate(model?.dob, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") fragmentUserProfileBinding.txtDob.text = getString(R.string.two_strings, getString(R.string.date_of_birth), dob) - fragmentUserProfileBinding.txtGender.text = getString(R.string.gender_colon, Utilities.checkNA(model?.gender)) - fragmentUserProfileBinding.txtLanguage.text = getString(R.string.two_strings, getString(R.string.language_colon), Utilities.checkNA(model?.language)) - fragmentUserProfileBinding.txtLevel.text = getString(R.string.level_colon, Utilities.checkNA(model?.level)) + fragmentUserProfileBinding.txtGender.text = getString(R.string.gender_colon, Utilities.checkNA("${model?.gender}")) + fragmentUserProfileBinding.txtLanguage.text = getString(R.string.two_strings, getString(R.string.language_colon), Utilities.checkNA("${model?.language}")) + fragmentUserProfileBinding.txtLevel.text = getString(R.string.level_colon, Utilities.checkNA("${model?.level}")) model?.userImage.let { Glide.with(requireContext()) @@ -303,12 +303,12 @@ class UserProfileFragment : Fragment() { private fun updateUIWithUserData(model: RealmUserModel?) { model?.let { fragmentUserProfileBinding.txtName.text = String.format("%s %s %s", it.firstName, it.middleName, it.lastName) - fragmentUserProfileBinding.txtEmail.text = getString(R.string.two_strings, getString(R.string.email_colon), Utilities.checkNA(it.email)) + fragmentUserProfileBinding.txtEmail.text = getString(R.string.two_strings, getString(R.string.email_colon), Utilities.checkNA("${it.email}")) val dob = if (TextUtils.isEmpty(it.dob)) "N/A" else TimeUtils.getFormatedDate(it.dob, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") fragmentUserProfileBinding.txtDob.text = getString(R.string.two_strings, getString(R.string.date_of_birth), dob) - fragmentUserProfileBinding.txtGender.text = getString(R.string.gender_colon, Utilities.checkNA(it.gender)) - fragmentUserProfileBinding.txtLanguage.text = getString(R.string.two_strings, getString(R.string.language_colon), Utilities.checkNA(it.language)) - fragmentUserProfileBinding.txtLevel.text = getString(R.string.level_colon, Utilities.checkNA(it.level)) + fragmentUserProfileBinding.txtGender.text = getString(R.string.gender_colon, Utilities.checkNA("${it.gender}")) + fragmentUserProfileBinding.txtLanguage.text = getString(R.string.two_strings, getString(R.string.language_colon), Utilities.checkNA("${it.language}")) + fragmentUserProfileBinding.txtLevel.text = getString(R.string.level_colon, Utilities.checkNA("${it.level}")) } } diff --git a/app/src/main/java/org/ole/planet/myplanet/utilities/Utilities.kt b/app/src/main/java/org/ole/planet/myplanet/utilities/Utilities.kt index f6c9fa1aeb..8c44bba418 100644 --- a/app/src/main/java/org/ole/planet/myplanet/utilities/Utilities.kt +++ b/app/src/main/java/org/ole/planet/myplanet/utilities/Utilities.kt @@ -78,7 +78,7 @@ object Utilities { .uncheckedTextColor(Color.parseColor("#000000")) } - fun checkNA(s: String?): String? { + fun checkNA(s: String): String { return if (TextUtils.isEmpty(s)) "N/A" else s } From 29f0f0d80d4159df28b14f2cbe22a814faac86ac Mon Sep 17 00:00:00 2001 From: Avinash Sharma <133222313+Avinash-Codes@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:53:38 +0530 Subject: [PATCH 02/16] all: smoother disclaimer link (fixes #5017) (#5018) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../myplanet/ui/dashboard/DisclaimerFragment.kt | 14 ++++++++++---- app/src/main/res/layout/fragment_disclaimer.xml | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 56209eaf25..ad11a20135 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2200 - versionName "0.22.0" + versionCode 2201 + versionName "0.22.1" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DisclaimerFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DisclaimerFragment.kt index 30269d594a..3a5efe714e 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DisclaimerFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DisclaimerFragment.kt @@ -1,20 +1,26 @@ package org.ole.planet.myplanet.ui.dashboard import android.os.Bundle -import android.text.Html +import android.text.method.LinkMovementMethod import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.text.HtmlCompat import androidx.fragment.app.Fragment +import org.ole.planet.myplanet.R import org.ole.planet.myplanet.databinding.FragmentDisclaimerBinding -import org.ole.planet.myplanet.utilities.Constants class DisclaimerFragment : Fragment() { private lateinit var fragmentDisclaimerBinding: FragmentDisclaimerBinding + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { fragmentDisclaimerBinding = FragmentDisclaimerBinding.inflate(inflater, container, false) - fragmentDisclaimerBinding.tvDisclaimer.text = Html.fromHtml(getString(Constants.DISCLAIMER), HtmlCompat.FROM_HTML_MODE_LEGACY) return fragmentDisclaimerBinding.root } -} \ No newline at end of file + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + fragmentDisclaimerBinding.tvDisclaimer.text = HtmlCompat.fromHtml(getString(R.string.disclaimer), HtmlCompat.FROM_HTML_MODE_LEGACY) + fragmentDisclaimerBinding.tvDisclaimer.movementMethod = LinkMovementMethod.getInstance() + } +} diff --git a/app/src/main/res/layout/fragment_disclaimer.xml b/app/src/main/res/layout/fragment_disclaimer.xml index f4c1d0a295..587d7654d4 100644 --- a/app/src/main/res/layout/fragment_disclaimer.xml +++ b/app/src/main/res/layout/fragment_disclaimer.xml @@ -11,5 +11,7 @@ android:id="@+id/tv_disclaimer" android:layout_width="match_parent" android:layout_height="match_parent" - android:textColor="@color/daynight_textColor" /> + android:textColor="@color/daynight_textColor" + android:autoLink="web" + android:linksClickable="true"/> From dcc1b1d044d59fda018a6b2613e9548d58e33e7d Mon Sep 17 00:00:00 2001 From: Avinash Sharma <133222313+Avinash-Codes@users.noreply.github.com> Date: Thu, 16 Jan 2025 01:00:02 +0530 Subject: [PATCH 03/16] mylife: smoother mypersonals editing (fixes #5026) (#5027) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../myplanet/ui/myPersonals/AdapterMyPersonal.kt | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ad11a20135..97458029b9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2201 - versionName "0.22.1" + versionCode 2202 + versionName "0.22.2" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myPersonals/AdapterMyPersonal.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myPersonals/AdapterMyPersonal.kt index d1ddd0b6e1..105a0b3824 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myPersonals/AdapterMyPersonal.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myPersonals/AdapterMyPersonal.kt @@ -1,5 +1,4 @@ package org.ole.planet.myplanet.ui.myPersonals - import android.content.Context import android.content.DialogInterface import android.content.Intent @@ -31,16 +30,13 @@ class AdapterMyPersonal(private val context: Context, private val list: List context.startActivity( Intent(context, PDFReaderActivity::class.java).putExtra("TOUCHED_FILE", path) ) - "bmp", "gif", "jpg", "png", "webp" -> { val ii = Intent(context, ImageViewerActivity::class.java).putExtra("TOUCHED_FILE", path) ii.putExtra("isFullPath", true) context.startActivity(ii) } - "aac", "mp3" -> openAudioFile(context, path) "mp4" -> openVideo(path) } } - private fun openVideo(path: String?) { val b = Bundle() b.putString("videoURL", "" + Uri.fromFile(path?.let { File(it) })) @@ -98,16 +90,15 @@ class AdapterMyPersonal(private val context: Context, private val list: List + .setPositiveButton(R.string.button_submit) {_: DialogInterface?, _: Int -> val title = alertMyPersonalBinding.etDescription.text.toString().trim { it <= ' ' } val desc = alertMyPersonalBinding.etTitle.text.toString().trim { it <= ' ' } if (title.isEmpty()) { @@ -124,10 +115,8 @@ class AdapterMyPersonal(private val context: Context, private val list: List Date: Wed, 15 Jan 2025 14:36:01 -0500 Subject: [PATCH 04/16] teams: smoother finances default (fixes #5007) (#5035) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../ui/enterprises/FinanceFragment.kt | 19 +++++++++++++------ app/src/main/res/layout/fragment_finance.xml | 5 +---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 97458029b9..170a165ae7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2202 - versionName "0.22.2" + versionCode 2203 + versionName "0.22.3" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.kt index e2be64e8bc..ee06e2e013 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.kt @@ -53,7 +53,6 @@ class FinanceFragment : BaseTeamFragment() { list = fRealm.where(RealmMyTeam::class.java).notEqualTo("status", "archived") .equalTo("teamId", teamId).equalTo("docType", "transaction") .sort("date", Sort.DESCENDING).findAllAsync() - list?.addChangeListener { results -> updatedFinanceList(results) } @@ -191,11 +190,19 @@ class FinanceFragment : BaseTeamFragment() { private fun updatedFinanceList(results: RealmResults) { activity?.runOnUiThread { - adapterFinance = AdapterFinance(requireActivity(), results) - fragmentFinanceBinding.rvFinance.layoutManager = LinearLayoutManager(activity) - fragmentFinanceBinding.rvFinance.adapter = adapterFinance - adapterFinance?.notifyDataSetChanged() - calculateTotal(results) + if (!results.isEmpty()) { + adapterFinance = AdapterFinance(requireActivity(), results) + fragmentFinanceBinding.rvFinance.layoutManager = LinearLayoutManager(activity) + fragmentFinanceBinding.rvFinance.adapter = adapterFinance + adapterFinance?.notifyDataSetChanged() + calculateTotal(results) + } else { + fragmentFinanceBinding.rvFinance.adapter = null + fragmentFinanceBinding.dataLayout.visibility= View.GONE + fragmentFinanceBinding.tvNodata.visibility= View.VISIBLE + + } } } + } diff --git a/app/src/main/res/layout/fragment_finance.xml b/app/src/main/res/layout/fragment_finance.xml index b95c5ad3e5..9dffc7f659 100644 --- a/app/src/main/res/layout/fragment_finance.xml +++ b/app/src/main/res/layout/fragment_finance.xml @@ -7,6 +7,7 @@ tools:context=".ui.enterprises.FinanceFragment"> @@ -104,7 +105,6 @@ android:textColor="@color/daynight_textColor" android:textSize="@dimen/text_size_mid" android:textStyle="bold" /> - - - - Date: Wed, 15 Jan 2025 14:13:24 -0600 Subject: [PATCH 05/16] courses: smoother mycourses select all (fixes #4986) (#5021) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 +-- .../myplanet/ui/courses/AdapterCourses.kt | 2 +- .../myplanet/ui/courses/CoursesFragment.kt | 34 ++++++++++++------- .../main/res/layout/fragment_my_course.xml | 5 +-- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 170a165ae7..b648a98a09 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2203 - versionName "0.22.3" + versionCode 2204 + versionName "0.22.4" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/courses/AdapterCourses.kt b/app/src/main/java/org/ole/planet/myplanet/ui/courses/AdapterCourses.kt index 760cc284ed..d066902cbb 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/courses/AdapterCourses.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/courses/AdapterCourses.kt @@ -49,7 +49,7 @@ class AdapterCourses(private val context: Context, private var courseList: List< private val config: ChipCloudConfig private var isAscending = true private var isTitleAscending = false - private var areAllSelected = true + private var areAllSelected = false var userModel: RealmUserModel?= null init { diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt index 8d0cfebeb0..e41475c36f 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt @@ -63,6 +63,7 @@ class CoursesFragment : BaseRecyclerFragment(), OnCourseItemSele lateinit var spnSubject: Spinner lateinit var searchTags: MutableList private lateinit var confirmation: AlertDialog + private var isCheckboxChangedByCode = false override fun getLayout(): Int { return R.layout.fragment_my_course } @@ -156,7 +157,7 @@ class CoursesFragment : BaseRecyclerFragment(), OnCourseItemSele clearTags() showNoData(tvMessage, adapterCourses.itemCount, "courses") setupUI(requireView().findViewById(R.id.my_course_parent_layout), requireActivity()) - changeButtonStatus() + if (!isMyCourseLib) tvFragmentInfo.setText(R.string.our_courses) additionalSetup() @@ -221,7 +222,7 @@ class CoursesFragment : BaseRecyclerFragment(), OnCourseItemSele spnGrade.onItemSelectedListener = itemSelectedListener spnSubject.onItemSelectedListener = itemSelectedListener - selectAll = requireView().findViewById(R.id.selectAll) + selectAll = requireView().findViewById(R.id.selectAllCourse) if (userModel?.isGuest() == true) { tvAddToLib.visibility = View.GONE btnRemove.visibility = View.GONE @@ -229,17 +230,20 @@ class CoursesFragment : BaseRecyclerFragment(), OnCourseItemSele selectAll.visibility = View.GONE } checkList() - selectAll.setOnClickListener { - val allSelected = selectedItems?.size == adapterCourses.getCourseList().size - adapterCourses.selectAllItems(!allSelected) - if (allSelected) { - selectAll.isChecked = false - selectAll.text = getString(R.string.select_all) - } else { - selectAll.isChecked = true + selectAll.setOnCheckedChangeListener { _, isChecked -> + if (isCheckboxChangedByCode) { + isCheckboxChangedByCode = false + return@setOnCheckedChangeListener + } + if (isChecked) { + adapterCourses.selectAllItems(true) selectAll.text = getString(R.string.unselect_all) + } else { + adapterCourses.selectAllItems(false) + selectAll.text = getString(R.string.select_all) } } + checkList() } @@ -338,16 +342,20 @@ class CoursesFragment : BaseRecyclerFragment(), OnCourseItemSele showTagText(searchTags, tvSelected) showNoData(tvMessage, adapterCourses.itemCount, "courses") } - + private fun updateCheckBoxState(programmaticState: Boolean) { + isCheckboxChangedByCode = true + selectAll.isChecked = programmaticState + isCheckboxChangedByCode = false + } private fun changeButtonStatus() { tvAddToLib.isEnabled = (selectedItems?.size ?: 0) > 0 btnRemove.isEnabled = (selectedItems?.size ?: 0) > 0 btnArchive.isEnabled = (selectedItems?.size ?: 0) > 0 if (adapterCourses.areAllSelected()) { - selectAll.isChecked = true + updateCheckBoxState(true) selectAll.text = getString(R.string.unselect_all) } else { - selectAll.isChecked = false + updateCheckBoxState(false) selectAll.text = getString(R.string.select_all) } } diff --git a/app/src/main/res/layout/fragment_my_course.xml b/app/src/main/res/layout/fragment_my_course.xml index 8462224d2c..0fd8f6830b 100644 --- a/app/src/main/res/layout/fragment_my_course.xml +++ b/app/src/main/res/layout/fragment_my_course.xml @@ -122,7 +122,7 @@ android:background="@color/secondary_bg"> + android:maxWidth="0dp" + android:checked="false" /> Date: Wed, 15 Jan 2025 15:21:16 -0500 Subject: [PATCH 06/16] mylife: smoother mysubmissions dark mode (fixes #4989) (#5022) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 +- app/src/main/res/color/toggle_text_color.xml | 5 + .../drawable/bg_submission_toggle_button.xml | 14 +++ .../main/res/drawable/submission_toggle.xml | 9 ++ .../res/layout/fragment_my_submission.xml | 103 ++++++++++-------- 5 files changed, 85 insertions(+), 50 deletions(-) create mode 100644 app/src/main/res/color/toggle_text_color.xml create mode 100644 app/src/main/res/drawable/bg_submission_toggle_button.xml create mode 100644 app/src/main/res/drawable/submission_toggle.xml diff --git a/app/build.gradle b/app/build.gradle index b648a98a09..ac67065f9a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2204 - versionName "0.22.4" + versionCode 2205 + versionName "0.22.5" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/res/color/toggle_text_color.xml b/app/src/main/res/color/toggle_text_color.xml new file mode 100644 index 0000000000..3f993e5998 --- /dev/null +++ b/app/src/main/res/color/toggle_text_color.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/bg_submission_toggle_button.xml b/app/src/main/res/drawable/bg_submission_toggle_button.xml new file mode 100644 index 0000000000..fbb8fd0f73 --- /dev/null +++ b/app/src/main/res/drawable/bg_submission_toggle_button.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/submission_toggle.xml b/app/src/main/res/drawable/submission_toggle.xml new file mode 100644 index 0000000000..8ae1811f43 --- /dev/null +++ b/app/src/main/res/drawable/submission_toggle.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/app/src/main/res/layout/fragment_my_submission.xml b/app/src/main/res/layout/fragment_my_submission.xml index 4cc2afc56a..2c8a1e684f 100644 --- a/app/src/main/res/layout/fragment_my_submission.xml +++ b/app/src/main/res/layout/fragment_my_submission.xml @@ -2,6 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/secondary_bg" tools:context=".ui.submission.MySubmissionFragment"> @@ -14,62 +15,68 @@ android:id="@+id/llSearch" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="right" - android:gravity="right"> + android:gravity="center_horizontal" + android:orientation="vertical" + android:padding="10dp"> - - - - - + android:orientation="horizontal" + android:gravity="center" + android:background="@drawable/submission_toggle" + android:padding="10dp"> - + + + - - - + android:layout_marginTop="16dp" + android:textColorHint="@color/hint_color"> - + + + + Date: Thu, 16 Jan 2025 01:58:48 +0530 Subject: [PATCH 07/16] login: smoother team dark mode (fixes #5039) (#5040) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ac67065f9a..6b17cda1ea 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2205 - versionName "0.22.5" + versionCode 2206 + versionName "0.22.6" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt index d0eed59e4f..3292f759c4 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt @@ -236,7 +236,7 @@ class LoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener { if (!teams.isNullOrEmpty()) { activityLoginBinding.team.visibility = View.VISIBLE teamAdapter = ArrayAdapter(this, R.layout.spinner_item_white, teamList) - teamAdapter?.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) + teamAdapter?.setDropDownViewResource(R.layout.custom_simple_list_item_1) teamList.clear() teamList.add(getString(R.string.select_team)) for (team in teams) { From 029ca40062395bc09fc505223bbe41e315691ddb Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Wed, 15 Jan 2025 23:40:46 +0300 Subject: [PATCH 08/16] teams: new surveys added (fixes #5029) (#4884) Co-authored-by: dogi --- app/build.gradle | 4 +- .../myplanet/base/BaseDialogFragment.kt | 2 + .../myplanet/base/BaseResourceFragment.kt | 2 +- .../planet/myplanet/model/RealmStepExam.kt | 8 ++- .../myplanet/ui/courses/CourseStepFragment.kt | 2 +- .../ui/dashboard/BaseDashboardFragment.kt | 2 +- .../ui/dashboard/BellDashboardFragment.kt | 2 +- .../notification/NotificationsFragment.kt | 4 +- .../myplanet/ui/exam/BaseExamFragment.kt | 9 ++- .../ui/exam/UserInformationFragment.kt | 55 ++++++++++++------- .../ui/submission/AdapterMySubmission.kt | 6 +- .../myplanet/ui/survey/AdapterSurvey.kt | 14 ++--- .../myplanet/ui/survey/SurveyFragment.kt | 20 ++++++- .../myplanet/ui/team/TeamPagerAdapter.kt | 32 +++++++---- 14 files changed, 105 insertions(+), 57 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6b17cda1ea..b3a0ec6b5c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2206 - versionName "0.22.6" + versionCode 2207 + versionName "0.22.7" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/base/BaseDialogFragment.kt b/app/src/main/java/org/ole/planet/myplanet/base/BaseDialogFragment.kt index 298697e04f..76ea2a2eba 100644 --- a/app/src/main/java/org/ole/planet/myplanet/base/BaseDialogFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/base/BaseDialogFragment.kt @@ -7,11 +7,13 @@ import androidx.fragment.app.DialogFragment abstract class BaseDialogFragment : DialogFragment() { @JvmField var id: String? = null + var teamId: String? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setStyle(STYLE_NO_TITLE, R.style.AppTheme_Dialog_NoActionBar_MinWidth) if (arguments != null) { id = requireArguments().getString(key) + teamId = requireArguments().getString("teamId") } } diff --git a/app/src/main/java/org/ole/planet/myplanet/base/BaseResourceFragment.kt b/app/src/main/java/org/ole/planet/myplanet/base/BaseResourceFragment.kt index bf9c5e2fc5..9cd57e0149 100644 --- a/app/src/main/java/org/ole/planet/myplanet/base/BaseResourceFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/base/BaseResourceFragment.kt @@ -171,7 +171,7 @@ abstract class BaseResourceFragment : Fragment() { } AlertDialog.Builder(requireActivity()).setTitle("Pending Surveys") .setAdapter(arrayAdapter) { _: DialogInterface?, i: Int -> - AdapterMySubmission.openSurvey(homeItemClickListener, list[i].id, true) + AdapterMySubmission.openSurvey(homeItemClickListener, list[i].id, true, false, "") }.setPositiveButton(R.string.dismiss, null).show() } diff --git a/app/src/main/java/org/ole/planet/myplanet/model/RealmStepExam.kt b/app/src/main/java/org/ole/planet/myplanet/model/RealmStepExam.kt index 54bf32ae29..f35413787e 100644 --- a/app/src/main/java/org/ole/planet/myplanet/model/RealmStepExam.kt +++ b/app/src/main/java/org/ole/planet/myplanet/model/RealmStepExam.kt @@ -29,6 +29,7 @@ open class RealmStepExam : RealmObject() { var passingPercentage: String? = null var noOfQuestions = 0 var isFromNation = false + var teamId: String? = null companion object { val examDataList: MutableList> = mutableListOf() @@ -66,6 +67,7 @@ open class RealmStepExam : RealmObject() { myExam?.totalMarks = JsonUtils.getInt("totalMarks", exam) myExam?.noOfQuestions = JsonUtils.getJsonArray("questions", exam).size() myExam?.isFromNation = !TextUtils.isEmpty(parentId) + myExam.teamId = JsonUtils.getString("teamId", exam) val oldQuestions: RealmResults<*>? = mRealm.where(RealmExamQuestion::class.java).equalTo("examId", JsonUtils.getString("_id", exam)).findAll() if (oldQuestions == null || oldQuestions.isEmpty()) { RealmExamQuestion.insertExamQuestions(JsonUtils.getJsonArray("questions", exam), JsonUtils.getString("_id", exam), mRealm) @@ -84,8 +86,10 @@ open class RealmStepExam : RealmObject() { JsonUtils.getString("updatedDate", exam), JsonUtils.getString("totalMarks", exam), JsonUtils.getString("noOfQuestions", exam), - JsonUtils.getString("isFromNation", exam) + JsonUtils.getString("isFromNation", exam), + JsonUtils.getString("teamId", exam) ) + examDataList.add(csvRow) } @@ -94,7 +98,7 @@ open class RealmStepExam : RealmObject() { val file = File(filePath) file.parentFile?.mkdirs() val writer = CSVWriter(FileWriter(file)) - writer.writeNext(arrayOf("_id", "_rev", "name", "passingPercentage", "type", "createdBy", "sourcePlanet", "createdDate", "updatedDate", "totalMarks", "noOfQuestions", "isFromNation")) + writer.writeNext(arrayOf("_id", "_rev", "name", "passingPercentage", "type", "createdBy", "sourcePlanet", "createdDate", "updatedDate", "totalMarks", "noOfQuestions", "isFromNation", "teamId")) for (row in data) { writer.writeNext(row) } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/courses/CourseStepFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/courses/CourseStepFragment.kt index 2bd0edf5e2..2a9d992d01 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/courses/CourseStepFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/courses/CourseStepFragment.kt @@ -184,7 +184,7 @@ class CourseStepFragment : BaseContainerFragment(), ImageCaptureCallback { fragmentCourseStepBinding.btnTakeSurvey.setOnClickListener { if (stepSurvey.isNotEmpty()) { - AdapterMySubmission.openSurvey(homeItemClickListener, stepSurvey[0].id, false) + AdapterMySubmission.openSurvey(homeItemClickListener, stepSurvey[0].id, false, false, "") } } val downloadedResources: List = cRealm.where(RealmMyLibrary::class.java).equalTo("stepId", stepId).equalTo("resourceOffline", true).isNotNull("resourceLocalAddress").findAll() diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragment.kt index a098a68874..27898343f9 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragment.kt @@ -73,7 +73,7 @@ open class BaseDashboardFragment : BaseDashboardFragmentPlugin(), NotificationCa v.findViewById(R.id.ll_prompt).visibility = View.VISIBLE v.findViewById(R.id.ll_prompt).setOnClickListener { if (!childFragmentManager.isStateSaved) { - UserInformationFragment.getInstance("").show(childFragmentManager, "") + UserInformationFragment.getInstance("", "").show(childFragmentManager, "") } } } else { diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt index 8c30778460..04337263fe 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt @@ -144,7 +144,7 @@ class BellDashboardFragment : BaseDashboardFragment() { val adapter = SurveyAdapter(surveyTitles, { position -> val selectedSurvey = pendingSurveys[position].id - AdapterMySubmission.openSurvey(homeItemClickListener, selectedSurvey, true) + AdapterMySubmission.openSurvey(homeItemClickListener, selectedSurvey, true, false, "") }, alertDialog) recyclerView.adapter = adapter diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/notification/NotificationsFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/notification/NotificationsFragment.kt index 8b7214309e..e63f4a689d 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/notification/NotificationsFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/notification/NotificationsFragment.kt @@ -111,8 +111,8 @@ class NotificationsFragment : Fragment() { "survey" -> { val currentStepExam = mRealm.where(RealmStepExam::class.java).equalTo("name", notification.relatedId) .findFirst() - if(context is OnHomeItemClickListener) { - AdapterMySubmission.openSurvey(context as OnHomeItemClickListener, currentStepExam?.id, false) + if (context is OnHomeItemClickListener) { + AdapterMySubmission.openSurvey(context as OnHomeItemClickListener, currentStepExam?.id, false, false, "") } } "task" -> { 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 5a7a0402be..b0986ae8a7 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 @@ -52,6 +52,9 @@ abstract class BaseExamFragment : Fragment(), ImageCaptureCallback { var date = Date().toString() private var photoPath: String? = "" var submitId = "" + private var isTeam: Boolean = false + private var teamId: String? = null + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) db = DatabaseService(requireActivity()) @@ -60,6 +63,8 @@ abstract class BaseExamFragment : Fragment(), ImageCaptureCallback { stepId = requireArguments().getString("stepId") stepNumber = requireArguments().getInt("stepNum") isMySurvey = requireArguments().getBoolean("isMySurvey") + isTeam = requireArguments().getBoolean("isTeam", false) + teamId = requireArguments().getString("teamId") checkId() checkType() } @@ -108,6 +113,8 @@ abstract class BaseExamFragment : Fragment(), ImageCaptureCallback { private fun continueExam() { if (currentIndex < (questions?.size ?: 0)) { startExam(questions?.get(currentIndex)) + } else if (isTeam == true && type?.startsWith("survey") == true) { + showUserInfoDialog() } else { saveCourseProgress() AlertDialog.Builder(requireActivity(), R.style.AlertDialogTheme) @@ -131,7 +138,7 @@ abstract class BaseExamFragment : Fragment(), ImageCaptureCallback { private fun showUserInfoDialog() { if (!isMySurvey && !exam?.isFromNation!!) { - UserInformationFragment.getInstance(sub?.id).show(childFragmentManager, "") + UserInformationFragment.getInstance(sub?.id, teamId).show(childFragmentManager, "") } else { if (!mRealm.isInTransaction) mRealm.beginTransaction() sub?.status = "complete" diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/exam/UserInformationFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/exam/UserInformationFragment.kt index 6fa96ca8b4..ddc5621e92 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/exam/UserInformationFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/exam/UserInformationFragment.kt @@ -16,11 +16,13 @@ import io.realm.Realm import org.ole.planet.myplanet.MainApplication import org.ole.planet.myplanet.R import org.ole.planet.myplanet.base.BaseDialogFragment +import org.ole.planet.myplanet.callback.OnHomeItemClickListener import org.ole.planet.myplanet.databinding.FragmentUserInformationBinding import org.ole.planet.myplanet.datamanager.DatabaseService import org.ole.planet.myplanet.model.RealmSubmission import org.ole.planet.myplanet.model.RealmUserModel import org.ole.planet.myplanet.service.UserProfileDbHandler +import org.ole.planet.myplanet.ui.team.TeamDetailFragment import org.ole.planet.myplanet.utilities.Utilities import java.util.Calendar import java.util.Locale @@ -31,6 +33,7 @@ class UserInformationFragment : BaseDialogFragment(), View.OnClickListener { lateinit var mRealm: Realm private var submissions: RealmSubmission? = null var userModel: RealmUserModel? = null + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { fragmentUserInformationBinding = FragmentUserInformationBinding.inflate(inflater, container, false) mRealm = DatabaseService(requireActivity()).realmInstance @@ -45,16 +48,8 @@ class UserInformationFragment : BaseDialogFragment(), View.OnClickListener { private fun initViews() { val langArray = resources.getStringArray(R.array.language).toMutableList() val levelArray = resources.getStringArray(R.array.level).toMutableList() - val adapterLang = ArrayAdapter( - requireContext(), - R.layout.spinner_item_white, - langArray - ) - val adapterLevel = ArrayAdapter( - requireContext(), - R.layout.spinner_item_white, - levelArray - ) + val adapterLang = ArrayAdapter(requireContext(), R.layout.spinner_item_white, langArray) + val adapterLevel = ArrayAdapter(requireContext(), R.layout.spinner_item_white, levelArray) adapterLang.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) adapterLevel.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) fragmentUserInformationBinding.spnLang.adapter = adapterLang @@ -67,13 +62,18 @@ class UserInformationFragment : BaseDialogFragment(), View.OnClickListener { val selectedView = fragmentUserInformationBinding.spnLevel.selectedView as? TextView selectedView?.setTextColor(ContextCompat.getColor(requireContext(), R.color.daynight_textColor)) } - fragmentUserInformationBinding.etEmail.setText(getString(R.string.message_placeholder, userModel?.email)) - fragmentUserInformationBinding.etFname.setText(getString(R.string.message_placeholder, userModel?.firstName)) - fragmentUserInformationBinding.etLname.setText(getString(R.string.message_placeholder, userModel?.lastName)) - fragmentUserInformationBinding.etPhone.setText(getString(R.string.message_placeholder, userModel?.phoneNumber)) - fragmentUserInformationBinding.txtDob.text = getString(R.string.message_placeholder, userModel?.dob) - dob = userModel?.dob - fragmentUserInformationBinding.btnCancel.setOnClickListener(this) +// fragmentUserInformationBinding.etEmail.setText(getString(R.string.message_placeholder, userModel?.email)) +// fragmentUserInformationBinding.etFname.setText(getString(R.string.message_placeholder, userModel?.firstName)) +// fragmentUserInformationBinding.etLname.setText(getString(R.string.message_placeholder, userModel?.lastName)) +// fragmentUserInformationBinding.etPhone.setText(getString(R.string.message_placeholder, userModel?.phoneNumber)) +// fragmentUserInformationBinding.txtDob.text = getString(R.string.message_placeholder, userModel?.dob) +// dob = userModel?.dob + if (teamId != null) { + fragmentUserInformationBinding.btnCancel.visibility = View.GONE + } else { + fragmentUserInformationBinding.btnCancel.setOnClickListener(this) + } + fragmentUserInformationBinding.btnSubmit.setOnClickListener(this) fragmentUserInformationBinding.txtDob.setOnClickListener(this) } @@ -157,7 +157,19 @@ class UserInformationFragment : BaseDialogFragment(), View.OnClickListener { override fun onDismiss(dialog: DialogInterface) { super.onDismiss(dialog) Utilities.toast(activity, getString(R.string.thank_you_for_taking_this_survey)) - BaseExamFragment.navigateToSurveyList(requireActivity()) + if (teamId == null) { + BaseExamFragment.navigateToSurveyList(requireActivity()) + } else { + if (context is OnHomeItemClickListener) { + val f = TeamDetailFragment() + val b = Bundle() + b.putString("id", teamId) + b.putBoolean("isMyTeam", true) + b.putInt("navigateToPage", 6) + f.arguments = b + (context as OnHomeItemClickListener).openCallFragment(f) + } + } } private fun showDatePickerDialog() { @@ -173,15 +185,16 @@ class UserInformationFragment : BaseDialogFragment(), View.OnClickListener { get() = "sub_id" companion object { - fun getInstance(id: String?): UserInformationFragment { + fun getInstance(id: String?, teamId: String?): UserInformationFragment { val f = UserInformationFragment() - setArgs(f, id) + setArgs(f, id, teamId) return f } - private fun setArgs(f: UserInformationFragment, id: String?) { + private fun setArgs(f: UserInformationFragment, id: String?, teamId: String?) { val b = Bundle() b.putString("sub_id", id) + b.putString("teamId", teamId) f.arguments = b } } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/submission/AdapterMySubmission.kt b/app/src/main/java/org/ole/planet/myplanet/ui/submission/AdapterMySubmission.kt index 32bea6baf2..19d8e38c49 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/submission/AdapterMySubmission.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/submission/AdapterMySubmission.kt @@ -54,7 +54,7 @@ class AdapterMySubmission(private val context: Context, private val list: List() { +class AdapterSurvey(private val context: Context, private val mRealm: Realm, private val userId: String, private val isTeam: Boolean, val teamId: String?) : RecyclerView.Adapter() { private var examList: List = emptyList() private var listener: OnHomeItemClickListener? = null - private var user: RealmUserModel? = null init { if (context is OnHomeItemClickListener) { listener = context } - user = UserProfileDbHandler(context).userModel } fun updateData(newList: List) { @@ -63,7 +59,7 @@ class AdapterSurvey(private val context: Context, private val mRealm: Realm, pri binding.apply { tvTitle.text = exam.name startSurvey.setOnClickListener { - AdapterMySubmission.openSurvey(listener, exam.id, false) + AdapterMySubmission.openSurvey(listener, exam.id, false, isTeam, teamId) } val questions = mRealm.where(RealmExamQuestion::class.java) @@ -81,12 +77,12 @@ class AdapterSurvey(private val context: Context, private val mRealm: Realm, pri context.getString(R.string.record_survey) } - if (user?.id?.startsWith("guest") == true) { + if (userId.startsWith("guest") == true) { startSurvey.visibility = View.GONE } - tvNoSubmissions.text = getNoOfSubmissionByUser(exam.id, exam.courseId, user?.id, mRealm) - tvDateCompleted.text = getRecentSubmissionDate(exam.id, exam.courseId, user?.id, mRealm) + tvNoSubmissions.text = getNoOfSubmissionByUser(exam.id, exam.courseId, userId, mRealm) + tvDateCompleted.text = getRecentSubmissionDate(exam.id, exam.courseId, userId, mRealm) tvDate.text = formatDate(RealmStepExam.getSurveyCreationTime(exam.id!!, mRealm)!!, "MMM dd, yyyy") } } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/survey/SurveyFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/survey/SurveyFragment.kt index 3d935e0dae..189fe4942a 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/survey/SurveyFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/survey/SurveyFragment.kt @@ -17,6 +17,8 @@ class SurveyFragment : BaseRecyclerFragment() { private lateinit var spn: CustomSpinner private var isTitleAscending = true private lateinit var adapter: AdapterSurvey + private var isTeam: Boolean = false + private var teamId: String? = null override fun getLayout(): Int { return R.layout.fragment_survey @@ -24,7 +26,9 @@ class SurveyFragment : BaseRecyclerFragment() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - adapter = AdapterSurvey(requireActivity(), mRealm, model?.id ?: "") + isTeam = arguments?.getBoolean("isTeam", false) == true + teamId = arguments?.getString("teamId", null) + adapter = AdapterSurvey(requireActivity(), mRealm, model?.id ?: "", isTeam, teamId) } override fun getAdapter(): RecyclerView.Adapter<*> { @@ -78,8 +82,18 @@ class SurveyFragment : BaseRecyclerFragment() { } private fun updateAdapterData(sort: Sort = Sort.ASCENDING, field: String = "name") { - val newList = getList(RealmStepExam::class.java, field, sort) - adapter.updateData(safeCastList(newList, RealmStepExam::class.java)) + val query = mRealm.where(RealmStepExam::class.java) + + val surveys = if (teamId != null && isTeam) { + query.equalTo("teamId", teamId) + .sort(field, sort) + .findAll() + } else { + query.sort(field, sort) + .findAll() + } + + adapter.updateData(safeCastList(surveys, RealmStepExam::class.java)) updateUIState() } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt b/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt index fe671d9457..f3e678cf0e 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt @@ -12,6 +12,7 @@ import org.ole.planet.myplanet.model.RealmMyTeam import org.ole.planet.myplanet.ui.enterprises.EnterpriseCalendarFragment import org.ole.planet.myplanet.ui.enterprises.FinanceFragment import org.ole.planet.myplanet.ui.enterprises.ReportsFragment +import org.ole.planet.myplanet.ui.survey.SurveyFragment import org.ole.planet.myplanet.ui.team.teamCourse.TeamCourseFragment import org.ole.planet.myplanet.ui.team.teamDiscussion.DiscussionListFragment import org.ole.planet.myplanet.ui.team.teamMember.JoinedMemberFragment @@ -25,20 +26,22 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, isInMyTeam: Boo private val isEnterprise: Boolean = TextUtils.equals(team?.type, "enterprise") init { - list.add(context.getString(if (isEnterprise) R.string.mission else R.string.plan)) - list.add(context.getString(if (isEnterprise) R.string.team else R.string.members)) if (isInMyTeam || team?.isPublic == true) { list.add(context.getString(R.string.chat)) + list.add(context.getString(if (isEnterprise) R.string.mission else R.string.plan)) + list.add(context.getString(if (isEnterprise) R.string.team else R.string.members)) list.add(context.getString(R.string.tasks)) list.add(context.getString(R.string.calendar)) + list.add(context.getString(R.string.survey)) list.add(context.getString(if (isEnterprise) R.string.finances else R.string.courses)) - if (isEnterprise) list.add(context.getString(R.string.reports)) + if (isEnterprise) { + list.add(context.getString(R.string.reports)) + } list.add(context.getString(if (isEnterprise) R.string.documents else R.string.resources)) list.add(context.getString(if (isEnterprise) R.string.applicants else R.string.join_requests)) - list.removeAt(0) - list.removeAt(0) - list.add(1, context.getString(if (isEnterprise) R.string.mission else R.string.plan)) - list.add(2, context.getString(if (isEnterprise) R.string.team else R.string.members)) + } else { + list.add(context.getString(if (isEnterprise) R.string.mission else R.string.plan)) + list.add(context.getString(if (isEnterprise) R.string.team else R.string.members)) } } @@ -56,6 +59,12 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, isInMyTeam: Boo context.getString(R.string.members), context.getString(R.string.team) -> JoinedMemberFragment() context.getString(R.string.tasks) -> TeamTaskFragment() context.getString(R.string.calendar) -> EnterpriseCalendarFragment() + context.getString(R.string.survey) -> SurveyFragment().apply { + arguments = Bundle().apply { + putBoolean("isTeam", true) + putString("teamId", teamId) + } + } context.getString(R.string.courses) -> TeamCourseFragment() context.getString(R.string.finances) -> FinanceFragment() context.getString(R.string.reports) -> ReportsFragment() @@ -63,10 +72,11 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, isInMyTeam: Boo context.getString(R.string.join_requests), context.getString(R.string.applicants) -> MembersFragment() else -> throw IllegalArgumentException("Invalid fragment type for position: $position") } - - val bundle = Bundle() - bundle.putString("id", teamId) - fragment.arguments = bundle + if (fragment.arguments == null) { + fragment.arguments = Bundle().apply { + putString("id", teamId) + } + } return fragment } From 9aae6369e05ff453996057539cf0c44c6b07324b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:38:12 -0500 Subject: [PATCH 09/16] all: bump `androidx.recyclerview:recyclerview` to 1.4.0 (fixes #5054) (#5047) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dogi --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b3a0ec6b5c..2944804d3b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2207 - versionName "0.22.7" + versionCode 2208 + versionName "0.22.8" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true @@ -170,7 +170,7 @@ dependencies { implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'androidx.recyclerview:recyclerview:1.3.2' + implementation 'androidx.recyclerview:recyclerview:1.4.0' implementation 'androidx.annotation:annotation:1.9.1' implementation 'androidx.exifinterface:exifinterface:1.3.7' implementation 'androidx.legacy:legacy-support-v4:1.0.0' From 8862598ac39ffef1dfdf391c3a4d81e623665ea3 Mon Sep 17 00:00:00 2001 From: Avinash Sharma <133222313+Avinash-Codes@users.noreply.github.com> Date: Fri, 17 Jan 2025 00:12:45 +0530 Subject: [PATCH 10/16] community: smoother services info (fixes #5006) (#5016) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 +- .../myplanet/ui/community/ServicesFragment.kt | 46 +++++++++++-------- app/src/main/res/layout/button_single.xml | 5 +- app/src/main/res/layout/fragment_services.xml | 46 ++++++++++++++++--- 4 files changed, 72 insertions(+), 29 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2944804d3b..e4c5317f39 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2208 - versionName "0.22.8" + versionCode 2209 + versionName "0.22.9" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt index 1eb4515e97..ee713c4d8c 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt @@ -50,11 +50,19 @@ class ServicesFragment : BaseTeamFragment() { if (links?.size == 0) { fragmentServicesBinding.llServices.visibility = View.GONE + fragmentServicesBinding.tvNoLinks.visibility = View.VISIBLE + } else { + fragmentServicesBinding.llServices.visibility = View.VISIBLE } val description = team?.description ?: "" - fragmentServicesBinding.llServices.visibility = View.VISIBLE - fragmentServicesBinding.tvDescription.visibility = View.VISIBLE + if (description.isEmpty()) { + fragmentServicesBinding.tvDescription.visibility = View.GONE + fragmentServicesBinding.tvNoDescription.visibility = View.VISIBLE + } else { + fragmentServicesBinding.tvDescription.visibility = View.VISIBLE + fragmentServicesBinding.tvNoDescription.visibility = View.GONE + } val markdownContentWithLocalPaths = CourseStepFragment.prependBaseUrlToImages(description, "file://${MainApplication.context.getExternalFilesDir(null)}/ole/") setMarkdownText(fragmentServicesBinding.tvDescription, markdownContentWithLocalPaths) setRecyclerView(links) @@ -75,25 +83,27 @@ class ServicesFragment : BaseTeamFragment() { private fun setRecyclerView(links: RealmResults?) { fragmentServicesBinding.llServices.removeAllViews() - links?.forEach { team -> - val b: TextView = LayoutInflater.from(activity).inflate(R.layout.button_single, fragmentServicesBinding.llServices, false) as TextView - b.setPadding(8, 8, 8, 8) - b.text = team.title - b.setOnClickListener { - val route = team.route?.split("/") - if (route != null) { - if (route.size >= 3) { - val f = TeamDetailFragment() - val c = Bundle() - val teamObject = mRealm.where(RealmMyTeam::class.java)?.equalTo("_id", route[3])?.findFirst() - c.putString("id", route[3]) - teamObject?.isMyTeam(user?.id, mRealm)?.let { it1 -> c.putBoolean("isMyTeam", it1) } - f.arguments = c - (context as OnHomeItemClickListener).openCallFragment(f) + if (links != null) { + links.forEach { team -> + val b: TextView = LayoutInflater.from(activity).inflate(R.layout.button_single, fragmentServicesBinding.llServices, false) as TextView + b.setPadding(8, 8, 8, 8) + b.text = team.title + b.setOnClickListener { + val route = team.route?.split("/") + if (route != null) { + if (route.size >= 3) { + val f = TeamDetailFragment() + val c = Bundle() + val teamObject = mRealm.where(RealmMyTeam::class.java)?.equalTo("_id", route[3])?.findFirst() + c.putString("id", route[3]) + teamObject?.isMyTeam(user?.id, mRealm)?.let { it1 -> c.putBoolean("isMyTeam", it1) } + f.arguments = c + (context as OnHomeItemClickListener).openCallFragment(f) + } } } + fragmentServicesBinding.llServices.addView(b) } - fragmentServicesBinding.llServices.addView(b) } } } diff --git a/app/src/main/res/layout/button_single.xml b/app/src/main/res/layout/button_single.xml index 423410903a..5064753145 100644 --- a/app/src/main/res/layout/button_single.xml +++ b/app/src/main/res/layout/button_single.xml @@ -6,7 +6,6 @@ android:background="@drawable/border" android:orientation="vertical" android:padding="@dimen/padding_large" - android:textColor="@color/md_black_1000" + android:textColor="@color/daynight_textColor" android:textSize="18sp"> - - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_services.xml b/app/src/main/res/layout/fragment_services.xml index 373a7cd6fb..57b4d1d7e4 100644 --- a/app/src/main/res/layout/fragment_services.xml +++ b/app/src/main/res/layout/fragment_services.xml @@ -8,29 +8,63 @@ + android:layout_height="match_parent"> + android:layout_height="match_parent"> + + + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvNoLinks"/> @@ -39,6 +73,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" - android:padding="16dp" + android:layout_margin="16dp" android:src="@drawable/ic_add" /> From fc0fe2edebd78ebed5adebbaa1efaee51ad925df Mon Sep 17 00:00:00 2001 From: Avinash Sharma <133222313+Avinash-Codes@users.noreply.github.com> Date: Fri, 17 Jan 2025 00:17:10 +0530 Subject: [PATCH 11/16] courses: smoother filter dark mode (fixes #5041) (#5043) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../org/ole/planet/myplanet/ui/courses/CoursesFragment.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e4c5317f39..f651bc3356 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2209 - versionName "0.22.9" + versionCode 2210 + versionName "0.22.10" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt index e41475c36f..bf35d3613c 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/courses/CoursesFragment.kt @@ -213,7 +213,7 @@ class CoursesFragment : BaseRecyclerFragment(), OnCourseItemSele requireView().findViewById(R.id.tl_tags).visibility = View.GONE tvFragmentInfo = requireView().findViewById(R.id.tv_fragment_info) val gradeAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.grade_level, R.layout.spinner_item) - gradeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) + gradeAdapter.setDropDownViewResource(R.layout.custom_simple_list_item_1) spnGrade.adapter = gradeAdapter val subjectAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.subject_level, R.layout.spinner_item) From 6f671c50a79b50c5728c153fff761ac158a54d54 Mon Sep 17 00:00:00 2001 From: Deep Vora <70479785+deeppp15@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:51:35 -0500 Subject: [PATCH 12/16] courses: smoother submissions headings (fixes #5033) (#5044) Co-authored-by: dogi --- app/build.gradle | 4 +-- .../res/layout/fragment_my_submission.xml | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f651bc3356..653b10600e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2210 - versionName "0.22.10" + versionCode 2211 + versionName "0.22.11" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/res/layout/fragment_my_submission.xml b/app/src/main/res/layout/fragment_my_submission.xml index 2c8a1e684f..db75e60a3c 100644 --- a/app/src/main/res/layout/fragment_my_submission.xml +++ b/app/src/main/res/layout/fragment_my_submission.xml @@ -11,6 +11,42 @@ android:layout_height="match_parent" android:orientation="vertical"> + + + + + + Date: Thu, 16 Jan 2025 13:02:53 -0600 Subject: [PATCH 13/16] sync: smoother myhealth dialog dark mode (fixes #5048) (#5052) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 653b10600e..0833db3c7a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2211 - versionName "0.22.11" + versionCode 2212 + versionName "0.22.12" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt index 04337263fe..a8b0e42b54 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BellDashboardFragment.kt @@ -67,7 +67,7 @@ class BellDashboardFragment : BaseDashboardFragment() { checkPendingSurveys() if (model?.id?.startsWith("guest") == false && TextUtils.isEmpty(model?.key) && MainApplication.showHealthDialog) { - AlertDialog.Builder(requireActivity()) + AlertDialog.Builder(requireActivity(), R.style.CustomAlertDialog) .setMessage(getString(R.string.health_record_not_available_sync_health_data)) .setPositiveButton(getString(R.string.sync)) { _: DialogInterface?, _: Int -> syncKeyId() From b32cc6f184f14d45344f7602a1a75309d6df44bc Mon Sep 17 00:00:00 2001 From: Avinash Sharma <133222313+Avinash-Codes@users.noreply.github.com> Date: Fri, 17 Jan 2025 00:38:59 +0530 Subject: [PATCH 14/16] mylife: smoother myhealth switch dark mode (fixes #4994) (#4997) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 +-- .../myplanet/ui/myhealth/MyHealthFragment.kt | 2 +- app/src/main/res/layout/alert_health_list.xml | 29 +++++++++++++------ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0833db3c7a..5fb1ec0fe6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2212 - versionName "0.22.12" + versionCode 2213 + versionName "0.22.13" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt index 51b0c4b61b..7e3cdb78ad 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt @@ -117,7 +117,7 @@ class MyHealthFragment : Fragment() { dialog?.dismiss() } sortList(alertHealthListBinding.spnSort, alertHealthListBinding.list) - dialog = AlertDialog.Builder(requireActivity()) + dialog = AlertDialog.Builder(requireActivity(),R.style.AlertDialogTheme) .setTitle(getString(R.string.select_health_member)).setView(alertHealthListBinding.root) .setCancelable(false).setNegativeButton(R.string.dismiss, null).create() dialog?.show() diff --git a/app/src/main/res/layout/alert_health_list.xml b/app/src/main/res/layout/alert_health_list.xml index c702b703cd..be4c90eca7 100644 --- a/app/src/main/res/layout/alert_health_list.xml +++ b/app/src/main/res/layout/alert_health_list.xml @@ -4,21 +4,24 @@ android:layout_width="match_parent" android:layout_height="fill_parent" android:gravity="center" + android:background="@color/secondary_bg" android:orientation="vertical"> - -