From d5cfe29032281253f9d6d9e1630323cc64127e9f Mon Sep 17 00:00:00 2001 From: Andrew Sapperstein Date: Fri, 10 Aug 2012 17:44:38 -0700 Subject: Created a sample photo viewer implementation. Change-Id: Ida5ab5c3247a52c5fbbd495d6e127c18493356ce --- photoviewer/Android.mk | 5 + photoviewer/sample/Android.mk | 47 ++++++ photoviewer/sample/AndroidManifest.xml | 35 ++++ photoviewer/sample/assets/blah.png | Bin 0 -> 550644 bytes photoviewer/sample/assets/galaxy.png | Bin 0 -> 762095 bytes photoviewer/sample/assets/johannson.png | Bin 0 -> 460793 bytes photoviewer/sample/assets/planets.png | Bin 0 -> 178597 bytes .../sample/res/drawable-hdpi/ic_action_search.png | Bin 0 -> 3120 bytes .../sample/res/drawable-hdpi/ic_launcher.png | Bin 0 -> 4996 bytes .../sample/res/drawable-mdpi/ic_action_search.png | Bin 0 -> 3030 bytes .../sample/res/drawable-mdpi/ic_launcher.png | Bin 0 -> 3065 bytes .../sample/res/drawable-xhdpi/ic_action_search.png | Bin 0 -> 3199 bytes .../sample/res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 6679 bytes photoviewer/sample/res/layout/activity_main.xml | 16 ++ photoviewer/sample/res/menu/activity_main.xml | 6 + photoviewer/sample/res/values/dimens.xml | 7 + photoviewer/sample/res/values/strings.xml | 8 + photoviewer/sample/res/values/styles.xml | 5 + .../example/photoviewersample/MainActivity.java | 30 ++++ .../example/photoviewersample/SampleProvider.java | 179 +++++++++++++++++++++ .../android/ex/photo/provider/PhotoContract.java | 6 +- 21 files changed, 341 insertions(+), 3 deletions(-) create mode 100644 photoviewer/sample/Android.mk create mode 100644 photoviewer/sample/AndroidManifest.xml create mode 100644 photoviewer/sample/assets/blah.png create mode 100644 photoviewer/sample/assets/galaxy.png create mode 100644 photoviewer/sample/assets/johannson.png create mode 100644 photoviewer/sample/assets/planets.png create mode 100644 photoviewer/sample/res/drawable-hdpi/ic_action_search.png create mode 100644 photoviewer/sample/res/drawable-hdpi/ic_launcher.png create mode 100644 photoviewer/sample/res/drawable-mdpi/ic_action_search.png create mode 100644 photoviewer/sample/res/drawable-mdpi/ic_launcher.png create mode 100644 photoviewer/sample/res/drawable-xhdpi/ic_action_search.png create mode 100644 photoviewer/sample/res/drawable-xhdpi/ic_launcher.png create mode 100644 photoviewer/sample/res/layout/activity_main.xml create mode 100644 photoviewer/sample/res/menu/activity_main.xml create mode 100644 photoviewer/sample/res/values/dimens.xml create mode 100644 photoviewer/sample/res/values/strings.xml create mode 100644 photoviewer/sample/res/values/styles.xml create mode 100644 photoviewer/sample/src/com/example/photoviewersample/MainActivity.java create mode 100644 photoviewer/sample/src/com/example/photoviewersample/SampleProvider.java (limited to 'photoviewer') diff --git a/photoviewer/Android.mk b/photoviewer/Android.mk index a97a1ff..54ad563 100644 --- a/photoviewer/Android.mk +++ b/photoviewer/Android.mk @@ -25,3 +25,8 @@ LOCAL_SRC_FILES := \ $(call all-logtags-files-under, src) LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res include $(BUILD_STATIC_JAVA_LIBRARY) + +################################################## +# Build all sub-directories + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/photoviewer/sample/Android.mk b/photoviewer/sample/Android.mk new file mode 100644 index 0000000..8346e7c --- /dev/null +++ b/photoviewer/sample/Android.mk @@ -0,0 +1,47 @@ +# Copyright 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. + +LOCAL_PATH:= $(call my-dir) + +#Include res dir from photoviewer +photo_dir := ..//res +res_dirs := $(photo_dir) res + +################################################## +# Build APK +include $(CLEAR_VARS) + +src_dirs := src +LOCAL_PACKAGE_NAME := PhotoViewerSample + +LOCAL_STATIC_JAVA_LIBRARIES += android-common-photoviewer +LOCAL_STATIC_JAVA_LIBRARIES += android-common +LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4 +LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13 + +LOCAL_SDK_VERSION := 16 + +LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs)) \ + $(call all-logtags-files-under, $(src_dirs)) +LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs)) $(LOCAL_PATH)/res +LOCAL_AAPT_FLAGS := --auto-add-overlay +LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.photo + +include $(BUILD_PACKAGE) + + +################################################## +# Build all sub-directories + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/photoviewer/sample/AndroidManifest.xml b/photoviewer/sample/AndroidManifest.xml new file mode 100644 index 0000000..8a75d6a --- /dev/null +++ b/photoviewer/sample/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/photoviewer/sample/assets/blah.png b/photoviewer/sample/assets/blah.png new file mode 100644 index 0000000..f895669 Binary files /dev/null and b/photoviewer/sample/assets/blah.png differ diff --git a/photoviewer/sample/assets/galaxy.png b/photoviewer/sample/assets/galaxy.png new file mode 100644 index 0000000..3fcfec8 Binary files /dev/null and b/photoviewer/sample/assets/galaxy.png differ diff --git a/photoviewer/sample/assets/johannson.png b/photoviewer/sample/assets/johannson.png new file mode 100644 index 0000000..0b6be7f Binary files /dev/null and b/photoviewer/sample/assets/johannson.png differ diff --git a/photoviewer/sample/assets/planets.png b/photoviewer/sample/assets/planets.png new file mode 100644 index 0000000..1644c48 Binary files /dev/null and b/photoviewer/sample/assets/planets.png differ diff --git a/photoviewer/sample/res/drawable-hdpi/ic_action_search.png b/photoviewer/sample/res/drawable-hdpi/ic_action_search.png new file mode 100644 index 0000000..67de12d Binary files /dev/null and b/photoviewer/sample/res/drawable-hdpi/ic_action_search.png differ diff --git a/photoviewer/sample/res/drawable-hdpi/ic_launcher.png b/photoviewer/sample/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..fba1ff0 Binary files /dev/null and b/photoviewer/sample/res/drawable-hdpi/ic_launcher.png differ diff --git a/photoviewer/sample/res/drawable-mdpi/ic_action_search.png b/photoviewer/sample/res/drawable-mdpi/ic_action_search.png new file mode 100644 index 0000000..134d549 Binary files /dev/null and b/photoviewer/sample/res/drawable-mdpi/ic_action_search.png differ diff --git a/photoviewer/sample/res/drawable-mdpi/ic_launcher.png b/photoviewer/sample/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..72a445d Binary files /dev/null and b/photoviewer/sample/res/drawable-mdpi/ic_launcher.png differ diff --git a/photoviewer/sample/res/drawable-xhdpi/ic_action_search.png b/photoviewer/sample/res/drawable-xhdpi/ic_action_search.png new file mode 100644 index 0000000..d699c6b Binary files /dev/null and b/photoviewer/sample/res/drawable-xhdpi/ic_action_search.png differ diff --git a/photoviewer/sample/res/drawable-xhdpi/ic_launcher.png b/photoviewer/sample/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..002e7b0 Binary files /dev/null and b/photoviewer/sample/res/drawable-xhdpi/ic_launcher.png differ diff --git a/photoviewer/sample/res/layout/activity_main.xml b/photoviewer/sample/res/layout/activity_main.xml new file mode 100644 index 0000000..ae94392 --- /dev/null +++ b/photoviewer/sample/res/layout/activity_main.xml @@ -0,0 +1,16 @@ + + +