Commit 8b0142db authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Design improvements

parent 0428dc56
......@@ -2,6 +2,7 @@ package com.frostnerd.smokescreen.dialog
import android.content.Context
import android.content.DialogInterface
import android.widget.ArrayAdapter
import androidx.annotation.Keep
import androidx.appcompat.app.AlertDialog
import com.frostnerd.smokescreen.R
......@@ -46,7 +47,14 @@ class HostSourceRefreshDialog(context:Context,
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(R.string.all_close)) { dialog, _ ->
val adapter: ArrayAdapter<CharSequence> = ArrayAdapter.createFromResource(
context,
R.array.dialog_hostsourcerefresh_timeunits,
R.layout.item_tasker_action_spinner_item
)
adapter.setDropDownViewResource(R.layout.item_tasker_action_spinner_dropdown_item)
view.timeUnit.adapter = adapter
setButton(DialogInterface.BUTTON_NEUTRAL, context.getString(android.R.string.cancel)) { dialog, _ ->
dialog.dismiss()
}
setButton(DialogInterface.BUTTON_POSITIVE, context.getString(android.R.string.ok)) { dialog, _ ->
......
......@@ -26,6 +26,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/dialog_hostsourcerefresh_refresh_every"
android:layout_height="wrap_content"/>
......@@ -55,8 +56,8 @@
android:layout_alignParentEnd="true"
android:layout_toEndOf="@id/timeAmountTil"
android:id="@+id/timeUnit"
android:layout_marginStart="8dp"
android:layout_alignBaseline="@id/timeAmountTil"
android:entries="@array/dialog_hostsourcerefresh_timeunits"
android:layout_height="wrap_content"/>
<Button
......
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