Loading AndroidManifest.xml +5 −4 Original line number Diff line number Diff line Loading @@ -204,12 +204,13 @@ <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <uses-library android:name="com.google.android.media.effects" android:required="false" /> <activity android:name="com.android.gallery3d.app.SlideshowDream" android:label="@string/slideshow_dream_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" > android:hardwareAccelerated="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> Loading res/drawable/photoeditor_effect_facelift.png 0 → 100644 +1.76 KiB Loading image diff... res/layout/photoeditor_effects_fix.xml +10 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,16 @@ android:text="@string/redeye" style="@style/EffectLabel"/> </com.android.gallery3d.photoeditor.actions.RedEyeAction> <com.android.gallery3d.photoeditor.actions.FaceliftAction style="@style/Effect"> <ImageButton android:id="@+id/effect_button" style="@style/EffectIcon" android:src="@drawable/photoeditor_effect_facelift"/> <TextView android:id="@+id/effect_label" android:text="@string/facelift" style="@style/EffectLabel"/> </com.android.gallery3d.photoeditor.actions.FaceliftAction> <com.android.gallery3d.photoeditor.actions.StraightenAction style="@style/Effect" android:tag="@string/straighten_tooltip"> <ImageButton Loading res/values/photoeditor_strings.xml +6 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,12 @@ <!-- Name for the photo effect that makes photo only two color tones. [CHAR LIMIT=15] --> <string name="duotone">Duo-tone</string> <!-- Name for the photo effect that smooths facial skins. [CHAR LIMIT=15] --> <string name="facelift">Face Glow</string> <!-- Name for the photo effect that tans facial skins. [CHAR LIMIT=15] --> <string name="facetan">Face Tan</string> <!-- Name for the photo effect that fills back-light. [CHAR LIMIT=15] --> <string name="filllight">Fill Light</string> Loading src/com/android/gallery3d/photoeditor/actions/FaceliftAction.java 0 → 100644 +62 −0 Original line number Diff line number Diff line /* * 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.photoeditor.actions; import android.content.Context; import android.util.AttributeSet; import com.android.gallery3d.photoeditor.filters.FaceliftFilter; /** * An action handling facelift effect. */ public class FaceliftAction extends EffectAction { private static final float DEFAULT_SCALE = 0.5f; private ScaleSeekBar scalePicker; public FaceliftAction(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void doBegin() { final FaceliftFilter filter = new FaceliftFilter(); scalePicker = factory.createScalePicker(EffectToolFactory.ScalePickerType.GENERIC); scalePicker.setOnScaleChangeListener(new ScaleSeekBar.OnScaleChangeListener() { @Override public void onProgressChanged(float progress, boolean fromUser) { if (fromUser) { filter.setScale(progress); notifyFilterChanged(filter, true); } } }); scalePicker.setProgress(DEFAULT_SCALE); filter.setScale(DEFAULT_SCALE); notifyFilterChanged(filter, true); } @Override public void doEnd() { scalePicker.setOnScaleChangeListener(null); } } Loading
AndroidManifest.xml +5 −4 Original line number Diff line number Diff line Loading @@ -204,12 +204,13 @@ <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <uses-library android:name="com.google.android.media.effects" android:required="false" /> <activity android:name="com.android.gallery3d.app.SlideshowDream" android:label="@string/slideshow_dream_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" > android:hardwareAccelerated="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> Loading
res/layout/photoeditor_effects_fix.xml +10 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,16 @@ android:text="@string/redeye" style="@style/EffectLabel"/> </com.android.gallery3d.photoeditor.actions.RedEyeAction> <com.android.gallery3d.photoeditor.actions.FaceliftAction style="@style/Effect"> <ImageButton android:id="@+id/effect_button" style="@style/EffectIcon" android:src="@drawable/photoeditor_effect_facelift"/> <TextView android:id="@+id/effect_label" android:text="@string/facelift" style="@style/EffectLabel"/> </com.android.gallery3d.photoeditor.actions.FaceliftAction> <com.android.gallery3d.photoeditor.actions.StraightenAction style="@style/Effect" android:tag="@string/straighten_tooltip"> <ImageButton Loading
res/values/photoeditor_strings.xml +6 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,12 @@ <!-- Name for the photo effect that makes photo only two color tones. [CHAR LIMIT=15] --> <string name="duotone">Duo-tone</string> <!-- Name for the photo effect that smooths facial skins. [CHAR LIMIT=15] --> <string name="facelift">Face Glow</string> <!-- Name for the photo effect that tans facial skins. [CHAR LIMIT=15] --> <string name="facetan">Face Tan</string> <!-- Name for the photo effect that fills back-light. [CHAR LIMIT=15] --> <string name="filllight">Fill Light</string> Loading
src/com/android/gallery3d/photoeditor/actions/FaceliftAction.java 0 → 100644 +62 −0 Original line number Diff line number Diff line /* * 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.photoeditor.actions; import android.content.Context; import android.util.AttributeSet; import com.android.gallery3d.photoeditor.filters.FaceliftFilter; /** * An action handling facelift effect. */ public class FaceliftAction extends EffectAction { private static final float DEFAULT_SCALE = 0.5f; private ScaleSeekBar scalePicker; public FaceliftAction(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void doBegin() { final FaceliftFilter filter = new FaceliftFilter(); scalePicker = factory.createScalePicker(EffectToolFactory.ScalePickerType.GENERIC); scalePicker.setOnScaleChangeListener(new ScaleSeekBar.OnScaleChangeListener() { @Override public void onProgressChanged(float progress, boolean fromUser) { if (fromUser) { filter.setScale(progress); notifyFilterChanged(filter, true); } } }); scalePicker.setProgress(DEFAULT_SCALE); filter.setScale(DEFAULT_SCALE); notifyFilterChanged(filter, true); } @Override public void doEnd() { scalePicker.setOnScaleChangeListener(null); } }