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
Nathan OBrian
Nebulo
Commits
22eeddeb
Commit
22eeddeb
authored
Aug 08, 2019
by
Daniel Wolf
Browse files
Use the dialog for refreshing the sources
parent
3015ac1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/dialog/HostSourceRefreshDialog.kt
View file @
22eeddeb
...
...
@@ -2,6 +2,7 @@ package com.frostnerd.smokescreen.dialog
import
android.content.Context
import
android.content.DialogInterface
import
androidx.annotation.Keep
import
androidx.appcompat.app.AlertDialog
import
com.frostnerd.smokescreen.R
import
com.frostnerd.smokescreen.getPreferences
...
...
@@ -57,6 +58,7 @@ class HostSourceRefreshDialog(context:Context,
}
}
@Keep
enum
class
TimeUnit
{
HOURS
,
DAYS
,
WEEKS
}
...
...
app/src/main/java/com/frostnerd/smokescreen/fragment/DnsRuleFragment.kt
View file @
22eeddeb
...
...
@@ -23,6 +23,7 @@ import com.frostnerd.smokescreen.database.entities.HostSource
import
com.frostnerd.smokescreen.database.getDatabase
import
com.frostnerd.smokescreen.dialog.DnsRuleDialog
import
com.frostnerd.smokescreen.dialog.ExportDnsRulesDialog
import
com.frostnerd.smokescreen.dialog.HostSourceRefreshDialog
import
com.frostnerd.smokescreen.dialog.NewHostSourceDialog
import
com.frostnerd.smokescreen.service.RuleExportService
import
com.frostnerd.smokescreen.service.RuleImportService
...
...
@@ -118,13 +119,15 @@ class DnsRuleFragment : Fragment() {
}).
show
()
}
refresh
.
setOnClickListener
{
if
(
context
!!
.
isServiceRunning
(
RuleImportService
::
class
.
java
))
{
context
!!
.
startService
(
Intent
(
context
!!
,
RuleImportService
::
class
.
java
).
putExtra
(
"abort"
,
true
))
}
else
{
context
!!
.
startService
(
Intent
(
context
!!
,
RuleImportService
::
class
.
java
))
refreshProgress
.
show
()
refreshProgressShown
=
true
}
HostSourceRefreshDialog
(
context
!!
)
{
if
(
context
!!
.
isServiceRunning
(
RuleImportService
::
class
.
java
))
{
context
!!
.
startService
(
Intent
(
context
!!
,
RuleImportService
::
class
.
java
).
putExtra
(
"abort"
,
true
))
}
else
{
context
!!
.
startService
(
Intent
(
context
!!
,
RuleImportService
::
class
.
java
))
refreshProgress
.
show
()
refreshProgressShown
=
true
}
}.
show
()
}
export
.
setOnClickListener
{
if
(
context
!!
.
isServiceRunning
(
RuleExportService
::
class
.
java
))
{
...
...
Write
Preview
Markdown
is supported
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