am 586c41f0: Import revised translations. DO NOT MERGE
* commit '586c41f0a6e871dd606830bfbac5e7460bb8d53b':
Import revised translations. DO NOT MERGE
diff --git a/src/com/cooliris/media/CropImage.java b/src/com/cooliris/media/CropImage.java
index 4c49dc7..f37f584 100644
--- a/src/com/cooliris/media/CropImage.java
+++ b/src/com/cooliris/media/CropImage.java
@@ -132,8 +132,11 @@
MediaScannerConnection connection = mConnectionMap.get(context);
if (connection != null) {
try {
+ final String downloadDirectoryPath = LocalDataSource.DOWNLOAD_BUCKET_NAME;
+ File downloadDirectory = new File(downloadDirectoryPath);
+ downloadDirectory.mkdirs();
final String path = UriTexture.writeHttpDataInDirectory(context, contentUri,
- LocalDataSource.DOWNLOAD_BUCKET_NAME);
+ downloadDirectoryPath);
if (path != null) {
connection.scanFile(path, item.mMimeType);
} else {
diff --git a/src/com/cooliris/media/GridLayer.java b/src/com/cooliris/media/GridLayer.java
index 74aff5d..119ddd9 100644
--- a/src/com/cooliris/media/GridLayer.java
+++ b/src/com/cooliris/media/GridLayer.java
@@ -82,6 +82,7 @@
private final LayoutInterface mLayoutInterface;
private static final LayoutInterface sfullScreenLayoutInterface = new GridLayoutInterface(1);
+ private static final float DEPTH_POSITION = 0.55f;
private MediaFeed mMediaFeed;
private boolean mInAlbum = false;
@@ -116,6 +117,7 @@
private String mRequestFocusContentUri;
private int mFrameCount;
private boolean mRequestToEnterSelection;
+ private boolean mLayoutChanged = false;
// private ArrayList<Integer> mBreakSlots = new ArrayList<Integer>();
// private ArrayList<Integer> mOldBreakSlots;
@@ -678,6 +680,11 @@
displayItem.set(position, j, false);
displayItem.commit();
} else {
+ if (mState == STATE_GRID_VIEW
+ && mLayoutChanged) {
+ displayItem.mAnimatedPosition.add(
+ 0.0f, 0.0f, (i % 5) * DEPTH_POSITION);
+ }
displayList.setPositionAndStackIndex(displayItem, position, j, true);
}
displayItems[baseIndex + j] = displayItem;
@@ -690,6 +697,7 @@
bestItems.clear();
}
}
+ mLayoutChanged = false;
if (mFeedChanged) {
mFeedChanged = false;
if (mInputProcessor != null && mState == STATE_FULL_SCREEN && mRequestFocusContentUri == null) {
@@ -872,6 +880,7 @@
deltaAnchorPosition.subtract(currentSlotPosition);
deltaAnchorPosition.y = 0;
deltaAnchorPosition.z = 0;
+ mLayoutChanged = true;
}
mDeltaAnchorPositionUncommited.set(deltaAnchorPosition);
} finally {
diff --git a/src/com/cooliris/media/LocalDataSource.java b/src/com/cooliris/media/LocalDataSource.java
index 7006ba3..54d1d00 100644
--- a/src/com/cooliris/media/LocalDataSource.java
+++ b/src/com/cooliris/media/LocalDataSource.java
@@ -393,6 +393,7 @@
if (cursor.moveToFirst()) {
item = new MediaItem();
CacheService.populateMediaItemFromCursor(item, cr, cursor, uri.toString() + "/");
+ item.mId = id;
}
cursor.close();
cursor = null;
@@ -401,7 +402,6 @@
// If the database operation failed for any reason.
;
}
- item.mId = id;
return item;
}
diff --git a/src/com/cooliris/media/PathBarLayer.java b/src/com/cooliris/media/PathBarLayer.java
index c09c407..21e3a2a 100644
--- a/src/com/cooliris/media/PathBarLayer.java
+++ b/src/com/cooliris/media/PathBarLayer.java
@@ -290,8 +290,10 @@
int numComponents = mComponents.size();
for (int i = 0; i < numComponents; i++) {
Component component = mComponents.get(i);
- width -= (component.getIconWidth() + 20.0f * App.PIXEL_DENSITY);
- component.computeLabel(width);
+ if (component != null) {
+ width -= (component.getIconWidth() + 20.0f * App.PIXEL_DENSITY);
+ component.computeLabel(width);
+ }
}
}
}
diff --git a/src/com/cooliris/media/PhotoAppWidgetProvider.java b/src/com/cooliris/media/PhotoAppWidgetProvider.java
index cca6413..4c0a8d9 100644
--- a/src/com/cooliris/media/PhotoAppWidgetProvider.java
+++ b/src/com/cooliris/media/PhotoAppWidgetProvider.java
@@ -155,8 +155,9 @@
Bitmap bitmap = null;
try {
SQLiteDatabase db = getReadableDatabase();
- String selection = String.format("%s=%d", FIELD_APPWIDGET_ID, appWidgetId);
- c = db.query(TABLE_PHOTOS, PHOTOS_PROJECTION, selection, null, null, null, null, null);
+ String[] selectionArgs = { String.valueOf(appWidgetId) };
+ c = db.query(TABLE_PHOTOS, PHOTOS_PROJECTION, FIELD_APPWIDGET_ID + "=?",
+ selectionArgs, null, null, null, null);
if (c != null && LOGD) {
Log.d(TAG, "getPhoto query count=" + c.getCount());
@@ -184,8 +185,8 @@
public void deletePhoto(int appWidgetId) {
try {
SQLiteDatabase db = getWritableDatabase();
- String whereClause = String.format("%s=%d", FIELD_APPWIDGET_ID, appWidgetId);
- db.delete(TABLE_PHOTOS, whereClause, null);
+ String[] selectionArgs = { String.valueOf(appWidgetId) };
+ db.delete(TABLE_PHOTOS, FIELD_APPWIDGET_ID + "=?", selectionArgs);
} catch (SQLiteException e) {
Log.e(TAG, "Could not delete photo from database", e);
}