Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

迁移到androidx。 #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ buildscript {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "http://oss.jfrog.org/oss-snapshot-local/" }
mavenCentral()
jcenter()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.github.xfumihiro.view-inspector:view-inspector-plugin:0.1.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0'
Expand All @@ -44,7 +45,8 @@ allprojects {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "http://oss.jfrog.org/oss-snapshot-local/" }
jcenter()
mavenLocal()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
}
}
6 changes: 3 additions & 3 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
compile project(':vlayout')
compile 'com.crittercism.dexmaker:dexmaker:1.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-annotations:21.0.0'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'androidx.appcompat:appcompat:1.0.0'
compile 'androidx.annotation:annotation:1.0.0'
compile 'androidx.cardview:cardview:1.0.0'
}
6 changes: 3 additions & 3 deletions examples/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
#}

-keepattributes InnerClasses
-keep class android.support.v7.widget.RecyclerView$LayoutParams {
-keep class androidx.recyclerview.widget.RecyclerView$LayoutParams {
*;
}

-keep class android.support.v7.widget.RecyclerView$ViewHolder {
-keep class androidx.recyclerview.widget.RecyclerView$ViewHolder {
*;
}

-keep class android.support.v7.widget.ChildHelper {
*;
}

-keep class android.support.v7.widget.RecyclerView$LayoutManager {
-keep class androidx.recyclerview.widget.RecyclerView$LayoutManager {
*;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.viewpager.widget.ViewPager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import android.app.Activity;
import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,20 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener;
import androidx.viewpager.widget.ViewPager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.EditText;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

Expand Down
6 changes: 3 additions & 3 deletions examples/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v4.widget.SwipeRefreshLayout
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -42,7 +42,7 @@
android:paddingRight="0dp"
android:requiresFadingEdge="none"
android:scrollbars="vertical"/>
</android.support.v4.widget.SwipeRefreshLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>


<LinearLayout
Expand Down
4 changes: 2 additions & 2 deletions examples/src/main/res/layout/view_pager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
~ SOFTWARE.
-->

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="280dp">


</android.support.v4.view.ViewPager>
</androidx.viewpager.widget.ViewPager>
10 changes: 7 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ VERSION=1
VERSION_NAME=1.2.22
PACKAGING_TYPE=aar
useNewSupportLibrary=true
systemProp.compileSdkVersion=25
systemProp.targetSdkVersion=25
systemProp.buildToolsVersion=25.0.3
systemProp.compileSdkVersion=28
systemProp.targetSdkVersion=28
systemProp.buildToolsVersion=28.0.3


android.useAndroidX=true
android.enableJetifier=true
28 changes: 2 additions & 26 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
#
# MIT License
#
# Copyright (c) 2016 Alibaba Group
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

#Tue Nov 29 17:56:32 CST 2016
#Thu Mar 14 21:37:11 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
33 changes: 20 additions & 13 deletions vlayout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,27 @@ buildscript {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "http://oss.jfrog.org/oss-snapshot-local/" }
mavenCentral()
jcenter()
// mavenCentral()
// jcenter()
// google()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.3.1'
}
}

repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "http://oss.jfrog.org/oss-snapshot-local/" }
jcenter()
mavenLocal()
// jcenter()
// mavenLocal()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
}


Expand Down Expand Up @@ -105,17 +112,17 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile project(':extension')
if (project.hasProperty('useNewSupportLibrary')) {
compile 'com.android.support:recyclerview-v7:25.2.0@aar'
compile('com.android.support:support-v4:25.2.0@aar')
compile 'com.android.support:support-annotations:25.2.0'
compile 'com.android.support:support-compat:25.2.0'
compile 'com.android.support:support-core-ui:25.2.0'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:support-v4:27.1.1'
compile 'com.android.support:support-annotations:27.1.1'
compile 'com.android.support:support-compat:27.1.1'
compile 'com.android.support:support-core-ui:27.1.1'
} else {
compile 'com.android.support:recyclerview-v7:23.1.1@aar'
compile('com.android.support:support-v4:23.1.1@aar') {
compile 'com.android.support:recyclerview-v7:27.1.1'
compile('com.android.support:support-v4:27.1.1') {
exclude group: 'com.android.support', module: 'support-annotations'
}
compile 'com.android.support:support-annotations:23.1.1'
compile 'com.android.support:support-annotations:27.1.1'
}

androidTestCompile "org.robolectric:robolectric:3.0"
Expand Down
8 changes: 4 additions & 4 deletions vlayout/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
#}

-keepattributes InnerClasses
-keep class android.support.v7.widget.RecyclerView$LayoutParams {
-keep class androidx.recyclerview.widget.RecyclerView$LayoutParams {
*;
}

-keep class android.support.v7.widget.RecyclerView$ViewHolder {
-keep class androidx.recyclerview.widget.RecyclerView$ViewHolder {
*;
}

-keep class android.support.v7.widget.ChildHelper {
*;
}

-keep class android.support.v7.widget.RecyclerView$LayoutManager {
-keep class androidx.recyclerview.widget.RecyclerView$LayoutManager {
*;
}

-keep class android.support.v7.widget.LinearLayoutManager {
-keep class androidx.recyclerview.widget.LinearLayoutManager {
void ensureLayoutState();
void resolveShouldLayoutReverse();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

package com.alibaba.android.vlayout;

import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import android.content.Context;
import android.graphics.Rect;
import android.os.Looper;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

package com.alibaba.android.vlayout;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Pair;
import android.util.SparseArray;
import android.view.View;
Expand All @@ -41,7 +42,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import static android.support.v7.widget.RecyclerView.NO_ID;
import static androidx.recyclerview.widget.RecyclerView.NO_ID;

/**
* Adapter delegates its responsibility to sub adapters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import android.graphics.PointF;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.RecyclerView;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.OrientationHelper;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.View;

Expand All @@ -41,7 +41,6 @@
import java.lang.reflect.Method;
import java.util.List;

import com.alibaba.android.vlayout.VirtualLayoutManager.LayoutParams;

/**
* This class is used to expose layoutChunk method, should not be used in anywhere else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

import android.graphics.Rect;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;

import com.alibaba.android.vlayout.layout.LayoutChunkResult;
Expand Down
Loading