diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightRuleAdapter.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightRuleAdapter.kt index f0ee87c00c756e3720b6f22b4e830d9c5bf5647e..3bd7fa9dbaa5186fa2d94c5009d1c9aaee3ad080 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightRuleAdapter.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightRuleAdapter.kt @@ -99,12 +99,24 @@ class HighlightRuleAdapter( @BindView(R.id.name) lateinit var name: TextView + @BindView(R.id.name_row) + lateinit var nameRow: View + @BindView(R.id.sender) lateinit var sender: TextView + @BindView(R.id.sender_row) + lateinit var senderRow: View + @BindView(R.id.channel) 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) lateinit var toggle: SwitchCompat @@ -136,10 +148,13 @@ class HighlightRuleAdapter( fun bind(item: HighlightRuleManager.HighlightRule) { this.item = item name.text = item.name + nameRow.visibleIf(item.name.isNotBlank()) sender.text = item.sender - sender.visibleIf(item.sender.isNotBlank()) + senderRow.visibleIf(item.sender.isNotBlank()) 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 } } diff --git a/app/src/main/res/drawable/ic_channel.xml b/app/src/main/res/drawable/ic_channel.xml new file mode 100644 index 0000000000000000000000000000000000000000..c4493cd12788247883a122a636279863a0b56af0 --- /dev/null +++ b/app/src/main/res/drawable/ic_channel.xml @@ -0,0 +1,9 @@ +<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> diff --git a/app/src/main/res/layout/settings_highlightlist_rule.xml b/app/src/main/res/layout/settings_highlightlist_rule.xml index a692fa5e16159c1d52cc71d422b269703a04bcd4..1df25f2c4d8e4ebce2410376773bf6907d2b3168 100644 --- a/app/src/main/res/layout/settings_highlightlist_rule.xml +++ b/app/src/main/res/layout/settings_highlightlist_rule.xml @@ -54,7 +54,25 @@ android:paddingBottom="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 + android:id="@+id/name_row" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> @@ -84,6 +102,7 @@ </LinearLayout> <LinearLayout + android:id="@+id/sender_row" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> @@ -110,13 +129,18 @@ </LinearLayout> <LinearLayout + android:id="@+id/channel_row" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> - <Space - android:layout_width="32dp" - android:layout_height="wrap_content" /> + <androidx.appcompat.widget.AppCompatImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginRight="8dp" + app:srcCompat="@drawable/ic_channel" + app:tint="?colorTextSecondary" /> <TextView android:id="@+id/channel"