Minor widget tweaks

pull/996/head
Alex Baker 5 years ago
parent 5c0ec4a5a3
commit ccde7f61a2

@ -64,8 +64,8 @@ class ScrollableWidget : InjectingPreferenceFragment() {
setupSlider(R.string.p_widget_font_size, 16)
setupCheckbox(R.string.p_widget_show_due_date)
setupCheckbox(R.string.p_widget_show_checkboxes)
setupCheckbox(R.string.p_widget_due_date_underneath)
setupCheckbox(R.string.p_widget_show_full_task_title)
setupCheckbox(R.string.p_widget_due_date_underneath, false)
setupCheckbox(R.string.p_widget_show_full_task_title, false)
setupList(R.string.p_widget_spacing)
val showHeader = setupCheckbox(R.string.p_widget_show_header)
val showSettings = setupCheckbox(R.string.p_widget_show_settings)
@ -163,11 +163,11 @@ class ScrollableWidget : InjectingPreferenceFragment() {
return preference
}
private fun setupCheckbox(resId: Int): SwitchPreferenceCompat {
private fun setupCheckbox(resId: Int, defaultValue: Boolean = true): SwitchPreferenceCompat {
val preference = findPreference(resId) as SwitchPreferenceCompat
val key = getString(resId) + appWidgetId
preference.key = key
preference.isChecked = preferences.getBoolean(key, true)
preference.isChecked = preferences.getBoolean(key, defaultValue)
return preference
}

@ -16,7 +16,7 @@
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:padding="@dimen/widget_padding"
tools:src="@drawable/ic_outline_check_box_outline_blank_24px"/>
tools:src="@drawable/ic_outline_check_box_outline_blank_24px" />
<TextView
android:id="@+id/widget_due_end"
@ -31,12 +31,12 @@
android:singleLine="true"
android:textAlignment="viewStart"
android:textSize="14sp"
tools:text="Tomorrow"/>
tools:text="Tomorrow" />
<TextView
android:id="@+id/widget_text"
android:layout_toEndOf="@id/widget_complete_box"
android:layout_toStartOf="@id/widget_due_end"
android:id="@+id/widget_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/widget_complete_box"
@ -45,9 +45,10 @@
android:paddingStart="0dp"
android:gravity="start|center_vertical"
android:maxLines="1"
android:ellipsize="end"
android:textAlignment="viewStart"
android:textSize="16sp"
tools:text="Task title"/>
tools:text="Task title" />
<TextView
android:id="@+id/widget_due_bottom"
@ -60,7 +61,7 @@
android:singleLine="true"
android:textAlignment="viewStart"
android:textSize="14sp"
tools:text="Tomorrow"/>
tools:text="Tomorrow" />
<ImageView
android:id="@+id/divider"

@ -49,10 +49,13 @@
app:min="10"
app:showSeekBarValue="true" />
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="@string/p_widget_show_full_task_title"
android:title="@string/EPr_fullTask_title" />
<ListPreference
android:defaultValue="0"
android:key="@string/p_widget_spacing"
android:entries="@array/widget_spacing_titles"
android:entryValues="@array/widget_spacing_values"
android:title="@string/row_spacing"
android:summary="%s" />
<SwitchPreferenceCompat
android:key="@string/p_widget_show_due_date"
@ -62,13 +65,10 @@
android:key="@string/p_widget_show_checkboxes"
android:title="@string/widget_show_checkboxes" />
<ListPreference
android:defaultValue="0"
android:key="@string/p_widget_spacing"
android:entries="@array/widget_spacing_titles"
android:entryValues="@array/widget_spacing_values"
android:title="@string/row_spacing"
android:summary="%s" />
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="@string/p_widget_show_full_task_title"
android:title="@string/EPr_fullTask_title" />
<SwitchPreferenceCompat
android:defaultValue="false"

Loading…
Cancel
Save