Skip to content

Commit

Permalink
Migrate to AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
malinajirka committed Jun 4, 2019
1 parent 1232693 commit b7ac12d
Show file tree
Hide file tree
Showing 704 changed files with 2,421 additions and 2,407 deletions.
44 changes: 22 additions & 22 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,29 +136,29 @@ dependencies {
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'

implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.android.support:support-core-ui:28.0.0'
implementation 'com.android.support:support-fragment:28.0.0'

implementation 'com.android.support:multidex:1.0.2'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:percent:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.fragment:fragment:1.0.0'

implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.media:media:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation "android.arch.work:work-runtime:$arch_work_version"
implementation "android.arch.work:work-runtime-ktx:$arch_work_version"

implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$arch_components_version"
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'

testImplementation("android.arch.core:core-testing:$arch_components_version", {
testImplementation('androidx.arch.core:core-testing:2.0.0', {
exclude group: 'com.android.support', module: 'support-compat'
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-core-utils'
Expand Down Expand Up @@ -198,11 +198,11 @@ dependencies {
androidTestImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
androidTestImplementation 'com.squareup.okhttp:mockwebserver:2.7.5'
androidTestImplementation 'com.squareup.okio:okio:1.14.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2', {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestImplementation('com.android.support.test.espresso:espresso-contrib:2.0') {
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.1.0') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
Expand All @@ -218,8 +218,8 @@ dependencies {

androidTestImplementation project(path:':libs:mocks:WordPressMocks')

androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation 'tools.fastlane:screengrab:1.2.0', {
exclude group: 'com.android.support.test.uiautomator', module: 'uiautomator-v18'
}
Expand Down
10 changes: 5 additions & 5 deletions WordPress/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
priority="4"
summary="Obsolete Gradle Dependency"
explanation="This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find."
errorLine1=" classpath 'com.android.tools.build:gradle:3.2.1'"
errorLine1=" classpath 'com.android.tools.build:gradle:3.3.2'"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
quickfix="studio">
<location
Expand All @@ -178,7 +178,7 @@
priority="4"
summary="Obsolete Gradle Dependency"
explanation="This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find."
errorLine1=" classpath &apos;com.android.tools.build:gradle:3.2.1&apos;"
errorLine1=" classpath &apos;com.android.tools.build:gradle:3.3.2&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
quickfix="studio">
<location
Expand All @@ -195,7 +195,7 @@
priority="4"
summary="Obsolete Gradle Dependency"
explanation="This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find."
errorLine1=" classpath &apos;com.android.tools.build:gradle:3.2.1&apos;"
errorLine1=" classpath &apos;com.android.tools.build:gradle:3.3.2&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
quickfix="studio">
<location
Expand All @@ -212,7 +212,7 @@
priority="4"
summary="Obsolete Gradle Dependency"
explanation="This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find."
errorLine1=" classpath &apos;com.android.tools.build:gradle:3.2.1&apos;"
errorLine1=" classpath &apos;com.android.tools.build:gradle:3.3.2&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
quickfix="studio">
<location
Expand Down Expand Up @@ -365,7 +365,7 @@
priority="3"
summary="Using private resources"
explanation="Private resources should not be referenced; the may not be present everywhere, and even where they are they may disappear without notice.&#xA;&#xA;To fix this, copy the resource into your own project instead."
errorLine1=" context.getResources().getDimensionPixelSize(android.support.design.R.dimen.design_fab_size_normal);"
errorLine1=" context.getResources().getDimensionPixelSize(com.google.android.material.R.dimen.design_fab_size_normal);"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="../WordPress/src/main/java/org/wordpress/android/util/AniUtils.java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.wordpress.android

import android.app.Application
import android.content.Context
import android.support.test.runner.AndroidJUnitRunner
import androidx.test.runner.AndroidJUnitRunner

/**
* Custom AndroidJUnitRunner that replaces the original application with [WordPressTest].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.wordpress.android.e2e;

import android.Manifest.permission;
import android.support.test.rule.ActivityTestRule;
import android.support.test.rule.GrantPermissionRule;
import androidx.test.rule.ActivityTestRule;
import androidx.test.rule.GrantPermissionRule;

import org.junit.Before;
import org.junit.Rule;
Expand All @@ -16,10 +16,10 @@

import java.time.Instant;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.Espresso.pressBack;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.Espresso.pressBack;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static junit.framework.TestCase.assertTrue;
import static org.wordpress.android.BuildConfig.E2E_WP_COM_USER_SITE_ADDRESS;
import static org.wordpress.android.support.WPSupportUtils.checkViewHasText;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wordpress.android.e2e;

import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import org.junit.After;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

import android.content.Intent;
import android.net.Uri;
import android.support.test.espresso.ViewInteraction;
import android.support.test.rule.ActivityTestRule;
import androidx.test.espresso.ViewInteraction;
import androidx.test.rule.ActivityTestRule;
import android.view.View;
import android.widget.EditText;

import org.hamcrest.Matchers;
import org.wordpress.android.R;
import org.wordpress.android.ui.accounts.LoginMagicLinkInterceptActivity;

import static android.support.test.InstrumentationRegistry.getTargetContext;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.isDescendantOfA;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.InstrumentationRegistry.getTargetContext;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.CoreMatchers.allOf;
import static org.wordpress.android.BuildConfig.E2E_WP_COM_USER_EMAIL;
import static org.wordpress.android.BuildConfig.E2E_WP_COM_USER_PASSWORD;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package org.wordpress.android.e2e.pages;

import android.support.test.espresso.ViewInteraction;
import androidx.test.espresso.ViewInteraction;

import junit.framework.AssertionFailedError;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.hasSibling;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.hasSibling;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;

public class AppSettingsPage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package org.wordpress.android.e2e.pages;

import android.support.test.espresso.ViewInteraction;
import android.support.test.espresso.action.ViewActions;
import androidx.test.espresso.ViewInteraction;
import androidx.test.espresso.action.ViewActions;

import org.wordpress.android.R;

import static android.support.test.InstrumentationRegistry.getInstrumentation;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu;
import static android.support.test.espresso.Espresso.pressBack;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.RootMatchers.isDialog;
import static android.support.test.espresso.matcher.ViewMatchers.isDescendantOfA;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withHint;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.InstrumentationRegistry.getInstrumentation;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu;
import static androidx.test.espresso.Espresso.pressBack;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.RootMatchers.isDialog;
import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withHint;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.wordpress.android.support.WPSupportUtils.clickOn;
import static org.wordpress.android.support.WPSupportUtils.isElementDisplayed;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.wordpress.android.e2e.pages;

import android.support.test.espresso.ViewInteraction;
import androidx.test.espresso.ViewInteraction;

import org.wordpress.android.R;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.wordpress.android.support.WPSupportUtils.clickOn;
import static org.wordpress.android.support.WPSupportUtils.getCurrentActivity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.wordpress.android.e2e.pages;

import android.support.test.espresso.ViewInteraction;
import android.support.v7.widget.Toolbar;
import androidx.test.espresso.ViewInteraction;
import androidx.appcompat.widget.Toolbar;
import android.widget.TextView;

import org.wordpress.android.R;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
import static android.support.test.espresso.matcher.ViewMatchers.withParent;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.wordpress.android.support.WPSupportUtils.clickOn;
import static org.wordpress.android.support.WPSupportUtils.longClickOn;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wordpress.android.e2e.pages;

import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import androidx.recyclerview.widget.RecyclerView;

import static org.wordpress.android.support.WPSupportUtils.getCurrentActivity;
import static org.wordpress.android.support.WPSupportUtils.scrollToAndClickOnTextInRecyclerView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wordpress.android.e2e.pages;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.wordpress.android.support.WPSupportUtils.clickOn;

public class SitePickerPage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wordpress.android.support;

import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import androidx.test.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;

import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.wordpress.android.support

import android.os.ParcelFileDescriptor
import android.os.ParcelFileDescriptor.AutoCloseInputStream
import android.support.test.InstrumentationRegistry
import androidx.test.InstrumentationRegistry
import java.io.BufferedReader
import java.io.InputStreamReader

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wordpress.android.support;

import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import android.view.View;
import android.widget.EditText;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.test.InstrumentationRegistry;
import androidx.test.InstrumentationRegistry;
import android.util.Size;
import android.widget.ImageView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.wordpress.android.support;

import android.support.v4.widget.SwipeRefreshLayout;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.view.View;

import org.hamcrest.Description;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.wordpress.android.support;

import android.support.test.espresso.IdlingResource;
import androidx.test.espresso.IdlingResource;
import static junit.framework.Assert.fail;

public abstract class WPIdler implements IdlingResource {
Expand Down
Loading

0 comments on commit b7ac12d

Please sign in to comment.