mirror of https://github.com/tasks/tasks
Convert WidgetPreferences to Kotlin
parent
c03e3747c6
commit
20f87061fd
@ -1,377 +0,0 @@
|
||||
package org.tasks.widget;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.todoroo.astrid.core.SortHelper;
|
||||
import com.todoroo.astrid.service.Upgrader;
|
||||
|
||||
import org.tasks.R;
|
||||
import org.tasks.Strings;
|
||||
import org.tasks.preferences.Preferences;
|
||||
import org.tasks.preferences.QueryPreferences;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class WidgetPreferences implements QueryPreferences {
|
||||
|
||||
private final Context context;
|
||||
private final Preferences preferences;
|
||||
private final int widgetId;
|
||||
|
||||
public WidgetPreferences(Context context, Preferences preferences, int widgetId) {
|
||||
this.context = context;
|
||||
this.preferences = preferences;
|
||||
this.widgetId = widgetId;
|
||||
}
|
||||
|
||||
boolean showHeader() {
|
||||
return getBoolean(R.string.p_widget_show_header, true);
|
||||
}
|
||||
|
||||
boolean showTitle() {
|
||||
return getBoolean(R.string.p_widget_show_title, true);
|
||||
}
|
||||
|
||||
boolean showCheckboxes() {
|
||||
return getBoolean(R.string.p_widget_show_checkboxes, true);
|
||||
}
|
||||
|
||||
boolean showSettings() {
|
||||
return getBoolean(R.string.p_widget_show_settings, true);
|
||||
}
|
||||
|
||||
boolean showMenu() {
|
||||
return getBoolean(R.string.p_widget_show_menu, true);
|
||||
}
|
||||
|
||||
boolean showFullTaskTitle() {
|
||||
return getBoolean(R.string.p_widget_show_full_task_title, false);
|
||||
}
|
||||
|
||||
boolean showDescription() {
|
||||
return getBoolean(R.string.p_widget_show_description, true);
|
||||
}
|
||||
|
||||
boolean showFullDescription() {
|
||||
return getBoolean(R.string.p_widget_show_full_description, false);
|
||||
}
|
||||
|
||||
boolean showDividers() {
|
||||
return getBoolean(R.string.p_widget_show_dividers, true);
|
||||
}
|
||||
|
||||
boolean showSubtasks() {
|
||||
return getBoolean(R.string.p_widget_show_subtasks, true);
|
||||
}
|
||||
|
||||
boolean showStartDates() {
|
||||
return getBoolean(R.string.p_widget_show_start_dates, true);
|
||||
}
|
||||
|
||||
boolean showPlaces() {
|
||||
return getBoolean(R.string.p_widget_show_places, true);
|
||||
}
|
||||
|
||||
boolean showLists() {
|
||||
return getBoolean(R.string.p_widget_show_lists, true);
|
||||
}
|
||||
|
||||
boolean showTags() {
|
||||
return getBoolean(R.string.p_widget_show_tags, true);
|
||||
}
|
||||
|
||||
public int getDueDatePosition() {
|
||||
return getIntegerFromString(R.string.p_widget_due_date_position, 0);
|
||||
}
|
||||
|
||||
public void setCollapsed(Iterable<Long> collapsed) {
|
||||
setString(R.string.p_widget_collapsed, Joiner.on(",").join(collapsed));
|
||||
}
|
||||
|
||||
public HashSet<Long> getCollapsed() {
|
||||
String value = getString(R.string.p_widget_collapsed);
|
||||
HashSet<Long> collapsed = new HashSet<>();
|
||||
if (!Strings.isNullOrEmpty(value)) {
|
||||
for (String entry : Splitter.on(",").split(value)) {
|
||||
try {
|
||||
collapsed.add(Long.parseLong(entry));
|
||||
} catch (NumberFormatException e) {
|
||||
Timber.e(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return collapsed;
|
||||
}
|
||||
|
||||
int getWidgetSpacing() {
|
||||
return getSpacing(R.string.p_widget_spacing);
|
||||
}
|
||||
|
||||
int getHeaderSpacing() {
|
||||
return getSpacing(R.string.p_widget_header_spacing);
|
||||
}
|
||||
|
||||
int getHeaderLayout() {
|
||||
switch (getIntegerFromString(R.string.p_widget_header_spacing, 0)) {
|
||||
case 1:
|
||||
return R.layout.widget_title_compact;
|
||||
case 2:
|
||||
return R.layout.widget_title_none;
|
||||
default:
|
||||
return R.layout.widget_title_default;
|
||||
}
|
||||
}
|
||||
|
||||
private int getSpacing(int pref) {
|
||||
int spacing = getIntegerFromString(pref, 0);
|
||||
if (spacing == 2) {
|
||||
return 0;
|
||||
}
|
||||
int dimen = spacing == 1 ? R.dimen.widget_padding_compact : R.dimen.widget_padding;
|
||||
return (int) context.getResources().getDimension(dimen);
|
||||
}
|
||||
|
||||
int getFontSize() {
|
||||
return getInt(R.string.p_widget_font_size, 16);
|
||||
}
|
||||
|
||||
public String getFilterId() {
|
||||
return getString(R.string.p_widget_filter);
|
||||
}
|
||||
|
||||
public int getThemeIndex() {
|
||||
return getInt(R.string.p_widget_theme, 3);
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
int color = getInt(R.string.p_widget_color_v2, 0);
|
||||
if (color != 0) {
|
||||
return color;
|
||||
}
|
||||
int index = getInt(R.string.p_widget_color, -1);
|
||||
color = context.getColor(Upgrader.getLegacyColor(index, R.color.blue_500));
|
||||
setInt(R.string.p_widget_color_v2, color);
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
setInt(R.string.p_widget_color_v2, color);
|
||||
}
|
||||
|
||||
int getHeaderOpacity() {
|
||||
return getAlphaValue(R.string.p_widget_header_opacity);
|
||||
}
|
||||
|
||||
int getFooterOpacity() {
|
||||
return getAlphaValue(R.string.p_widget_footer_opacity);
|
||||
}
|
||||
|
||||
int getRowOpacity() {
|
||||
return getAlphaValue(R.string.p_widget_opacity);
|
||||
}
|
||||
|
||||
boolean openOnFooterClick() {
|
||||
return getIntegerFromString(R.string.p_widget_footer_click, 0) == 1;
|
||||
}
|
||||
|
||||
boolean rescheduleOnDueDateClick() {
|
||||
return getIntegerFromString(R.string.p_widget_due_date_click, 0) == 0;
|
||||
}
|
||||
|
||||
private int getAlphaValue(int resId) {
|
||||
return (int) (getInt(resId, 100) / 100.0 * 255.0);
|
||||
}
|
||||
|
||||
public void setTheme(int index) {
|
||||
setInt(R.string.p_widget_theme, index);
|
||||
}
|
||||
|
||||
public String getKey(int resId) {
|
||||
return context.getString(resId) + widgetId;
|
||||
}
|
||||
|
||||
public void setFilter(String filterPreferenceValue) {
|
||||
setCollapsed(new HashSet<>());
|
||||
preferences.setString(getKey(R.string.p_widget_filter), filterPreferenceValue);
|
||||
}
|
||||
|
||||
public boolean getCompact() {
|
||||
return getBoolean(R.string.p_widget_compact, false);
|
||||
}
|
||||
|
||||
public void setCompact(boolean value) {
|
||||
setBoolean(R.string.p_widget_compact, value);
|
||||
}
|
||||
|
||||
private int getInt(int resId, int defValue) {
|
||||
return preferences.getInt(getKey(resId), defValue);
|
||||
}
|
||||
|
||||
private int getIntegerFromString(int resId, int defValue) {
|
||||
return preferences.getIntegerFromString(getKey(resId), defValue);
|
||||
}
|
||||
|
||||
private boolean getBoolean(int resId, boolean defValue) {
|
||||
return preferences.getBoolean(getKey(resId), defValue);
|
||||
}
|
||||
|
||||
private String getString(int resId) {
|
||||
return preferences.getStringValue(getKey(resId));
|
||||
}
|
||||
|
||||
private void setInt(int resId, int value) {
|
||||
preferences.setInt(getKey(resId), value);
|
||||
}
|
||||
|
||||
private void setBoolean(int resId, boolean value) {
|
||||
preferences.setBoolean(getKey(resId), value);
|
||||
}
|
||||
|
||||
private void setString(int resId, String value) {
|
||||
preferences.setString(getKey(resId), value);
|
||||
}
|
||||
|
||||
public void maintainExistingConfiguration() {
|
||||
int rowOpacity = getInt(R.string.p_widget_opacity, 100);
|
||||
setInt(R.string.p_widget_header_opacity, rowOpacity);
|
||||
setInt(R.string.p_widget_footer_opacity, rowOpacity);
|
||||
boolean showDueDate = getBoolean(R.string.p_widget_show_due_date, true);
|
||||
setString(R.string.p_widget_due_date_position, showDueDate ? "1" : "2"); // below or hidden
|
||||
setBoolean(R.string.p_widget_show_dividers, false); // no dividers
|
||||
setBoolean(R.string.p_widget_show_menu, false); // no menu
|
||||
setString(R.string.p_widget_spacing, "1"); // compact
|
||||
setBoolean(R.string.p_widget_show_description, false); // no description
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortMode() {
|
||||
return getInt(R.string.p_widget_sort, SortHelper.SORT_AUTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGroupMode() {
|
||||
return getInt(R.string.p_widget_group, SortHelper.GROUP_NONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isManualSort() {
|
||||
return getBoolean(R.string.p_widget_sort_manual, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAstridSort() {
|
||||
return getBoolean(R.string.p_widget_sort_astrid, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSortAscending() {
|
||||
return getBoolean(R.string.p_widget_sort_ascending, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getGroupAscending() {
|
||||
return getBoolean(R.string.p_widget_group_ascending, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShowHidden() {
|
||||
return getBoolean(R.string.p_widget_show_hidden, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShowCompleted() {
|
||||
return getBoolean(R.string.p_widget_show_completed, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAlwaysDisplayFullDate() { return preferences.getAlwaysDisplayFullDate(); }
|
||||
|
||||
@Override
|
||||
public boolean getCompletedTasksAtBottom() {
|
||||
return preferences.getCompletedTasksAtBottom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompletedTasksAtBottom(boolean value) {
|
||||
preferences.setBoolean(R.string.p_completed_tasks_at_bottom, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSortMode(int sortMode) {
|
||||
setInt(R.string.p_widget_sort, sortMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupMode(int groupMode) {
|
||||
setInt(R.string.p_widget_group, groupMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManualSort(boolean isManualSort) {
|
||||
setBoolean(R.string.p_widget_sort_manual, isManualSort);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAstridSort(boolean isAstridSort) {
|
||||
setBoolean(R.string.p_widget_sort_astrid, isAstridSort);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSortAscending(boolean ascending) {
|
||||
setBoolean(R.string.p_widget_sort_ascending, ascending);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupAscending(boolean ascending) {
|
||||
setBoolean(R.string.p_widget_group_ascending, ascending);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlwaysDisplayFullDate(boolean noWeekday) {
|
||||
preferences.setAlwaysDisplayFullDate(noWeekday);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompletedMode() {
|
||||
return preferences.getCompletedMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompletedMode(int mode) {
|
||||
preferences.setCompletedMode(mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCompletedAscending() {
|
||||
return preferences.getCompletedAscending();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompletedAscending(boolean ascending) {
|
||||
preferences.setCompletedAscending(ascending);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSubtaskMode() {
|
||||
return preferences.getSubtaskMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSubtaskMode(int mode) {
|
||||
preferences.setSubtaskMode(mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSubtaskAscending() {
|
||||
return preferences.getSubtaskAscending();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSubtaskAscending(boolean ascending) {
|
||||
preferences.setSubtaskAscending(ascending);
|
||||
}
|
||||
}
|
@ -0,0 +1,279 @@
|
||||
package org.tasks.widget
|
||||
|
||||
import android.content.Context
|
||||
import com.google.common.base.Joiner
|
||||
import com.google.common.base.Splitter
|
||||
import com.todoroo.astrid.core.SortHelper
|
||||
import com.todoroo.astrid.service.Upgrader.Companion.getLegacyColor
|
||||
import org.tasks.R
|
||||
import org.tasks.preferences.Preferences
|
||||
import org.tasks.preferences.QueryPreferences
|
||||
import timber.log.Timber
|
||||
|
||||
class WidgetPreferences(
|
||||
private val context: Context,
|
||||
private val preferences: Preferences,
|
||||
private val widgetId: Int
|
||||
) : QueryPreferences {
|
||||
fun showHeader(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_header, true)
|
||||
}
|
||||
|
||||
fun showTitle(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_title, true)
|
||||
}
|
||||
|
||||
fun showCheckboxes(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_checkboxes, true)
|
||||
}
|
||||
|
||||
fun showSettings(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_settings, true)
|
||||
}
|
||||
|
||||
fun showMenu(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_menu, true)
|
||||
}
|
||||
|
||||
fun showFullTaskTitle(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_full_task_title, false)
|
||||
}
|
||||
|
||||
fun showDescription(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_description, true)
|
||||
}
|
||||
|
||||
fun showFullDescription(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_full_description, false)
|
||||
}
|
||||
|
||||
fun showDividers(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_dividers, true)
|
||||
}
|
||||
|
||||
fun showSubtasks(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_subtasks, true)
|
||||
}
|
||||
|
||||
fun showStartDates(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_start_dates, true)
|
||||
}
|
||||
|
||||
fun showPlaces(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_places, true)
|
||||
}
|
||||
|
||||
fun showLists(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_lists, true)
|
||||
}
|
||||
|
||||
fun showTags(): Boolean {
|
||||
return getBoolean(R.string.p_widget_show_tags, true)
|
||||
}
|
||||
|
||||
val dueDatePosition: Int
|
||||
get() = getIntegerFromString(R.string.p_widget_due_date_position)
|
||||
var collapsed: MutableSet<Long>
|
||||
get() {
|
||||
val value = getString(R.string.p_widget_collapsed)
|
||||
val collapsed = HashSet<Long>()
|
||||
if (value?.isNotBlank() == true) {
|
||||
for (entry in Splitter.on(",").split(value)) {
|
||||
try {
|
||||
collapsed.add(entry.toLong())
|
||||
} catch (e: NumberFormatException) {
|
||||
Timber.e(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
return collapsed
|
||||
}
|
||||
set(collapsed) {
|
||||
setString(R.string.p_widget_collapsed, Joiner.on(",").join(collapsed))
|
||||
}
|
||||
val widgetSpacing: Int
|
||||
get() = getSpacing(R.string.p_widget_spacing)
|
||||
val headerSpacing: Int
|
||||
get() = getSpacing(R.string.p_widget_header_spacing)
|
||||
val headerLayout: Int
|
||||
get() = when (getIntegerFromString(R.string.p_widget_header_spacing)) {
|
||||
1 -> R.layout.widget_title_compact
|
||||
2 -> R.layout.widget_title_none
|
||||
else -> R.layout.widget_title_default
|
||||
}
|
||||
|
||||
private fun getSpacing(pref: Int): Int {
|
||||
val spacing = getIntegerFromString(pref)
|
||||
if (spacing == 2) {
|
||||
return 0
|
||||
}
|
||||
val dimen = if (spacing == 1) R.dimen.widget_padding_compact else R.dimen.widget_padding
|
||||
return context.resources.getDimension(dimen).toInt()
|
||||
}
|
||||
|
||||
val fontSize: Int
|
||||
get() = getInt(R.string.p_widget_font_size, 16)
|
||||
val filterId: String?
|
||||
get() = getString(R.string.p_widget_filter)
|
||||
val themeIndex: Int
|
||||
get() = getInt(R.string.p_widget_theme, 3)
|
||||
var color: Int
|
||||
get() {
|
||||
var color = getInt(R.string.p_widget_color_v2, 0)
|
||||
if (color != 0) {
|
||||
return color
|
||||
}
|
||||
val index = getInt(R.string.p_widget_color, -1)
|
||||
color = context.getColor(getLegacyColor(index, R.color.blue_500))
|
||||
setInt(R.string.p_widget_color_v2, color)
|
||||
return color
|
||||
}
|
||||
set(color) {
|
||||
setInt(R.string.p_widget_color_v2, color)
|
||||
}
|
||||
val headerOpacity: Int
|
||||
get() = getAlphaValue(R.string.p_widget_header_opacity)
|
||||
val footerOpacity: Int
|
||||
get() = getAlphaValue(R.string.p_widget_footer_opacity)
|
||||
val rowOpacity: Int
|
||||
get() = getAlphaValue(R.string.p_widget_opacity)
|
||||
|
||||
fun openOnFooterClick(): Boolean {
|
||||
return getIntegerFromString(R.string.p_widget_footer_click) == 1
|
||||
}
|
||||
|
||||
fun rescheduleOnDueDateClick(): Boolean {
|
||||
return getIntegerFromString(R.string.p_widget_due_date_click) == 0
|
||||
}
|
||||
|
||||
private fun getAlphaValue(resId: Int): Int {
|
||||
return (getInt(resId, 100) / 100.0 * 255.0).toInt()
|
||||
}
|
||||
|
||||
fun setTheme(index: Int) {
|
||||
setInt(R.string.p_widget_theme, index)
|
||||
}
|
||||
|
||||
fun getKey(resId: Int): String {
|
||||
return context.getString(resId) + widgetId
|
||||
}
|
||||
|
||||
fun setFilter(filterPreferenceValue: String?) {
|
||||
collapsed = HashSet()
|
||||
preferences.setString(getKey(R.string.p_widget_filter), filterPreferenceValue)
|
||||
}
|
||||
|
||||
var compact: Boolean
|
||||
get() = getBoolean(R.string.p_widget_compact, false)
|
||||
set(value) {
|
||||
setBoolean(R.string.p_widget_compact, value)
|
||||
}
|
||||
|
||||
private fun getInt(resId: Int, defValue: Int): Int {
|
||||
return preferences.getInt(getKey(resId), defValue)
|
||||
}
|
||||
|
||||
private fun getIntegerFromString(resId: Int): Int {
|
||||
return preferences.getIntegerFromString(getKey(resId), 0)
|
||||
}
|
||||
|
||||
private fun getBoolean(resId: Int, defValue: Boolean): Boolean {
|
||||
return preferences.getBoolean(getKey(resId), defValue)
|
||||
}
|
||||
|
||||
private fun getString(resId: Int): String? {
|
||||
return preferences.getStringValue(getKey(resId))
|
||||
}
|
||||
|
||||
private fun setInt(resId: Int, value: Int) {
|
||||
preferences.setInt(getKey(resId), value)
|
||||
}
|
||||
|
||||
private fun setBoolean(resId: Int, value: Boolean) {
|
||||
preferences.setBoolean(getKey(resId), value)
|
||||
}
|
||||
|
||||
private fun setString(resId: Int, value: String) {
|
||||
preferences.setString(getKey(resId), value)
|
||||
}
|
||||
|
||||
fun maintainExistingConfiguration() {
|
||||
val rowOpacity = getInt(R.string.p_widget_opacity, 100)
|
||||
setInt(R.string.p_widget_header_opacity, rowOpacity)
|
||||
setInt(R.string.p_widget_footer_opacity, rowOpacity)
|
||||
val showDueDate = getBoolean(R.string.p_widget_show_due_date, true)
|
||||
setString(
|
||||
R.string.p_widget_due_date_position,
|
||||
if (showDueDate) "1" else "2"
|
||||
) // below or hidden
|
||||
setBoolean(R.string.p_widget_show_dividers, false) // no dividers
|
||||
setBoolean(R.string.p_widget_show_menu, false) // no menu
|
||||
setString(R.string.p_widget_spacing, "1") // compact
|
||||
setBoolean(R.string.p_widget_show_description, false) // no description
|
||||
}
|
||||
|
||||
override var sortMode: Int
|
||||
get() = getInt(R.string.p_widget_sort, SortHelper.SORT_AUTO)
|
||||
set(sortMode) {
|
||||
setInt(R.string.p_widget_sort, sortMode)
|
||||
}
|
||||
override var groupMode: Int
|
||||
get() = getInt(R.string.p_widget_group, SortHelper.GROUP_NONE)
|
||||
set(groupMode) {
|
||||
setInt(R.string.p_widget_group, groupMode)
|
||||
}
|
||||
override var isManualSort: Boolean
|
||||
get() = getBoolean(R.string.p_widget_sort_manual, false)
|
||||
set(isManualSort) {
|
||||
setBoolean(R.string.p_widget_sort_manual, isManualSort)
|
||||
}
|
||||
override var isAstridSort: Boolean
|
||||
get() = getBoolean(R.string.p_widget_sort_astrid, false)
|
||||
set(isAstridSort) {
|
||||
setBoolean(R.string.p_widget_sort_astrid, isAstridSort)
|
||||
}
|
||||
override var sortAscending: Boolean
|
||||
get() = getBoolean(R.string.p_widget_sort_ascending, true)
|
||||
set(ascending) {
|
||||
setBoolean(R.string.p_widget_sort_ascending, ascending)
|
||||
}
|
||||
override var groupAscending: Boolean
|
||||
get() = getBoolean(R.string.p_widget_group_ascending, false)
|
||||
set(ascending) {
|
||||
setBoolean(R.string.p_widget_group_ascending, ascending)
|
||||
}
|
||||
override val showHidden: Boolean
|
||||
get() = getBoolean(R.string.p_widget_show_hidden, true)
|
||||
override val showCompleted: Boolean
|
||||
get() = getBoolean(R.string.p_widget_show_completed, false)
|
||||
override var alwaysDisplayFullDate: Boolean
|
||||
get() = preferences.alwaysDisplayFullDate
|
||||
set(noWeekday) {
|
||||
preferences.alwaysDisplayFullDate = noWeekday
|
||||
}
|
||||
override var completedTasksAtBottom: Boolean
|
||||
get() = preferences.completedTasksAtBottom
|
||||
set(value) {
|
||||
preferences.setBoolean(R.string.p_completed_tasks_at_bottom, value)
|
||||
}
|
||||
override var completedMode: Int
|
||||
get() = preferences.completedMode
|
||||
set(mode) {
|
||||
preferences.completedMode = mode
|
||||
}
|
||||
override var completedAscending: Boolean
|
||||
get() = preferences.completedAscending
|
||||
set(ascending) {
|
||||
preferences.completedAscending = ascending
|
||||
}
|
||||
override var subtaskMode: Int
|
||||
get() = preferences.subtaskMode
|
||||
set(mode) {
|
||||
preferences.subtaskMode = mode
|
||||
}
|
||||
override var subtaskAscending: Boolean
|
||||
get() = preferences.subtaskAscending
|
||||
set(ascending) {
|
||||
preferences.subtaskAscending = ascending
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue