summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ImageGallery.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2009-04-23 16:24:26 -0700
committerOwen Lin <owenlin@google.com>2009-04-28 12:51:21 -0700
commit228f1322c6dcbd324ecf1b927db6b9ef10c7868c (patch)
tree03822fbb2543e6e1102dfed91fb8216bacb7af8b /src/com/android/camera/ImageGallery.java
parent2716078c6252f926cea467be4202855d491f8cf7 (diff)
downloadLegacyCamera-228f1322c6dcbd324ecf1b927db6b9ef10c7868c.zip
LegacyCamera-228f1322c6dcbd324ecf1b927db6b9ef10c7868c.tar.gz
LegacyCamera-228f1322c6dcbd324ecf1b927db6b9ef10c7868c.tar.bz2
More UI on multiselect. A grayout checkbox for unselected images and a dynamic button pannel shows when user
select some images.
Diffstat (limited to 'src/com/android/camera/ImageGallery.java')
-rw-r--r--src/com/android/camera/ImageGallery.java44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/com/android/camera/ImageGallery.java b/src/com/android/camera/ImageGallery.java
index 6816880..29b46a8 100644
--- a/src/com/android/camera/ImageGallery.java
+++ b/src/com/android/camera/ImageGallery.java
@@ -52,6 +52,8 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
import android.widget.TextView;
import android.widget.Toast;
@@ -73,6 +75,7 @@ public class ImageGallery extends Activity implements
private MenuItem mSlideShowItem;
private SharedPreferences mPrefs;
private long mVideoSizeLimit = Long.MAX_VALUE;
+ private View mFooterOrganizeView;
BroadcastReceiver mReceiver = null;
@@ -106,6 +109,8 @@ public class ImageGallery extends Activity implements
mGvs.requestFocus();
mGvs.setListener(this);
+ mFooterOrganizeView = findViewById(R.id.footer_organize);
+
if (isPickIntent()) {
mVideoSizeLimit = getIntent().getLongExtra(
MediaStore.EXTRA_SIZE_LIMIT, Long.MAX_VALUE);
@@ -471,7 +476,7 @@ public class ImageGallery extends Activity implements
item.setAlphabeticShortcut('p');
item.setIcon(android.R.drawable.ic_menu_preferences);
- item = menu.add(R.string.multiselect);
+ item = menu.add(0, 0, 900, R.string.multiselect);
item.setOnMenuItemClickListener(
new MenuItem.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
@@ -597,8 +602,11 @@ public class ImageGallery extends Activity implements
// if in multiselect mode
if (mMultiSelected != null) {
+ int original = mMultiSelected.size();
if (!mMultiSelected.add(img)) mMultiSelected.remove(img);
mGvs.invalidateImage(index);
+ if (original == 0) showFooter();
+ if (mMultiSelected.size() == 0) hideFooter();
return;
}
@@ -771,6 +779,7 @@ public class ImageGallery extends Activity implements
private Drawable mVideoOverlay;
private Drawable mVideoMmsErrorOverlay;
private Drawable mMultiSelectTrue;
+ private Drawable mMultiSelectFalse;
public void drawImage(Canvas canvas, IImage image,
Bitmap b, int xPos, int yPos, int w, int h) {
@@ -839,10 +848,12 @@ public class ImageGallery extends Activity implements
overlay.draw(canvas);
}
- if (mMultiSelected != null && mMultiSelected.contains(image)) {
+ if (mMultiSelected != null) {
initializeMultiSelectDrawables();
- Drawable checkBox = mMultiSelectTrue;
+ Drawable checkBox = mMultiSelected.contains(image)
+ ? mMultiSelectTrue
+ : mMultiSelectFalse;
int width = checkBox.getIntrinsicWidth();
int height = checkBox.getIntrinsicHeight();
int left = 5 + xPos;
@@ -858,6 +869,10 @@ public class ImageGallery extends Activity implements
mMultiSelectTrue = getResources()
.getDrawable(R.drawable.btn_check_buttonless_on);
}
+ if (mMultiSelectFalse == null) {
+ mMultiSelectFalse = getResources()
+ .getDrawable(R.drawable.btn_check_buttonless_off);
+ }
}
private Bitmap mMissingImageThumbnailBitmap;
@@ -881,4 +896,27 @@ public class ImageGallery extends Activity implements
return mMissingVideoThumbnailBitmap;
}
}
+
+ private Animation mFooterAppear;
+ private Animation mFooterDisappear;
+
+ private void showFooter() {
+ mFooterOrganizeView.setVisibility(View.VISIBLE);
+ if (mFooterAppear == null) {
+ mFooterAppear = AnimationUtils.loadAnimation(
+ this, R.anim.footer_appear);
+ }
+ mFooterOrganizeView.startAnimation(mFooterAppear);
+ }
+
+ private void hideFooter() {
+ if (mFooterOrganizeView.getVisibility() != View.GONE) {
+ mFooterOrganizeView.setVisibility(View.GONE);
+ if (mFooterDisappear == null) {
+ mFooterDisappear = AnimationUtils.loadAnimation(
+ this, R.anim.footer_disappear);
+ }
+ mFooterOrganizeView.startAnimation(mFooterDisappear);
+ }
+ }
}