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

Improved nick list

parent e400ca9e
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,9 @@ class NickListAdapter( ...@@ -29,7 +29,9 @@ class NickListAdapter(
runInBackground { runInBackground {
val list = it ?: emptyList() val list = it ?: emptyList()
val old: List<IrcUserItem> = data val old: List<IrcUserItem> = data
val new: List<IrcUserItem> = list.sortedBy { it.lowestMode } val new: List<IrcUserItem> = list
.sortedBy { it.nick.toLowerCase() }
.sortedBy { it.lowestMode }
val result = DiffUtil.calculateDiff( val result = DiffUtil.calculateDiff(
object : DiffUtil.Callback() { object : DiffUtil.Callback() {
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int) override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int)
...@@ -86,6 +88,9 @@ class NickListAdapter( ...@@ -86,6 +88,9 @@ class NickListAdapter(
itemView: View, itemView: View,
private val clickListener: ((String) -> Unit)? = null private val clickListener: ((String) -> Unit)? = null
) : RecyclerView.ViewHolder(itemView) { ) : RecyclerView.ViewHolder(itemView) {
@BindView(R.id.modesContainer)
lateinit var modesContainer: View
@BindView(R.id.modes) @BindView(R.id.modes)
lateinit var modes: TextView lateinit var modes: TextView
......
...@@ -15,8 +15,11 @@ ...@@ -15,8 +15,11 @@
tools:theme="@style/Theme.ChatTheme.Quassel_Light"> tools:theme="@style/Theme.ChatTheme.Quassel_Light">
<FrameLayout <FrameLayout
android:id="@+id/modesContainer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:minWidth="40dp"> android:minWidth="40dp">
<android.support.v7.widget.AppCompatTextView <android.support.v7.widget.AppCompatTextView
...@@ -41,8 +44,6 @@ ...@@ -41,8 +44,6 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|start" android:gravity="center_vertical|start"
android:orientation="vertical"> android:orientation="vertical">
......
...@@ -15,8 +15,11 @@ ...@@ -15,8 +15,11 @@
tools:theme="@style/Theme.ChatTheme.Quassel_Light"> tools:theme="@style/Theme.ChatTheme.Quassel_Light">
<FrameLayout <FrameLayout
android:id="@+id/modesContainer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:minWidth="40dp"> android:minWidth="40dp">
<android.support.v7.widget.AppCompatTextView <android.support.v7.widget.AppCompatTextView
...@@ -41,8 +44,6 @@ ...@@ -41,8 +44,6 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|start" android:gravity="center_vertical|start"
android:orientation="vertical"> android:orientation="vertical">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment