Skip to content
Snippets Groups Projects
Commit c4d58520 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Minor Bugfixes

parent 0a1989c4
No related branches found
No related tags found
No related merge requests found
package de.kuschku.quasseldroid.ui.chat.buffers
import android.arch.lifecycle.Observer
import android.os.Build
import android.os.Bundle
import android.support.v7.widget.*
import android.view.*
......@@ -147,10 +146,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
}
override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?): Boolean {
mode?.tag = "MESSAGES"
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mode?.type = ActionMode.TYPE_FLOATING
}
mode?.tag = "BUFFERS"
return true
}
......@@ -216,8 +212,8 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
viewModel.collapsedNetworks,
::runInBackground,
activity!!::runOnUiThread,
clickListener,
longClickListener
::clickListener,
::longClickListener
)
chatList.adapter = listAdapter
......@@ -320,15 +316,15 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
outState.putParcelable(KEY_STATE_SPINNER, chatListSpinner.onSaveInstanceState())
}
private val clickListener: ((BufferId) -> Unit)? = {
private fun clickListener(it: BufferId) {
if (actionMode != null) {
longClickListener?.invoke(it)
longClickListener(it)
} else {
viewModel.buffer.onNext(it)
}
}
private val longClickListener: ((BufferId) -> Unit)? = {
private fun longClickListener(it: BufferId) {
if (actionMode == null) {
chatListToolbar.startActionMode(actionModeCallback)
}
......
......@@ -29,7 +29,7 @@
<android.support.v7.widget.CardView
android:layout_width="@dimen/max_content_width"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="32dp"
android:layout_marginTop="-64dp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment