Skip to content

Commit

Permalink
Migrate to Android X (#55)
Browse files Browse the repository at this point in the history
* Migrate to android x

* Update travis configuration
  • Loading branch information
pedrovgs authored May 20, 2020
1 parent 27fb79d commit 71ea754
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 48 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ language: android
android:
components:
- tools
- build-tools-29.0.2
- build-tools-28.0.3
- android-28
- android-29
- extra-android-support
- extra-google-m2repository
- extra-android-m2repository
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Add this dependency to your ``build.gradle``:

```groovy
dependencies{
compile 'com.github.pedrovgs:renderers:3.4.0'
implementation 'com.github.pedrovgs:renderers:4.0.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.github.pedrovgs:kuronometer:0.1.1'
}
}
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ POM_NAME=Renderers
POM_ARTIFACT_ID=renderers
POM_PACKAGING=aar

VERSION_NAME=3.5.1-SNAPSHOT
VERSION_CODE=030501
VERSION_NAME=4.0.0
VERSION_CODE=040000
GROUP=com.github.pedrovgs

POM_DESCRIPTION=Android library to avoid duplicated adapters code
Expand All @@ -16,3 +16,6 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=pedrovgs
POM_DEVELOPER_NAME=Pedro Vicente Gómez Sánchez

android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 08 16:06:53 CEST 2019
#Wed May 20 13:56:23 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
20 changes: 10 additions & 10 deletions renderers/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
apply plugin: 'com.android.library'
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

apply plugin: 'com.github.pedrovgs.kuronometer'

kuronometer {
platformName = 'Android'
//This value can be true or false.
//It's used to remove the project sensitive information before to being reported. By default is true.
reportProjectInfo = true
reportProjectInfo = false
//This value can be true or false.
//It's used to send or not the build report to the kuronometer server. By default is true.
reportDataRemotely = true
reportDataRemotely = false
//This value can be true or false.
//It's used to show a message after the build execution showing the report execution result. By default is false.
verbose = true
verbose = false
}
android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 10
targetSdkVersion 28
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -35,9 +35,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:2.26.0"
testImplementation 'org.mockito:mockito-core:2.26.0'
testImplementation 'org.robolectric:robolectric:4.2'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.pedrogomez.renderers;

import android.support.annotation.NonNull;
import android.support.v7.util.DiffUtil;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;

public class DefaultDiffUtilItemCallback<T> extends DiffUtil.ItemCallback<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.pedrogomez.renderers;

import android.support.v7.util.DiffUtil;
import androidx.recyclerview.widget.DiffUtil;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.pedrogomez.renderers;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.recyclerview.extensions.AsyncDifferConfig;
import android.support.v7.recyclerview.extensions.ListAdapter;
import android.support.v7.util.DiffUtil;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.AsyncDifferConfig;
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.DiffUtil;
import android.view.LayoutInflater;
import android.view.ViewGroup;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.pedrogomez.renderers;

import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ protected void setContent(T content) {
*
* @param rootView inflated using previously.
*/
protected abstract void setUpView(View rootView);
protected void setUpView(View rootView) { }

/**
* Set all the listeners to members mapped in setUpView method.
*
* @param rootView inflated using previously.
*/
protected abstract void hookListeners(View rootView);
protected void hookListeners(View rootView) { }

/**
* Inflate renderer layout. The view inflated can't be null. If this method returns a null view a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.pedrogomez.renderers;

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

/**
* RecyclerView.ViewHolder extension created to be able to use Renderer classes in RecyclerView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.pedrogomez.renderers;

import android.support.v4.view.PagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.pedrogomez.renderers;

import android.support.v7.util.DiffUtil;
import androidx.recyclerview.widget.DiffUtil;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.pedrogomez.renderers.exception.NullRendererBuiltException;
Expand Down
16 changes: 10 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
applicationId "com.github.pedrovgs.renderers.sample"
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -18,14 +18,18 @@ android {
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation project(':renderers')
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
package com.pedrogomez.renderers.sample.ui;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.pedrogomez.renderers.AdapteeCollection;
import com.pedrogomez.renderers.RVRendererAdapter;
Expand All @@ -41,7 +42,8 @@ public class RecyclerViewAdapterActivity extends BaseActivity {

private static final int VIDEO_COUNT = 100;

@BindView(R.id.rv_renderers) RecyclerView recyclerView;
@BindView(R.id.rv_renderers)
RecyclerView recyclerView;

private RVRendererAdapter<Video> adapter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.pedrogomez.renderers.sample.ui;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.pedrogomez.renderers.AdapteeCollection;
import com.pedrogomez.renderers.RVListRendererAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
package com.pedrogomez.renderers.sample.ui;

import android.os.Bundle;
import android.support.v4.view.ViewPager;

import androidx.viewpager.widget.ViewPager;

import com.pedrogomez.renderers.AdapteeCollection;
import com.pedrogomez.renderers.VPRendererAdapter;
Expand All @@ -38,7 +39,8 @@ public class ViewPagerActivity extends BaseActivity {

private VPRendererAdapter<Video> adapter;

@BindView(R.id.vp_renderers) ViewPager viewPager;
@BindView(R.id.vp_renderers)
ViewPager viewPager;

@Override protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_view_pager);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.pedrogomez.renderers.sample.ui.diffing;

import android.support.annotation.NonNull;
import android.support.v7.util.DiffUtil;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;

import com.pedrogomez.renderers.sample.model.Video;

public class VideoItemDiffCallback extends DiffUtil.ItemCallback<Video> {
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/activity_recycler_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rv_renderers"
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/activity_view_pager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vp_renderers"
android:layout_height="match_parent"
Expand Down

0 comments on commit 71ea754

Please sign in to comment.