If you have knowledge, let others light their candles in it.
Android Jetpack introducing new concepts day by day. Now, Jetpack introduce another data storage solution “Data Store”. Now, It is in beta.
What is Data Store?
It is a data storage solution. It uses Kotlin coroutines and Flow to store data asynchronously, consistently, and transactionally. Just like Shared Preferences, It also allow us to store data in key-value pairs and typed objects with help of protocol buffers.
Types of Data Store
There are two types of Data Store : Preferences Data Store, Proto Data Store.
Love of learning is the most necessary passion … In it lies our happiness. It’s a sure remedy for what ails us, an unending source of pleasure
— Emilie du Chatelet
We all are using Recycler view to show the list of items in app. But when the time comes to update the data then we just called notifyDataSetChanged() which is very costly operation because it updates the whole view. So here, DiffUtil comes into the picture, it just update those views that were actually changed…
DiffUtil is a utility class that calculates the difference between two lists and outputs…
Sharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without loosing something.
Most of the developers facing the problem of restore the recycler view position when view recreated (on rotation). But Finally Android come up with StateRestorationPolicy to solve this problem. So, Let’s get deep dive into this article and after reading this article please try with yourself….
Starting from 1.2.0-alpha02, Recycler View introduces a new API to let the Adapter block layout restoration until it is ready.
State Restoration Policy has 3 states.
Share your knowledge. It’s a way to achieve immortality.
This is the fourth and last series of articles which cover the fundamentals of using Constraint Layout. We will talk about Helpers in constraint layout.
Utility class representing a Guideline helper object for Constraint Layout. Helper objects are not displayed on device (they are marked as View.GONE) and are only used for layout purposes. They only work within a Constraint Layout. A Guideline can be either horizontal or vertical.
Vertical Guidelines have a width of zero and the height of their Constraint Layout parent
Horizontal Guidelines have a height of…
An investment in knowledge always pays the best interest.
We have already covered to create new layout, Constraint types and some shortcut attributes. Please go through this link: https://swatiomar09.medium.com/constraint-layout-part-ii-21a8d4c943f9
So let’s talk about Chains…
A chain is a group of views that are linked to each other along with bi-directional position constraints. The views within a chain can be distributed either vertically or horizontally. We can also combine horizontal and vertical chains.
Press Shift and select all views and right click horizontal chain or select any one then change default spread mode to anyone, chain created but you…
The beautiful thing about learning is that nobody can take it away from you.
― B.B. King
We have already covered what is Constraint layout, Why it introduced and how to convert an existing layout to constraint layout. Please go through this link: https://medium.com/@swatiomar09/constraint-layout-part-i-2b05f3d4c987
So let’s proceed further…
Note: When creating constraints, remember the following rules:
Every view must have at least two constraints: one…
In this tutorial, we are going to learn Constraint Layout. But To start learning let’s know what is constraint layout and why it introduced.
Constraint Layout allows you to create large and complex layouts with a flat view hierarchy (no nested view groups).
We already have Linear layout, Relative layout etc. But When we have to create large layouts then there will be nested view hierarchy which is very complex and hard to read. So…