mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 00:05:04 +01:00
Hide floating button on search
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
27829eb1d8
commit
28892c9728
@ -34,10 +34,9 @@ import android.widget.EditText
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.appcompat.app.ActionBar
|
||||
import androidx.core.view.isVisible
|
||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
import com.bluelinelabs.conductor.ControllerChangeType
|
||||
import com.bluelinelabs.conductor.autodispose.ControllerScopeProvider
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.activities.MainActivity
|
||||
import com.nextcloud.talk.controllers.AccountVerificationController
|
||||
@ -75,6 +74,18 @@ abstract class BaseController : ButterKnifeController(), ComponentCallbacks {
|
||||
return actionBarProvider?.supportActionBar
|
||||
}
|
||||
|
||||
protected val floatingActionButton: FloatingActionButton?
|
||||
get() {
|
||||
var floatingActionButton: FloatingActionButton? = null
|
||||
activity?.let {
|
||||
if (it is MainActivity) {
|
||||
floatingActionButton = it.floatingActionButton
|
||||
}
|
||||
}
|
||||
|
||||
return floatingActionButton
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
return when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
|
@ -125,6 +125,15 @@ class ConversationsListView : BaseView() {
|
||||
viewModel.filterLiveData.observe(this@ConversationsListView) {query ->
|
||||
activity?.settingsButton?.isVisible = query.isNullOrEmpty()
|
||||
activity?.clearButton?.isVisible = !query.isNullOrEmpty()
|
||||
if (query.isNullOrEmpty()) {
|
||||
if (floatingActionButton?.isOrWillBeShown == false) {
|
||||
floatingActionButton?.show()
|
||||
}
|
||||
} else {
|
||||
if (floatingActionButton?.isOrWillBeHidden == false) {
|
||||
floatingActionButton?.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
return view
|
||||
}
|
||||
@ -211,11 +220,6 @@ class ConversationsListView : BaseView() {
|
||||
return R.layout.controller_conversations_rv
|
||||
}
|
||||
|
||||
/*@OnClick(R.id.floatingActionButton)
|
||||
fun onFloatingActionButtonClick() {
|
||||
openNewConversationScreen()
|
||||
}*/
|
||||
|
||||
private fun openNewConversationScreen() {
|
||||
val bundle = Bundle()
|
||||
bundle.putBoolean(BundleKeys.KEY_NEW_CONVERSATION, true)
|
||||
|
Loading…
Reference in New Issue
Block a user