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

Fixes #157

parent e9ba0397
No related branches found
No related tags found
No related merge requests found
...@@ -99,12 +99,24 @@ class HighlightRuleAdapter( ...@@ -99,12 +99,24 @@ class HighlightRuleAdapter(
@BindView(R.id.name) @BindView(R.id.name)
lateinit var name: TextView lateinit var name: TextView
@BindView(R.id.name_row)
lateinit var nameRow: View
@BindView(R.id.sender) @BindView(R.id.sender)
lateinit var sender: TextView lateinit var sender: TextView
@BindView(R.id.sender_row)
lateinit var senderRow: View
@BindView(R.id.channel) @BindView(R.id.channel)
lateinit var channel: TextView lateinit var channel: TextView
@BindView(R.id.channel_row)
lateinit var channelRow: View
@BindView(R.id.match_all)
lateinit var matchAll: View
@BindView(R.id.toggle) @BindView(R.id.toggle)
lateinit var toggle: SwitchCompat lateinit var toggle: SwitchCompat
...@@ -136,10 +148,13 @@ class HighlightRuleAdapter( ...@@ -136,10 +148,13 @@ class HighlightRuleAdapter(
fun bind(item: HighlightRuleManager.HighlightRule) { fun bind(item: HighlightRuleManager.HighlightRule) {
this.item = item this.item = item
name.text = item.name name.text = item.name
nameRow.visibleIf(item.name.isNotBlank())
sender.text = item.sender sender.text = item.sender
sender.visibleIf(item.sender.isNotBlank()) senderRow.visibleIf(item.sender.isNotBlank())
channel.text = item.channel channel.text = item.channel
channel.visibleIf(item.channel.isNotBlank()) channelRow.visibleIf(item.channel.isNotBlank())
matchAll.visibleIf(item.name.isBlank() && item.sender.isBlank() && item.channel.isBlank())
toggle.isChecked = item.isEnabled toggle.isChecked = item.isEnabled
} }
} }
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000"
android:pathData="M5.41,21L6.12,17H2.12L2.47,15H6.47L7.53,9H3.53L3.88,7H7.88L8.59,3H10.59L9.88,7H15.88L16.59,3H18.59L17.88,7H21.88L21.53,9H17.53L16.47,15H20.47L20.12,17H16.12L15.41,21H13.41L14.12,17H8.12L7.41,21H5.41M9.53,9L8.47,15H14.47L15.53,9H9.53Z" />
</vector>
...@@ -54,7 +54,25 @@ ...@@ -54,7 +54,25 @@
android:paddingBottom="16dp" android:paddingBottom="16dp"
android:paddingTop="16dp"> android:paddingTop="16dp">
<TextView
android:id="@+id/match_all"
style="@style/Widget.RtlConformTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="marquee"
android:orientation="vertical"
android:singleLine="true"
android:text="@string/label_match_all"
android:textAppearance="?android:textAppearanceMedium"
android:textColor="?colorTextPrimary"
android:textSize="16sp"
android:textStyle="italic"
android:visibility="gone"
tools:visibility="visible" />
<LinearLayout <LinearLayout
android:id="@+id/name_row"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -84,6 +102,7 @@ ...@@ -84,6 +102,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/sender_row"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -110,13 +129,18 @@ ...@@ -110,13 +129,18 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/channel_row"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<Space <androidx.appcompat.widget.AppCompatImageView
android:layout_width="32dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:srcCompat="@drawable/ic_channel"
app:tint="?colorTextSecondary" />
<TextView <TextView
android:id="@+id/channel" android:id="@+id/channel"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment