Ashutosh Bhandari

Android

Screenshot testing with jetpack compose

What is Screenshot testing Screenshot or snapshot testing is a way to automate the validation of the UI components and widgets. It prevents regressions when updating any existing screen or component. A screenshot testing tool helps render a piece of UI (a screen or component), takes a snapshot of it, and then compares it with the...

26-Jun-2024

Android

Handling multiple backstack with FragmentManager

Multiple back stack support was added in Navigation 2.4.0-alpha01 and Fragment 1.4.0-alpha01. In this discussion, we will cover supporting Multiple backstacks with the conventional FragmentManager API. We will be using `Fragment 1.4.0-alpha01` or later to implement this. Background The fragment's backstack in Android is not made of...

29-Sep-2023

Android, Software development

Minimize number of layout inflation in RecyclerView Adapter

RecyclerView internally uses a ViewPool to save scrap views which are no longer visible on screen and can be recycled. Normally each recyclerview creates a seperate ViewPool which is limited to that recyclerview only. With the help of #RecyclerView.setRecycledViewPool() we can share a ViewPool across multiple RecyclerViews. With this we...

16-Dec-2021