
--------------------------------------------
MainActivity.kt
---------------------------------------------

package com.example.radiobutton
import android.graphics.Typeface
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
import android.widget.Toast

class MainActivity : AppCompatActivity() {
    private lateinit var firstText: TextView
    private lateinit var secondText:TextView
    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        firstText=findViewById<TextView>(R.id.textView1)
        secondText=findViewById<TextView>(R.id.textView2)
        firstText.text="world"
        secondText.text="hello"
        secondText.setTextColor(getColor(R.color.teal_700))
        secondText.typeface= Typeface.MONOSPACE
        secondText.setOnClickListener {
            Toast.makeText(this, "TextClicked", Toast.LENGTH_LONG).show()
        }

    }
}

--------------------------------------------
activity_main.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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">



    <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:layout_editor_absoluteX="64dp"
    tools:layout_editor_absoluteY="178dp" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:text="NotesJam"
        android:textSize="36sp"
        app:layout_editor_absoluteX="16dp"
        app:layout_editor_absoluteY="119dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.497"
        app:layout_constraintStart_toStartOf="parent"
        tools:layout_editor_absoluteY="207dp" />

</android.support.constraint.ConstraintLayout>


