Breaking News Fragment
Learn how to load data to our fragments from the ViewModel
We'll cover the following
Understanding the breaking news fragment
In this fragment, a list of articles is loaded into a RecyclerView
. The adapter has an onClick
listener set on the articles so that when an item is clicked, a WebView
is opened within the application where the user can read the article.
The fragment has been optimized with various features to improve the application’s data handling, performance, and efficiency. These features include using ViewBinding
and coroutines. These technologies help to improve the structure and organization of the code, as well as the efficiency and speed of the application. Let’s break it down for better comprehension.
Get hands-on with 1400+ tech skills courses.