Skip to content

Commit

Permalink
Merge branch 'master' into 3728-deprecations-in-mydownloadedservice
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Jun 28, 2024
2 parents f02ac78 + c6a96b4 commit ae4960d
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 23 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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/[email protected]
with:
Expand All @@ -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/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
Expand All @@ -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/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ abstract class BaseRecyclerFragment<LI> : BaseRecyclerParentFragment<Any?>(), 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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -58,7 +59,6 @@ class MySubmissionFragment : Fragment(), CompoundButton.OnCheckedChangeListener
val cleanString = charSequence.toString()
setData(cleanString)
}

override fun afterTextChanged(editable: Editable) {}
})
showHideRadioButton()
Expand Down Expand Up @@ -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<RealmStepExam> = mRealm.where(RealmStepExam::class.java)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class SurveyFragment : BaseRecyclerFragment<RealmStepExam?>() {
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) {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/fragment_my_submission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:orientation="vertical">

<LinearLayout
android:id="@+id/llSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
Expand Down Expand Up @@ -67,6 +68,7 @@


<LinearLayout
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/md_blue_grey_50"
Expand Down Expand Up @@ -113,4 +115,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

<TextView
android:visibility="gone"
android:id="@+id/tvMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
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 @@ -1045,5 +1045,6 @@
<string name="checking_server">جارٍ فحص الخادم</string>
<string name="below_min_apk">إصدار Apk أقل من المسموح. يرجى تحديث التطبيق إلى أحدث إصدار.</string>
<string name="add_note">إضافة ملاحظة (اختياري)</string>
<string name="no_submissions">التقديمات غير متاحة</string>

</resources>
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 @@ -1045,5 +1045,6 @@
<string name="checking_server">verificando el servidor</string>
<string name="below_min_apk">la versión de la aplicación está por debajo de la permitida. Actualice la aplicación a la última versión.</string>
<string name="add_note">Agregar una nota (opcional)</string>
<string name="no_submissions">envíos no disponibles</string>

</resources>
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 @@ -1045,5 +1045,6 @@
<string name="checking_server">vérification du serveur</string>
<string name="below_min_apk">la version de l\'app est inférieure à celle autorisée. veuillez mettre à jour l\'application vers la dernière version.</string>
<string name="add_note">Ajouter une note (optionnel)</string>
<string name="no_submissions">soumissions non disponibles</string>

</resources>
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 @@ -1045,5 +1045,6 @@
<string name="checking_server">सर्भर जाँच गर्दै</string>
<string name="below_min_apk">एप संस्करण अनुमत संस्करणभन्दा कम छ। कृपया अनुप्रयोगलाई नवीनतम संस्करणमा अद्यावधिक गर्नुहोस्।</string>
<string name="add_note">नोट थप्नुहोस् (वैकल्पिक)</string>
<string name="no_submissions">पेशाहरू उपलब्ध छैनन्</string>

</resources>
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 @@ -1045,5 +1045,6 @@
<string name="checking_server">hubinta server-ka</string>
<string name="below_min_apk">nooca app-ga waa ka hooseeyaa kan la oggol yahay. fadlan cusbooneysii app-ka nooca ugu dambeeya.</string>
<string name="add_note">Ku dar falanqeey (ixtiyaacsi ah)</string>
<string name="no_submissions">soo gudbin lama heli karo</string>

</resources>
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 @@ -1045,5 +1045,6 @@
<string name="checking_server">checking server</string>
<string name="below_min_apk">app is below allowed version. please update the app to the latest version.</string>
<string name="add_note">add a note (optional)</string>
<string name="no_submissions">submissions not available</string>

</resources>

0 comments on commit ae4960d

Please sign in to comment.