Google recently released an alpha update(1.2.0-alpha05) of its material components library that includes the implementation of The motion system which is a set of guidance for transition patterns between views.
The motion system categories transitions pattern of views and fragments/activities in 4 different types
The container transform pattern is used when the transition includes a persistent container (buttons, lists or cards) that transitions into a detailed view.
Note: It’s a shared element transition but unlike the traditional shared element transition that works on a single shared element between both views container transformation changes bounds of start view to the bounds of end view which can be two different views on the same screen or a view on different fragment/activity. …
Google introduced view binding in the What’s new in Android session at Google I/O 2019.
There is a brief talk about view binding in What’s New in Architecture Components, which compares view binding with existing solutions and further talks about why view binding is better than existing solutions like data binding or Kotlin synthetics.
For me, Kotlin synthetics was working fine but all the IDs reside in a global namespace so if you are using an ID with the same name and if you import the ID from the wrong layout, you’re going to get a crash because the ID is not part of the current layout and there is no way to know this in advance unless you run your app and go to that layout. …
Android developers were happy when Google announced in-app update at Google I/0 2019 because we all wanted a way to tell our user if there is a critical update available that fixes some security flow. In-app update is also useful in some other cases like where you may have API v1 up and running on your server because 1.5% of users haven’t updated the application in months😂. So at work after knowing about in-app update we were quick to implement it so let’s dive right into it
There are two types of in-app updates available Immediate & Flexible.
Remember, Java provides interesting ways to generate random numbers and Kotlin is no different. Until recently Kotlin didn’t have its own Random class but with the release of Kotlin 1.3 developers now have a whole new kotlin.random package so let’s see how it’s done !! There are 4 (or more) ways to do it-
Let’s look at them one by one -
Kotlin is a multiplatform language and there was no common API to generate random number in Kotlin for all targets, there was no way to do that consistently in multiplatform code. As of 1.3, Kotlin comes with its own multiplatform Random generator. …
Previously in part one, we talked about different annotations available in ButterKnife. Please read part one to know the reason behind this article. We previously talked about Resource Binding and View Binding and left with @BindViews in which we can bind multiple views in a
Array. There are three convenience methods for working with view list or array.
apply(List, Action– Applies an action to each view.
apply(List, Setter, Object– Applies a setter value to each view.
apply(List, Property, Object– Applies a property value to each view.
Let’s cut the Rope… (oops Crap) and start coding
I’ll bind some country names inside CheckBox. …
Ever since I started mobile development I used many libraries some of them are evergreen, A must for every Android project of mine and one of them is ButterKnife. I hope most of you’re familiar with it… and just in case you’re not, check it out on Github.
I am using ButterKnife for the last two years and have seen many projects on GitHub that use ButterKnife but one thing I noticed is that very few of those projects actually make use of this library. Even I wasn’t using its awesome features until recently. Most of us use it only for binding view (the findViewById Phobia) and for setting clicks (The SetOnClickListener Phobia ) on views. I’ve seen many people on StackOverflow using
@OnClick from Butterknife at the same time using
setOnLongClickListener() their buttons on the same activity. So what about other listeners? Bindings other than BindView? Like
@BindBitmap ? At the time of writing ButterKnife 8.8.1 has 24 different annotations that we can use. …