Commit 8395b9d3 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Display wildcard rule in search dialog

parent 16425854
...@@ -59,7 +59,13 @@ class DnsRuleSearchDialog( ...@@ -59,7 +59,13 @@ class DnsRuleSearchDialog(
val hostSource = rule?.importedFrom?.let { getHostSourceForId(it) } val hostSource = rule?.importedFrom?.let { getHostSourceForId(it) }
if(isActive) launch(Dispatchers.Main) { if(isActive) launch(Dispatchers.Main) {
if(rule == null) displayRuleSource(wasFound = false, isUserRule = false, null) if(rule == null) displayRuleSource(wasFound = false, isUserRule = false, null)
else displayRuleSource(wasFound = true, isUserRule = rule.importedFrom == null, hostSource) else {
displayRuleSource(wasFound = true, isUserRule = rule.importedFrom == null, hostSource)
val readableHost = DnsRuleDialog.printableHost(rule.host)
if(readableHost != rule.host) {
view.searchResultRule.text = readableHost
}
}
} }
} }
else clearSearchResultText() else clearSearchResultText()
...@@ -129,5 +135,6 @@ class DnsRuleSearchDialog( ...@@ -129,5 +135,6 @@ class DnsRuleSearchDialog(
private fun clearSearchResultText() { private fun clearSearchResultText() {
view.searchResult.text = "" view.searchResult.text = ""
view.searchResultRule.text = ""
} }
} }
\ No newline at end of file
...@@ -2,43 +2,48 @@ ...@@ -2,43 +2,48 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:padding="16dp" android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:padding="16dp">
android:layout_height="match_parent">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="@string/dialog_dnsrules_search_message" android:layout_height="wrap_content"
android:layout_height="wrap_content" /> android:text="@string/dialog_dnsrules_search_message" />
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/searchTermTIL"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:paddingLeft="32dp" android:paddingLeft="32dp"
android:paddingRight="32dp" android:paddingRight="32dp"
android:layout_marginTop="32dp"
android:id="@+id/searchTermTIL"
android:visibility="visible"
app:errorEnabled="true"
android:textColorHint="?android:attr/textColorSecondary" android:textColorHint="?android:attr/textColorSecondary"
android:layout_height="wrap_content"> android:visibility="visible"
app:errorEnabled="true">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/searchTerm"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_searchterm" android:hint="@string/hint_searchterm"
android:id="@+id/searchTerm"
android:text="example.com"
android:inputType="textUri" android:inputType="textUri"
android:textDirection="locale" android:text="example.com"
android:textAlignment="viewStart" android:textAlignment="viewStart"
tools:ignore="HardcodedText" android:textDirection="locale"
android:layout_height="wrap_content"/> tools:ignore="HardcodedText" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<TextView <TextView
android:layout_width="wrap_content"
android:id="@+id/searchResult" android:id="@+id/searchResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/searchResultRule"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment