summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-04-02 17:31:55 +0800
committerChih-Chung Chang <chihchung@google.com>2012-04-02 18:48:58 +0800
commit2415a060b1cf69f5820e8d4d5c9954271cad2cd6 (patch)
treefec5fd132e151dcfd89c95c48c615a527a0fddd6 /src/com/android/gallery3d/app
parent948b5ffc4c004b6e4daf18f64165fb555bc4d6b2 (diff)
downloadandroid_packages_apps_Snap-2415a060b1cf69f5820e8d4d5c9954271cad2cd6.tar.gz
android_packages_apps_Snap-2415a060b1cf69f5820e8d4d5c9954271cad2cd6.tar.bz2
android_packages_apps_Snap-2415a060b1cf69f5820e8d4d5c9954271cad2cd6.zip
Remove FilmStripView.
Change-Id: I45cee8c32863cc65eba4c5e83e667e104cf24e42
Diffstat (limited to 'src/com/android/gallery3d/app')
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java3
-rw-r--r--src/com/android/gallery3d/app/Config.java36
-rw-r--r--src/com/android/gallery3d/app/PhotoDataAdapter.java5
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java50
-rw-r--r--src/com/android/gallery3d/app/SinglePhotoDataAdapter.java4
5 files changed, 2 insertions, 96 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index ba2119842..43936e746 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -351,8 +351,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
mGridDrawer = new GridDrawer((Context) mActivity, mSelectionManager);
Config.AlbumPage config = Config.AlbumPage.get((Context) mActivity);
mSlotView = new SlotView((Context) mActivity, config.slotViewSpec);
- mAlbumView = new AlbumView(
- mActivity, mSlotView, 0/* don't cache thumbnail */);
+ mAlbumView = new AlbumView(mActivity, mSlotView);
mSlotView.setSlotRenderer(mAlbumView);
mAlbumView.setSelectionDrawer(mGridDrawer);
mRootPane.addComponent(mSlotView);
diff --git a/src/com/android/gallery3d/app/Config.java b/src/com/android/gallery3d/app/Config.java
index 3cc045ccd..46ea7c89f 100644
--- a/src/com/android/gallery3d/app/Config.java
+++ b/src/com/android/gallery3d/app/Config.java
@@ -105,41 +105,5 @@ final class Config {
cachePinMargin = r.getDimensionPixelSize(R.dimen.cache_pin_margin);
}
}
-
- public static class PhotoPage {
- private static PhotoPage sInstance;
-
- // These are all height values. See the comment in FilmStripView for
- // the meaning of these values.
- public final int filmstripTopMargin;
- public final int filmstripMidMargin;
- public final int filmstripBottomMargin;
- public final int filmstripThumbSize;
- public final int filmstripContentSize;
- public final int filmstripGripSize;
- public final int filmstripBarSize;
-
- // These are width values.
- public final int filmstripGripWidth;
-
- public static synchronized PhotoPage get(Context context) {
- if (sInstance == null) {
- sInstance = new PhotoPage(context);
- }
- return sInstance;
- }
-
- public PhotoPage(Context context) {
- Resources r = context.getResources();
- filmstripTopMargin = r.getDimensionPixelSize(R.dimen.filmstrip_top_margin);
- filmstripMidMargin = r.getDimensionPixelSize(R.dimen.filmstrip_mid_margin);
- filmstripBottomMargin = r.getDimensionPixelSize(R.dimen.filmstrip_bottom_margin);
- filmstripThumbSize = r.getDimensionPixelSize(R.dimen.filmstrip_thumb_size);
- filmstripContentSize = r.getDimensionPixelSize(R.dimen.filmstrip_content_size);
- filmstripGripSize = r.getDimensionPixelSize(R.dimen.filmstrip_grip_size);
- filmstripBarSize = r.getDimensionPixelSize(R.dimen.filmstrip_bar_size);
- filmstripGripWidth = r.getDimensionPixelSize(R.dimen.filmstrip_grip_width);
- }
- }
}
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java
index 109323c1c..f4bf5a57c 100644
--- a/src/com/android/gallery3d/app/PhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java
@@ -336,11 +336,6 @@ public class PhotoDataAdapter implements PhotoPage.Model {
updateCurrentIndex(mCurrentIndex - 1);
}
- public void jumpTo(int index) {
- if (mCurrentIndex == index) return;
- updateCurrentIndex(index);
- }
-
public ScreenNail getScreenNail() {
return mTileProvider.getScreenNail();
}
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 050fad437..e16ac8a3e 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -50,7 +50,6 @@ import com.android.gallery3d.picasasource.PicasaSource;
import com.android.gallery3d.ui.DetailsHelper;
import com.android.gallery3d.ui.DetailsHelper.CloseListener;
import com.android.gallery3d.ui.DetailsHelper.DetailsSource;
-import com.android.gallery3d.ui.FilmStripView;
import com.android.gallery3d.ui.GLCanvas;
import com.android.gallery3d.ui.GLView;
import com.android.gallery3d.ui.ImportCompleteListener;
@@ -64,8 +63,7 @@ import com.android.gallery3d.ui.UserInteractionListener;
import com.android.gallery3d.util.GalleryUtils;
public class PhotoPage extends ActivityState
- implements PhotoView.PhotoTapListener, FilmStripView.Listener,
- UserInteractionListener {
+ implements PhotoView.PhotoTapListener, UserInteractionListener {
private static final String TAG = "PhotoPage";
private static final int MSG_HIDE_BARS = 1;
@@ -87,7 +85,6 @@ public class PhotoPage extends ActivityState
private PhotoView mPhotoView;
private PhotoPage.Model mModel;
- private FilmStripView mFilmStripView;
private DetailsHelper mDetailsHelper;
private boolean mShowDetails;
private Path mPendingSharePath;
@@ -140,37 +137,12 @@ public class PhotoPage extends ActivityState
protected void onLayout(
boolean changed, int left, int top, int right, int bottom) {
mPhotoView.layout(0, 0, right - left, bottom - top);
- int filmStripHeight = 0;
- if (mFilmStripView != null) {
- mFilmStripView.measure(
- MeasureSpec.makeMeasureSpec(right - left, MeasureSpec.EXACTLY),
- MeasureSpec.UNSPECIFIED);
- filmStripHeight = mFilmStripView.getMeasuredHeight();
- mFilmStripView.layout(0, bottom - top - filmStripHeight,
- right - left, bottom - top);
- }
if (mShowDetails) {
mDetailsHelper.layout(left, mActionBar.getHeight(), right, bottom);
}
}
};
- private void initFilmStripView() {
- Config.PhotoPage config = Config.PhotoPage.get((Context) mActivity);
- mFilmStripView = new FilmStripView(mActivity, mMediaSet,
- config.filmstripTopMargin, config.filmstripMidMargin, config.filmstripBottomMargin,
- config.filmstripContentSize, config.filmstripThumbSize, config.filmstripBarSize,
- config.filmstripGripSize, config.filmstripGripWidth);
- mRootPane.addComponent(mFilmStripView);
- mFilmStripView.setListener(this);
- mFilmStripView.setUserInteractionListener(this);
- mFilmStripView.setFocusIndex(mCurrentIndex);
- mFilmStripView.setStartIndex(mCurrentIndex);
- mRootPane.requestLayout();
- if (mIsActive) mFilmStripView.resume();
- if (!mShowBars) mFilmStripView.setVisibility(GLView.INVISIBLE);
- }
-
@Override
public void onCreate(Bundle data, Bundle restoreState) {
mActionBar = mActivity.getGalleryActionBar();
@@ -223,7 +195,6 @@ public class PhotoPage extends ActivityState
@Override
public void onPhotoChanged(int index, Path item) {
- if (mFilmStripView != null) mFilmStripView.setFocusIndex(index);
mCurrentIndex = index;
mResultIntent.putExtra(KEY_INDEX_HINT, index);
if (item != null) {
@@ -254,7 +225,6 @@ public class PhotoPage extends ActivityState
@Override
public void onPhotoAvailable(long version, boolean fullImage) {
- if (mFilmStripView == null) initFilmStripView();
}
});
} else {
@@ -362,9 +332,6 @@ public class PhotoPage extends ActivityState
WindowManager.LayoutParams params = ((Activity) mActivity).getWindow().getAttributes();
params.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;
((Activity) mActivity).getWindow().setAttributes(params);
- if (mFilmStripView != null) {
- mFilmStripView.show();
- }
}
private void hideBars() {
@@ -374,9 +341,6 @@ public class PhotoPage extends ActivityState
WindowManager.LayoutParams params = ((Activity) mActivity).getWindow().getAttributes();
params.systemUiVisibility = View. SYSTEM_UI_FLAG_LOW_PROFILE;
((Activity) mActivity).getWindow().setAttributes(params);
- if (mFilmStripView != null) {
- mFilmStripView.hide();
- }
}
private void refreshHidingMessage() {
@@ -580,12 +544,6 @@ public class PhotoPage extends ActivityState
}
}
- // Called by FileStripView.
- // Returns false if it cannot jump to the specified index at this time.
- public boolean onSlotSelected(int slotIndex) {
- return mPhotoView.jumpTo(slotIndex);
- }
-
@Override
protected void onStateResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
@@ -622,9 +580,6 @@ public class PhotoPage extends ActivityState
public void onPause() {
super.onPause();
mIsActive = false;
- if (mFilmStripView != null) {
- mFilmStripView.pause();
- }
DetailsHelper.pause();
mPhotoView.pause();
mModel.pause();
@@ -641,9 +596,6 @@ public class PhotoPage extends ActivityState
mModel.resume();
mPhotoView.resume();
- if (mFilmStripView != null) {
- mFilmStripView.resume();
- }
if (mMenuVisibilityListener == null) {
mMenuVisibilityListener = new MyMenuVisibilityListener();
}
diff --git a/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java b/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
index 66e7c20df..ad0d31a7d 100644
--- a/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
@@ -174,10 +174,6 @@ public class SinglePhotoDataAdapter extends TileImageViewAdapter
throw new UnsupportedOperationException();
}
- public void jumpTo(int index) {
- throw new UnsupportedOperationException();
- }
-
public MediaItem getCurrentMediaItem() {
return mItem;
}