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
fa1f309b
Commit
fa1f309b
authored
Aug 08, 2019
by
Daniel Wolf
Browse files
Added minute as time unit
parent
03df59d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/dialog/HostSourceRefreshDialog.kt
View file @
fa1f309b
...
...
@@ -48,10 +48,6 @@ class HostSourceRefreshDialog(context:Context,
view
.
automaticRefresh
.
setOnCheckedChangeListener
{
_
,
isChecked
->
changeAutomaticRefreshStatus
(
isChecked
)
}
view
.
automaticRefresh
.
isChecked
=
context
.
getPreferences
().
automaticHostRefresh
view
.
refreshWifiOnly
.
isChecked
=
context
.
getPreferences
().
automaticHostRefreshWifiOnly
view
.
timeAmount
.
setText
(
context
.
getPreferences
().
automaticHostRefreshTimeAmount
.
toString
())
view
.
timeUnit
.
setSelection
(
context
.
getPreferences
().
automaticHostRefreshTimeUnit
.
ordinal
)
changeAutomaticRefreshStatus
(
view
.
automaticRefresh
.
isChecked
)
val
adapter
:
ArrayAdapter
<
CharSequence
>
=
ArrayAdapter
.
createFromResource
(
context
,
...
...
@@ -60,6 +56,10 @@ class HostSourceRefreshDialog(context:Context,
)
adapter
.
setDropDownViewResource
(
R
.
layout
.
item_tasker_action_spinner_dropdown_item
)
view
.
timeUnit
.
adapter
=
adapter
view
.
automaticRefresh
.
isChecked
=
context
.
getPreferences
().
automaticHostRefresh
view
.
refreshWifiOnly
.
isChecked
=
context
.
getPreferences
().
automaticHostRefreshWifiOnly
view
.
timeAmount
.
setText
(
context
.
getPreferences
().
automaticHostRefreshTimeAmount
.
toString
())
view
.
timeUnit
.
setSelection
(
context
.
getPreferences
().
automaticHostRefreshTimeUnit
.
ordinal
)
setButton
(
DialogInterface
.
BUTTON_NEUTRAL
,
context
.
getString
(
android
.
R
.
string
.
cancel
))
{
dialog
,
_
->
dialog
.
dismiss
()
}
...
...
@@ -75,6 +75,6 @@ class HostSourceRefreshDialog(context:Context,
@Keep
enum
class
TimeUnit
{
HOURS
,
DAYS
,
WEEKS
MINUTES
,
HOURS
,
DAYS
,
WEEKS
}
}
\ No newline at end of file
app/src/main/java/com/frostnerd/smokescreen/fragment/DnsRuleFragment.kt
View file @
fa1f309b
...
...
@@ -151,6 +151,7 @@ class DnsRuleFragment : Fragment() {
HostSourceRefreshDialog
.
TimeUnit
.
WEEKS
->
TimeUnit
.
DAYS
HostSourceRefreshDialog
.
TimeUnit
.
DAYS
->
TimeUnit
.
DAYS
HostSourceRefreshDialog
.
TimeUnit
.
HOURS
->
TimeUnit
.
HOURS
HostSourceRefreshDialog
.
TimeUnit
.
MINUTES
->
TimeUnit
.
MINUTES
}
}
val
workRequest
=
PeriodicWorkRequest
.
Builder
(
RuleImportStartWorker
::
class
.
java
,
...
...
app/src/main/res/values/strings-dialog.xml
View file @
fa1f309b
...
...
@@ -163,10 +163,12 @@
<string
name=
"dialog_hostsourcerefresh_wifi_only"
>
Refresh on WIFI only
</string>
<string
name=
"dialog_hostsourcerefresh_refresh_every"
>
Refresh every
</string>
<string
name=
"dialog_hostsourcerefresh_refresh_now"
>
Refresh now
</string>
<string
name=
"dialog_hostsourcerefresh_timeunit_minutes"
>
Minutes
</string>
<string
name=
"dialog_hostsourcerefresh_timeunit_hours"
>
Hours
</string>
<string
name=
"dialog_hostsourcerefresh_timeunit_days"
>
Days
</string>
<string
name=
"dialog_hostsourcerefresh_timeunit_weeks"
>
Weeks
</string>
<string-array
name=
"dialog_hostsourcerefresh_timeunits"
>
<item>
@string/dialog_hostsourcerefresh_timeunit_minutes
</item>
<item>
@string/dialog_hostsourcerefresh_timeunit_hours
</item>
<item>
@string/dialog_hostsourcerefresh_timeunit_days
</item>
<item>
@string/dialog_hostsourcerefresh_timeunit_weeks
</item>
...
...
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