Skip to content

Commit 87fd9d6

Browse files
authored
Merge pull request #999 from wordpress-mobile/feature/option-for-adding-checklist-as-a-toolbar-button
Added task list as a potential button that you can add to toolbar.
2 parents c7bd4da + fb9de6e commit 87fd9d6

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/toolbar/ToolbarAction.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ enum class ToolbarAction constructor(
5555
ToolbarActionType.BLOCK_STYLE,
5656
setOf(AztecTextFormat.FORMAT_ORDERED_LIST),
5757
R.layout.format_bar_button_list_ordered),
58+
TASK_LIST(
59+
R.id.format_bar_button_list_task,
60+
R.drawable.format_bar_button_tasklist_selector,
61+
ToolbarActionType.BLOCK_STYLE,
62+
setOf(AztecTextFormat.FORMAT_TASK_LIST),
63+
R.layout.format_bar_button_list_task),
5864
INDENT(
5965
R.id.format_bar_button_indent,
6066
R.drawable.format_bar_button_indent_selector,

aztec/src/main/res/drawable/format_bar_button_tasklist.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
<vector xmlns:android="http://schemas.android.com/apk/res/android"
44
android:width="24dp"
55
android:height="24dp"
6-
android:tint="?attr/toolbarIconNormalColor"
76
android:viewportWidth="24"
87
android:viewportHeight="24">
98

10-
119
<group
1210
android:pivotX="12"
1311
android:pivotY="12"
1412
android:scaleX="0.6"
1513
android:scaleY="0.6">
1614
<path
17-
android:fillColor="@color/white"
15+
android:fillColor="?attr/toolbarIconNormalColor"
1816
android:pathData="M7.57622 11.4801L12.5762 5.48014L11.4239 4.51987L6.94966 9.88895L4.53039 7.46968L3.46973 8.53034L6.46973 11.5303L7.05046 12.1111L7.57622 11.4801ZM20.0001 16H4.00006V14.5H20.0001V16ZM13.0001 20H4.00006V18.5H13.0001V20Z" />
1917
</group>
2018

aztec/src/main/res/drawable/format_bar_button_tasklist_disabled.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<vector xmlns:android="http://schemas.android.com/apk/res/android"
44
android:width="24dp"
55
android:height="24dp"
6-
android:tint="?attr/toolbarIconDisabledColor"
76
android:viewportWidth="24"
87
android:viewportHeight="24">
98

@@ -14,7 +13,7 @@
1413
android:scaleX="0.6"
1514
android:scaleY="0.6">
1615
<path
17-
android:fillColor="@color/white"
16+
android:fillColor="?attr/toolbarIconDisabledColor"
1817
android:pathData="M7.57622 11.4801L12.5762 5.48014L11.4239 4.51987L6.94966 9.88895L4.53039 7.46968L3.46973 8.53034L6.46973 11.5303L7.05046 12.1111L7.57622 11.4801ZM20.0001 16H4.00006V14.5H20.0001V16ZM13.0001 20H4.00006V18.5H13.0001V20Z" />
1918
</group>
2019

aztec/src/main/res/drawable/format_bar_button_tasklist_highlighted.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<vector xmlns:android="http://schemas.android.com/apk/res/android"
44
android:width="24dp"
55
android:height="24dp"
6-
android:tint="?attr/toolbarIconHighlightColor"
76
android:viewportWidth="24"
87
android:viewportHeight="24">
98

@@ -13,7 +12,7 @@
1312
android:scaleX="0.6"
1413
android:scaleY="0.6">
1514
<path
16-
android:fillColor="@color/white"
15+
android:fillColor="?attr/toolbarIconHighlightColor"
1716
android:pathData="M7.57622 11.4801L12.5762 5.48014L11.4239 4.51987L6.94966 9.88895L4.53039 7.46968L3.46973 8.53034L6.46973 11.5303L7.05046 12.1111L7.57622 11.4801ZM20.0001 16H4.00006V14.5H20.0001V16ZM13.0001 20H4.00006V18.5H13.0001V20Z" />
1817
</group>
1918

aztec/src/main/res/drawable/format_bar_button_tasklist_selector.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
tools:targetApi="lollipop">
66

77
<item android:drawable="@drawable/format_bar_button_tasklist_disabled" android:state_enabled="false" />
8-
<item android:drawable="@drawable/format_bar_button_tasklist_highlighted" android:state_focused="true" />
8+
<item android:drawable="@drawable/format_bar_button_tasklist_highlighted" android:state_checked="true" />
99
<item android:drawable="@drawable/format_bar_button_tasklist" />
1010

1111
</animated-selector>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<org.wordpress.aztec.toolbar.RippleToggleButton xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/format_bar_button_list_task"
4+
style="@style/FormatBarButton"
5+
android:layout_width="wrap_content"
6+
android:layout_height="fill_parent"
7+
android:contentDescription="@string/item_format_task_list" />

0 commit comments

Comments
 (0)