mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Enable widget stacks for all users
This commit is contained in:
@@ -54,7 +54,6 @@ open class HabitPickerDialog : Activity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
val component = (applicationContext as HabitsApplication).component
|
||||
val habitList = component.habitList
|
||||
val preferences = component.preferences
|
||||
widgetPreferences = component.widgetPreferences
|
||||
widgetUpdater = component.widgetUpdater
|
||||
widgetId = intent.extras?.getInt(EXTRA_APPWIDGET_ID, INVALID_APPWIDGET_ID) ?: 0
|
||||
@@ -79,7 +78,6 @@ open class HabitPickerDialog : Activity() {
|
||||
val listView = findViewById<ListView>(R.id.listView)
|
||||
val saveButton = findViewById<Button>(R.id.buttonSave)
|
||||
|
||||
if(preferences.isWidgetStackEnabled) {
|
||||
with(listView) {
|
||||
adapter = ArrayAdapter(context,
|
||||
android.R.layout.simple_list_item_multiple_choice,
|
||||
@@ -96,19 +94,6 @@ open class HabitPickerDialog : Activity() {
|
||||
}
|
||||
confirm(selectedIds)
|
||||
}
|
||||
} else {
|
||||
saveButton.visibility = GONE
|
||||
with(listView) {
|
||||
adapter = ArrayAdapter(context,
|
||||
android.R.layout.simple_list_item_1,
|
||||
habitNames)
|
||||
choiceMode = CHOICE_MODE_SINGLE
|
||||
itemsCanFocus = false
|
||||
}
|
||||
listView.setOnItemClickListener { _, _, position, _ ->
|
||||
confirm(listOf(habitIds[position]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun confirm(selectedIds: List<Long>) {
|
||||
|
||||
@@ -222,12 +222,6 @@
|
||||
android:title="Enable developer mode"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="pref_feature_widget_stack"
|
||||
android:title="Enable widget stacks"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue="@string/syncBaseURL"
|
||||
android:key="pref_sync_base_url"
|
||||
|
||||
@@ -226,11 +226,6 @@ public class Preferences
|
||||
storage.putBoolean("pref_short_toggle", enabled);
|
||||
}
|
||||
|
||||
public boolean isWidgetStackEnabled()
|
||||
{
|
||||
return storage.getBoolean("pref_feature_widget_stack", false);
|
||||
}
|
||||
|
||||
public void removeListener(Listener listener)
|
||||
{
|
||||
listeners.remove(listener);
|
||||
|
||||
Reference in New Issue
Block a user