On Oreo+, night mode isn't taken into account in the application resources. It is taken into account in the activity resources. To prevent any issues, when reading resources that have different values in day/night modes, always use an activity context to access these resources.
This impacts:
The search icon in the empty text
Move the creation of the empty text out of the view model and into the fragment. Create a sealed class (like enum) EmptyText, which the viewmodel publishes via a livedata to the fragment. The fragment observes this and is reponsible for determining which text to display.
The background color of the list rows.
Move the logic for determining the background color out of the various result LiveDatas and into the RTListAdapter.
On Oreo+, night mode isn't taken into account in the application resources. It is taken into account in the activity resources. To prevent any issues, when reading resources that have different values in day/night modes, always use an activity context to access these resources.
This impacts:
EmptyText
, which the viewmodel publishes via a livedata to the fragment. The fragment observes this and is reponsible for determining which text to display.