diff options
| -rw-r--r-- | Android.mk | 4 | ||||
| -rw-r--r-- | res/layout/filtershow_actionbar_effects.xml | 6 | ||||
| -rwxr-xr-x | res/values/strings.xml | 4 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 1 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 2 | ||||
| -rwxr-xr-x | src/com/android/gallery3d/app/TimeLineDataLoader.java | 4 | ||||
| -rwxr-xr-x | src/com/android/gallery3d/app/TimeLinePage.java | 6 | ||||
| -rw-r--r-- | src/com/android/gallery3d/data/ClusterAlbum.java | 4 | ||||
| -rw-r--r-- | src/com/android/gallery3d/data/ClusterAlbumSet.java | 31 | ||||
| -rw-r--r-- | src/com/android/gallery3d/filtershow/category/MainPanel.java | 3 | ||||
| -rwxr-xr-x | src/com/android/gallery3d/ui/TimeLineTitleMaker.java | 14 | ||||
| -rw-r--r-- | src/com/android/gallery3d/util/GalleryUtils.java | 1 |
12 files changed, 32 insertions, 48 deletions
diff --git a/Android.mk b/Android.mk index 447b77e43..7d29369ee 100644 --- a/Android.mk +++ b/Android.mk @@ -12,7 +12,7 @@ LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit LOCAL_STATIC_JAVA_LIBRARIES += mp4parser #LOCAL_STATIC_JAVA_LIBRARIES += android-support-v8-renderscript -LOCAL_RENDERSCRIPT_TARGET_API := 18 +#LOCAL_RENDERSCRIPT_TARGET_API := 18 #LOCAL_RENDERSCRIPT_COMPATIBILITY := 18 #LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=android.support.v8.renderscript @@ -45,7 +45,7 @@ LOCAL_PROGUARD_ENABLED := disabled #LOCAL_SDK_VERSION := current -LOCAL_JNI_SHARED_LIBRARIES := libjni_eglfence libjni_filtershow_filters librsjni libjni_jpegstream +LOCAL_JNI_SHARED_LIBRARIES := libjni_eglfence libjni_filtershow_filters libjni_jpegstream LOCAL_SHARED_LIBRARIES += libjni_dualcamera ifeq ($(TARGET_TS_MAKEUP), true) diff --git a/res/layout/filtershow_actionbar_effects.xml b/res/layout/filtershow_actionbar_effects.xml index 90554bbf2..c2b05ebe0 100644 --- a/res/layout/filtershow_actionbar_effects.xml +++ b/res/layout/filtershow_actionbar_effects.xml @@ -31,7 +31,8 @@ android:layout_weight=".1" android:background="@android:color/transparent" android:gravity="center" - android:src="@drawable/ic_menu_cancel_holo_light" + android:src="@drawable/cancel" + android:paddingStart="16dp" android:textSize="18dip" /> <LinearLayout @@ -64,7 +65,8 @@ android:layout_weight=".1" android:background="@android:color/transparent" android:gravity="center" - android:src="@drawable/ic_menu_done_holo_light" + android:src="@drawable/done" + android:paddingEnd="16dp" android:textSize="18dip" /> </LinearLayout>
\ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 405c44350..7e4c50310 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1136,8 +1136,8 @@ CHAR LIMIT = NONE] --> </plurals> <plurals name="number_of_videos"> - <item quantity="one">%1$d Video</item> - <item quantity="other">%1$d Videos</item> + <item quantity="one">%1$d video</item> + <item quantity="other">%1$d videos</item> </plurals> <!-- The label for the bass boost knob of the audio effects dialog. --> diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 65442d056..3181d2daf 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -660,6 +660,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster menu.findItem(R.id.action_camera).setVisible( GalleryUtils.isAnyCameraAvailable(mActivity)); menu.findItem(R.id.action_slideshow).setVisible(!mIsVideoScreen); + menu.findItem(R.id.action_sync_picasa_albums).setVisible(mIsVideoScreen); MenuItem item = menu.findItem(R.id.action_view_type); updateMenuTitle(item); diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 15b70d330..41cdb02b2 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -693,7 +693,7 @@ public abstract class PhotoPage extends ActivityState implements return; case R.id.photopage_bottom_control_share: if (mModel != null && mModel.getMediaItem(0) != null) { - Uri uri = Uri.parse(mModel.getMediaItem(0).getFilePath()); + Uri uri = mActivity.getDataManager().getContentUri(mModel.getMediaItem(0).getPath()); mShareIntent.setType(MenuExecutor.getMimeType(mModel .getMediaItem(0).getMediaType())); mShareIntent.putExtra(Intent.EXTRA_STREAM, uri); diff --git a/src/com/android/gallery3d/app/TimeLineDataLoader.java b/src/com/android/gallery3d/app/TimeLineDataLoader.java index 6817b8871..7816c2943 100755 --- a/src/com/android/gallery3d/app/TimeLineDataLoader.java +++ b/src/com/android/gallery3d/app/TimeLineDataLoader.java @@ -135,10 +135,6 @@ public class TimeLineDataLoader { return mData[index % mData.length]; } - public MediaItem getTimeLineTitleItem(int index) { - return ((ClusterAlbumSet)mSource).getTimelineTitleMediaItem(index); - } - public int getTimeLineTitlesCount() { return ((ClusterAlbumSet) mSource).getSubMediaSetCount(); } diff --git a/src/com/android/gallery3d/app/TimeLinePage.java b/src/com/android/gallery3d/app/TimeLinePage.java index b3134ddcb..0954727ba 100755 --- a/src/com/android/gallery3d/app/TimeLinePage.java +++ b/src/com/android/gallery3d/app/TimeLinePage.java @@ -695,8 +695,7 @@ public class TimeLinePage extends ActivityState implements mRootPane.invalidate(); break; } - case SelectionManager.SELECT_ALL_MODE: - case SelectionManager.SELECT_NONE_MODE: { + case SelectionManager.SELECT_ALL_MODE: { mActionModeHandler.updateSupportedOperation(); mRootPane.invalidate(); break; @@ -801,8 +800,7 @@ public class TimeLinePage extends ActivityState implements if (mSelectionManager.getSelected(false) == null) return -1; Path id = mSelectionManager.getSelected(false).get(0); mIndex = mAlbumDataAdapter.findItem(id); - int albumIndex = ((ClusterAlbumSet) mMediaSet).findTimelineAlbumIndex(mIndex); - return mIndex - albumIndex - 1; + return mIndex; } @Override diff --git a/src/com/android/gallery3d/data/ClusterAlbum.java b/src/com/android/gallery3d/data/ClusterAlbum.java index 3f84cc903..4f2537a63 100644 --- a/src/com/android/gallery3d/data/ClusterAlbum.java +++ b/src/com/android/gallery3d/data/ClusterAlbum.java @@ -143,7 +143,9 @@ public class ClusterAlbum extends MediaSet implements ContentListener { dataManager.mapMediaItems(subset, consumer, 0); ArrayList<MediaItem> result = new ArrayList<MediaItem>(end - start); for (int i = 0; i < buf.length; i++) { - result.add(buf[i]); + if(buf[i] != null) { + result.add(buf[i]); + } } return result; } diff --git a/src/com/android/gallery3d/data/ClusterAlbumSet.java b/src/com/android/gallery3d/data/ClusterAlbumSet.java index c16b6bf79..f9a05524a 100644 --- a/src/com/android/gallery3d/data/ClusterAlbumSet.java +++ b/src/com/android/gallery3d/data/ClusterAlbumSet.java @@ -38,7 +38,6 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { private int mTotalMediaItemCount; private ArrayList<Integer> mAlbumItemCountList; - private ArrayList<TimeLineTitleMediaItem> mTimelineTitleMediaList; public ClusterAlbumSet(Path path, GalleryApp application, MediaSet baseSet, int kind) { @@ -78,7 +77,6 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { } if (mKind == ClusterSource.CLUSTER_ALBUMSET_TIME) { calculateTotalItemsCount(); - createTimelineTitleMediaList(); } } return mDataVersion; @@ -199,23 +197,6 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { } } - private void createTimelineTitleMediaList() { - if (mTimelineTitleMediaList == null) { - mTimelineTitleMediaList = new ArrayList<TimeLineTitleMediaItem>(); - } - mTimelineTitleMediaList.clear(); - for(ClusterAlbum album: mAlbums) { - mTimelineTitleMediaList.add(album.getTimelineTitle()); - } - } - - public TimeLineTitleMediaItem getTimelineTitleMediaItem(int index) { - if (mTimelineTitleMediaList == null || index >= mTimelineTitleMediaList.size()) { - return null; - } - return mTimelineTitleMediaList.get(index); - } - @Override public int getMediaItemCount() { return mTotalMediaItemCount; @@ -230,13 +211,9 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { ArrayList<MediaItem> mediaItems = new ArrayList<MediaItem>(); int startAlbum = findTimelineAlbumIndex(start); int endAlbum = findTimelineAlbumIndex(start + count - 1); - int pAlbumCount = 0; int s; int lCount; - if (startAlbum > 0) { - pAlbumCount = mAlbumItemCountList.get(startAlbum -1); - } - s = start - pAlbumCount; + s = mAlbums.get(startAlbum).getTotalMediaItemCount() - (mAlbumItemCountList.get(startAlbum) - start); for (int i = startAlbum; i <= endAlbum && i < mAlbums.size(); ++i) { int albumCount = mAlbums.get(i).getTotalMediaItemCount(); lCount = Math.min(albumCount - s, count); @@ -260,9 +237,9 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { } public ClusterAlbum getAlbumFromindex(int index) { - int albumIndex = findTimelineAlbumIndex(index); - if (albumIndex >= 0 && albumIndex < mAlbums.size()) { - return mAlbums.get(albumIndex); + int aIndex = findTimelineAlbumIndex(index); + if (aIndex < mAlbums.size() && aIndex >= 0) { + return mAlbums.get(aIndex); } return null; } diff --git a/src/com/android/gallery3d/filtershow/category/MainPanel.java b/src/com/android/gallery3d/filtershow/category/MainPanel.java index 93da39ceb..e7d686e4c 100644 --- a/src/com/android/gallery3d/filtershow/category/MainPanel.java +++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java @@ -428,6 +428,9 @@ public class MainPanel extends Fragment { public void enableDualCameraButton(boolean enable) { if(dualCamButton != null) { dualCamButton.setVisibility(enable?View.VISIBLE:View.GONE); + TextView tvDualCam = (TextView) mEffectsTextContainer + .findViewById(R.id.tvDualCam); + tvDualCam.setVisibility(enable?View.VISIBLE:View.GONE); } } } diff --git a/src/com/android/gallery3d/ui/TimeLineTitleMaker.java b/src/com/android/gallery3d/ui/TimeLineTitleMaker.java index 45acdef87..a0464147e 100755 --- a/src/com/android/gallery3d/ui/TimeLineTitleMaker.java +++ b/src/com/android/gallery3d/ui/TimeLineTitleMaker.java @@ -24,6 +24,7 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.PorterDuff; +import android.graphics.Rect; import android.graphics.Typeface; import android.text.TextPaint; import android.text.TextUtils; @@ -121,7 +122,7 @@ public class TimeLineTitleMaker { if(mImageCount != 0) { sb.append(mContext.getResources().getQuantityString(R.plurals.number_of_photos, mImageCount, mImageCount)); if(mVideoCount!=0) { - sb.append(mContext.getResources().getQuantityString( + sb.append(" " +mContext.getResources().getQuantityString( R.plurals.number_of_videos, mVideoCount, mVideoCount)); } } else { @@ -140,13 +141,18 @@ public class TimeLineTitleMaker { if (mTitle != null) { mTitle = mTitle.toUpperCase(); x = 16; - y = (height/2)-14; + y = (height - spec.timeLineTitleFontSize)/2; drawText(canvas, x, y, mTitle, width-x, mTitlePaint); } if (countString != null) { - y = (height/2)-14; - x = width - countString.length()- 100; + + Rect mediaCountBounds = new Rect(); + mCountPaint.getTextBounds( + countString, 0, countString.length(), mediaCountBounds); + int w = mediaCountBounds.width(); + y = (height - spec.timeLineTitleFontSize)/2; + x = width - countString.length() -w; drawText(canvas, x, y, countString, width - x, mCountPaint); } diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java index d7fb3332a..0a3540e9c 100644 --- a/src/com/android/gallery3d/util/GalleryUtils.java +++ b/src/com/android/gallery3d/util/GalleryUtils.java @@ -45,7 +45,6 @@ import com.android.gallery3d.app.PackagesMonitor; import com.android.gallery3d.common.ApiHelper; import com.android.gallery3d.data.DataManager; import com.android.gallery3d.data.MediaItem; -import com.android.gallery3d.ui.SharedPreferencesCompat; import com.android.gallery3d.ui.TiledScreenNail; import com.android.gallery3d.util.IntentHelper; import com.android.gallery3d.util.ThreadPool.CancelListener; |
