MainActivity.kt
package com.cfsuman.kotlintutorials
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// If the support action bar is available
supportActionBar?.apply {
// Set the action bar title
title = " Display Logo On ActionBar"
// Action bar more settings to display logo
setDisplayShowHomeEnabled(true)
setDisplayUseLogoEnabled(true)
// Set the icon to show as logo on action bar
setLogo(R.drawable.ic_action_help)
}
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
android:id="@+id/rootLayout"
android:background="#DCDCDC" />

- android kotlin - ActionBar title text size
- android kotlin - ActionBar title color
- android kotlin - ActionBar title style
- android kotlin - ActionBar title padding left
- android kotlin - AlertDialog EditText programmatically
- android kotlin - AlertDialog title align center programmatically
- android kotlin - AlertDialog title text color size bold programmatically
- android kotlin - Full screen AlertDialog example
- android kotlin - Create spinner programmatically
- android kotlin - Spinner item separator programmatically
- android kotlin - Disable an item in Spinner
- android kotlin - Spinner text align center right programmatically
- android kotlin - Spinner text color programmatically
- android kotlin - Spinner text size programmatically
- android kotlin - ConstraintLayout center in parent programmatically