From 0f508acc32a56ec4a84f257b2a885751a92a1aca Mon Sep 17 00:00:00 2001 From: dogi Date: Fri, 28 Jun 2024 15:27:55 -0400 Subject: [PATCH 1/2] actions: smoother manual release (fixes #3712) (#3732) --- .github/workflows/android-release.yml | 18 ++++++++---------- app/build.gradle | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index e54a22e818..9ec5e805e5 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -22,9 +22,6 @@ jobs: app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt steps: - - name: set more env - run: echo "BRANCHNAME="${GITHUB_REF##*/} >> $GITHUB_ENV - - name: checkout repository code uses: actions/checkout@v4 with: @@ -88,7 +85,7 @@ jobs: - name: publish AAB to playstore id: playstore - if: github.ref == 'refs/heads/master' && matrix.build == 'lite' + if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' continue-on-error: true uses: dogi/upload-google-play@v1.1.4 with: @@ -100,7 +97,7 @@ jobs: status: completed - name: publish AAB to playstore fallback - if: github.ref == 'refs/heads/master' && matrix.build == 'lite' && steps.playstore.outcome == 'failure' + if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' && steps.playstore.outcome == 'failure' uses: dogi/upload-google-play@v1.1.4 with: serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} @@ -112,24 +109,25 @@ jobs: changesNotSentForReview: true - name: rename APK and AAB with version and branch for artifact - if: github.ref != 'refs/heads/master' + if: github.event_name == 'workflow_dispatch' run: | mv output/myPlanet.apk output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.apk mv output/myPlanet.apk.sha256 output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.apk.sha256 mv output/myPlanet.aab output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.aab mv output/myPlanet.aab.sha256 output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.aab.sha256 ls -alR output + echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: upload APK and AAB as build artifact - if: github.ref != 'refs/heads/master' + if: github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v4 with: - name: myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}-${{ matrix.build }} + name: myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }} path: output/* retention-days: 9 - name: release APK and AAB on GitHub - if: github.ref == 'refs/heads/master' + if: github.event_name != 'workflow_dispatch' uses: dogi/upload-release-action@v2.9.0 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -139,7 +137,7 @@ jobs: file_glob: 'true' - name: send success message to discord - if: github.ref == 'refs/heads/master' && matrix.build != 'lite' + if: github.event_name != 'workflow_dispatch' && matrix.build != 'lite' run: | sudo npm install -g @treehouses/cli export discord_channel="${{ secrets.CHANNEL }}" #remote diff --git a/app/build.gradle b/app/build.gradle index 70f00d93c9..03a23d12a5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1633 - versionName "0.16.33" + versionCode 1634 + versionName "0.16.34" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true From c6a96b4aabcadd1e75e4d58d4ebb0bf7f9fb2828 Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Fri, 28 Jun 2024 22:39:22 +0300 Subject: [PATCH 2/2] surveys: smoother empty list (fixes #3724) (#3736) Co-authored-by: dogi --- app/build.gradle | 4 +-- .../myplanet/base/BaseRecyclerFragment.kt | 1 + .../ui/submission/MySubmissionFragment.kt | 27 ++++++++++--------- .../myplanet/ui/survey/SurveyFragment.kt | 3 +++ .../res/layout/fragment_my_submission.xml | 9 +++++++ 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 + 11 files changed, 35 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 03a23d12a5..dacf413ece 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1634 - versionName "0.16.34" + versionCode 1635 + versionName "0.16.35" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/base/BaseRecyclerFragment.kt b/app/src/main/java/org/ole/planet/myplanet/base/BaseRecyclerFragment.kt index e81d07b632..9cda0ef557 100644 --- a/app/src/main/java/org/ole/planet/myplanet/base/BaseRecyclerFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/base/BaseRecyclerFragment.kt @@ -295,6 +295,7 @@ abstract class BaseRecyclerFragment
  • : BaseRecyclerParentFragment(), On "members" -> (v as TextView).setText(R.string.no_join_request_available) "discussions" -> (v as TextView).setText(R.string.no_news) "survey" -> (v as TextView).setText(R.string.no_surveys) + "submission" -> (v as TextView).setText(R.string.no_submissions) else -> (v as TextView).setText(R.string.no_data_available_please_check_and_try_again) } } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/submission/MySubmissionFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/submission/MySubmissionFragment.kt index 265f62d81c..27816a1fb3 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/submission/MySubmissionFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/submission/MySubmissionFragment.kt @@ -14,6 +14,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import io.realm.Case import io.realm.Realm import io.realm.RealmQuery +import org.ole.planet.myplanet.base.BaseRecyclerFragment.Companion.showNoData import org.ole.planet.myplanet.databinding.FragmentMySubmissionBinding import org.ole.planet.myplanet.datamanager.DatabaseService import org.ole.planet.myplanet.model.RealmStepExam @@ -58,7 +59,6 @@ class MySubmissionFragment : Fragment(), CompoundButton.OnCheckedChangeListener val cleanString = charSequence.toString() setData(cleanString) } - override fun afterTextChanged(editable: Editable) {} }) showHideRadioButton() @@ -86,18 +86,12 @@ class MySubmissionFragment : Fragment(), CompoundButton.OnCheckedChangeListener private fun setData(s: String) { val q: RealmQuery<*>? = when (type) { - "survey" -> { - mRealm.where(RealmSubmission::class.java).equalTo("userId", user?.id) - .equalTo("type", "survey") - } - "survey_submission" -> { - mRealm.where(RealmSubmission::class.java).equalTo("userId", user?.id) - .notEqualTo("status", "pending").equalTo("type", "survey") - } - else -> { - mRealm.where(RealmSubmission::class.java).equalTo("userId", user?.id) - .notEqualTo("type", "survey") - } + "survey" -> mRealm.where(RealmSubmission::class.java).equalTo("userId", user?.id) + .equalTo("type", "survey") + "survey_submission" -> mRealm.where(RealmSubmission::class.java).equalTo("userId", user?.id) + .notEqualTo("status", "pending").equalTo("type", "survey") + else -> mRealm.where(RealmSubmission::class.java).equalTo("userId", user?.id) + .notEqualTo("type", "survey") } if (!TextUtils.isEmpty(s)) { val ex: List = mRealm.where(RealmStepExam::class.java) @@ -109,6 +103,13 @@ class MySubmissionFragment : Fragment(), CompoundButton.OnCheckedChangeListener } val adapter = AdapterMySubmission(requireActivity(), submissions, exams) + val itemCount = adapter.itemCount + showNoData(fragmentMySubmissionBinding.tvMessage, itemCount, "submission") + + if (itemCount == 0) { + fragmentMySubmissionBinding.llSearch.visibility = View.GONE + fragmentMySubmissionBinding.title.visibility = View.GONE + } adapter.setmRealm(mRealm) adapter.setType(type) fragmentMySubmissionBinding.rvMysurvey.adapter = adapter 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 b63a4a163b..81b7d56eff 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 @@ -29,6 +29,9 @@ class SurveyFragment : BaseRecyclerFragment() { spn = requireView().findViewById(R.id.spn_sort) addNewServey = requireView().findViewById(R.id.fab_add_new_survey) addNewServey.setOnClickListener { } + if (getAdapter().itemCount == 0) { + spn.visibility = View.GONE + } showNoData(tvMessage, getAdapter().itemCount, "survey") spn.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { override fun onItemSelected(adapterView: AdapterView<*>?, view: View?, i: Int, l: Long) { diff --git a/app/src/main/res/layout/fragment_my_submission.xml b/app/src/main/res/layout/fragment_my_submission.xml index 3b90ef53fe..1b117e0928 100644 --- a/app/src/main/res/layout/fragment_my_submission.xml +++ b/app/src/main/res/layout/fragment_my_submission.xml @@ -10,6 +10,7 @@ android:orientation="vertical"> + + diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index d1180318b2..cbd445677f 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -1045,5 +1045,6 @@ جارٍ فحص الخادم إصدار Apk أقل من المسموح. يرجى تحديث التطبيق إلى أحدث إصدار. إضافة ملاحظة (اختياري) + التقديمات غير متاحة diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index cb2b404ed3..59e5473f0a 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1045,5 +1045,6 @@ verificando el servidor la versión de la aplicación está por debajo de la permitida. Actualice la aplicación a la última versión. Agregar una nota (opcional) + envíos no disponibles diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index dcea61b2ce..1a47eccfee 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1045,5 +1045,6 @@ vérification du serveur la version de l\'app est inférieure à celle autorisée. veuillez mettre à jour l\'application vers la dernière version. Ajouter une note (optionnel) + soumissions non disponibles diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 6ddc1d7164..afbfe10414 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -1045,5 +1045,6 @@ सर्भर जाँच गर्दै एप संस्करण अनुमत संस्करणभन्दा कम छ। कृपया अनुप्रयोगलाई नवीनतम संस्करणमा अद्यावधिक गर्नुहोस्। नोट थप्नुहोस् (वैकल्पिक) + पेशाहरू उपलब्ध छैनन् diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index 69f95a14e5..23727ecfba 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -1045,5 +1045,6 @@ hubinta server-ka nooca app-ga waa ka hooseeyaa kan la oggol yahay. fadlan cusbooneysii app-ka nooca ugu dambeeya. Ku dar falanqeey (ixtiyaacsi ah) + soo gudbin lama heli karo diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 28cf04b755..180040db0a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1045,5 +1045,6 @@ checking server app is below allowed version. please update the app to the latest version. add a note (optional) + submissions not available