Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 985e289d authored by Yuli Huang's avatar Yuli Huang
Browse files

Make 'Edit' behave more consistent with 'Crop'. DO NOT MERGE.

1. Save edited PWA photo in 'dowload', same as cropped images.
2. Fix Crop-image toast may show strings without i18n.
bug:6168430

Change-Id: Ic99a478e684597d3dc1a105c4f592dd98d8f227d
parent 03be062c
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -19,16 +19,13 @@
    <string name="photoeditor_name">Photo Studio</string>

    <!-- Toast shown when selected photo could not be loaded. [CHAR LIMIT=40] -->
    <string name="loading_failure">Photo cannot be loaded</string>
    <string name="loading_failure">Couldn\'t load the photo</string>

    <!-- Toast shown when edited photo could not be saved. [CHAR LIMIT=40] -->
    <string name="saving_failure">Photo cannot be saved</string>
    <string name="saving_failure">Couldn\'t save edited photo</string>

    <!-- Toast shown when edited photo is successfully saved under %s album [CHAR LIMIT=40] -->
    <string name="photo_saved">Photo saved to <xliff:g id="album_name">%s</xliff:g> album</string>

    <!-- Album name where edited photo will be saved in the storage. [CHAR LIMIT=12] -->
    <string name="edited_photo_bucket_name">Edited</string>
    <!-- Toast shown when edited photo is successfully saved under %s folder [CHAR LIMIT=40] -->
    <string name="photo_saved">Edited photo saved to <xliff:g id="folder_name">%s</xliff:g></string>

    <!-- Dialog message prompted when the user is abandoning unsaved changes. [CHAR LIMIT=40] -->
    <string name="save_photo">Save edited photo?</string>
@@ -133,7 +130,7 @@
    <string name="flip_tooltip">Drag photo to flip it</string>

    <!-- Tool-tip toast shown when the user chooses to remove red eyes. [CHAR LIMIT=40] -->
    <string name="redeye_tooltip">Tap to remove red eyes</string>
    <string name="redeye_tooltip">Tap on red eyes to remove them</string>

    <!-- Tool-tip toast shown when the user chooses to rotate photo. [CHAR LIMIT=40] -->
    <string name="rotate_tooltip">Drag photo to rotate it</string>
+3 −2
Original line number Diff line number Diff line
@@ -230,8 +230,9 @@
    <string name="appwidget_empty_text">No photos.</string>

    <!-- Toast message shown when the cropped image has been saved in the
         download folder [CHAR LIMIT=50]-->
    <string name="crop_saved">Cropped image saved to Downloads.</string>
         %s folder (string: folder_download) [CHAR LIMIT=50]-->
    <string name="crop_saved">
        Cropped image saved to <xliff:g id="folder_name">%s</xliff:g>.</string>

    <!-- Toast message shown when the cropped image is not saved
         [CHAR LIMIT=50]-->
+2 −2
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import com.android.gallery3d.ui.CropView;
import com.android.gallery3d.ui.GLRoot;
import com.android.gallery3d.ui.SynchronizedHandler;
import com.android.gallery3d.ui.TileImageViewAdapter;
import com.android.gallery3d.util.BucketNames;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.FutureListener;
import com.android.gallery3d.util.GalleryUtils;
@@ -120,9 +121,8 @@ public class CropImage extends AbstractGalleryActivity {
    private static final int STATE_LOADED = 1;
    private static final int STATE_SAVING = 2;

    public static final String DOWNLOAD_STRING = "download";
    public static final File DOWNLOAD_BUCKET = new File(
            Environment.getExternalStorageDirectory(), DOWNLOAD_STRING);
            Environment.getExternalStorageDirectory(), BucketNames.DOWNLOAD);

    public static final String CROP_ACTION = "com.android.camera.action.CROP";

+6 −5
Original line number Diff line number Diff line
@@ -587,11 +587,12 @@ public class PhotoPage extends ActivityState
                }
                break;
            case REQUEST_CROP_PICASA: {
                int message = resultCode == Activity.RESULT_OK
                        ? R.string.crop_saved
                        : R.string.crop_not_saved;
                Toast.makeText(mActivity.getAndroidContext(),
                        message, Toast.LENGTH_SHORT).show();
                Context context = mActivity.getAndroidContext();
                // TODO: Use crop_saved instead of photo_saved after its new translation is done.
                String message = resultCode == Activity.RESULT_OK ? context.getString(
                        R.string.photo_saved, context.getString(R.string.folder_download))
                        : context.getString(R.string.crop_not_saved);
                Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
                break;
            }
            case REQUEST_SLIDESHOW: {
+2 −3
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ import android.util.Log;
import android.widget.Toast;

import com.android.gallery3d.R;
import com.android.gallery3d.util.BucketNames;
import com.android.gallery3d.util.GalleryUtils;

import java.io.File;
@@ -19,8 +20,6 @@ import java.util.List;
public class MtpContext implements MtpClient.Listener {
    private static final String TAG = "MtpContext";

    public static final String NAME_IMPORTED_FOLDER = "Imported";

    private ScannerClient mScannerClient;
    private Context mContext;
    private MtpClient mClient;
@@ -104,7 +103,7 @@ public class MtpContext implements MtpClient.Listener {
    public boolean copyFile(String deviceName, MtpObjectInfo objInfo) {
        if (GalleryUtils.hasSpaceForSize(objInfo.getCompressedSize())) {
            File dest = Environment.getExternalStorageDirectory();
            dest = new File(dest, NAME_IMPORTED_FOLDER);
            dest = new File(dest, BucketNames.IMPORTED);
            dest.mkdirs();
            String destPath = new File(dest, objInfo.getName()).getAbsolutePath();
            int objectId = objInfo.getObjectHandle();
Loading