summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-09-18 16:54:05 -0700
committernicolasroard <nicolasroard@google.com>2013-09-19 12:17:23 -0700
commit19ab725a5e640a1a20b1a6def083e37d1d1c1e20 (patch)
treebde8672301573cd987f4e383029e55e7c70692fe /res
parent064d6000933354f7bf344a41e0caa7052401c903 (diff)
downloadandroid_packages_apps_Snap-19ab725a5e640a1a20b1a6def083e37d1d1c1e20.tar.gz
android_packages_apps_Snap-19ab725a5e640a1a20b1a6def083e37d1d1c1e20.tar.bz2
android_packages_apps_Snap-19ab725a5e640a1a20b1a6def083e37d1d1c1e20.zip
Add crop activity
bug:10367125 Change-Id: I8dce6d799e7469ff048d419598d87b0c04bef2a0
Diffstat (limited to 'res')
-rw-r--r--res/drawable/crop_background.pngbin0 -> 2902 bytes
-rw-r--r--res/drawable/crop_tiled_background.xml21
-rw-r--r--res/drawable/menu_save_photo.xml20
-rw-r--r--res/layout/crop_actionbar.xml25
-rw-r--r--res/layout/crop_activity.xml54
-rw-r--r--res/values/strings.xml5
-rw-r--r--res/values/styles.xml8
7 files changed, 133 insertions, 0 deletions
diff --git a/res/drawable/crop_background.png b/res/drawable/crop_background.png
new file mode 100644
index 000000000..a11538944
--- /dev/null
+++ b/res/drawable/crop_background.png
Binary files differ
diff --git a/res/drawable/crop_tiled_background.xml b/res/drawable/crop_tiled_background.xml
new file mode 100644
index 000000000..751234ce0
--- /dev/null
+++ b/res/drawable/crop_tiled_background.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<bitmap
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/crop_background"
+ android:tileMode="repeat"
+ android:dither="false" /> \ No newline at end of file
diff --git a/res/drawable/menu_save_photo.xml b/res/drawable/menu_save_photo.xml
new file mode 100644
index 000000000..0b92ac968
--- /dev/null
+++ b/res/drawable/menu_save_photo.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="true" android:drawable="@drawable/ic_menu_savephoto" />
+ <item android:state_enabled="false" android:drawable="@drawable/ic_menu_savephoto_disabled" />
+</selector>
diff --git a/res/layout/crop_actionbar.xml b/res/layout/crop_actionbar.xml
new file mode 100644
index 000000000..1259d3f95
--- /dev/null
+++ b/res/layout/crop_actionbar.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:textAllCaps="true"
+ android:text="@string/crop_save"
+ android:gravity="center_vertical"
+ android:textSize="14sp"
+ android:drawableLeft="@drawable/menu_save_photo"
+ android:drawablePadding="8dip" /> \ No newline at end of file
diff --git a/res/layout/crop_activity.xml b/res/layout/crop_activity.xml
new file mode 100644
index 000000000..a2841e61a
--- /dev/null
+++ b/res/layout/crop_activity.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/mainView">
+
+ <LinearLayout
+ android:id="@+id/mainPanel"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical" >
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1" >
+
+ <com.android.camera.crop.CropView
+ android:id="@+id/cropView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <ProgressBar
+ android:id="@+id/loading"
+ style="@android:style/Widget.Holo.ProgressBar.Large"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:indeterminate="true"
+ android:indeterminateOnly="true"
+ android:background="@android:color/transparent" />
+
+ </FrameLayout>
+
+ </LinearLayout>
+
+</FrameLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 021fc4ee5..eee320339 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -647,4 +647,9 @@ CHAR LIMIT = NONE] -->
<string name="tiny_planet_zoom">Zoom</string>
<!-- Label above a slider that let's the user set the rotation of a tiny planet image. [CHAR LIMIT = 15] -->
<string name="tiny_planet_rotate">Rotate</string>
+
+ <!-- Crop -->
+ <!-- Label for the save button in the crop activity action bar [CHAR LIMIT=20] -->
+ <string name="crop_save">Save</string>
+
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 23a5f5c79..a09bce73f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -30,6 +30,14 @@
<item name="android:actionBarStyle">@style/Holo.ActionBar</item>
</style>
<style name="Theme.CameraBase" parent="android:Theme.Holo"/>
+ <style name="Theme.Crop" parent="Theme.GalleryBase">
+ <item name="android:displayOptions"></item>
+ <item name="android:windowContentOverlay">@null</item>
+ <item name="android:actionBarStyle">@style/Holo.ActionBar</item>
+ <item name="android:colorBackground">@null</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowBackground">@drawable/crop_tiled_background</item>
+ </style>
<style name="Holo.ActionBar" parent="android:Widget.Holo.ActionBar">
<item name="android:displayOptions">useLogo|showHome|homeAsUp</item>
<item name="android:background">@drawable/actionbar_translucent</item>