diff options
Diffstat (limited to 'src_pd/com')
12 files changed, 687 insertions, 0 deletions
diff --git a/src_pd/com/android/camera/PanoramaStitchingManager.java b/src_pd/com/android/camera/PanoramaStitchingManager.java new file mode 100644 index 000000000..5ba16b863 --- /dev/null +++ b/src_pd/com/android/camera/PanoramaStitchingManager.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera; + +import android.content.Context; +import android.net.Uri; + +class PanoramaStitchingManager implements ImageTaskManager { + + public PanoramaStitchingManager(Context ctx) { + } + + @Override + public void addTaskListener(TaskListener l) { + // do nothing. + } + + @Override + public void removeTaskListener(TaskListener l) { + // do nothing. + } + + @Override + public int getTaskProgress(Uri uri) { + return -1; + } +} diff --git a/src_pd/com/android/gallery3d/app/StitchingProgressManager.java b/src_pd/com/android/gallery3d/app/StitchingProgressManager.java new file mode 100644 index 000000000..73868478e --- /dev/null +++ b/src_pd/com/android/gallery3d/app/StitchingProgressManager.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.app; + +import android.net.Uri; + +public class StitchingProgressManager { + public StitchingProgressManager(GalleryApp app) { + } + + public void addChangeListener(StitchingChangeListener l) { + } + + public void removeChangeListener(StitchingChangeListener l) { + } + + public Integer getProgress(Uri uri) { + return null; + } +} diff --git a/src_pd/com/android/gallery3d/filtershow/editors/EditorManager.java b/src_pd/com/android/gallery3d/filtershow/editors/EditorManager.java new file mode 100644 index 000000000..32664258a --- /dev/null +++ b/src_pd/com/android/gallery3d/filtershow/editors/EditorManager.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.filtershow.editors; + +import com.android.gallery3d.filtershow.EditorPlaceHolder; +import com.android.gallery3d.filtershow.editors.BasicEditor; +import com.android.gallery3d.filtershow.editors.EditorCurves; +import com.android.gallery3d.filtershow.editors.EditorZoom; + +public class EditorManager { + + public static void addEditors(EditorPlaceHolder editorPlaceHolder) { + editorPlaceHolder.addEditor(new EditorGrad()); + editorPlaceHolder.addEditor(new EditorChanSat()); + editorPlaceHolder.addEditor(new EditorZoom()); + editorPlaceHolder.addEditor(new EditorCurves()); + editorPlaceHolder.addEditor(new EditorTinyPlanet()); + editorPlaceHolder.addEditor(new EditorDraw()); + editorPlaceHolder.addEditor(new EditorVignette()); + editorPlaceHolder.addEditor(new EditorMirror()); + editorPlaceHolder.addEditor(new EditorRotate()); + editorPlaceHolder.addEditor(new EditorStraighten()); + editorPlaceHolder.addEditor(new EditorCrop()); + } + +} diff --git a/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java b/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java new file mode 100644 index 000000000..66372c27f --- /dev/null +++ b/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.filtershow.filters; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Color; + +import com.android.gallery3d.R; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Vector; + +public class FiltersManager extends BaseFiltersManager { + private static FiltersManager sInstance = null; + private static FiltersManager sPreviewInstance = null; + private static FiltersManager sHighresInstance = null; + private static int mImageBorderSize = 4; // in percent + public FiltersManager() { + init(); + } + + public static FiltersManager getPreviewManager() { + if (sPreviewInstance == null) { + sPreviewInstance = new FiltersManager(); + } + return sPreviewInstance; + } + + public static FiltersManager getManager() { + if (sInstance == null) { + sInstance = new FiltersManager(); + } + return sInstance; + } + + @Override + public void addBorders(Context context) { + + // Do not localize + String[] serializationNames = { + "FRAME_4X5", + "FRAME_BRUSH", + "FRAME_GRUNGE", + "FRAME_SUMI_E", + "FRAME_TAPE", + "FRAME_BLACK", + "FRAME_BLACK_ROUNDED", + "FRAME_WHITE", + "FRAME_WHITE_ROUNDED", + "FRAME_CREAM", + "FRAME_CREAM_ROUNDED" + }; + + // The "no border" implementation + int i = 0; + FilterRepresentation rep = new FilterImageBorderRepresentation(0); + mBorders.add(rep); + + // Regular borders + ArrayList <FilterRepresentation> borderList = new ArrayList<FilterRepresentation>(); + + + rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_4x5); + borderList.add(rep); + + rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_brush); + borderList.add(rep); + + rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_grunge); + borderList.add(rep); + + rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_sumi_e); + borderList.add(rep); + + rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_tape); + borderList.add(rep); + + rep = new FilterColorBorderRepresentation(Color.BLACK, mImageBorderSize, 0); + borderList.add(rep); + + rep = new FilterColorBorderRepresentation(Color.BLACK, mImageBorderSize, + mImageBorderSize); + borderList.add(rep); + + rep = new FilterColorBorderRepresentation(Color.WHITE, mImageBorderSize, 0); + borderList.add(rep); + + rep = new FilterColorBorderRepresentation(Color.WHITE, mImageBorderSize, + mImageBorderSize); + borderList.add(rep); + + int creamColor = Color.argb(255, 237, 237, 227); + rep = new FilterColorBorderRepresentation(creamColor, mImageBorderSize, 0); + borderList.add(rep); + + rep = new FilterColorBorderRepresentation(creamColor, mImageBorderSize, + mImageBorderSize); + borderList.add(rep); + + for (FilterRepresentation filter : borderList) { + filter.setSerializationName(serializationNames[i++]); + addRepresentation(filter); + } + + } + + public static FiltersManager getHighresManager() { + if (sHighresInstance == null) { + sHighresInstance = new FiltersManager(); + } + return sHighresInstance; + } + + public static void reset() { + sInstance = null; + sPreviewInstance = null; + sHighresInstance = null; + } + + public static void setResources(Resources resources) { + FiltersManager.getManager().setFilterResources(resources); + FiltersManager.getPreviewManager().setFilterResources(resources); + FiltersManager.getHighresManager().setFilterResources(resources); + } +} diff --git a/src_pd/com/android/gallery3d/picasasource/PicasaSource.java b/src_pd/com/android/gallery3d/picasasource/PicasaSource.java new file mode 100644 index 000000000..5e800e23b --- /dev/null +++ b/src_pd/com/android/gallery3d/picasasource/PicasaSource.java @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.picasasource; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.os.ParcelFileDescriptor; + +import com.android.gallery3d.app.GalleryApp; +import com.android.gallery3d.data.MediaItem; +import com.android.gallery3d.data.MediaObject; +import com.android.gallery3d.data.MediaSet; +import com.android.gallery3d.data.MediaSource; +import com.android.gallery3d.data.Path; +import com.android.gallery3d.data.PathMatcher; + +import java.io.FileNotFoundException; + +public class PicasaSource extends MediaSource { + private static final String TAG = "PicasaSource"; + + private static final int NO_MATCH = -1; + private static final int IMAGE_MEDIA_ID = 1; + + private static final int PICASA_ALBUMSET = 0; + private static final int MAP_BATCH_COUNT = 100; + + private GalleryApp mApplication; + private PathMatcher mMatcher; + + public static final Path ALBUM_PATH = Path.fromString("/picasa/all"); + + public PicasaSource(GalleryApp application) { + super("picasa"); + mApplication = application; + mMatcher = new PathMatcher(); + mMatcher.add("/picasa/all", PICASA_ALBUMSET); + mMatcher.add("/picasa/image", PICASA_ALBUMSET); + mMatcher.add("/picasa/video", PICASA_ALBUMSET); + } + + private static class EmptyAlbumSet extends MediaSet { + + public EmptyAlbumSet(Path path, long version) { + super(path, version); + } + + @Override + public String getName() { + return "picasa"; + } + + @Override + public long reload() { + return mDataVersion; + } + } + + @Override + public MediaObject createMediaObject(Path path) { + switch (mMatcher.match(path)) { + case PICASA_ALBUMSET: + return new EmptyAlbumSet(path, MediaObject.nextVersionNumber()); + default: + throw new RuntimeException("bad path: " + path); + } + } + + public static MediaItem getFaceItem(Context context, MediaItem item, int faceIndex) { + throw new UnsupportedOperationException(); + } + + public static boolean isPicasaImage(MediaObject object) { + return false; + } + + public static String getImageTitle(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static int getImageSize(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static String getContentType(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static long getDateTaken(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static double getLatitude(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static double getLongitude(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static int getRotation(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static long getPicasaId(MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static String getUserAccount(Context context, MediaObject image) { + throw new UnsupportedOperationException(); + } + + public static ParcelFileDescriptor openFile(Context context, MediaObject image, String mode) + throws FileNotFoundException { + throw new UnsupportedOperationException(); + } + + public static void initialize(Context context) {/*do nothing*/} + + public static void requestSync(Context context) {/*do nothing*/} + + public static void showSignInReminder(Activity context) {/*do nothing*/} + + public static void onPackageAdded(Context context, String packageName) {/*do nothing*/} + + public static void onPackageRemoved(Context context, String packageName) {/*do nothing*/} + + public static void onPackageChanged(Context context, String packageName) {/*do nothing*/} + + public static Dialog getVersionCheckDialog(Activity activity){ + return null; + } +} diff --git a/src_pd/com/android/gallery3d/settings/GallerySettings.java b/src_pd/com/android/gallery3d/settings/GallerySettings.java new file mode 100644 index 000000000..d30d755e3 --- /dev/null +++ b/src_pd/com/android/gallery3d/settings/GallerySettings.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.settings; + +import android.preference.PreferenceActivity; + +public class GallerySettings extends PreferenceActivity { + private static final String TAG = "GallerySettings"; +} diff --git a/src_pd/com/android/gallery3d/util/HelpUtils.java b/src_pd/com/android/gallery3d/util/HelpUtils.java new file mode 100644 index 000000000..7da3fca52 --- /dev/null +++ b/src_pd/com/android/gallery3d/util/HelpUtils.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.util; + +import android.content.Context; +import android.content.Intent; + +public class HelpUtils { + + public static Intent getHelpIntent(Context context) { + return null; + } + +} diff --git a/src_pd/com/android/gallery3d/util/LightCycleHelper.java b/src_pd/com/android/gallery3d/util/LightCycleHelper.java new file mode 100644 index 000000000..5cd910f8f --- /dev/null +++ b/src_pd/com/android/gallery3d/util/LightCycleHelper.java @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.util; + +import android.app.Activity; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; + +import com.android.camera.CameraModule; +import com.android.gallery3d.app.GalleryApp; +import com.android.gallery3d.app.StitchingProgressManager; + +public class LightCycleHelper { + public static class PanoramaMetadata { + // Whether a panorama viewer should be used + public final boolean mUsePanoramaViewer; + // Whether a panorama is 360 degrees + public final boolean mIsPanorama360; + + public PanoramaMetadata(boolean usePanoramaViewer, boolean isPanorama360) { + mUsePanoramaViewer = usePanoramaViewer; + mIsPanorama360 = isPanorama360; + } + } + + public static class PanoramaViewHelper { + + public PanoramaViewHelper(Activity activity) { + /* Do nothing */ + } + + public void onStart() { + /* Do nothing */ + } + + public void onCreate() { + /* Do nothing */ + } + + public void onStop() { + /* Do nothing */ + } + + public void showPanorama(Uri uri) { + /* Do nothing */ + } + } + + public static final PanoramaMetadata NOT_PANORAMA = new PanoramaMetadata(false, false); + + public static void setupCaptureIntent(Context context, Intent it, String outputDir) { + /* Do nothing */ + } + + public static boolean hasLightCycleCapture(Context context) { + return false; + } + + public static PanoramaMetadata getPanoramaMetadata(Context context, Uri uri) { + return NOT_PANORAMA; + } + + public static CameraModule createPanoramaModule() { + return null; + } + + public static StitchingProgressManager createStitchingManagerInstance(GalleryApp app) { + return null; + } + + /** + * Get the file path from a Media storage URI. + */ + public static String getPathFromURI(ContentResolver contentResolver, Uri contentUri) { + return null; + } + + /** + * Get the modified time from a Media storage URI. + */ + public static long getModifiedTimeFromURI(ContentResolver contentResolver, Uri contentUri) { + return 0; + } +} diff --git a/src_pd/com/android/gallery3d/util/RefocusHelper.java b/src_pd/com/android/gallery3d/util/RefocusHelper.java new file mode 100644 index 000000000..39ded4740 --- /dev/null +++ b/src_pd/com/android/gallery3d/util/RefocusHelper.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.util; + +import com.android.camera.CameraModule; + +public class RefocusHelper { + public static CameraModule createRefocusModule() { + return null; + } +} diff --git a/src_pd/com/android/gallery3d/util/UsageStatistics.java b/src_pd/com/android/gallery3d/util/UsageStatistics.java new file mode 100644 index 000000000..48fc6ae24 --- /dev/null +++ b/src_pd/com/android/gallery3d/util/UsageStatistics.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.util; + +import android.content.Context; + +public class UsageStatistics { + + public static final String COMPONENT_GALLERY = "Gallery"; + public static final String COMPONENT_CAMERA = "Camera"; + public static final String COMPONENT_EDITOR = "Editor"; + public static final String COMPONENT_IMPORTER = "Importer"; + + public static final String TRANSITION_BACK_BUTTON = "BackButton"; + public static final String TRANSITION_UP_BUTTON = "UpButton"; + public static final String TRANSITION_PINCH_IN = "PinchIn"; + public static final String TRANSITION_PINCH_OUT = "PinchOut"; + public static final String TRANSITION_INTENT = "Intent"; + public static final String TRANSITION_ITEM_TAP = "ItemTap"; + public static final String TRANSITION_MENU_TAP = "MenuTap"; + public static final String TRANSITION_BUTTON_TAP = "ButtonTap"; + public static final String TRANSITION_SWIPE = "Swipe"; + + public static final String ACTION_CAPTURE_START = "CaptureStart"; + public static final String ACTION_CAPTURE_FAIL = "CaptureFail"; + public static final String ACTION_CAPTURE_DONE = "CaptureDone"; + public static final String ACTION_SHARE = "Share"; + + public static final String CATEGORY_LIFECYCLE = "AppLifecycle"; + public static final String CATEGORY_BUTTON_PRESS = "ButtonPress"; + + public static final String LIFECYCLE_START = "Start"; + + public static void initialize(Context context) {} + public static void setPendingTransitionCause(String cause) {} + public static void onContentViewChanged(String screenComponent, String screenName) {} + public static void onEvent(String category, String action, String label) {}; + public static void onEvent(String category, String action, String label, long optional_value) {}; +} diff --git a/src_pd/com/android/gallery3d/util/XmpUtilHelper.java b/src_pd/com/android/gallery3d/util/XmpUtilHelper.java new file mode 100644 index 000000000..88b813dea --- /dev/null +++ b/src_pd/com/android/gallery3d/util/XmpUtilHelper.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.gallery3d.util; + +import com.adobe.xmp.XMPMeta; + +import java.io.InputStream; + +public class XmpUtilHelper { + + public static XMPMeta extractXMPMeta(InputStream is) { + return null; + } + + public static boolean writeXMPMeta(String filename, Object meta) { + return false; + } + +} diff --git a/src_pd/com/android/photos/data/PhotoProviderAuthority.java b/src_pd/com/android/photos/data/PhotoProviderAuthority.java new file mode 100644 index 000000000..0ac76cb0e --- /dev/null +++ b/src_pd/com/android/photos/data/PhotoProviderAuthority.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.photos.data; + +interface PhotoProviderAuthority { + public static final String AUTHORITY = "com.android.gallery3d.photoprovider"; +} |