Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Faisal Alanzi
Nebulo
Commits
8395b9d3
Commit
8395b9d3
authored
Jun 05, 2021
by
Daniel Wolf
Browse files
Display wildcard rule in search dialog
parent
16425854
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/dialog/DnsRuleSearchDialog.kt
View file @
8395b9d3
...
...
@@ -59,7 +59,13 @@ class DnsRuleSearchDialog(
val
hostSource
=
rule
?.
importedFrom
?.
let
{
getHostSourceForId
(
it
)
}
if
(
isActive
)
launch
(
Dispatchers
.
Main
)
{
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
()
...
...
@@ -129,5 +135,6 @@ class DnsRuleSearchDialog(
private
fun
clearSearchResultText
()
{
view
.
searchResult
.
text
=
""
view
.
searchResultRule
.
text
=
""
}
}
\ No newline at end of file
app/src/main/res/layout/dialog_dnsrule_search.xml
View file @
8395b9d3
...
...
@@ -2,43 +2,48 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
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:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:padding=
"16dp"
>
<TextView
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
android:id=
"@+id/searchTermTIL"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:paddingLeft=
"32dp"
android:paddingRight=
"32dp"
android:layout_marginTop=
"32dp"
android:id=
"@+id/searchTermTIL"
android:visibility=
"visible"
app:errorEnabled=
"true"
android:textColorHint=
"?android:attr/textColorSecondary"
android:layout_height=
"wrap_content"
>
android:visibility=
"visible"
app:errorEnabled=
"true"
>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/searchTerm"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/hint_searchterm"
android:id=
"@+id/searchTerm"
android:text=
"example.com"
android:inputType=
"textUri"
android:text
Direction=
"locale
"
android:text
=
"example.com
"
android:textAlignment=
"viewStart"
tools:ignore=
"HardcodedText
"
android:layout_height=
"wrap_conten
t"
/>
android:textDirection=
"locale
"
tools:ignore=
"HardcodedTex
t"
/>
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width=
"wrap_content"
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"
/>
</LinearLayout>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment