Posts

Shimmer Layout like Facebook in Android - Kotlin

Image
While loading data from API, we used to show boring loaders. But in Facebook's app, one loading screen will be displayed. That one looks interesting know. We can also do that shimmer effect in our Andorid App using Shimmer library by Facebook. Let's start. Implementation: build.gradle Include the following in app-level gradle file. implementation 'com.facebook.shimmer:shimmer:0.1.0' colors.xml Include the following color in values -> colors.xml <color name= "placeholder_color" > #dddddd </color> Design: 1. First we have to design placeholder layout that is similar to your RecyclerView's adapter layout. placeholder.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" android:layout_width...

Map, Location update and AutoComplete Places - Kotlin

Image
Let's see how to show current location in Maps and also show the location which is chosen from AutoComplete in Maps with the updated Google play services. That is, for location listening we gonna use   FusedLocationProviderClient and for autocomplete places, we gonna use, GeoDataClient with AutoCompletePrediction, i.e., no need to call places url from our end, Google Playservices will do that work for you. Okiee, Let's start now. You can find the project in Github . PreRequisite: Navigate to  https://developers.google.com/maps/documentation/android-api/signup and do as per the instructions to start. Manifest: Include your API key, which you got from previous step in AndroidManifest.xml <meta-data android:name= "com.google.android.geo.API_KEY" android:value= "AIzXXXXXXXXXX_XXXXXXXXXXXXXX" /> Gradle: Include the following in app-level build 's dependencies. implementation 'com...

AppIntro (OnBoard) Screen - Kotlin

Image
Introduction: App Intro/Onboard screen is mainly to display the key features of our app to users while launching it, in a sweet way. Let's do that simply with TabLayout, ViewPager and its PageTransformer.  Design: slide_page.xml  Desgin this layout with ViewPager and TabLayout to begin with. <?xml version= "1.0" encoding= "utf-8"? > <RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" android: id = "@+id/introLayout" android:layout_width= "match_parent" android:layout_height= "match_parent" > <android.support.v4.view.ViewPager android: id = "@+id/viewPager" android:layout_width= "match_parent" android:layout_height= "match_parent" android:layout_above= "@+id/tabLayout" /> <android.support....