From 4b84387b6ad258f17b4f73386c8c5763b7197597 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Fri, 7 Jun 2019 00:42:18 +0300 Subject: [PATCH 01/24] Able to build with gb-mobile --- app/build.gradle | 6 +++--- aztec/build.gradle | 8 ++++---- glide-loader/build.gradle | 4 ++-- picasso-loader/build.gradle | 8 ++++---- wordpress-comments/build.gradle | 8 ++++---- wordpress-shortcodes/build.gradle | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 25384818d..c96697945 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,13 +2,13 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { applicationId "org.wordpress.aztec" minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' @@ -40,7 +40,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation "com.android.support:appcompat-v7:$supportLibVersion" + implementation "com.android.support:appcompat-v7:27.1.1" implementation "org.wordpress:utils:$wordpressUtilsVersion" androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion", { diff --git a/aztec/build.gradle b/aztec/build.gradle index 51d6c76b2..7d1ed6619 100644 --- a/aztec/build.gradle +++ b/aztec/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionName "1.0" } @@ -44,8 +44,8 @@ dependencies { implementation "org.ccil.cowan.tagsoup:tagsoup:$tagSoupVersion" implementation "org.jsoup:jsoup:$jSoupVersion" - implementation "com.android.support:support-v4:$supportLibVersion" - implementation "com.android.support:design:$supportLibVersion" + implementation "com.android.support:support-v4:27.1.1" + implementation "com.android.support:design:27.1.1" implementation "org.wordpress:utils:$wordpressUtilsVersion" diff --git a/glide-loader/build.gradle b/glide-loader/build.gradle index 928ea0db5..0f2ab93d9 100644 --- a/glide-loader/build.gradle +++ b/glide-loader/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionCode 1 versionName "1.0" diff --git a/picasso-loader/build.gradle b/picasso-loader/build.gradle index e668ef2e1..3ec7326e6 100644 --- a/picasso-loader/build.gradle +++ b/picasso-loader/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -25,8 +25,8 @@ dependencies { implementation project(':aztec') - implementation "com.android.support:support-v4:$supportLibVersion" - implementation "com.android.support:design:$supportLibVersion" + implementation "com.android.support:support-v4:27.1.1" + implementation "com.android.support:design:27.1.1" implementation "com.squareup.picasso:picasso:$picassoVersion" } diff --git a/wordpress-comments/build.gradle b/wordpress-comments/build.gradle index 8dd311f91..f8dcb7d16 100644 --- a/wordpress-comments/build.gradle +++ b/wordpress-comments/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionName "1.0" } @@ -36,8 +36,8 @@ dependencies { implementation project(':aztec') - implementation "com.android.support:support-v4:$supportLibVersion" - implementation "com.android.support:design:$supportLibVersion" + implementation "com.android.support:support-v4:27.1.1" + implementation "com.android.support:design:27.1.1" implementation "org.wordpress:utils:$wordpressUtilsVersion" testImplementation "junit:junit:$jUnitVersion" diff --git a/wordpress-shortcodes/build.gradle b/wordpress-shortcodes/build.gradle index 9c481844d..8d4d1451a 100644 --- a/wordpress-shortcodes/build.gradle +++ b/wordpress-shortcodes/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionName "1.0" } @@ -36,7 +36,7 @@ dependencies { implementation project(':aztec') - implementation "com.android.support:appcompat-v7:$supportLibVersion" + implementation "com.android.support:appcompat-v7:27.1.1" testImplementation "junit:junit:$jUnitVersion" testImplementation "org.robolectric:robolectric:$robolectricVersion" From 794497db64e63a5751265f484ea07a2fa5d0b0d0 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Fri, 7 Jun 2019 01:13:39 +0300 Subject: [PATCH 02/24] Migrated to AndroidX --- app/build.gradle | 8 +++---- .../aztec/demo/BetterClickAction.java | 18 +++++++------- .../aztec/demo/BetterScrollToAction.java | 18 +++++++------- .../org/wordpress/aztec/demo/Actions.kt | 18 +++++++------- .../wordpress/aztec/demo/BaseHistoryTest.kt | 4 ++-- .../org/wordpress/aztec/demo/BasePage.kt | 16 ++++++------- .../org/wordpress/aztec/demo/BaseTest.kt | 4 ++-- .../aztec/demo/pages/EditLinkPage.kt | 16 ++++++------- .../wordpress/aztec/demo/pages/EditorPage.kt | 24 +++++++++---------- .../aztec/demo/tests/BasicTextEditingTests.kt | 2 +- .../demo/tests/CssUnderlineFormattingTests.kt | 2 +- .../aztec/demo/tests/GutenbergCompatTests.kt | 6 ++--- .../tests/HtmlAttributeStyleColorTests.kt | 4 ++-- .../aztec/demo/tests/ImageHistoryTests.kt | 8 +++---- .../wordpress/aztec/demo/tests/ImageTests.kt | 6 ++--- .../wordpress/aztec/demo/tests/LinkTests.kt | 2 +- .../demo/tests/MixedTextFormattingTests.kt | 2 +- .../demo/tests/ParagraphFormattingTests.kt | 4 ++-- .../demo/tests/SimpleTextFormattingTests.kt | 2 +- .../demo/tests/ToolbarHighlightingTests.kt | 6 ++--- app/src/main/AndroidManifest.xml | 2 +- .../org/wordpress/aztec/demo/MainActivity.kt | 10 ++++---- aztec/build.gradle | 6 +++-- .../main/kotlin/org/wordpress/aztec/Aztec.kt | 6 ++--- .../kotlin/org/wordpress/aztec/AztecParser.kt | 2 +- .../org/wordpress/aztec/AztecTagHandler.kt | 2 +- .../kotlin/org/wordpress/aztec/AztecText.kt | 15 ++++++++---- .../aztec/formatting/BlockFormatter.kt | 2 +- .../aztec/formatting/LineBlockFormatter.kt | 2 +- .../aztec/source/CssStyleFormatter.kt | 2 +- .../aztec/source/HtmlStyleTextWatcher.kt | 4 ++-- .../wordpress/aztec/source/HtmlStyleUtils.kt | 2 +- .../aztec/source/SourceViewEditText.kt | 19 ++++++++------- .../wordpress/aztec/spans/AztecAudioSpan.kt | 2 +- .../wordpress/aztec/spans/AztecQuoteSpan.kt | 12 +++++----- .../wordpress/aztec/spans/AztecVideoSpan.kt | 2 +- .../wordpress/aztec/toolbar/AztecToolbar.kt | 6 ++--- .../aztec/toolbar/RippleToggleButton.kt | 2 +- .../wordpress/aztec/util/ColorConverter.kt | 4 ++-- .../res/layout/aztec_format_bar_advanced.xml | 2 +- picasso-loader/build.gradle | 4 ++-- .../aztec/picassoloader/PicassoImageLoader.kt | 2 +- wordpress-comments/build.gradle | 4 ++-- .../wpcomments/HiddenGutenbergPlugin.kt | 4 ++-- .../wpcomments/WordPressCommentsPlugin.kt | 4 ++-- .../wpcomments/toolbar/MoreToolbarButton.kt | 4 ++-- .../wpcomments/toolbar/PageToolbarButton.kt | 4 ++-- wordpress-shortcodes/build.gradle | 2 +- .../extensions/VideoPressExtensions.kt | 2 +- 49 files changed, 156 insertions(+), 148 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c96697945..1bcf6ee38 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { @@ -40,13 +40,13 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation "com.android.support:appcompat-v7:27.1.1" + implementation 'androidx.appcompat:appcompat:1.0.0' implementation "org.wordpress:utils:$wordpressUtilsVersion" - androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion", { + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' } - androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espressoVersion", { + androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' } androidTestImplementation('com.xamarin.testcloud:espresso-support:1.3') diff --git a/app/src/androidTest/java/org/wordpress/aztec/demo/BetterClickAction.java b/app/src/androidTest/java/org/wordpress/aztec/demo/BetterClickAction.java index ea5b72696..2df551dba 100644 --- a/app/src/androidTest/java/org/wordpress/aztec/demo/BetterClickAction.java +++ b/app/src/androidTest/java/org/wordpress/aztec/demo/BetterClickAction.java @@ -1,20 +1,20 @@ package org.wordpress.aztec.demo; -import android.support.test.espresso.PerformException; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.action.CoordinatesProvider; -import android.support.test.espresso.action.PrecisionDescriber; -import android.support.test.espresso.action.Tap; -import android.support.test.espresso.action.Tapper; -import android.support.test.espresso.util.HumanReadables; +import androidx.test.espresso.PerformException; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.PrecisionDescriber; +import androidx.test.espresso.action.Tap; +import androidx.test.espresso.action.Tapper; +import androidx.test.espresso.util.HumanReadables; import android.view.View; import android.view.ViewConfiguration; import android.webkit.WebView; import org.hamcrest.Matcher; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; import static org.hamcrest.Matchers.allOf; /** diff --git a/app/src/androidTest/java/org/wordpress/aztec/demo/BetterScrollToAction.java b/app/src/androidTest/java/org/wordpress/aztec/demo/BetterScrollToAction.java index 6e5ea4aa8..bb21ada6e 100644 --- a/app/src/androidTest/java/org/wordpress/aztec/demo/BetterScrollToAction.java +++ b/app/src/androidTest/java/org/wordpress/aztec/demo/BetterScrollToAction.java @@ -1,17 +1,17 @@ package org.wordpress.aztec.demo; -import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom; -import static android.support.test.espresso.matcher.ViewMatchers.isDescendantOfA; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; -import static android.support.test.espresso.matcher.ViewMatchers.withEffectiveVisibility; +import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom; +import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; +import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.anyOf; -import android.support.test.espresso.PerformException; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.matcher.ViewMatchers.Visibility; -import android.support.test.espresso.util.HumanReadables; +import androidx.test.espresso.PerformException; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.matcher.ViewMatchers.Visibility; +import androidx.test.espresso.util.HumanReadables; import android.graphics.Rect; import android.util.Log; diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/Actions.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/Actions.kt index 6c2984d7e..67ded61c2 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/Actions.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/Actions.kt @@ -1,15 +1,15 @@ package org.wordpress.aztec.demo import android.graphics.Rect -import android.support.test.espresso.UiController -import android.support.test.espresso.ViewAction -import android.support.test.espresso.action.CoordinatesProvider -import android.support.test.espresso.action.GeneralClickAction -import android.support.test.espresso.action.Press -import android.support.test.espresso.action.Tap -import android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom -import android.support.test.espresso.matcher.ViewMatchers.isClickable -import android.support.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.UiController +import androidx.test.espresso.ViewAction +import androidx.test.espresso.action.CoordinatesProvider +import androidx.test.espresso.action.GeneralClickAction +import androidx.test.espresso.action.Press +import androidx.test.espresso.action.Tap +import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom +import androidx.test.espresso.matcher.ViewMatchers.isClickable +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import android.view.View import android.widget.EditText import org.hamcrest.Matcher diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseHistoryTest.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseHistoryTest.kt index 14cac8a1a..65902c701 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseHistoryTest.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseHistoryTest.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo -import android.support.test.rule.ActivityTestRule +import androidx.test.rule.ActivityTestRule import org.junit.Before import org.junit.Rule import org.wordpress.aztec.AztecText @@ -24,4 +24,4 @@ abstract class BaseHistoryTest : BaseTest() { val aztecText = mActivityTestRule.activity.findViewById(R.id.aztec) aztecText.history.historyThrottleTime = throttleTime } -} \ No newline at end of file +} diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BasePage.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BasePage.kt index c415bce20..9b5ef9086 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BasePage.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BasePage.kt @@ -1,13 +1,13 @@ package org.wordpress.aztec.demo -import android.support.test.espresso.ViewAction -import android.support.test.espresso.ViewInteraction -import android.support.test.espresso.action.GeneralLocation -import android.support.test.espresso.action.Press -import android.support.test.espresso.action.Tap -import android.support.test.espresso.action.ViewActions -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.ViewAction +import androidx.test.espresso.ViewInteraction +import androidx.test.espresso.action.GeneralLocation +import androidx.test.espresso.action.Press +import androidx.test.espresso.action.Tap +import androidx.test.espresso.action.ViewActions +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed abstract class BasePage { diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt index 1faa8278c..7fb10c973 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt @@ -1,7 +1,7 @@ package org.wordpress.aztec.demo -import android.support.test.rule.GrantPermissionRule -import android.support.test.runner.AndroidJUnit4 +import androidx.test.rule.GrantPermissionRule +import androidx.test.runner.AndroidJUnit4 import com.xamarin.testcloud.espresso.Factory import com.xamarin.testcloud.espresso.ReportHelper import org.junit.Before diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditLinkPage.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditLinkPage.kt index ba082a0bd..c9f892252 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditLinkPage.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditLinkPage.kt @@ -1,13 +1,13 @@ package org.wordpress.aztec.demo.pages -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.ViewInteraction -import android.support.test.espresso.action.ViewActions -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.replaceText -import android.support.test.espresso.assertion.ViewAssertions -import android.support.test.espresso.matcher.ViewMatchers.withId -import android.support.test.espresso.matcher.ViewMatchers.withText +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.ViewInteraction +import androidx.test.espresso.action.ViewActions +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.replaceText +import androidx.test.espresso.assertion.ViewAssertions +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withText import org.wordpress.aztec.demo.BasePage import org.wordpress.aztec.demo.R diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditorPage.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditorPage.kt index dfc3b9c95..37518486a 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditorPage.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditorPage.kt @@ -1,17 +1,17 @@ package org.wordpress.aztec.demo.pages -import android.support.test.espresso.DataInteraction -import android.support.test.espresso.Espresso.onData -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.ViewInteraction -import android.support.test.espresso.action.ViewActions -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.pressKey -import android.support.test.espresso.action.ViewActions.typeText -import android.support.test.espresso.action.ViewActions.typeTextIntoFocusedView -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.matcher.ViewMatchers.withId -import android.support.test.espresso.matcher.ViewMatchers.withText +import androidx.test.espresso.DataInteraction +import androidx.test.espresso.Espresso.onData +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.ViewInteraction +import androidx.test.espresso.action.ViewActions +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.pressKey +import androidx.test.espresso.action.ViewActions.typeText +import androidx.test.espresso.action.ViewActions.typeTextIntoFocusedView +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withText import android.view.KeyEvent import android.view.View import org.hamcrest.Matcher diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/BasicTextEditingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/BasicTextEditingTests.kt index 1c7f7eccb..2793a5a6e 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/BasicTextEditingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/BasicTextEditingTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.rule.ActivityTestRule +import androidx.test.rule.ActivityTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/CssUnderlineFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/CssUnderlineFormattingTests.kt index 49abb4ff0..248a5f15f 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/CssUnderlineFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/CssUnderlineFormattingTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.rule.ActivityTestRule +import androidx.test.rule.ActivityTestRule import org.junit.Before import org.junit.Rule import org.junit.Test diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt index d379cde10..6429e2811 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt @@ -6,9 +6,9 @@ import android.content.Intent import android.graphics.Bitmap import android.graphics.BitmapFactory import android.net.Uri -import android.support.test.espresso.intent.Intents -import android.support.test.espresso.intent.matcher.IntentMatchers -import android.support.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.intent.Intents +import androidx.test.espresso.intent.matcher.IntentMatchers +import androidx.test.espresso.intent.rule.IntentsTestRule import org.junit.Before import org.junit.Ignore import org.junit.Rule diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/HtmlAttributeStyleColorTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/HtmlAttributeStyleColorTests.kt index 314e78e23..25c4270d7 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/HtmlAttributeStyleColorTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/HtmlAttributeStyleColorTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.intent.rule.IntentsTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest @@ -75,4 +75,4 @@ class HtmlAttributeStyleColorTests : BaseTest() { .toggleHtml() .verifyHTML(htmlEnd) } -} \ No newline at end of file +} diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageHistoryTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageHistoryTests.kt index 7cff29af8..ba533ef24 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageHistoryTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageHistoryTests.kt @@ -6,9 +6,9 @@ import android.content.Intent import android.graphics.Bitmap import android.graphics.BitmapFactory import android.net.Uri -import android.support.test.espresso.intent.Intents -import android.support.test.espresso.intent.matcher.IntentMatchers -import android.support.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.intent.Intents +import androidx.test.espresso.intent.matcher.IntentMatchers +import androidx.test.espresso.intent.rule.IntentsTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest @@ -229,4 +229,4 @@ class ImageHistoryTests : BaseTest() { Intents.intending(IntentMatchers.hasAction(Intent.ACTION_OPEN_DOCUMENT)) .respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, intent)) } -} \ No newline at end of file +} diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageTests.kt index 0dd54958c..37600a68b 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ImageTests.kt @@ -6,9 +6,9 @@ import android.content.Intent import android.graphics.Bitmap import android.graphics.BitmapFactory import android.net.Uri -import android.support.test.espresso.intent.Intents -import android.support.test.espresso.intent.matcher.IntentMatchers -import android.support.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.intent.Intents +import androidx.test.espresso.intent.matcher.IntentMatchers +import androidx.test.espresso.intent.rule.IntentsTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/LinkTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/LinkTests.kt index 91f72ea4a..76665a67d 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/LinkTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/LinkTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.intent.rule.IntentsTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index a277e8fd9..cccd6cea6 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.rule.ActivityTestRule +import androidx.test.rule.ActivityTestRule import org.junit.Ignore import org.junit.Rule import org.junit.Test diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ParagraphFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ParagraphFormattingTests.kt index e855da276..78a85798c 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ParagraphFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ParagraphFormattingTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.rule.ActivityTestRule +import androidx.test.rule.ActivityTestRule import org.junit.Before import org.junit.Rule import org.junit.Test @@ -38,4 +38,4 @@ class ParagraphFormattingTests : BaseTest() { .toggleHtml() .verifyHTML(html) } -} \ No newline at end of file +} diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt index 170b35f49..36e4dd0fd 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.demo.tests -import android.support.test.rule.ActivityTestRule +import androidx.test.rule.ActivityTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ToolbarHighlightingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ToolbarHighlightingTests.kt index a7bc9b68b..941fea7e3 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ToolbarHighlightingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/ToolbarHighlightingTests.kt @@ -1,8 +1,8 @@ package org.wordpress.aztec.demo.tests -import android.support.test.espresso.matcher.ViewMatchers.isChecked -import android.support.test.espresso.matcher.ViewMatchers.isNotChecked -import android.support.test.rule.ActivityTestRule +import androidx.test.espresso.matcher.ViewMatchers.isChecked +import androidx.test.espresso.matcher.ViewMatchers.isNotChecked +import androidx.test.rule.ActivityTestRule import org.junit.Rule import org.junit.Test import org.wordpress.aztec.demo.BaseTest diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5ad002155..2bedb1949 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,7 +29,7 @@ diff --git a/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt b/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt index 490d47388..523458a3e 100644 --- a/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt +++ b/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt @@ -19,11 +19,9 @@ import android.os.Bundle import android.os.Environment import android.os.Handler import android.provider.MediaStore -import android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback -import android.support.v4.content.ContextCompat -import android.support.v4.content.FileProvider -import android.support.v7.app.AlertDialog -import android.support.v7.app.AppCompatActivity +import androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback +import androidx.core.content.ContextCompat +import androidx.core.content.FileProvider import android.util.DisplayMetrics import android.view.Gravity import android.view.Menu @@ -32,6 +30,8 @@ import android.view.MotionEvent import android.view.View import android.widget.PopupMenu import android.widget.ToggleButton +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity import org.wordpress.android.util.AppLog import org.wordpress.android.util.ImageUtils import org.wordpress.android.util.PermissionUtils diff --git a/aztec/build.gradle b/aztec/build.gradle index 7d1ed6619..770f2c908 100644 --- a/aztec/build.gradle +++ b/aztec/build.gradle @@ -44,8 +44,8 @@ dependencies { implementation "org.ccil.cowan.tagsoup:tagsoup:$tagSoupVersion" implementation "org.jsoup:jsoup:$jSoupVersion" - implementation "com.android.support:support-v4:27.1.1" - implementation "com.android.support:design:27.1.1" + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.0.0' implementation "org.wordpress:utils:$wordpressUtilsVersion" @@ -54,4 +54,6 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion" + + implementation 'org.apache.commons:commons-lang3:3.8.1' } diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/Aztec.kt b/aztec/src/main/kotlin/org/wordpress/aztec/Aztec.kt index e488435ae..4bd3d5365 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/Aztec.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/Aztec.kt @@ -1,8 +1,8 @@ package org.wordpress.aztec import android.app.Activity -import android.support.annotation.IdRes import android.view.View +import androidx.annotation.IdRes import org.wordpress.aztec.plugins.IAztecPlugin import org.wordpress.aztec.plugins.IToolbarButton import org.wordpress.aztec.source.SourceViewEditText @@ -34,8 +34,8 @@ open class Aztec private constructor(val visualEditor: AztecText, val toolbar: I } private constructor(activity: Activity, @IdRes aztecTextId: Int, - @IdRes sourceTextId: Int, @IdRes toolbarId: Int, - toolbarClickListener: IAztecToolbarClickListener) : this(activity.findViewById(aztecTextId), + @IdRes sourceTextId: Int, @IdRes toolbarId: Int, + toolbarClickListener: IAztecToolbarClickListener) : this(activity.findViewById(aztecTextId), activity.findViewById(sourceTextId), activity.findViewById(toolbarId), toolbarClickListener) private constructor(activity: Activity, @IdRes aztecTextId: Int, diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt index 24de93da1..78f4d74fa 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt @@ -19,7 +19,7 @@ package org.wordpress.aztec import android.content.Context -import android.support.v4.text.TextDirectionHeuristicsCompat +import androidx.core.text.TextDirectionHeuristicsCompat import android.text.Editable import android.text.Spannable import android.text.SpannableString diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecTagHandler.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecTagHandler.kt index 3792239bb..965a0ffb9 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecTagHandler.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecTagHandler.kt @@ -23,7 +23,7 @@ package org.wordpress.aztec import android.content.Context import android.graphics.drawable.Drawable -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.Editable import android.text.Spanned import org.wordpress.aztec.plugins.IAztecPlugin diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt index 3edbf11f8..a6b2beeb7 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt @@ -31,11 +31,6 @@ import android.os.Bundle import android.os.Looper import android.os.Parcel import android.os.Parcelable -import android.support.annotation.DrawableRes -import android.support.graphics.drawable.VectorDrawableCompat -import android.support.v4.content.ContextCompat -import android.support.v7.app.AlertDialog -import android.support.v7.widget.AppCompatEditText import android.text.Editable import android.text.InputFilter import android.text.InputType @@ -56,6 +51,11 @@ import android.view.inputmethod.BaseInputConnection import android.widget.CheckBox import android.widget.EditText import android.widget.Toast +import androidx.annotation.DrawableRes +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.widget.AppCompatEditText +import androidx.core.content.ContextCompat +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext @@ -348,6 +348,11 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown isInGutenbergMode = isCompatibleWithGutenberg } + // Newer AppCompatEditText returns Editable?, and using that would require changing all of Aztec to not use `text.` + override fun getText(): Editable { + return super.getText()!! + } + @SuppressLint("ResourceType") private fun init(attrs: AttributeSet?) { disableTextChangedListener() diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt b/aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt index 7cd5bb5a8..d5a8f0fac 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.formatting -import android.support.v4.text.TextDirectionHeuristicsCompat +import androidx.core.text.TextDirectionHeuristicsCompat import android.text.Editable import android.text.Layout import android.text.Spanned diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt b/aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt index 88f1f594c..523c8330b 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt @@ -1,7 +1,7 @@ package org.wordpress.aztec.formatting import android.graphics.drawable.Drawable -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.SpannableStringBuilder import android.text.Spanned import android.text.TextUtils diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/source/CssStyleFormatter.kt b/aztec/src/main/kotlin/org/wordpress/aztec/source/CssStyleFormatter.kt index 6440fb1e3..9659107b0 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/source/CssStyleFormatter.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/source/CssStyleFormatter.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.source -import android.support.v4.text.TextDirectionHeuristicsCompat +import androidx.core.text.TextDirectionHeuristicsCompat import android.text.Editable import android.text.Layout import android.text.Spannable diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleTextWatcher.kt b/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleTextWatcher.kt index 473c555c9..9359ac626 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleTextWatcher.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleTextWatcher.kt @@ -1,9 +1,9 @@ package org.wordpress.aztec.source -import android.support.annotation.ColorInt import android.text.Editable import android.text.Spannable import android.text.TextWatcher +import androidx.annotation.ColorInt class HtmlStyleTextWatcher(@ColorInt private val tagColor: Int, @ColorInt private val attributeColor: Int) : TextWatcher { @@ -224,4 +224,4 @@ class HtmlStyleTextWatcher(@ColorInt private val tagColor: Int, @ColorInt privat * Stores a pair of integers describing a range of values. */ private class SpanRange(val openingTagLoc: Int, val closingTagLoc: Int) -} \ No newline at end of file +} diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleUtils.kt b/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleUtils.kt index f4818f319..ddfc04136 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleUtils.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/source/HtmlStyleUtils.kt @@ -2,12 +2,12 @@ package org.wordpress.aztec.source import android.graphics.Typeface import android.os.Build -import android.support.annotation.ColorInt import android.text.Spannable import android.text.style.CharacterStyle import android.text.style.ForegroundColorSpan import android.text.style.RelativeSizeSpan import android.text.style.StyleSpan +import androidx.annotation.ColorInt import org.wordpress.aztec.spans.AztecStyleSpan import java.util.regex.Pattern diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/source/SourceViewEditText.kt b/aztec/src/main/kotlin/org/wordpress/aztec/source/SourceViewEditText.kt index fbc6b8f1e..7c3b877aa 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/source/SourceViewEditText.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/source/SourceViewEditText.kt @@ -5,8 +5,7 @@ import android.content.Context import android.os.Bundle import android.os.Parcel import android.os.Parcelable -import android.support.annotation.ColorInt -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.Editable import android.text.SpannableStringBuilder import android.text.TextWatcher @@ -14,6 +13,8 @@ import android.util.AttributeSet import android.view.KeyEvent import android.view.MotionEvent import android.view.View +import androidx.annotation.ColorInt +import androidx.appcompat.widget.AppCompatEditText import org.wordpress.aztec.AztecText import org.wordpress.aztec.AztecText.EditorHasChanges import org.wordpress.aztec.AztecTextAccessibilityDelegate @@ -23,7 +24,7 @@ import org.wordpress.aztec.spans.AztecCursorSpan import org.wordpress.aztec.util.InstanceStateUtils @SuppressLint("SupportAnnotationUsage") -open class SourceViewEditText : android.support.v7.widget.AppCompatEditText, TextWatcher { +open class SourceViewEditText : AppCompatEditText, TextWatcher { companion object { val RETAINED_CONTENT_KEY = "RETAINED_CONTENT_KEY" } @@ -240,18 +241,18 @@ open class SourceViewEditText : android.support.v7.widget.AppCompatEditText, Tex } fun isCursorInsideTag(): Boolean { - val indexOfFirstClosingBracketOnTheRight = text.indexOf(">", selectionEnd) - val indexOfFirstOpeningBracketOnTheRight = text.indexOf("<", selectionEnd) + val indexOfFirstClosingBracketOnTheRight = text?.indexOf(">", selectionEnd) + val indexOfFirstOpeningBracketOnTheRight = text?.indexOf("<", selectionEnd) val isThereClosingBracketBeforeOpeningBracket = indexOfFirstClosingBracketOnTheRight != -1 && - ((indexOfFirstClosingBracketOnTheRight < indexOfFirstOpeningBracketOnTheRight) + ((indexOfFirstClosingBracketOnTheRight!! < indexOfFirstOpeningBracketOnTheRight!!) || indexOfFirstOpeningBracketOnTheRight == -1) - val indexOfFirstClosingBracketOnTheLeft = text.lastIndexOf(">", selectionEnd - 1) - val indexOfFirstOpeningBracketOnTheLeft = text.lastIndexOf("<", selectionEnd - 1) + val indexOfFirstClosingBracketOnTheLeft = text?.lastIndexOf(">", selectionEnd - 1) + val indexOfFirstOpeningBracketOnTheLeft = text?.lastIndexOf("<", selectionEnd - 1) val isThereOpeningBracketBeforeClosingBracket = indexOfFirstOpeningBracketOnTheLeft != -1 && - ((indexOfFirstOpeningBracketOnTheLeft > indexOfFirstClosingBracketOnTheLeft) || indexOfFirstClosingBracketOnTheLeft == -1) + ((indexOfFirstOpeningBracketOnTheLeft!! > indexOfFirstClosingBracketOnTheLeft!!) || indexOfFirstClosingBracketOnTheLeft == -1) return isThereClosingBracketBeforeOpeningBracket && isThereOpeningBracketBeforeClosingBracket } diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecAudioSpan.kt b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecAudioSpan.kt index aab143820..b297617d7 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecAudioSpan.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecAudioSpan.kt @@ -2,7 +2,7 @@ package org.wordpress.aztec.spans import android.content.Context import android.graphics.drawable.Drawable -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.view.Gravity import org.wordpress.aztec.AztecAttributes import org.wordpress.aztec.AztecText diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecQuoteSpan.kt b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecQuoteSpan.kt index 5f6f8a3d9..d7f2b52c2 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecQuoteSpan.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecQuoteSpan.kt @@ -21,11 +21,10 @@ import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint import android.graphics.Rect -import android.support.v4.text.TextDirectionHeuristicCompat -import android.support.v4.text.TextDirectionHeuristicsCompat -import android.support.v4.text.TextUtilsCompat -import android.support.v4.util.ArrayMap -import android.support.v4.view.ViewCompat +import androidx.core.text.TextDirectionHeuristicCompat +import androidx.core.text.TextDirectionHeuristicsCompat +import androidx.core.text.TextUtilsCompat +import androidx.core.view.ViewCompat import android.text.Editable import android.text.Layout import android.text.Spanned @@ -33,6 +32,7 @@ import android.text.style.LineBackgroundSpan import android.text.style.LineHeightSpan import android.text.style.QuoteSpan import android.text.style.UpdateLayout +import androidx.collection.ArrayMap import org.wordpress.aztec.AztecAttributes import org.wordpress.aztec.formatting.BlockFormatter import java.util.Locale @@ -167,4 +167,4 @@ class AztecQuoteSpan( return textDirectionHeuristic.isRtl(text, start, end - start) } -} \ No newline at end of file +} diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecVideoSpan.kt b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecVideoSpan.kt index 7bf65db61..4391493e2 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecVideoSpan.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecVideoSpan.kt @@ -2,7 +2,7 @@ package org.wordpress.aztec.spans import android.content.Context import android.graphics.drawable.Drawable -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.view.Gravity import org.wordpress.aztec.AztecAttributes import org.wordpress.aztec.AztecText diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt index d9014c309..1e2e6a6cd 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt @@ -5,9 +5,8 @@ import android.content.Context import android.os.Build import android.os.Bundle import android.os.Parcelable -import android.support.v4.text.TextUtilsCompat -import android.support.v4.view.ViewCompat -import android.support.v7.app.AlertDialog +import androidx.core.text.TextUtilsCompat +import androidx.core.view.ViewCompat import android.util.AttributeSet import android.view.KeyEvent import android.view.LayoutInflater @@ -23,6 +22,7 @@ import android.widget.PopupMenu import android.widget.PopupMenu.OnMenuItemClickListener import android.widget.Toast import android.widget.ToggleButton +import androidx.appcompat.app.AlertDialog import org.wordpress.android.util.AppLog import org.wordpress.aztec.AztecText import org.wordpress.aztec.AztecText.EditorHasChanges.NO_CHANGES diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/RippleToggleButton.kt b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/RippleToggleButton.kt index 6578e9ccb..c85d725c2 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/RippleToggleButton.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/RippleToggleButton.kt @@ -3,7 +3,7 @@ package org.wordpress.aztec.toolbar import android.content.Context import android.graphics.Canvas import android.graphics.Paint -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.util.AttributeSet import android.view.MotionEvent import android.view.View diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/util/ColorConverter.kt b/aztec/src/main/kotlin/org/wordpress/aztec/util/ColorConverter.kt index ed71eb82b..1a1b54364 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/util/ColorConverter.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/util/ColorConverter.kt @@ -3,8 +3,8 @@ package org.wordpress.aztec.util import android.content.res.Resources import android.graphics.Color import android.os.Build -import android.support.annotation.ColorInt import android.text.TextUtils +import androidx.annotation.ColorInt import org.wordpress.aztec.util.ColorConverter.Companion.COLOR_NOT_FOUND /** @@ -244,4 +244,4 @@ class ColorConverter { } } } -} \ No newline at end of file +} diff --git a/aztec/src/main/res/layout/aztec_format_bar_advanced.xml b/aztec/src/main/res/layout/aztec_format_bar_advanced.xml index decd28686..84d07620c 100644 --- a/aztec/src/main/res/layout/aztec_format_bar_advanced.xml +++ b/aztec/src/main/res/layout/aztec_format_bar_advanced.xml @@ -241,7 +241,7 @@ - diff --git a/picasso-loader/build.gradle b/picasso-loader/build.gradle index 3ec7326e6..c48262210 100644 --- a/picasso-loader/build.gradle +++ b/picasso-loader/build.gradle @@ -25,8 +25,8 @@ dependencies { implementation project(':aztec') - implementation "com.android.support:support-v4:27.1.1" - implementation "com.android.support:design:27.1.1" + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.0.0' implementation "com.squareup.picasso:picasso:$picassoVersion" } diff --git a/picasso-loader/src/main/java/org/wordpress/aztec/picassoloader/PicassoImageLoader.kt b/picasso-loader/src/main/java/org/wordpress/aztec/picassoloader/PicassoImageLoader.kt index ad53d8a84..d20c5cd73 100644 --- a/picasso-loader/src/main/java/org/wordpress/aztec/picassoloader/PicassoImageLoader.kt +++ b/picasso-loader/src/main/java/org/wordpress/aztec/picassoloader/PicassoImageLoader.kt @@ -4,8 +4,8 @@ import android.content.Context import android.graphics.Bitmap import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable -import android.support.v4.util.ArrayMap import android.util.DisplayMetrics +import androidx.collection.ArrayMap import com.squareup.picasso.Picasso import com.squareup.picasso.Target diff --git a/wordpress-comments/build.gradle b/wordpress-comments/build.gradle index f8dcb7d16..597f32764 100644 --- a/wordpress-comments/build.gradle +++ b/wordpress-comments/build.gradle @@ -36,8 +36,8 @@ dependencies { implementation project(':aztec') - implementation "com.android.support:support-v4:27.1.1" - implementation "com.android.support:design:27.1.1" + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.0.0' implementation "org.wordpress:utils:$wordpressUtilsVersion" testImplementation "junit:junit:$jUnitVersion" diff --git a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/HiddenGutenbergPlugin.kt b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/HiddenGutenbergPlugin.kt index 551308fc4..c352ee176 100644 --- a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/HiddenGutenbergPlugin.kt +++ b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/HiddenGutenbergPlugin.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.plugins.wpcomments -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.Editable import android.text.Spannable import android.text.style.CharacterStyle @@ -99,4 +99,4 @@ class HiddenGutenbergPlugin @JvmOverloads constructor(private val aztecText: Azt override fun handleSpanEnd(html: StringBuilder, span: CharacterStyle) { html.append("-->") } -} \ No newline at end of file +} diff --git a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/WordPressCommentsPlugin.kt b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/WordPressCommentsPlugin.kt index a4b285571..6e9f66bb6 100644 --- a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/WordPressCommentsPlugin.kt +++ b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/WordPressCommentsPlugin.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.plugins.wpcomments -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.Editable import android.text.Spannable import android.text.style.CharacterStyle @@ -68,4 +68,4 @@ class WordPressCommentsPlugin(private val visualEditor: AztecText) : IInlineSpan } return false } -} \ No newline at end of file +} diff --git a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/MoreToolbarButton.kt b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/MoreToolbarButton.kt index 00ecb99ff..46e4aa63b 100644 --- a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/MoreToolbarButton.kt +++ b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/MoreToolbarButton.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.plugins.wpcomments.toolbar -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.SpannableStringBuilder import android.text.Spanned import android.view.KeyEvent @@ -60,4 +60,4 @@ class MoreToolbarButton(val visualEditor: AztecText) : IToolbarButton { override fun toolbarStateAboutToChange(toolbar: AztecToolbar, enable: Boolean) { toolbar.findViewById(R.id.format_bar_button_more).isEnabled = enable } -} \ No newline at end of file +} diff --git a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/PageToolbarButton.kt b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/PageToolbarButton.kt index 096648255..630de571f 100644 --- a/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/PageToolbarButton.kt +++ b/wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/toolbar/PageToolbarButton.kt @@ -1,6 +1,6 @@ package org.wordpress.aztec.plugins.wpcomments.toolbar -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.text.SpannableStringBuilder import android.text.Spanned import android.view.KeyEvent @@ -55,4 +55,4 @@ class PageToolbarButton(val visualEditor: AztecText) : IToolbarButton { override fun toolbarStateAboutToChange(toolbar: AztecToolbar, enable: Boolean) { // no op } -} \ No newline at end of file +} diff --git a/wordpress-shortcodes/build.gradle b/wordpress-shortcodes/build.gradle index 8d4d1451a..23fe46967 100644 --- a/wordpress-shortcodes/build.gradle +++ b/wordpress-shortcodes/build.gradle @@ -36,7 +36,7 @@ dependencies { implementation project(':aztec') - implementation "com.android.support:appcompat-v7:27.1.1" + implementation 'androidx.appcompat:appcompat:1.0.0' testImplementation "junit:junit:$jUnitVersion" testImplementation "org.robolectric:robolectric:$robolectricVersion" diff --git a/wordpress-shortcodes/src/main/java/org/wordpress/aztec/plugins/shortcodes/extensions/VideoPressExtensions.kt b/wordpress-shortcodes/src/main/java/org/wordpress/aztec/plugins/shortcodes/extensions/VideoPressExtensions.kt index a14bb31f3..87490cb45 100644 --- a/wordpress-shortcodes/src/main/java/org/wordpress/aztec/plugins/shortcodes/extensions/VideoPressExtensions.kt +++ b/wordpress-shortcodes/src/main/java/org/wordpress/aztec/plugins/shortcodes/extensions/VideoPressExtensions.kt @@ -1,7 +1,7 @@ package org.wordpress.aztec.plugins.shortcodes.extensions import android.graphics.drawable.Drawable -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import org.wordpress.aztec.AztecText import org.wordpress.aztec.Html import org.wordpress.aztec.spans.AztecVideoSpan From 225505e94d6ac388d206e929ac65c8a29eab1ba5 Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Mon, 10 Jun 2019 17:14:41 -0400 Subject: [PATCH 03/24] Migrate demo project to AndroidX --- aztec/src/main/res/layout/aztec_format_bar_advanced.xml | 2 +- aztec/src/main/res/layout/dialog_link.xml | 8 ++++---- gradle.properties | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/aztec/src/main/res/layout/aztec_format_bar_advanced.xml b/aztec/src/main/res/layout/aztec_format_bar_advanced.xml index 84d07620c..200481b59 100644 --- a/aztec/src/main/res/layout/aztec_format_bar_advanced.xml +++ b/aztec/src/main/res/layout/aztec_format_bar_advanced.xml @@ -241,7 +241,7 @@ - diff --git a/aztec/src/main/res/layout/dialog_link.xml b/aztec/src/main/res/layout/dialog_link.xml index 049b339d3..49f47a081 100644 --- a/aztec/src/main/res/layout/dialog_link.xml +++ b/aztec/src/main/res/layout/dialog_link.xml @@ -5,7 +5,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - + - - + Date: Mon, 10 Jun 2019 17:15:07 -0400 Subject: [PATCH 04/24] Remove space from gradle.properties --- gradle.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index eb5f41feb..2d6c0509e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,9 +10,10 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m - android.enableJetifier=true -android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +android.enableJetifier=true +android.useAndroidX=true + # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit From 74d1e513dd3ee89eff328e50ac70133bbf42e8ad Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Tue, 9 Jul 2019 13:37:17 +0300 Subject: [PATCH 05/24] Declare usage of base, mock libs --- aztec/build.gradle | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aztec/build.gradle b/aztec/build.gradle index 770f2c908..f4ab53ff4 100644 --- a/aztec/build.gradle +++ b/aztec/build.gradle @@ -36,6 +36,12 @@ android { } } } + + // Gradle automatically adds 'android.test.runner' as a dependency. + useLibrary 'android.test.runner' + + useLibrary 'android.test.base' + useLibrary 'android.test.mock' } dependencies { @@ -52,6 +58,13 @@ dependencies { testImplementation "junit:junit:$jUnitVersion" testImplementation "org.robolectric:robolectric:$robolectricVersion" + androidTestImplementation 'androidx.test:core:1.2.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0', { + exclude group: 'com.android.support', module: 'support-annotations' + } + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion" From c1c4765d4c703e8dddc4b12dc33c07afcea62cf0 Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 13:18:02 -0400 Subject: [PATCH 06/24] User roboelectric context instead of MockContext --- aztec/src/test/kotlin/org/wordpress/aztec/AztecParserTest.kt | 4 ++-- .../test/kotlin/org/wordpress/aztec/CalypsoFormattingTest.kt | 4 ++-- .../test/kotlin/org/wordpress/aztec/CssStyleAttributeTest.kt | 4 ++-- .../kotlin/org/wordpress/aztec/HtmlAttributeStyleColorTest.kt | 4 ++-- .../src/test/kotlin/org/wordpress/aztec/HtmlFormattingTest.kt | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/AztecParserTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/AztecParserTest.kt index 61960d453..cb04fdc19 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/AztecParserTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/AztecParserTest.kt @@ -3,7 +3,6 @@ package org.wordpress.aztec import android.test.AndroidTestCase -import android.test.mock.MockContext import android.text.SpannableString import android.text.SpannableStringBuilder import org.junit.Assert @@ -14,6 +13,7 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config +import org.robolectric.shadows.ShadowApplication /** * Tests for [AztecParser]. @@ -92,7 +92,7 @@ class AztecParserTest : AndroidTestCase() { */ @Before fun init() { - context = MockContext() + context = ShadowApplication.getInstance().applicationContext } /** diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/CalypsoFormattingTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/CalypsoFormattingTest.kt index 40e47b2bd..571c1ab47 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/CalypsoFormattingTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/CalypsoFormattingTest.kt @@ -3,7 +3,6 @@ package org.wordpress.aztec import android.test.AndroidTestCase -import android.test.mock.MockContext import android.text.SpannableString import android.text.SpannableStringBuilder import junit.framework.Assert @@ -13,6 +12,7 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config +import org.robolectric.shadows.ShadowApplication import org.wordpress.aztec.source.Format @RunWith(RobolectricTestRunner::class) @@ -104,7 +104,7 @@ class CalypsoFormattingTest : AndroidTestCase() { */ @Before fun init() { - context = MockContext() + context = ShadowApplication.getInstance().applicationContext } /** diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/CssStyleAttributeTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/CssStyleAttributeTest.kt index 30cf5c881..9f8dda243 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/CssStyleAttributeTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/CssStyleAttributeTest.kt @@ -3,7 +3,6 @@ package org.wordpress.aztec import android.test.AndroidTestCase -import android.test.mock.MockContext import android.text.SpannableString import junit.framework.Assert import org.junit.Before @@ -12,6 +11,7 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config +import org.robolectric.shadows.ShadowApplication import org.wordpress.aztec.source.CssStyleFormatter import org.wordpress.aztec.spans.AztecStyleBoldSpan @@ -27,7 +27,7 @@ class CssStyleAttributeTest : AndroidTestCase() { @Before fun init() { - context = MockContext() + context = ShadowApplication.getInstance().applicationContext parser = AztecParser() } diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/HtmlAttributeStyleColorTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/HtmlAttributeStyleColorTest.kt index 1ec5e501b..d15657013 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/HtmlAttributeStyleColorTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/HtmlAttributeStyleColorTest.kt @@ -3,7 +3,6 @@ package org.wordpress.aztec import android.test.AndroidTestCase -import android.test.mock.MockContext import android.text.SpannableString import android.text.style.ForegroundColorSpan import junit.framework.Assert @@ -13,6 +12,7 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config +import org.robolectric.shadows.ShadowApplication import org.wordpress.aztec.spans.IAztecAttributedSpan /** @@ -45,7 +45,7 @@ class HtmlAttributeStyleColorTest : AndroidTestCase() { @Before fun init() { - context = MockContext() + context = ShadowApplication.getInstance().applicationContext parser = AztecParser() } diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/HtmlFormattingTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/HtmlFormattingTest.kt index 9c38bcf3d..0d1d43f6e 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/HtmlFormattingTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/HtmlFormattingTest.kt @@ -3,7 +3,6 @@ package org.wordpress.aztec import android.test.AndroidTestCase -import android.test.mock.MockContext import android.text.SpannableString import junit.framework.Assert import org.junit.Before @@ -12,6 +11,7 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config +import org.robolectric.shadows.ShadowApplication import org.wordpress.aztec.source.Format @RunWith(RobolectricTestRunner::class) @@ -173,7 +173,7 @@ class HtmlFormattingTest : AndroidTestCase() { */ @Before fun init() { - context = MockContext() + context = ShadowApplication.getInstance().applicationContext } /** From 07cba88035bd5cd5723ef687ff2d2933e12d78d5 Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 14:15:27 -0400 Subject: [PATCH 07/24] Fix wrong hardcoded Espresso path --- app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt b/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt index 523458a3e..728cb3b02 100644 --- a/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt +++ b/app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt @@ -170,7 +170,7 @@ open class MainActivity : AppCompatActivity(), private val isRunningTest: Boolean by lazy { try { - Class.forName("android.support.test.espresso.Espresso") + Class.forName("androidx.test.espresso.Espresso") true } catch (e: ClassNotFoundException) { false From 67b3b63e85bb57bf8a885c1f24edddecf2081f7b Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 15:13:20 -0400 Subject: [PATCH 08/24] Fixed failing test --- .../org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt index 6429e2811..182265aa0 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt @@ -55,7 +55,7 @@ class GutenbergCompatTests : BaseTest() { fun testRetainGutenbergPostContentWithCoverImage() { val html = "" + "
" + - "

Of Mountains & Printing Presses

" + + "

Of Mountains & Printing Presses

" + "
" + "" From c98945fc70ea4e83b81558ee8af2c2fbac5c757f Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 16:22:09 -0400 Subject: [PATCH 09/24] Add some sleep --- .../wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index cccd6cea6..51a0775a6 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -11,6 +11,8 @@ import org.wordpress.aztec.demo.pages.EditorPage class MixedTextFormattingTests : BaseTest() { + protected val throttleTime: Long = 1000L + @Rule @JvmField var mActivityTestRule = ActivityTestRule(MainActivity::class.java) @@ -27,11 +29,14 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleBold() .insertText(text1) + .threadSleep(throttleTime) .toggleBold() .toggleItalics() .insertText(text2) + .threadSleep(throttleTime) .toggleBold() .insertText(text3) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(regex) } @@ -249,7 +254,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(input) + .threadSleep(throttleTime) .toggleHtml() + .threadSleep(throttleTime) .toggleHtml() .hasChanges(AztecText.EditorHasChanges.NO_CHANGES) // Verify that the user had not changed the input } From dcffc6cb1d2321dbffb263d92c644004a1f2b60e Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 16:54:24 -0400 Subject: [PATCH 10/24] Use API 28 on CI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8648faa0c..0ade1424d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: Lint: executor: name: android/default - api-version: "27" + api-version: "28" steps: - checkout - android/restore-gradle-cache: @@ -26,7 +26,7 @@ jobs: Unit Tests: executor: name: android/default - api-version: "27" + api-version: "28" steps: - checkout - android/restore-gradle-cache: @@ -40,7 +40,7 @@ jobs: Connected Tests: executor: name: android/default - api-version: "27" + api-version: "28" steps: - checkout - android/restore-gradle-cache: From d2c5b5a0ea0f300aa5f66d72b39b6c615b87b36c Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 16:55:04 -0400 Subject: [PATCH 11/24] Add more sleep in tests --- .../org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 51a0775a6..0a3df64ad 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -69,10 +69,13 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .insertText(text1) + .threadSleep(throttleTime) .toggleBold() .insertText(text2) + .threadSleep(throttleTime) .toggleBold() .insertText(text3) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } From 9bdc429f2743a750f247d850e8e548ed5a581fc5 Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 17:35:25 -0400 Subject: [PATCH 12/24] Insert sleep into all test cases after text is inserted --- .../demo/tests/MixedTextFormattingTests.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 0a3df64ad..68bffcfb7 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -52,9 +52,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .insertText(text1) + .threadSleep(throttleTime) .toggleBold() .focusedInsertText(text2) .moveCursorLeftAsManyTimes(1) + .threadSleep(throttleTime) .focusedInsertText(text3) .toggleHtml() .verifyHTML(html) @@ -89,8 +91,10 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html1) + .threadSleep(throttleTime) .toggleHtml() .toggleQuote() + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html2) } @@ -105,6 +109,7 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html) + .threadSleep(throttleTime) .toggleHtml() .toggleHtml() .verifyHTML(html) @@ -133,9 +138,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html) + .threadSleep(throttleTime) .toggleHtml() .selectAllText() .makeHeader(EditorPage.HeadingStyle.DEFAULT) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(text) } @@ -148,9 +155,12 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeHeader(EditorPage.HeadingStyle.ONE) .insertText(text) + .threadSleep(throttleTime) .insertText("\n") .makeHeader(EditorPage.HeadingStyle.TWO) + .threadSleep(throttleTime) .insertText(text) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -163,8 +173,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeHeader(EditorPage.HeadingStyle.ONE) .insertText(text) + .threadSleep(throttleTime) .insertText("\n") + .threadSleep(throttleTime) .insertText(text) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -192,8 +205,10 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleQuote() .insertText(text) + .threadSleep(throttleTime) .insertText("\n") .insertText(text) + .threadSleep(throttleTime) .toggleQuote() .toggleHtml() .verifyHTML(html) @@ -209,6 +224,7 @@ class MixedTextFormattingTests : BaseTest() { .toggleQuote() .makeList(EditorPage.ListStyle.UNORDERED) .insertText(text) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -223,6 +239,7 @@ class MixedTextFormattingTests : BaseTest() { .toggleQuote() .makeList(EditorPage.ListStyle.UNORDERED) .insertText(text) + .threadSleep(throttleTime) .makeList(EditorPage.ListStyle.UNORDERED) .toggleHtml() .verifyHTML(html) @@ -237,8 +254,10 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeList(EditorPage.ListStyle.UNORDERED) .insertText(text1) + .threadSleep(throttleTime) .toggleQuote() .insertText(text2) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -273,9 +292,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(input) + .threadSleep(throttleTime) .toggleHtml() .setCursorPositionAtEnd() .insertText(insertedText) + .threadSleep(throttleTime) .toggleHtml() .hasChanges(AztecText.EditorHasChanges.CHANGES) .verifyHTML(afterParser) @@ -292,6 +313,7 @@ class MixedTextFormattingTests : BaseTest() { .toggleHtml() .toggleHtml() // switch back to HTML editor .insertHTML(insertedText) + .threadSleep(throttleTime) .hasChangesHTML(AztecText.EditorHasChanges.CHANGES) .verifyHTML(afterParser) } @@ -304,9 +326,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage().toggleHtml() .insertHTML(input) + .threadSleep(throttleTime) .toggleHtml() .toggleHtml() // switch back to HTML editor .insertHTML(insertedText) + .threadSleep(throttleTime) .hasChangesHTML(AztecText.EditorHasChanges.CHANGES) .toggleHtml() // switch back to Visual editor .verify(afterParser) From c1ce7b89b6f04fb39a09102548d619f4f5352e78 Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 17:57:33 -0400 Subject: [PATCH 13/24] Added more sleep to testListwithQuoteFormatting --- .../org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 68bffcfb7..68c2546f1 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -253,12 +253,15 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeList(EditorPage.ListStyle.UNORDERED) + .threadSleep(throttleTime) .insertText(text1) .threadSleep(throttleTime) .toggleQuote() + .threadSleep(throttleTime) .insertText(text2) .threadSleep(throttleTime) .toggleHtml() + .threadSleep(throttleTime) .verifyHTML(html) } From bb0d5849e3052215572e0c16c26fcc7801c8da3b Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Tue, 9 Jul 2019 19:20:40 -0400 Subject: [PATCH 14/24] Added sleep to testRetainHeadingFormatting --- .../org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 68c2546f1..5be6d5bda 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -123,9 +123,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html) + .threadSleep(throttleTime) .toggleHtml() .selectAllText() .makeHeader(EditorPage.HeadingStyle.ONE) + .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } From e65501f1ba7b2b8fee8d4cb64f218c0593beae7d Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:33:27 +0300 Subject: [PATCH 15/24] Revert "Fixed failing test" This reverts commit 67b3b63e85bb57bf8a885c1f24edddecf2081f7b. --- .../org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt index 182265aa0..6429e2811 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/GutenbergCompatTests.kt @@ -55,7 +55,7 @@ class GutenbergCompatTests : BaseTest() { fun testRetainGutenbergPostContentWithCoverImage() { val html = "" + "
" + - "

Of Mountains & Printing Presses

" + + "

Of Mountains & Printing Presses

" + "
" + "" From 18bfeee6fa502ea98dd477b912baf4c989e7049e Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:33:33 +0300 Subject: [PATCH 16/24] Revert "Add some sleep" This reverts commit c98945fc70ea4e83b81558ee8af2c2fbac5c757f. --- .../wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 5be6d5bda..4b8d2e247 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -11,8 +11,6 @@ import org.wordpress.aztec.demo.pages.EditorPage class MixedTextFormattingTests : BaseTest() { - protected val throttleTime: Long = 1000L - @Rule @JvmField var mActivityTestRule = ActivityTestRule(MainActivity::class.java) @@ -29,14 +27,11 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleBold() .insertText(text1) - .threadSleep(throttleTime) .toggleBold() .toggleItalics() .insertText(text2) - .threadSleep(throttleTime) .toggleBold() .insertText(text3) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(regex) } @@ -281,9 +276,7 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(input) - .threadSleep(throttleTime) .toggleHtml() - .threadSleep(throttleTime) .toggleHtml() .hasChanges(AztecText.EditorHasChanges.NO_CHANGES) // Verify that the user had not changed the input } From da803367e5d7b2d5f036b6a5ade8f1b48e770f49 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:33:34 +0300 Subject: [PATCH 17/24] Revert "Add more sleep in tests" This reverts commit d2c5b5a0ea0f300aa5f66d72b39b6c615b87b36c. --- .../org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 4b8d2e247..70c1b36d1 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -66,13 +66,10 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .insertText(text1) - .threadSleep(throttleTime) .toggleBold() .insertText(text2) - .threadSleep(throttleTime) .toggleBold() .insertText(text3) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } From de4a19d0ba72938bf1fca411818f332810b1c408 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:33:34 +0300 Subject: [PATCH 18/24] Revert "Insert sleep into all test cases after text is inserted" This reverts commit 9bdc429f2743a750f247d850e8e548ed5a581fc5. --- .../demo/tests/MixedTextFormattingTests.kt | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 70c1b36d1..d0c23f695 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -47,11 +47,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .insertText(text1) - .threadSleep(throttleTime) .toggleBold() .focusedInsertText(text2) .moveCursorLeftAsManyTimes(1) - .threadSleep(throttleTime) .focusedInsertText(text3) .toggleHtml() .verifyHTML(html) @@ -83,10 +81,8 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html1) - .threadSleep(throttleTime) .toggleHtml() .toggleQuote() - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html2) } @@ -101,7 +97,6 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html) - .threadSleep(throttleTime) .toggleHtml() .toggleHtml() .verifyHTML(html) @@ -132,11 +127,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html) - .threadSleep(throttleTime) .toggleHtml() .selectAllText() .makeHeader(EditorPage.HeadingStyle.DEFAULT) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(text) } @@ -149,12 +142,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeHeader(EditorPage.HeadingStyle.ONE) .insertText(text) - .threadSleep(throttleTime) .insertText("\n") .makeHeader(EditorPage.HeadingStyle.TWO) - .threadSleep(throttleTime) .insertText(text) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -167,11 +157,8 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeHeader(EditorPage.HeadingStyle.ONE) .insertText(text) - .threadSleep(throttleTime) .insertText("\n") - .threadSleep(throttleTime) .insertText(text) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -199,10 +186,8 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleQuote() .insertText(text) - .threadSleep(throttleTime) .insertText("\n") .insertText(text) - .threadSleep(throttleTime) .toggleQuote() .toggleHtml() .verifyHTML(html) @@ -218,7 +203,6 @@ class MixedTextFormattingTests : BaseTest() { .toggleQuote() .makeList(EditorPage.ListStyle.UNORDERED) .insertText(text) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } @@ -233,7 +217,6 @@ class MixedTextFormattingTests : BaseTest() { .toggleQuote() .makeList(EditorPage.ListStyle.UNORDERED) .insertText(text) - .threadSleep(throttleTime) .makeList(EditorPage.ListStyle.UNORDERED) .toggleHtml() .verifyHTML(html) @@ -249,11 +232,9 @@ class MixedTextFormattingTests : BaseTest() { .makeList(EditorPage.ListStyle.UNORDERED) .threadSleep(throttleTime) .insertText(text1) - .threadSleep(throttleTime) .toggleQuote() .threadSleep(throttleTime) .insertText(text2) - .threadSleep(throttleTime) .toggleHtml() .threadSleep(throttleTime) .verifyHTML(html) @@ -287,11 +268,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(input) - .threadSleep(throttleTime) .toggleHtml() .setCursorPositionAtEnd() .insertText(insertedText) - .threadSleep(throttleTime) .toggleHtml() .hasChanges(AztecText.EditorHasChanges.CHANGES) .verifyHTML(afterParser) @@ -308,7 +287,6 @@ class MixedTextFormattingTests : BaseTest() { .toggleHtml() .toggleHtml() // switch back to HTML editor .insertHTML(insertedText) - .threadSleep(throttleTime) .hasChangesHTML(AztecText.EditorHasChanges.CHANGES) .verifyHTML(afterParser) } @@ -321,11 +299,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage().toggleHtml() .insertHTML(input) - .threadSleep(throttleTime) .toggleHtml() .toggleHtml() // switch back to HTML editor .insertHTML(insertedText) - .threadSleep(throttleTime) .hasChangesHTML(AztecText.EditorHasChanges.CHANGES) .toggleHtml() // switch back to Visual editor .verify(afterParser) From 573ec29f237e06bf05bca82485bdd4a268003e07 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:33:35 +0300 Subject: [PATCH 19/24] Revert "Added more sleep to testListwithQuoteFormatting" This reverts commit c1ce7b89b6f04fb39a09102548d619f4f5352e78. --- .../org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index d0c23f695..63824370e 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -230,13 +230,10 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .makeList(EditorPage.ListStyle.UNORDERED) - .threadSleep(throttleTime) .insertText(text1) .toggleQuote() - .threadSleep(throttleTime) .insertText(text2) .toggleHtml() - .threadSleep(throttleTime) .verifyHTML(html) } From 1b492438fef8eb2c3b26e48830579a35d6d4a65f Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:33:36 +0300 Subject: [PATCH 20/24] Revert "Added sleep to testRetainHeadingFormatting" This reverts commit bb0d5849e3052215572e0c16c26fcc7801c8da3b. --- .../org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index 63824370e..cccd6cea6 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -110,11 +110,9 @@ class MixedTextFormattingTests : BaseTest() { EditorPage() .toggleHtml() .insertHTML(html) - .threadSleep(throttleTime) .toggleHtml() .selectAllText() .makeHeader(EditorPage.HeadingStyle.ONE) - .threadSleep(throttleTime) .toggleHtml() .verifyHTML(html) } From ab6cc3ff537eb34784208cf38a1c5e6cc0c8aa92 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:35:08 +0300 Subject: [PATCH 21/24] Have JitPack use SDK 28 as well --- jitpack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jitpack.yml b/jitpack.yml index f4fa44377..96526030e 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,3 +1,3 @@ before_install: - - yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27" + - yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-28" - yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3" From f80c55aa45d6ec5c045016e3c9e8c8e9e1bbc3ad Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 10 Jul 2019 11:36:24 +0300 Subject: [PATCH 22/24] Increase connected tests timeout to 18mins on Firebase Test Lab --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ade1424d..febcdb742 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: test-apk-path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk device: model=Nexus5X,version=26,locale=en,orientation=portrait project: api-project-108380595987 - timeout: 10m + timeout: 18m - android/save-gradle-cache: cache-prefix: connected-tests From c8b636226978caad00ac4747416a537136afb98a Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Wed, 10 Jul 2019 12:43:46 -0400 Subject: [PATCH 23/24] Update release notes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3816c1455..e12334264 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [1.3.28](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.28) +### Added +- Added support for AndroidX + ## [v1.3.27](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.27) ### Fixed - Gutenberg fixes: From 9d4d2b1c361992e420ca7024767d99fc6b0cea83 Mon Sep 17 00:00:00 2001 From: Marko Savic Date: Wed, 10 Jul 2019 12:47:19 -0400 Subject: [PATCH 24/24] Update README for v1.3.28 release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e03301a82..db1a034db 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ repositories { ``` ```gradle dependencies { - api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.27') + api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.28') } ```