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

AndroidX migration #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
the project was migrated to androidx
  • Loading branch information
gfanjul committed Mar 3, 2020
commit 30f1a462b219381a501da292ea5a2b3ba28bac80
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http:https://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

#androidx
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-5.5.1-all.zip
10 changes: 5 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
android {
compileSdkVersion 26
compileSdkVersion 28
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
minSdkVersion 23
targetSdkVersion 28
versionCode 10
versionName "1.1.2"
}
Expand All @@ -19,8 +19,8 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'io.supercharge:shimmerlayout:2.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
}

publish {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.ethanhua.skeleton;

import android.support.annotation.ArrayRes;
import android.support.annotation.ColorRes;
import android.support.annotation.IntRange;
import android.support.annotation.LayoutRes;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.ArrayRes;
import androidx.annotation.ColorRes;
import androidx.annotation.IntRange;
import androidx.annotation.LayoutRes;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;

/**
* Created by ethanhua on 2017/7/29.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.ethanhua.skeleton;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.recyclerview.widget.RecyclerView;

/**
* Created by ethanhua on 2017/7/29.
*/
Expand Down
3 changes: 2 additions & 1 deletion library/src/main/java/com/ethanhua/skeleton/Skeleton.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.ethanhua.skeleton;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

/**
* Created by ethanhua on 2017/7/29.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.ethanhua.skeleton;

import android.support.annotation.IntRange;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.IntRange;
import androidx.recyclerview.widget.RecyclerView;

import io.supercharge.shimmerlayout.ShimmerLayout;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.ethanhua.skeleton;

import android.support.annotation.ColorRes;
import android.support.annotation.IntRange;
import android.support.annotation.LayoutRes;
import android.support.v4.content.ContextCompat;
import androidx.annotation.ColorRes;
import androidx.annotation.IntRange;
import androidx.annotation.LayoutRes;
import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
16 changes: 8 additions & 8 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
compileSdkVersion 28
defaultConfig {
applicationId "com.ethanhua.skeleton.sample"
minSdkVersion 15
targetSdkVersion 26
minSdkVersion 23
targetSdkVersion 28
versionCode 6
versionName "1.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -20,14 +20,14 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//implementation project(':library')
implementation 'com.ethanhua:skeleton:1.1.2'
implementation 'io.supercharge:shimmerlayout:2.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.ethanhua.skeleton.Skeleton;
import com.ethanhua.skeleton.SkeletonScreen;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.ethanhua.skeleton.sample;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.ethanhua.skeleton.ViewReplacer;

public class StatusViewActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.ethanhua.skeleton.Skeleton;
import com.ethanhua.skeleton.SkeletonScreen;
import com.ethanhua.skeleton.sample.adapter.TopicAdapter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.ethanhua.skeleton.sample.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.recyclerview.widget.RecyclerView;

import com.ethanhua.skeleton.sample.R;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.ethanhua.skeleton.sample.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.recyclerview.widget.RecyclerView;

import com.ethanhua.skeleton.sample.R;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.ethanhua.skeleton.sample.adapter;

import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;


public class SimpleRcvViewHolder extends RecyclerView.ViewHolder {
private final SparseArray<View> views = new SparseArray<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.ethanhua.skeleton.sample.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.recyclerview.widget.RecyclerView;

import com.ethanhua.skeleton.sample.R;

/**
Expand Down
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_status_view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
<androidx.constraintlayout.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
xmlns:tools="http:https://schemas.android.com/tools"
android:layout_width="match_parent"
Expand Down Expand Up @@ -61,4 +61,4 @@
android:layout_gravity="center"
android:layout_height="wrap_content" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>
8 changes: 4 additions & 4 deletions sample/src/main/res/layout/activity_view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http:https://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
xmlns:tools="http:https://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -21,7 +21,7 @@
android:scaleType="centerCrop"
android:src="@drawable/girl" />

<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
Expand Down Expand Up @@ -77,7 +77,7 @@
app:layout_constraintLeft_toRightOf="@+id/tv_service"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>

<View
android:id="@+id/divider_1"
Expand All @@ -99,4 +99,4 @@


</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_view_skeleton.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
<androidx.constraintlayout.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
xmlns:tools="http:https://schemas.android.com/tools"
android:layout_width="match_parent"
Expand Down Expand Up @@ -272,4 +272,4 @@
android:layout_marginLeft="10dp"
android:layout_height="0.5dp"
android:id="@+id/divider2" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/item_news.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
<androidx.constraintlayout.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="130dp"
Expand Down Expand Up @@ -71,4 +71,4 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintLeft_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/item_skeleton_news.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
<androidx.constraintlayout.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="130dp"
Expand Down Expand Up @@ -67,4 +67,4 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintLeft_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/item_title_more.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
<androidx.constraintlayout.ConstraintLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:paddingLeft="16dp"
Expand All @@ -26,4 +26,4 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/item_topic.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.ConstraintLayout
xmlns:android="http:https://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
xmlns:app="http:https://schemas.android.com/apk/res-auto"
Expand Down Expand Up @@ -68,4 +68,4 @@
android:layout_marginLeft="10dp"
android:layout_height="0.5dp"
android:id="@+id/divider" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.ConstraintLayout>