Posts

TabLayout in Android with Kotlin

Image
1. Create New Project:            Lets create New Project with Kotlin support as follows: 2. Adding design library:           Add design library in app's build.gradle file. build.gradle         implementation 'com.android.support:design:26.1.0' 3. Drawing layouts:  Create a layout with TabLayout and ViewPager slide_page.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="match_parent"     android:layout_height="match_parent">     <LinearLayout         android:layout_width="0dp"         android:layout_height="0dp"         android:orientation="vertical"         app:layout_constraintBottom_toBottomOf="parent"         app:layout_con

RecyclerView with Kotlin in Android

Image
Hi,                                  This is my first post in Blog. So lets begin with something new, fun and easy ;) Lets do RecyclerView with Kotlin. 1. Create New Project : First, create a new project in Android Studio with Kotlin support. 2. Design Layouts :  Design layout with RecyclerView  as below: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     xmlns:app="http://schemas.android.com/apk/res-auto">     <android.support.v7.widget.RecyclerView         android:id="@+id/recyclerView"         android:layout_width="0dp"         android:layout_height="0dp"         too