mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Design review fixes.
This commit is contained in:
parent
a10253c003
commit
7546071df8
2 changed files with 10 additions and 2 deletions
|
@ -56,7 +56,8 @@ class CreatePollController @Inject constructor(
|
|||
id("question")
|
||||
value(currentState.question)
|
||||
hint(host.stringProvider.getString(R.string.create_poll_question_hint))
|
||||
singleLine(false)
|
||||
singleLine(true)
|
||||
imeOptions(EditorInfo.IME_ACTION_NEXT)
|
||||
maxLength(500)
|
||||
onTextChange {
|
||||
host.callback?.onQuestionChanged(it)
|
||||
|
|
|
@ -22,6 +22,7 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.airbnb.mvrx.activityViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.R
|
||||
|
@ -50,7 +51,7 @@ class CreatePollFragment @Inject constructor(
|
|||
super.onViewCreated(view, savedInstanceState)
|
||||
vectorBaseActivity.setSupportActionBar(views.createPollToolbar)
|
||||
|
||||
views.createPollRecyclerView.configureWith(controller)
|
||||
views.createPollRecyclerView.configureWith(controller, disableItemAnimation = true)
|
||||
controller.callback = this
|
||||
|
||||
views.createPollClose.debouncedClicks {
|
||||
|
@ -92,6 +93,12 @@ class CreatePollFragment @Inject constructor(
|
|||
|
||||
override fun onAddOption() {
|
||||
viewModel.handle(CreatePollAction.OnAddOption)
|
||||
// Scroll to bottom to show "Add Option" button
|
||||
views.createPollRecyclerView.apply {
|
||||
postDelayed({
|
||||
smoothScrollToPosition(adapter?.itemCount?.minus(1) ?: 0)
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSuccess() {
|
||||
|
|
Loading…
Reference in a new issue