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 to latest AndroidX libraries #184

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
20 changes: 9 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apply plugin: 'com.android.application'
apply from: "$rootDir/versions.gradle"

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "agency.tango.materialintro"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -22,11 +22,9 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:${project.androidSupport}"
testCompile 'junit:junit:4.12'
compile project(path: ':material-intro-screen')
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.13'
implementation project(path: ':material-intro-screen')
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package agency.tango.materialintro;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;

import androidx.annotation.Nullable;

import agency.tango.materialintroscreen.SlideFragment;

public class CustomSlide extends SlideFragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import android.Manifest;
import android.os.Bundle;
import android.support.annotation.FloatRange;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.FloatRange;
import androidx.annotation.Nullable;

import agency.tango.materialintroscreen.MaterialIntroActivity;
import agency.tango.materialintroscreen.MessageButtonBehaviour;
import agency.tango.materialintroscreen.SlideFragmentBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

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

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;


public class MainActivity extends AppCompatActivity {
AppCompatButton button;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package agency.tango.materialintro;

import android.content.Intent;
import android.support.v4.app.TaskStackBuilder;
import android.support.v7.app.AppCompatActivity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.TaskStackBuilder;


public class SplashActivity extends AppCompatActivity {
@Override
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:background="@color/colorPrimary">

<android.support.v7.widget.AppCompatButton
<Button
android:id="@+id/btn_launch_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.novoda:bintray-release:0.3.4'
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.novoda:bintray-release:0.9.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=tango
POM_DEVELOPER_NAME=Tango Agency
POM_DEVELOPER_NAME=Tango Agency
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 Dec 28 10:00:20 PST 2015
#Wed Apr 22 02:32:29 EET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
20 changes: 9 additions & 11 deletions material-intro-screen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ apply plugin: 'com.novoda.bintray-release'

apply from: "$rootDir/versions.gradle"
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
Expand All @@ -30,7 +30,7 @@ android {
source = variant.javaCompile.source

ext.androidJar = "${project.android.sdkDirectory}/platforms/${project.android.compileSdkVersion}/android.jar"
classpath = project.files(variant.javaCompile.classpath.files) + project.files(ext.androidJar)
doFirst { classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar) }

options.memberLevel = JavadocMemberLevel.PROTECTED
options.links("http://docs.oracle.com/javase/7/docs/api/")
Expand All @@ -47,12 +47,10 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:${project.androidSupport}"
compile "com.android.support:design:${project.androidSupport}"
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha06'
}

publish {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import android.content.res.ColorStateList;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AppCompatActivity;

import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.View;
Expand All @@ -21,6 +21,8 @@
import android.widget.ImageButton;
import android.widget.LinearLayout;

import com.google.android.material.snackbar.Snackbar;

import agency.tango.materialintroscreen.adapter.SlidesAdapter;
import agency.tango.materialintroscreen.animations.ViewTranslationWrapper;
import agency.tango.materialintroscreen.animations.wrappers.BackButtonTranslationWrapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package agency.tango.materialintroscreen;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;

import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;

import androidx.coordinatorlayout.widget.CoordinatorLayout;

import com.google.android.material.snackbar.Snackbar;

@SuppressWarnings("unused")
public class MoveUpBehaviour extends CoordinatorLayout.Behavior<LinearLayout> {
public MoveUpBehaviour(Context context, AttributeSet attrs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;

import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
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,7 +1,8 @@
package agency.tango.materialintroscreen;

import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;

@SuppressWarnings({"unused", "WeakerAccess"})
public class SlideFragmentBuilder {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package agency.tango.materialintroscreen.adapter;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

import agency.tango.materialintroscreen.SlideFragment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

public interface IViewTranslation {
void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package agency.tango.materialintroscreen.animations;

import android.support.annotation.AnimRes;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

import androidx.annotation.AnimRes;

import agency.tango.materialintroscreen.animations.translations.NoTranslation;

@SuppressWarnings("WeakerAccess")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations.translations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

import agency.tango.materialintroscreen.animations.IViewTranslation;

public class AlphaTranslation implements IViewTranslation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations.translations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

import agency.tango.materialintroscreen.animations.IViewTranslation;

public class DefaultAlphaTranslation implements IViewTranslation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations.translations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

import agency.tango.materialintroscreen.animations.IViewTranslation;

public class DefaultPositionTranslation implements IViewTranslation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations.translations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

import agency.tango.materialintroscreen.R;
import agency.tango.materialintroscreen.animations.IViewTranslation;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations.translations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

import agency.tango.materialintroscreen.R;
import agency.tango.materialintroscreen.animations.IViewTranslation;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package agency.tango.materialintroscreen.animations.translations;

import android.support.annotation.FloatRange;
import android.view.View;

import androidx.annotation.FloatRange;

import agency.tango.materialintroscreen.animations.IViewTranslation;

public class NoTranslation implements IViewTranslation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package agency.tango.materialintroscreen.listeners;


import android.support.v4.view.CustomViewPager;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package agency.tango.materialintroscreen.listeners.scrollListeners;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import agency.tango.materialintroscreen.SlideFragment;
import agency.tango.materialintroscreen.adapter.SlidesAdapter;
Expand Down
Loading