mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Forum improvements
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
package org.briarproject.android.util;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import org.briarproject.android.controller.handler.ResultHandler;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.MeasureSpec.UNSPECIFIED;
|
||||
import static android.view.View.VISIBLE;
|
||||
@@ -26,49 +21,6 @@ public class CustomAnimations {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public static void animateColorTransition(final View view, int color,
|
||||
int duration, final ResultHandler<Void> finishedCallback) {
|
||||
// No soup for Gingerbread
|
||||
if (Build.VERSION.SDK_INT < 11) {
|
||||
return;
|
||||
}
|
||||
ValueAnimator anim = new ValueAnimator();
|
||||
ColorDrawable viewColor = (ColorDrawable) view.getBackground();
|
||||
anim.setIntValues(viewColor.getColor(), color);
|
||||
anim.setEvaluator(new ArgbEvaluator());
|
||||
anim.addListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
if (finishedCallback != null) finishedCallback.onResult(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
}
|
||||
});
|
||||
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||
view.setBackgroundColor((Integer)valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
anim.setDuration(duration);
|
||||
|
||||
anim.start();
|
||||
}
|
||||
|
||||
private static void animateHeightGingerbread(ViewGroup viewGroup,
|
||||
boolean isExtending) {
|
||||
// No animations for Gingerbread
|
||||
|
||||
Reference in New Issue
Block a user