Skip to content

Commit 90ad33a

Browse files
authored
Merge pull request #900 from wordpress-mobile/issue/888-woo-aztec-toolbar-design-changes
Issue/888 woo aztec toolbar design changes
2 parents 2d22d4a + 88c03f2 commit 90ad33a

File tree

140 files changed

+309
-246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+309
-246
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ android {
1111
targetSdkVersion 28
1212
versionCode 1
1313
versionName "1.0"
14+
vectorDrawables.useSupportLibrary = true
1415
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1516
}
1617

app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import android.widget.PopupMenu
2929
import android.widget.ToggleButton
3030
import androidx.appcompat.app.AlertDialog
3131
import androidx.appcompat.app.AppCompatActivity
32+
import androidx.appcompat.content.res.AppCompatResources
3233
import androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
33-
import androidx.core.content.ContextCompat
3434
import androidx.core.content.FileProvider
3535
import org.wordpress.android.util.AppLog
3636
import org.wordpress.android.util.ImageUtils
@@ -339,7 +339,7 @@ open class MainActivity : AppCompatActivity(),
339339
aztec.visualEditor.setOverlay(predicate, 0, ColorDrawable(0x80000000.toInt()), Gravity.FILL)
340340
aztec.visualEditor.updateElementAttributes(predicate, attrs)
341341

342-
val progressDrawable = ContextCompat.getDrawable(this, android.R.drawable.progress_horizontal)!!
342+
val progressDrawable = AppCompatResources.getDrawable(this, android.R.drawable.progress_horizontal)!!
343343
// set the height of the progress bar to 2 (it's in dp since the drawable will be adjusted by the span)
344344
progressDrawable.setBounds(0, 0, 0, 4)
345345

@@ -361,7 +361,7 @@ open class MainActivity : AppCompatActivity(),
361361

362362
if (attrs.hasAttribute("video")) {
363363
attrs.removeAttribute(attrs.getIndex("video"))
364-
aztec.visualEditor.setOverlay(predicate, 0, ContextCompat.getDrawable(this, android.R.drawable.ic_media_play), Gravity.CENTER)
364+
aztec.visualEditor.setOverlay(predicate, 0, AppCompatResources.getDrawable(this, android.R.drawable.ic_media_play), Gravity.CENTER)
365365
}
366366

367367
aztec.visualEditor.updateElementAttributes(predicate, attrs)

app/src/main/kotlin/org/wordpress/aztec/demo/MediaToolbarAction.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ import org.wordpress.aztec.ITextFormat
55
import org.wordpress.aztec.toolbar.IToolbarAction
66
import org.wordpress.aztec.toolbar.ToolbarActionType
77

8-
enum class MediaToolbarAction constructor(override val buttonId: Int, override val actionType: ToolbarActionType,
9-
override val textFormats: Set<ITextFormat> = setOf()) : IToolbarAction {
10-
GALLERY(R.id.media_bar_button_gallery, ToolbarActionType.OTHER, setOf(AztecTextFormat.FORMAT_NONE)),
11-
CAMERA(R.id.media_bar_button_camera, ToolbarActionType.OTHER, setOf(AztecTextFormat.FORMAT_NONE))
8+
enum class MediaToolbarAction constructor(
9+
override val buttonId: Int,
10+
override val buttonDrawableRes: Int,
11+
override val actionType: ToolbarActionType,
12+
override val textFormats: Set<ITextFormat> = setOf()
13+
) : IToolbarAction {
14+
GALLERY(R.id.media_bar_button_gallery, R.drawable.media_bar_button_image_multiple_selector, ToolbarActionType.OTHER, setOf(AztecTextFormat.FORMAT_NONE)),
15+
CAMERA(R.id.media_bar_button_camera, R.drawable.media_bar_button_camera_selector, ToolbarActionType.OTHER, setOf(AztecTextFormat.FORMAT_NONE))
1216
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

3-
<selector
4-
xmlns:android="http://schemas.android.com/apk/res/android" >
3+
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
tools:targetApi="lollipop">
56

67
<item android:drawable="@drawable/ic_action_redo_white_30_24dp" android:state_enabled="false" />
78
<item android:drawable="@drawable/ic_action_redo_white_24dp" />
89

9-
</selector>
10+
</animated-selector>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

3-
<selector
4-
xmlns:android="http://schemas.android.com/apk/res/android" >
3+
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
tools:targetApi="lollipop">
56

67
<item android:drawable="@drawable/ic_action_undo_white_30_24dp" android:state_enabled="false" />
78
<item android:drawable="@drawable/ic_action_undo_white_24dp" />
89

9-
</selector>
10+
</animated-selector>

app/src/main/res/drawable/media_bar_button_camera.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- @color/grey_darken_20 -->
99
<path
10-
android:fillColor="#ff4f748e"
10+
android:fillColor="?attr/toolbarIconNormalColor"
1111
android:pathData="M29,24c0,1.7-1.3,3-3,3s-3-1.3-3-3s1.3-3,3-3S29,22.3,29,24zM34,19v11c0,1.1-0.9,2-2,2H16c-1.1,0-2-0.9-2-2V19c0-1.1,0.9-2,2-2v-1h4v1h2l1-2h6l1,2h2C33.1,17,34,17.9,34,19zM19.5,21c0-0.8-0.7-1.5-1.5-1.5s-1.5,0.7-1.5,1.5s0.7,1.5,1.5,1.5S19.5,21.8,19.5,21z M31,24c0-2.8-2.2-5-5-5s-5,2.2-5,5s2.2,5,5,5S31,26.8,31,24z">
1212
</path>
1313

app/src/main/res/drawable/media_bar_button_camera_disabled.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- @color/grey_lighten_20 -->
99
<path
10-
android:fillColor="#ffc8d7e1"
10+
android:fillColor="?attr/toolbarIconDisabledColor"
1111
android:pathData="M29,24c0,1.7-1.3,3-3,3s-3-1.3-3-3s1.3-3,3-3S29,22.3,29,24zM34,19v11c0,1.1-0.9,2-2,2H16c-1.1,0-2-0.9-2-2V19c0-1.1,0.9-2,2-2v-1h4v1h2l1-2h6l1,2h2C33.1,17,34,17.9,34,19zM19.5,21c0-0.8-0.7-1.5-1.5-1.5s-1.5,0.7-1.5,1.5s0.7,1.5,1.5,1.5S19.5,21.8,19.5,21z M31,24c0-2.8-2.2-5-5-5s-5,2.2-5,5s2.2,5,5,5S31,26.8,31,24z">
1212
</path>
1313

app/src/main/res/drawable/media_bar_button_camera_highlighted.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- @color/almost_black -->
99
<path
10-
android:fillColor="#ff11181D"
10+
android:fillColor="?attr/toolbarIconHighlightColor"
1111
android:pathData="M29,24c0,1.7-1.3,3-3,3s-3-1.3-3-3s1.3-3,3-3S29,22.3,29,24zM34,19v11c0,1.1-0.9,2-2,2H16c-1.1,0-2-0.9-2-2V19c0-1.1,0.9-2,2-2v-1h4v1h2l1-2h6l1,2h2C33.1,17,34,17.9,34,19zM19.5,21c0-0.8-0.7-1.5-1.5-1.5s-1.5,0.7-1.5,1.5s0.7,1.5,1.5,1.5S19.5,21.8,19.5,21z M31,24c0-2.8-2.2-5-5-5s-5,2.2-5,5s2.2,5,5,5S31,26.8,31,24z">
1212
</path>
1313

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<selector xmlns:android="http://schemas.android.com/apk/res/android">
2+
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
tools:targetApi="lollipop">
35

46
<item android:drawable="@drawable/media_bar_button_camera_disabled" android:state_enabled="false"/>
57
<item android:drawable="@drawable/media_bar_button_camera_highlighted" android:state_focused="true"/>
68
<item android:drawable="@drawable/media_bar_button_camera"/>
79

8-
</selector>
10+
</animated-selector>

app/src/main/res/drawable/media_bar_button_image_multiple.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<!-- @color/grey_darken_20 -->
1111
<path
12-
android:fillColor="#ff4f748e"
12+
android:fillColor="?attr/toolbarIconNormalColor"
1313
android:pathData="M27,19.5c0-0.8,0.7-1.5,1.5-1.5s1.5,0.7,1.5,1.5S29.3,21,28.5,21S27,20.3,27,19.5z M16,32h14c0,1.1-0.9,2-2,2H16 c-1.1,0-2-0.9-2-2V20c0-1.1,0.9-2,2-2V32z M34,16v12c0,1.1-0.9,2-2,2H20c-1.1,0-2-0.9-2-2V16c0-1.1,0.9-2,2-2h12 C33.1,14,34,14.9,34,16z M20,16v6.3l3-3.3l4.9,5.4l0.7-0.7c0.8-0.9,2.2-0.9,3,0l0.5,0.6V16H20z" >
1414
</path>
1515

0 commit comments

Comments
 (0)