add setupOptionsBtn

This commit is contained in:
Chumva 2018-08-10 12:33:23 +03:00
parent f047a655c8
commit b14190c190

View file

@ -112,13 +112,11 @@ class MyLocationTabFragment : Fragment(), TelegramListener, ChatLiveMessagesList
} }
optionsBtn = mainView.findViewById<ImageView>(R.id.options).apply { optionsBtn = mainView.findViewById<ImageView>(R.id.options).apply {
setImageDrawable(app.uiUtils.getThemedIcon(R.drawable.ic_action_other_menu)) setupOptionsBtn(this)
setOnClickListener { (activity as MainActivity).showOptionsPopupMenu(this) }
} }
mainView.findViewById<ImageView>(R.id.options_title).apply { mainView.findViewById<ImageView>(R.id.options_title).apply {
setImageDrawable(app.uiUtils.getThemedIcon(R.drawable.ic_action_other_menu)) setupOptionsBtn(this)
setOnClickListener { (activity as MainActivity).showOptionsPopupMenu(this) }
} }
imageContainer = mainView.findViewById<FrameLayout>(R.id.image_container) imageContainer = mainView.findViewById<FrameLayout>(R.id.image_container)
@ -317,6 +315,11 @@ class MyLocationTabFragment : Fragment(), TelegramListener, ChatLiveMessagesList
} }
} }
private fun setupOptionsBtn(imageView: ImageView) {
imageView.setImageDrawable(app.uiUtils.getThemedIcon(R.drawable.ic_action_other_menu))
imageView.setOnClickListener { (activity as MainActivity).showOptionsPopupMenu(imageView) }
}
private fun updateTitleTextColor() { private fun updateTitleTextColor() {
val color = if (appBarCollapsed) R.color.app_bar_title_light else R.color.ctrl_active_light val color = if (appBarCollapsed) R.color.app_bar_title_light else R.color.ctrl_active_light
context?.also { context?.also {