@@ -36,7 +36,7 @@ abstract class BaseRecyclerFragment<LI> : BaseRecyclerParentFragment<Any?>(), On
3636 var gradeLevel = " "
3737 var subjectLevel = " "
3838 lateinit var recyclerView: RecyclerView
39- lateinit var tvMessage: TextView
39+ var tvMessage: View ? = null
4040 lateinit var tvFragmentInfo: TextView
4141 var tvDelete: TextView ? = null
4242 var list: MutableList <LI >? = null
@@ -340,8 +340,10 @@ abstract class BaseRecyclerFragment<LI> : BaseRecyclerParentFragment<Any?>(), On
340340 private val noDataMessages = mapOf (
341341 " courses" to R .string.no_courses,
342342 " resources" to R .string.no_resources,
343+ " resources_filtered" to R .string.no_results_for_filter,
343344 " finances" to R .string.no_finance_record,
344345 " news" to R .string.no_voices_available,
346+ " news_filtered" to R .string.no_results_for_filter,
345347 " teamCourses" to R .string.no_team_courses,
346348 " teamResources" to R .string.no_team_resources,
347349 " tasks" to R .string.no_tasks,
@@ -362,13 +364,15 @@ abstract class BaseRecyclerFragment<LI> : BaseRecyclerParentFragment<Any?>(), On
362364 v.visibility = if (count == 0 ) View .VISIBLE else View .GONE
363365 val messageRes = noDataMessages[source]
364366 ? : R .string.no_data_available_please_check_and_try_again
365- (v as TextView ).setText(messageRes)
367+ val textView = if (v is TextView ) v else v.findViewById<TextView >(R .id.tv_empty_message)
368+ textView?.setText(messageRes)
366369 }
367370
368371 fun showNoFilter (v : View ? , count : Int ) {
369372 v ? : return
370373 v.visibility = if (count == 0 ) View .VISIBLE else View .GONE
371- (v as TextView ).setText(R .string.no_course_matched_filter)
374+ val textView = if (v is TextView ) v else v.findViewById<TextView >(R .id.tv_empty_message)
375+ textView?.setText(R .string.no_course_matched_filter)
372376 }
373377 }
374378}
0 commit comments