mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Custom Toolbar
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user