Add option to hide list chips

pull/757/head
Alex Baker 6 years ago
parent e789b943fa
commit 108de56ba9

@ -53,7 +53,8 @@ public class AppearancePreferences extends InjectingPreferenceActivity
R.string.p_fullTaskTitle,
R.string.p_show_description,
R.string.p_show_full_description,
R.string.p_linkify_task_list);
R.string.p_linkify_task_list,
R.string.p_show_list_indicators);
setExtraOnChange(R.string.p_show_today_filter, EXTRA_FILTERS_CHANGED);
setExtraOnChange(R.string.p_show_recently_modified_filter, EXTRA_FILTERS_CHANGED);
setExtraOnChange(R.string.p_show_not_in_list_filter, EXTRA_FILTERS_CHANGED);

@ -270,20 +270,22 @@ class ViewHolder extends RecyclerView.ViewHolder {
dueDate.setVisibility(View.GONE);
}
String tags = task.getTagsString();
List<String> tagUuids = tags != null ? newArrayList(tags.split(",")) : Lists.newArrayList();
if (preferences.getBoolean(R.string.p_show_list_indicators, true)) {
String tags = task.getTagsString();
List<String> tagUuids = tags != null ? newArrayList(tags.split(",")) : Lists.newArrayList();
List<Chip> chips = chipProvider.getChips(task.getCaldav(), task.getGoogleTaskList(), tagUuids);
if (chips.isEmpty()) {
chipGroup.setVisibility(View.GONE);
} else {
chipGroup.removeAllViews();
for (Chip chip : chips) {
chip.setTextSize(fontSizeDetails);
chip.setOnClickListener(view -> callback.onClick((Filter) view.getTag()));
chipGroup.addView(chip);
List<Chip> chips = chipProvider.getChips(task.getCaldav(), task.getGoogleTaskList(), tagUuids);
if (chips.isEmpty()) {
chipGroup.setVisibility(View.GONE);
} else {
chipGroup.removeAllViews();
for (Chip chip : chips) {
chip.setTextSize(fontSizeDetails);
chip.setOnClickListener(view -> callback.onClick((Filter) view.getTag()));
chipGroup.addView(chip);
}
chipGroup.setVisibility(View.VISIBLE);
}
chipGroup.setVisibility(View.VISIBLE);
}
}

@ -96,6 +96,7 @@
android:layout_marginStart="@dimen/keyline_first"
android:layout_marginLeft="@dimen/keyline_first"
android:layout_marginRight="@dimen/keyline_content_inset"
android:layout_marginEnd="@dimen/keyline_content_inset"/>
android:layout_marginEnd="@dimen/keyline_content_inset"
android:visibility="gone"/>
</LinearLayout>

@ -294,4 +294,5 @@
<string name="p_show_description">show_description</string>
<string name="p_show_full_description">show_full_description</string>
<string name="p_linkify_task_list">linkify_task_list</string>
<string name="p_show_list_indicators">show_list_indicators</string>
</resources>

@ -873,4 +873,5 @@ File %1$s contained %2$s.\n\n
<string name="show_full_description">Show full description</string>
<string name="linkify">Show links</string>
<string name="linkify_description">Add links to websites, addresses, and phone numbers</string>
<string name="show_list_indicators">Show list chips</string>
</resources>

@ -34,6 +34,11 @@
android:dependency="@string/p_show_description"
android:title="@string/show_full_description" />
<CheckBoxPreference
android:defaultValue="true"
android:key="@string/p_show_list_indicators"
android:title="@string/show_list_indicators" />
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/p_linkify_task_list"

Loading…
Cancel
Save