Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate project to AndroidX libraries #362

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ android {
}

dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'

implementation project(':aws-android-sdk-appsync-runtime')
implementation project(':aws-android-sdk-appsync-api')
Expand All @@ -40,8 +41,8 @@ dependencies {
implementation "com.amazonaws:aws-android-sdk-core:$aws_version"
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"

def lifecycle_version = "1.1.1"
implementation("android.arch.lifecycle:runtime:$lifecycle_version")
implementation("android.arch.lifecycle:extensions:$lifecycle_version")
def lifecycle_version = "2.0.0"
implementation("androidx.lifecycle:lifecycle-runtime:$lifecycle_version")
implementation("androidx.lifecycle:lifecycle-extensions:$lifecycle_version")
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -12,16 +12,10 @@

import com.amazonaws.amplify.generated.graphql.CreatePostMutation;
import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
import com.amazonaws.mobileconnectors.appsync.fetcher.AppSyncResponseFetchers;
import com.apollographql.apollo.GraphQLCall;
import com.apollographql.apollo.api.Response;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.exception.ApolloException;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import javax.annotation.Nonnull;

import type.CreatePostInput;
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/com/amazonaws/postsapp/PostsActivity.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.amazonaws.postsapp;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;

import android.view.View;
import android.arch.lifecycle.ProcessLifecycleOwner;
import androidx.lifecycle.ProcessLifecycleOwner;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;


import com.amazonaws.mobileconnectors.appsync.AWSAppSyncAppLifecycleObserver;
import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
import com.google.android.material.floatingactionbutton.FloatingActionButton;

public class PostsActivity extends AppCompatActivity {
private static final String TAG = PostsActivity.class.getSimpleName();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package com.amazonaws.postsapp;

import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import androidx.recyclerview.widget.RecyclerView;

import com.amazonaws.amplify.generated.graphql.DeletePostMutation;
import com.amazonaws.amplify.generated.graphql.ListPostsDeltaQuery;
import com.amazonaws.amplify.generated.graphql.ListPostsQuery;

import com.amazonaws.amplify.generated.graphql.OnDeltaPostSubscription;
import com.amazonaws.amplify.generated.graphql.UpdatePostMutation;
import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;

import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.Toast;


import com.amazonaws.amplify.generated.graphql.ListPostsQuery;
import com.apollographql.apollo.GraphQLCall;
import com.apollographql.apollo.api.Response;
import com.apollographql.apollo.exception.ApolloException;

import javax.annotation.Nonnull;

public class UpdatePostActivity extends AppCompatActivity {
private static ListPostsQuery.ListPost sPost;
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/layout/activity_posts.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.v4.widget.SwipeRefreshLayout
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.amazonaws.postsapp.PostsActivity">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"/>

</android.support.v4.widget.SwipeRefreshLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/addPost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right|end"
android:layout_margin="16dp"
android:tint="@android:color/white"
app:srcCompat="@android:drawable/ic_input_add"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
8 changes: 4 additions & 4 deletions aws-android-sdk-appsync-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
Expand All @@ -53,9 +53,9 @@ repositories {
}

dependencies {
androidTestImplementation 'com.android.support:support-compat:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestImplementation 'androidx.core:core:1.0.0'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'junit:junit:4.13'
androidTestImplementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
androidTestImplementation "com.amazonaws:aws-android-sdk-appsync:$VERSION_NAME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.amazonaws.mobileconnectors.appsync.client;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.Log;

import com.amazonaws.mobile.config.AWSConfiguration;
Expand All @@ -28,7 +28,7 @@

import java.util.concurrent.TimeUnit;

import static android.support.test.InstrumentationRegistry.getTargetContext;
import static androidx.test.InstrumentationRegistry.getTargetContext;
import static org.junit.Assert.assertNotNull;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.amazonaws.mobileconnectors.appsync.client;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.amazonaws.mobileconnectors.appsync.util.Consumer;
import com.apollographql.apollo.GraphQLCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

package com.amazonaws.mobileconnectors.appsync.client;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.amazonaws.mobileconnectors.appsync.util.Await;
import com.apollographql.apollo.GraphQLCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

package com.amazonaws.mobileconnectors.appsync.client;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.amazonaws.mobileconnectors.appsync.AppSyncSubscriptionCall;
import com.amazonaws.mobileconnectors.appsync.util.Await;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.amazonaws.mobileconnectors.appsync.client;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.apollographql.apollo.GraphQLCall;
import com.apollographql.apollo.api.Response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

package com.amazonaws.mobileconnectors.appsync.identity;

import android.support.annotation.NonNull;
import static androidx.test.InstrumentationRegistry.getTargetContext;

import androidx.annotation.NonNull;

import android.util.Log;

import com.amazonaws.mobile.client.results.SignInResult;
Expand All @@ -22,8 +25,6 @@
import com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation;
import com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler;

import static android.support.test.InstrumentationRegistry.getTargetContext;

public final class CustomCognitoUserPool {
private static final String TAG = CustomCognitoUserPool.class.getSimpleName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
package com.amazonaws.mobileconnectors.appsync.identity;

import android.content.Context;
import android.support.test.InstrumentationRegistry;

import androidx.test.InstrumentationRegistry;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.amazonaws.mobileconnectors.appsync.identity;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.amazonaws.mobile.client.Callback;
import com.amazonaws.mobileconnectors.appsync.util.Consumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package com.amazonaws.mobileconnectors.appsync.identity;

import android.content.Context;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.amazonaws.mobile.client.AWSMobileClient;
import com.amazonaws.mobile.client.UserStateDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

package com.amazonaws.mobileconnectors.appsync.tests;

import android.support.test.runner.AndroidJUnit4;

import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
import com.amazonaws.mobileconnectors.appsync.client.AWSAppSyncClients;
Expand Down Expand Up @@ -38,6 +37,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import androidx.test.runner.AndroidJUnit4;

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

package com.amazonaws.mobileconnectors.appsync.tests;

import android.support.test.runner.AndroidJUnit4;

import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
import com.amazonaws.mobileconnectors.appsync.client.AWSAppSyncClients;
import com.amazonaws.mobileconnectors.appsync.client.LatchedGraphQLCallback;
Expand All @@ -28,6 +26,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import androidx.test.runner.AndroidJUnit4;

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

package com.amazonaws.mobileconnectors.appsync.tests;

import android.support.test.runner.AndroidJUnit4;
import static androidx.test.InstrumentationRegistry.getTargetContext;

import android.util.Log;

import com.amazonaws.mobile.client.AWSMobileClient;
Expand Down Expand Up @@ -49,7 +50,6 @@
import java.util.List;
import java.util.Map;

import static android.support.test.InstrumentationRegistry.getTargetContext;
import static com.amazonaws.mobileconnectors.appsync.util.InternetConnectivity.goOffline;
import static com.amazonaws.mobileconnectors.appsync.util.InternetConnectivity.goOnline;
import static org.junit.Assert.assertEquals;
Expand All @@ -60,6 +60,8 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import androidx.test.runner.AndroidJUnit4;

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.amazonaws.mobileconnectors.appsync.tests;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.Log;

import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
*/
package com.amazonaws.mobileconnectors.appsync.util;

import static androidx.test.InstrumentationRegistry.getInstrumentation;

import android.content.ContentResolver;
import android.content.Intent;
import android.provider.Settings;

import android.support.test.uiautomator.By;
import android.support.test.uiautomator.BySelector;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.Until;

import static android.support.test.InstrumentationRegistry.getInstrumentation;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.Until;

public final class AirplaneMode {
private static final int TIMEOUT_MS = 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.amazonaws.mobileconnectors.appsync.util;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import java.util.Objects;
import java.util.concurrent.CountDownLatch;
Expand Down
Loading