Skip to content

Commit

Permalink
courses: text when filter results empty (fixes open-learning-exchange…
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanGazali and dogi authored Dec 20, 2023
1 parent 1a9f194 commit 7714ddb
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 3 deletions.
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 1200
versionName "0.12.00"
versionCode 1201
versionName "0.12.1"
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 @@ -59,6 +59,12 @@ public static void showNoData(View v, int count) {
((TextView) v).setText(R.string.no_data_available_please_check_and_try_again);
}

public static void showNoFilter(View v, int count) {
if (v == null) return;
v.setVisibility(count == 0 ? View.VISIBLE : View.GONE);
((TextView) v).setText(R.string.no_course_matched_filter);
}

public abstract int getLayout();

public abstract RecyclerView.Adapter getAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l)
gradeLevel = spnGrade.getSelectedItem().toString().equals("All") ? "" : spnGrade.getSelectedItem().toString();
subjectLevel = spnSubject.getSelectedItem().toString().equals("All") ? "" : spnSubject.getSelectedItem().toString();
adapterCourses.setCourseList(filterCourseByTag(etSearch.getText().toString(), searchTags));
showNoFilter(tvMessage, adapterCourses.getItemCount());
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -956,5 +956,6 @@
<string name="web_view">عرض الويب</string>
<string name="invalid_configuration">تكوينات الخادم غير صالحة</string>
<string name="date_reset">إعادة ضبط التاريخ</string>

<string name="no_course_matched_filter">لا توجد دورات تطابق الفلتر</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 @@ -961,5 +961,6 @@
<string name="web_view">vista web</string>
<string name="invalid_configuration">Configuraciones de servidor no válidas</string>
<string name="date_reset">Restablecer fecha</string>
<string name="no_course_matched_filter">Ningún curso coincide con el filtro</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 @@ -961,5 +961,6 @@
<string name="web_view">vue web</string>
<string name="invalid_configuration">Configurations de serveur invalides</string>
<string name="date_reset">Réinitialisation des dates</string>
<string name="no_course_matched_filter">Aucun cours ne correspond au filtre</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 @@ -961,5 +961,6 @@
<string name="web_view">वेब दृश्य</string>
<string name="invalid_configuration">अमान्य सर्भर विन्यास</string>
<string name="date_reset">मिति रिसेट</string>
<string name="no_course_matched_filter">कुनै पनि पाठ्यक्रम मेल खाँदैन</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 @@ -950,5 +950,6 @@
<string name="web_view">barashada webka</string>
<string name="invalid_configuration">Dhamaan Suurtagal ah oo Serveryaasha ah</string>
<string name="date_reset">Dib u habeynta taariikhda</string>
<string name="no_course_matched_filter">Ma jiro koorsooyin u dhigma filtarrada</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 @@ -685,6 +685,7 @@
<string name="select_resource_to_open">"Select resource to open : "</string>
<string name="shared_to_community">Shared to community</string>
<string name="no_data_available_please_check_and_try_again">No data available, please check and try again.</string>
<string name="no_course_matched_filter">No courses matched filter</string>
<string name="added_to_my_library">Added to my library</string>
<string name="added_to_my_courses">Added to my courses</string>
<string name="do_you_want_to_stay_online">Do you want to stay online?</string>
Expand Down

0 comments on commit 7714ddb

Please sign in to comment.