summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-02-22 12:31:02 +0100
committerTor Andersson <tor.andersson@artifex.com>2012-02-22 12:31:02 +0100
commitb6e9b2f8fe172d7175cea3d14d89f986688639af (patch)
tree40d91a63315df6b7c950ab4b09d4d313b89ec9c1
parent482ae6630a379bccb6c2fcb2fa9c61037fe0727e (diff)
downloadmupdf-b6e9b2f8fe172d7175cea3d14d89f986688639af.tar.xz
Tweak animations and colors.
-rw-r--r--.gitignore1
-rw-r--r--android/res/drawable/busy.xml4
-rw-r--r--android/res/drawable/page_num.xml4
-rw-r--r--android/res/drawable/slider.xml2
-rw-r--r--android/res/layout/buttons.xml40
-rw-r--r--android/res/values/colors.xml5
-rw-r--r--android/src/com/artifex/mupdf/MuPDFActivity.java39
7 files changed, 56 insertions, 39 deletions
diff --git a/.gitignore b/.gitignore
index 21ce486b..e86f8687 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ android/obj
android/bin
android/libs
android/gen
+android/local.properties
diff --git a/android/res/drawable/busy.xml b/android/res/drawable/busy.xml
index f0bc5612..c20d320b 100644
--- a/android/res/drawable/busy.xml
+++ b/android/res/drawable/busy.xml
@@ -6,5 +6,5 @@
android:right="20dp"
android:top="20dp"
android:bottom="20dp" />
- <solid android:color="#FF444444" />
-</shape> \ No newline at end of file
+ <solid android:color="@color/bar" />
+</shape>
diff --git a/android/res/drawable/page_num.xml b/android/res/drawable/page_num.xml
index 8090fb45..627f9b60 100644
--- a/android/res/drawable/page_num.xml
+++ b/android/res/drawable/page_num.xml
@@ -6,5 +6,5 @@
android:right="5dp"
android:top="5dp"
android:bottom="5dp" />
- <solid android:color="#CC444444" />
-</shape> \ No newline at end of file
+ <solid android:color="@color/bar" />
+</shape>
diff --git a/android/res/drawable/slider.xml b/android/res/drawable/slider.xml
index acac1d80..bf4a75da 100644
--- a/android/res/drawable/slider.xml
+++ b/android/res/drawable/slider.xml
@@ -5,5 +5,5 @@
android:right="15dp"
android:top="5dp"
android:bottom="5dp" />
- <solid android:color="#CC444444" />
+ <solid android:color="@color/bar" />
</shape>
diff --git a/android/res/layout/buttons.xml b/android/res/layout/buttons.xml
index b35f7daa..e18ebbb2 100644
--- a/android/res/layout/buttons.xml
+++ b/android/res/layout/buttons.xml
@@ -18,7 +18,7 @@
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
- android:background="#CC444444" >
+ android:background="@color/bar" >
<ImageButton
android:id="@+id/searchButton"
@@ -58,7 +58,7 @@
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
- android:background="#CC444444" >
+ android:background="@color/bar" >
<ImageButton
android:id="@+id/cancel"
@@ -107,25 +107,25 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" >
-
- <SeekBar
- android:id="@+id/pageSlider"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:layout_margin="0dp"
- android:background="@drawable/slider" />
- <TextView
- android:id="@+id/pageNumber"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_above="@+id/pageSlider"
- android:layout_centerHorizontal="true"
- android:layout_marginBottom="10dp"
- android:background="@drawable/page_num"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ <SeekBar
+ android:id="@+id/pageSlider"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_margin="0dp"
+ android:background="@drawable/slider" />
+
+ <TextView
+ android:id="@+id/pageNumber"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/pageSlider"
+ android:layout_centerHorizontal="true"
+ android:layout_marginBottom="10dp"
+ android:background="@drawable/page_num"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</RelativeLayout>
diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml
new file mode 100644
index 00000000..068c0a3f
--- /dev/null
+++ b/android/res/values/colors.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="canvas">#FF404040</color>
+ <color name="bar">#C0303030</color>
+</resources>
diff --git a/android/src/com/artifex/mupdf/MuPDFActivity.java b/android/src/com/artifex/mupdf/MuPDFActivity.java
index f7de9a4f..051c2740 100644
--- a/android/src/com/artifex/mupdf/MuPDFActivity.java
+++ b/android/src/com/artifex/mupdf/MuPDFActivity.java
@@ -7,6 +7,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.RectF;
+import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -238,7 +239,6 @@ public class MuPDFActivity extends Activity
}
};
mDocView.setAdapter(new MuPDFPageAdapter(this, core));
- mDocView.setBackgroundResource(R.drawable.tiled_background);
// Make the buttons overlay, and store all its
// controls in variables
@@ -344,6 +344,8 @@ public class MuPDFActivity extends Activity
RelativeLayout layout = new RelativeLayout(this);
layout.addView(mDocView);
layout.addView(mButtonsView);
+ layout.setBackgroundResource(R.drawable.tiled_background);
+ //layout.setBackgroundResource(R.color.canvas);
setContentView(layout);
}
@@ -416,8 +418,9 @@ public class MuPDFActivity extends Activity
mSearchText.requestFocus();
showKeyboard();
}
+
Animation anim = new TranslateAnimation(0, 0, -mTopBarSwitcher.getHeight(), 0);
- anim.setDuration(500);
+ anim.setDuration(200);
anim.setAnimationListener(new Animation.AnimationListener() {
public void onAnimationStart(Animation animation) {
mTopBarSwitcher.setVisibility(View.VISIBLE);
@@ -426,16 +429,19 @@ public class MuPDFActivity extends Activity
public void onAnimationEnd(Animation animation) {}
});
mTopBarSwitcher.startAnimation(anim);
- anim = new TranslateAnimation(0, 0, mLowerButtons.getHeight(), 0);
- anim.setDuration(500);
+
+ anim = new TranslateAnimation(0, 0, mPageSlider.getHeight(), 0);
+ anim.setDuration(200);
anim.setAnimationListener(new Animation.AnimationListener() {
public void onAnimationStart(Animation animation) {
- mLowerButtons.setVisibility(View.VISIBLE);
+ mPageSlider.setVisibility(View.VISIBLE);
}
public void onAnimationRepeat(Animation animation) {}
- public void onAnimationEnd(Animation animation) {}
+ public void onAnimationEnd(Animation animation) {
+ mPageNumberView.setVisibility(View.VISIBLE);
+ }
});
- mLowerButtons.startAnimation(anim);
+ mPageSlider.startAnimation(anim);
}
}
@@ -443,8 +449,9 @@ public class MuPDFActivity extends Activity
if (mButtonsVisible) {
mButtonsVisible = false;
hideKeyboard();
+
Animation anim = new TranslateAnimation(0, 0, 0, -mTopBarSwitcher.getHeight());
- anim.setDuration(500);
+ anim.setDuration(200);
anim.setAnimationListener(new Animation.AnimationListener() {
public void onAnimationStart(Animation animation) {}
public void onAnimationRepeat(Animation animation) {}
@@ -453,16 +460,19 @@ public class MuPDFActivity extends Activity
}
});
mTopBarSwitcher.startAnimation(anim);
- anim = new TranslateAnimation(0, 0, 0, mLowerButtons.getHeight());
- anim.setDuration(500);
+
+ anim = new TranslateAnimation(0, 0, 0, mPageSlider.getHeight());
+ anim.setDuration(200);
anim.setAnimationListener(new Animation.AnimationListener() {
- public void onAnimationStart(Animation animation) {}
+ public void onAnimationStart(Animation animation) {
+ mPageNumberView.setVisibility(View.INVISIBLE);
+ }
public void onAnimationRepeat(Animation animation) {}
public void onAnimationEnd(Animation animation) {
- mLowerButtons.setVisibility(View.INVISIBLE);
+ mPageSlider.setVisibility(View.INVISIBLE);
}
});
- mLowerButtons.startAnimation(anim);
+ mPageSlider.startAnimation(anim);
}
}
@@ -502,7 +512,8 @@ public class MuPDFActivity extends Activity
mSearchText = (EditText)mButtonsView.findViewById(R.id.searchText);
mLowerButtons = mButtonsView.findViewById(R.id.lowerButtons);
mTopBarSwitcher.setVisibility(View.INVISIBLE);
- mLowerButtons.setVisibility(View.INVISIBLE);
+ mPageNumberView.setVisibility(View.INVISIBLE);
+ mPageSlider.setVisibility(View.INVISIBLE);
}
void showKeyboard() {