Android

In this Kotlin programming tutorial I am going to share with you how to load image from a remote URL in Kotlin using Glide. Glide is probably the easiest and the most efficient way to load image to an ImageView.  You can use Glide to load a local image and well as an image hosted on a remote…

Read More Load Image From a Remote URL with Kotlin and Glide

In this short Kotlin programming tutorial we will learn how to create a Switch in Kotlin programmatically. In the code example below we are going to cover: Create Switch and add it to a LinearLayout Get input from the Switch when it’s state is changed  Set textOff and textOn text programmatically Set OnClickListener on the…

Read More Create a Switch in Kotlin Programmatically

In this short Kotlin tutorial I am going to share with you how to create a TimePicker in Kotlin programmatically and how to update text label when the value of Hours or Minutes has changed. The below code example will cover: Create TimePicker and add it to LinearLayout Get input from TimePicker when user changes the value…

Read More Create TimePicker in Kotlin Programmatically

In this Kotlin code example we will learn how to create DatePicker in Kotlin programmatically. To break it in more details the code example below will cover:  Create DatePicker in LinearLayout Initialize DatePicker with current date( Year, Month and Day) When user changes the DatePicker values, call OnDateChangeListener and get input from the DatePicker Set DatePicker values…

Read More Create DatePicker in Kotlin

In Kotlin you may skip and not use the findViewById( ) and still be able to refer to UI components defined in XML Layout file. There is another way. You will need to do a couple of things first:  Edit your Module/ app level build.gradle file Import the data binding library into the Kotlin file (Don’t worry,…

Read More You may skip and not use the findViewById( ) in Kotlin

Below is a very short tutorial on how to create RecyclerView in Kotlin programmatically. RecyclerView is a flexible view for providing a limited window into a large data set and learning how to create and use it make you even better Mobile App Developer :). The Kotlin code example below will cover: Create RecyclerView Create RecyclerAdapter Create a…

Read More Create RecyclerView in Kotlin Programmatically

With this blog post I am going to share with you how to create a ListView in Kotlin programmatically. ListView is a very commonly used UI component and knowing how to work with it enables you build even more powerful apps. The example below will cover: Create ListView in a ConstraintLayout Populate ListView with data using…

Read More Create ListView in Kotlin Programmatically

In this short code example in Kotlin I am going to share with you how to create an EditText programmatically and also how to: Add the created EditText in a ConstraintLayout Set hint text for the TextView Set text color Set EditText backgroundColor Layout XML file for the EditText UI component <?xml version=”1.0″ encoding=”utf-8″?> <android.support.constraint.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android”…

Read More Create EditText in Kotlin Programmatically