Custom Toolbar

This commit is contained in:
Moez Bhatti
2017-09-26 01:12:33 -04:00
parent bea81ce7b8
commit 413ff51f0f
7 changed files with 94 additions and 24 deletions
@@ -2,6 +2,7 @@ package com.moez.QKSMS.ui.base
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
import kotlinx.android.synthetic.main.toolbar.*
abstract class QkActivity : AppCompatActivity() {
@@ -15,4 +16,15 @@ abstract class QkActivity : AppCompatActivity() {
}
}
override fun setContentView(layoutResID: Int) {
super.setContentView(layoutResID)
setSupportActionBar(toolbar)
title = title // The title may have been set before layout inflation
}
override fun setTitle(title: CharSequence?) {
super.setTitle(title)
toolbarTitle?.text = title
}
}
@@ -21,14 +21,14 @@ class GroupAvatarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int)
constructor(context: Context) : this(context, null, 0)
init {
if (!isInEditMode) {
View.inflate(context, R.layout.group_avatar_view, this)
}
View.inflate(context, R.layout.group_avatar_view, this)
}
override fun onFinishInflate() {
super.onFinishInflate()
updateView()
if (!isInEditMode) {
updateView()
}
}
private fun updateView() {