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

Updated Picasso v2.71828, removed NineOldAndroids; Gradle v4.1, sdk26, Travis build working! #400

Open
wants to merge 8 commits 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
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ android:
# - tools

# The BuildTools version used by your project
- build-tools-22.0.1
- build-tools-26.0.2

# The SDK version used to compile your project
- android-22
- android-26

# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-19
- extra-android-support

# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-19
- sys-img-x86-android-17
- sys-img-x86-android-26
- sys-img-armeabi-v7a-android-17

# Licenses
# - 'android-sdk-license-.+'
# - 'google-gdk-license-.+'

script: ./gradlew assembleDebug
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Version compatibility
// https://developer.android.com/studio/releases/gradle-plugin#3-0-0

task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
gradleVersion = '4.1'
}

buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.2'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
}
22 changes: 11 additions & 11 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'android-sdk-manager'
//apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'


android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
minSdkVersion 8
targetSdkVersion 22
minSdkVersion 19
targetSdkVersion 28
versionCode 2
versionName "1.0.1"
versionName "1.1.0"
}
buildTypes {
release {
Expand All @@ -20,9 +20,9 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.androidanimations:library:1.0.3@aar'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':library')
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.androidanimations:library:1.0.3@aar'
}
8 changes: 4 additions & 4 deletions demo/src/main/java/com/daimajia/slider/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
Expand All @@ -24,15 +24,15 @@
import java.util.HashMap;


public class MainActivity extends ActionBarActivity implements BaseSliderView.OnSliderClickListener, ViewPagerEx.OnPageChangeListener{
public class MainActivity extends AppCompatActivity implements BaseSliderView.OnSliderClickListener, ViewPagerEx.OnPageChangeListener{

private SliderLayout mDemoSlider;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mDemoSlider = (SliderLayout)findViewById(R.id.slider);
mDemoSlider = findViewById(R.id.slider);

HashMap<String,String> url_maps = new HashMap<String, String>();
url_maps.put("Hannibal", "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
Expand Down Expand Up @@ -67,7 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
mDemoSlider.addOnPageChangeListener(this);
ListView l = (ListView)findViewById(R.id.transformers);
ListView l = findViewById(R.id.transformers);
l.setAdapter(new TransformerAdapter(this));
l.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
Expand Down
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 @@
#Sun May 03 23:34:25 CST 2015
#Wed Jun 20 19:50:50 EAT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
21 changes: 11 additions & 10 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
minSdkVersion 8
targetSdkVersion 22
minSdkVersion 19
targetSdkVersion 26
versionCode 15
versionName "1.1.5"
versionName "1.2.1"
}
buildTypes {
release {
Expand All @@ -21,10 +21,11 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile "com.android.support:support-v4:22.1.1"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation "com.android.support:support-v4:26.0.1"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:exifinterface:26.0.1'
implementation 'com.android.support:animated-vector-drawable:26.0.1'
}
apply from: './gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.daimajia.slider.library.Animations;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.view.View;

import com.daimajia.slider.library.R;
import com.nineoldandroids.animation.ObjectAnimator;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.ViewHelper;

/**
* A demo class to show how to use {@link com.daimajia.slider.library.Animations.BaseAnimationInterface}
Expand Down Expand Up @@ -49,7 +48,7 @@ public void onNextItemAppear(View view) {

View descriptionLayout = view.findViewById(R.id.description_layout);
if(descriptionLayout!=null){
float layoutY = ViewHelper.getY(descriptionLayout);
float layoutY = descriptionLayout.getY();
view.findViewById(R.id.description_layout).setVisibility(View.VISIBLE);
ValueAnimator animator = ObjectAnimator.ofFloat(
descriptionLayout,"y",layoutY + descriptionLayout.getHeight(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

Expand All @@ -24,6 +25,7 @@ public abstract class BaseSliderView {
protected Context mContext;

private Bundle mBundle;
private String TAG = "BaseSliderView.java";

/**
* Error place holder image.
Expand Down Expand Up @@ -207,7 +209,8 @@ public void onClick(View v) {
mLoadListener.onStart(me);
}

Picasso p = (mPicasso != null) ? mPicasso : Picasso.with(mContext);
//Picasso p = (mPicasso != null) ? mPicasso : Picasso.with(mContext);
Picasso p = (mPicasso != null) ? mPicasso : Picasso.get();
RequestCreator rq = null;
if(mUrl!=null){
rq = p.load(mUrl);
Expand Down Expand Up @@ -252,14 +255,29 @@ public void onSuccess() {
}

@Override
public void onError() {
public void onError(Exception e) {

Log.e(TAG,"Picasso error: "+e);

if(mLoadListener != null){
mLoadListener.onEnd(false,me);
}
if(v.findViewById(R.id.loading_bar) != null){
v.findViewById(R.id.loading_bar).setVisibility(View.INVISIBLE);
}

}

/*
@Override
public void onError() {
if(mLoadListener != null){
mLoadListener.onEnd(false,me);
}
if(v.findViewById(R.id.loading_bar) != null){
v.findViewById(R.id.loading_bar).setVisibility(View.INVISIBLE);
}
} */
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
*/
import android.view.View;

import com.nineoldandroids.view.ViewHelper;

public class AccordionTransformer extends BaseTransformer {

@Override
protected void onTransform(View view, float position) {
ViewHelper.setPivotX(view,position < 0 ? 0 : view.getWidth());
ViewHelper.setScaleX(view,position < 0 ? 1f + position : 1f - position);
view.setPivotX(position < 0 ? 0 : view.getWidth());
view.setScaleX(position < 0 ? 1f + position : 1f - position);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import android.view.View;

import com.nineoldandroids.view.ViewHelper;

public class BackgroundToForegroundTransformer extends BaseTransformer {

@Override
Expand All @@ -12,11 +10,11 @@ protected void onTransform(View view, float position) {
final float width = view.getWidth();
final float scale = min(position < 0 ? 1f : Math.abs(1f - position), 0.5f);

ViewHelper.setScaleX(view,scale);
ViewHelper.setScaleY(view,scale);
ViewHelper.setPivotX(view,width*0.5f);
ViewHelper.setPivotY(view,height*0.5f);
ViewHelper.setTranslationX(view,position < 0 ? width * position : -width * position * 0.25f);
view.setScaleX(scale);
view.setScaleY(scale);
view.setPivotX(width*0.5f);
view.setPivotY(height*0.5f);
view.setTranslationX(position < 0 ? width * position : -width * position * 0.25f);
}

private static final float min(float val, float min) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.daimajia.slider.library.Animations.BaseAnimationInterface;
import com.daimajia.slider.library.Tricks.ViewPagerEx;
import com.nineoldandroids.view.ViewHelper;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -72,26 +71,26 @@ protected boolean isPagingEnabled() {
protected void onPreTransform(View view, float position) {
final float width = view.getWidth();

ViewHelper.setRotationX(view,0);
ViewHelper.setRotationY(view,0);
ViewHelper.setRotation(view,0);
ViewHelper.setScaleX(view,1);
ViewHelper.setScaleY(view,1);
ViewHelper.setPivotX(view,0);
ViewHelper.setPivotY(view,0);
ViewHelper.setTranslationY(view,0);
ViewHelper.setTranslationX(view,isPagingEnabled() ? 0f : -width * position);
view.setRotationX(0);
view.setRotationY(0);
view.setRotation(0);
view.setScaleX(1);
view.setScaleY(1);
view.setPivotX(0);
view.setPivotY(0);
view.setTranslationY(0);
view.setTranslationX(isPagingEnabled() ? 0f : -width * position);

if (hideOffscreenPages()) {
ViewHelper.setAlpha(view,position <= -1f || position >= 1f ? 0f : 1f);
view.setAlpha(position <= -1f || position >= 1f ? 0f : 1f);
} else {
ViewHelper.setAlpha(view,1f);
view.setAlpha(1f);
}
if(mCustomAnimationInterface != null){
if(h.containsKey(view) == false || h.get(view).size() == 1){
if(position > -1 && position < 1){
if(h.get(view) == null){
h.put(view,new ArrayList<Float>());
h.put(view, new ArrayList<Float>());
}
h.get(view).add(position);
if(h.get(view).size() == 2){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import android.view.View;

import com.nineoldandroids.view.ViewHelper;

public class CubeInTransformer extends BaseTransformer {

@Override
protected void onTransform(View view, float position) {
// Rotate the fragment on the left or right edge
ViewHelper.setPivotX(view,position > 0 ? 0 : view.getWidth());
ViewHelper.setPivotY(view,0);
ViewHelper.setRotation(view,-90f * position);
view.setPivotX(position > 0 ? 0 : view.getWidth());
view.setPivotY(0);
view.setRotation(-90f * position);
}

@Override
Expand Down
Loading