Skip to content

Commit

Permalink
Merge pull request #2087 from wordpress-mobile/release/1.25.0
Browse files Browse the repository at this point in the history
Release 1.25.0 -> Master
  • Loading branch information
SergioEstevao authored Apr 3, 2020
2 parents d584f8d + 1adbbb2 commit e75a227
Show file tree
Hide file tree
Showing 139 changed files with 5,156 additions and 3,807 deletions.
11 changes: 11 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
1.25.0
------
* New block: Cover
* [Android] Dark Mode
* [Android] Improve icon on the "Take a Video" media option
* Removed the dimming effect on unselected blocks
* [iOS] Add alignment options for heading block
* Implemented dropdown toolbar for alignment toolbar in Heading, Paragraph, Image, MediaText blocks
* Block Editor: When editing link settings, tapping the keyboard return button now closes the settings panel as well as closing the keyboard.
* [Android] Show an "Edit" button overlay on selected image blocks

1.24.0
------
* New block: Latest Posts
Expand Down
2 changes: 1 addition & 1 deletion RNTAztecView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Pod::Spec.new do |s|
s.xcconfig = {'OTHER_LDFLAGS' => '-lxml2',
'HEADER_SEARCH_PATHS' => '/usr/include/libxml2'}
s.dependency 'React-Core'
s.dependency 'WordPress-Aztec-iOS', '1.17.0'
s.dependency 'WordPress-Aztec-iOS', '~> 1.17.1'

end
7 changes: 6 additions & 1 deletion __device-tests__/helpers/caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ const ios = {
automationName: 'XCUITest',
appiumVersion: '1.15.0', // SauceLabs requires appiumVersion to be specified.
app: undefined, // will be set later, locally this is relative to root of project
processArguments: {
args: [
'uitesting',
],
},
};

exports.iosLocal = {
...ios,
platformVersion: '13.3',
platformVersion: '13.4',
deviceName: 'iPhone 11',
};

Expand Down
17 changes: 13 additions & 4 deletions __device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ const stopDriver = async ( driver: wd.PromiseChainWebdriver ) => {
};

/*
* The 'clear' parameter is defaulted to true because not clearing the text requires Android to use ADB, which
* Problems about the 'clear' parameter:
*
* On Android: "clear" is defaulted to true because not clearing the text requires Android to use ADB, which
* has demonstrated itself to be very flaky, particularly on CI. In other words, clear the view unless you absolutely
* have to append the new text and, in that case, append fewest number of characters possible.
*
* On iOS: "clear" is not defaulted to true because calling element.clear when a text is present takes a very long time (approx. 23 seconds)
*/
const typeString = async ( driver: wd.PromiseChainWebdriver, element: wd.PromiseChainWebdriver.Element, str: string, clear: boolean = true ) => {
const typeString = async ( driver: wd.PromiseChainWebdriver, element: wd.PromiseChainWebdriver.Element, str: string, clear: boolean ) => {
if ( isAndroid() ) {
await typeStringAndroid( driver, element, str, clear );
} else {
Expand All @@ -160,7 +164,12 @@ const typeStringIos = async ( driver: wd.PromiseChainWebdriver, element: wd.Prom
await element.type( str );
};

const typeStringAndroid = async ( driver: wd.PromiseChainWebdriver, element: wd.PromiseChainWebdriver.Element, str: string, clear: boolean ) => {
const typeStringAndroid = async (
driver: wd.PromiseChainWebdriver,
element: wd.PromiseChainWebdriver.Element,
str: string,
clear: boolean = true // see comment above for why it is defaulted to true
) => {
if ( str in strToKeycode ) {
return await driver.pressKeycode( strToKeycode[ str ] );
} else if ( clear ) {
Expand All @@ -170,7 +179,7 @@ const typeStringAndroid = async ( driver: wd.PromiseChainWebdriver, element: wd.
* long text along these lines:
* await driver.execute( 'mobile: shell', { command: 'input',
* args: [ 'text', 'text I want to enter...' ] } )
* but using adb in this way proved to be very flakey (frequently all of the text would not get entered,
* but using adb in this way proved to be very flaky (frequently all of the text would not get entered,
* particularly on CI). We are now using the `type` approach again, but adding a space to the block to
* insure it is not empty, which avoids the deletion of the block when `type` executes.
*
Expand Down
4 changes: 2 additions & 2 deletions __device-tests__/pages/editor-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ export default class EditorPage {
return await this.driver.elementByXPath( blockLocator );
}

async sendTextToParagraphBlock( block: wd.PromiseChainWebdriver.Element, text: string, clear: boolean = true ) {
async sendTextToParagraphBlock( block: wd.PromiseChainWebdriver.Element, text: string, clear: boolean ) {
const textViewElement = await this.getTextViewForParagraphBlock( block );
await typeString( this.driver, textViewElement, text, clear );
await this.driver.sleep( 1000 ); // Give time for the block to rerender (such as for accessibility)
}

async sendTextToParagraphBlockAtPosition( position: number, text: string, clear: boolean = true ) {
async sendTextToParagraphBlockAtPosition( position: number, text: string, clear: boolean ) {
const paragraphs = text.split( '\n' );
for ( let i = 0; i < paragraphs.length; i++ ) {
// Select block first
Expand Down
11 changes: 10 additions & 1 deletion android/app/src/main/java/com/gutenberg/MainApplication.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.gutenberg;

import android.app.Application;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;

Expand Down Expand Up @@ -126,7 +127,8 @@ public void editorDidEmitLog(String message, LogLevel logLevel) {

@Override
public void performRequest(String path, Consumer<String> onSuccess, Consumer<Bundle> onError) {}
});

}, isDarkMode());

return new ReactNativeHost(this) {
@Override
Expand All @@ -153,6 +155,13 @@ protected String getJSMainModuleName() {
};
}

private boolean isDarkMode() {
Configuration configuration = getResources().getConfiguration();
int currentNightMode = configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK;

return currentNightMode == Configuration.UI_MODE_NIGHT_YES;
}

@Override
public ReactNativeHost getReactNativeHost() {
if (mReactNativeHost == null) {
Expand Down
Loading

0 comments on commit e75a227

Please sign in to comment.