summaryrefslogtreecommitdiff
path: root/platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-03-30 17:49:04 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-03-31 13:00:41 +0200
commitd68576c3785572c1f5d41f83015b8fe6bbcbe9e8 (patch)
tree431a86edfac640864ba7f406611e8fe9929908cd /platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java
parent32cdb2246eeb9e8109a712ec2a5dd2938e30e9b6 (diff)
downloadmupdf-d68576c3785572c1f5d41f83015b8fe6bbcbe9e8.tar.xz
Reorganize java and android source.
platform/java and platform/android are reorganized: platform/java The new JNI Java classes, mupdf_native.{c,h}, Makefile and Makejar. platform/java/example The example desktop viewer classes. platform/android/viewer The original demo viewer. ndk-build is used to build libmupdf_java.so, making reference to mupdf_native.{c,h} in platform/java.
Diffstat (limited to 'platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java')
-rw-r--r--platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java b/platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java
new file mode 100644
index 00000000..7f715bb4
--- /dev/null
+++ b/platform/android/viewer/src/com/artifex/mupdfdemo/SafeAnimatorInflater.java
@@ -0,0 +1,35 @@
+package com.artifex.mupdfdemo;
+
+import android.animation.Animator;
+import android.animation.AnimatorInflater;
+import android.animation.AnimatorSet;
+import android.app.Activity;
+import android.view.View;
+
+public class SafeAnimatorInflater
+{
+ private View mView;
+
+ public SafeAnimatorInflater(Activity activity, int animation, View view)
+ {
+ AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(activity, R.animator.info);
+ mView = view;
+ set.setTarget(view);
+ set.addListener(new Animator.AnimatorListener() {
+ public void onAnimationStart(Animator animation) {
+ mView.setVisibility(View.VISIBLE);
+ }
+
+ public void onAnimationRepeat(Animator animation) {
+ }
+
+ public void onAnimationEnd(Animator animation) {
+ mView.setVisibility(View.INVISIBLE);
+ }
+
+ public void onAnimationCancel(Animator animation) {
+ }
+ });
+ set.start();
+ }
+}