Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teams: smoother empty list (fixes #3727) #3743

Merged
merged 7 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1646
versionName "0.16.46"
versionCode 1647
versionName "0.16.47"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ abstract class BaseRecyclerFragment<LI> : BaseRecyclerParentFragment<Any?>(), On
"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)
"teams" -> (v as TextView).setText(R.string.no_teams)
"chatHistory" -> (v as TextView).setText(R.string.no_chats)
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 @@ -11,6 +11,7 @@ import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import org.ole.planet.myplanet.base.BaseRecyclerFragment.Companion.showNoData
import io.realm.Case
import io.realm.Realm
import io.realm.RealmQuery
Expand Down Expand Up @@ -242,6 +243,12 @@ class TeamFragment : Fragment(), AdapterTeamList.OnClickTeamItem {
}
fragmentTeamBinding.rvTeamList.adapter = adapterTeamList
listContentDescription(conditionApplied)
val itemCount = adapterTeamList?.itemCount
showNoData(fragmentTeamBinding.tvMessage, itemCount, "teams")
if (itemCount == 0) {
fragmentTeamBinding.etSearch.visibility = View.GONE
fragmentTeamBinding.tableTitle.visibility = View.GONE
}
}

override fun onEditTeam(team: RealmMyTeam?) {
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/fragment_team.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@
android:layout_weight="1" />

</LinearLayout>

<TextView
android:visibility="gone"
android:id="@+id/tvMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_team"
android:layout_width="wrap_content"
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 @@ -1046,6 +1046,7 @@
<string name="checking_server">جارٍ فحص الخادم</string>
<string name="below_min_apk">إصدار Apk أقل من المسموح. يرجى تحديث التطبيق إلى أحدث إصدار.</string>
<string name="add_note">إضافة ملاحظة (اختياري)</string>
<string name="no_teams">الفرق غير متوفرة</string>
<string name="planet_name">كوكب %s</string>
<string name="no_submissions">التقديمات غير متاحة</string>
<string name="no_chats">لا توجد محادثات سابقة</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 @@ -1046,6 +1046,7 @@
<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_teams">equipos no disponibles</string>
<string name="planet_name">%s Planeta</string>
<string name="no_submissions">envíos no disponibles</string>
<string name="no_chats">no hay chats anteriores</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 @@ -1046,6 +1046,7 @@
<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_teams">équipes non disponibles</string>
<string name="planet_name">%s planète</string>
<string name="no_submissions">soumissions non disponibles</string>
<string name="no_chats">aucune discussion précédente</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 @@ -1046,6 +1046,7 @@
<string name="checking_server">सर्भर जाँच गर्दै</string>
<string name="below_min_apk">एप संस्करण अनुमत संस्करणभन्दा कम छ। कृपया अनुप्रयोगलाई नवीनतम संस्करणमा अद्यावधिक गर्नुहोस्।</string>
<string name="add_note">नोट थप्नुहोस् (वैकल्पिक)</string>
<string name="no_teams">टोलीहरू उपलब्ध छैनन्</string>
<string name="planet_name">%s ग्रह</string>
<string name="no_submissions">पेशाहरू उपलब्ध छैनन्</string>
<string name="no_chats">अघिल्ला कुराकानीहरू छैनन्</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 @@ -1046,6 +1046,7 @@
<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_teams">kooxaha aan la heli karin</string>
<string name="planet_name">%s Meerah</string>
<string name="no_submissions">soo gudbin lama heli karo</string>
<string name="no_chats">ma jiraan wada sheekaysi hore</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 @@ -1046,6 +1046,7 @@
<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_teams">teams not available</string>
<string name="planet_name">%s\'s Planet</string>
<string name="no_submissions">submissions not available</string>
<string name="no_chats">no previous chats</string>
Expand Down