Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Kwiecień committed Nov 26, 2015
1 parent 14c676f commit 4b11a13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
}
}
Expand All @@ -20,5 +20,5 @@ ext {
buildToolsVersion = "23.0.1"
minSdkVersion = 14
versionCode = 16
versionName = "2.0.3"
versionName = "git --git-dir=${rootDir}/.git --work-tree=${rootDir} describe --tags --abbrev=0".execute().text.trim()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.util.Log;
import android.view.View;

Expand All @@ -11,11 +12,20 @@
public class Animations {

public static CrossfadeListeners crossfadeViews(final View viewToHide, final View viewToShow) {
return crossfadeViews(viewToHide, viewToShow);
Context context;
if (viewToHide != null) {
context = viewToHide.getContext();
} else if (viewToShow != null) {
context = viewToShow.getContext();
} else {
return null;
}
int animDuration = context.getResources().getInteger(android.R.integer.config_shortAnimTime);
return crossfadeViews(viewToHide, viewToShow, animDuration);
}

public static CrossfadeListeners crossfadeViews(final View viewToHide, final View viewToShow, int animDuration) {
if (viewToShow == null) return null;
if (viewToShow == null || viewToHide == null) return null;
FadeInListener fadeInListener = fadeIn(viewToShow, animDuration);
FadeOutListener fadeOutListener = fadeOut(viewToHide, animDuration);
return new CrossfadeListeners(fadeOutListener, fadeInListener);
Expand Down

0 comments on commit 4b11a13

Please sign in to comment.