summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/ActivityBase.java2
-rw-r--r--src/com/android/camera/CameraScreenNail.java19
-rw-r--r--src/com/android/camera/CaptureAnimManager.java22
-rw-r--r--src/com/android/camera/CountDownTimerPreference.java19
-rw-r--r--src/com/android/camera/PhotoMenu.java133
-rw-r--r--src/com/android/camera/PhotoUI.java17
-rw-r--r--src/com/android/camera/ui/CountdownTimerPopup.java (renamed from src/com/android/camera/ui/TimerSettingPopup.java)92
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropActivity.java9
8 files changed, 130 insertions, 183 deletions
diff --git a/src/com/android/camera/ActivityBase.java b/src/com/android/camera/ActivityBase.java
index d2a4be58a..c3cde8bfc 100644
--- a/src/com/android/camera/ActivityBase.java
+++ b/src/com/android/camera/ActivityBase.java
@@ -558,7 +558,7 @@ public abstract class ActivityBase extends AbstractGalleryActivity
public ScreenNail attachScreenNail() {
if (mCameraScreenNail == null) {
if (ApiHelper.HAS_SURFACE_TEXTURE) {
- mCameraScreenNail = new CameraScreenNail(this, getResources());
+ mCameraScreenNail = new CameraScreenNail(this, ActivityBase.this);
} else {
Bitmap b = BitmapFactory.decodeResource(getResources(),
R.drawable.wallpaper_picker_preview);
diff --git a/src/com/android/camera/CameraScreenNail.java b/src/com/android/camera/CameraScreenNail.java
index afa46290d..993a7d336 100644
--- a/src/com/android/camera/CameraScreenNail.java
+++ b/src/com/android/camera/CameraScreenNail.java
@@ -17,7 +17,7 @@
package com.android.camera;
import android.annotation.TargetApi;
-import android.content.res.Resources;
+import android.content.Context;
import android.graphics.SurfaceTexture;
import android.opengl.Matrix;
import android.util.Log;
@@ -58,7 +58,7 @@ public class CameraScreenNail extends SurfaceTextureScreenNail {
private final float[] mTextureTransformMatrix = new float[16];
// Animation.
- private CaptureAnimManager mCaptureAnimManager = new CaptureAnimManager();
+ private CaptureAnimManager mCaptureAnimManager;
private SwitchAnimManager mSwitchAnimManager = new SwitchAnimManager();
private int mAnimState = ANIM_NONE;
private RawTexture mAnimTexture;
@@ -120,9 +120,9 @@ public class CameraScreenNail extends SurfaceTextureScreenNail {
RawTexture copyToTexture(GLCanvas c, RawTexture texture, int width, int height);
}
- public CameraScreenNail(Listener listener, Resources res) {
+ public CameraScreenNail(Listener listener, Context ctx) {
mListener = listener;
- mCaptureAnimManager.setResources(res);
+ mCaptureAnimManager = new CaptureAnimManager(ctx);
}
public void setFullScreen(boolean full) {
@@ -293,15 +293,6 @@ public class CameraScreenNail extends SurfaceTextureScreenNail {
public void animateSlide() {
synchronized (mLock) {
- // Ignore the case where animateFlash is skipped but animateSlide is called
- // e.g. Double tap shutter and immediately swipe to gallery, and quickly swipe back
- // to camera. This case only happens in monkey tests, not applicable to normal
- // human beings.
- if (mAnimState != ANIM_CAPTURE_RUNNING) {
- Log.v(TAG, "Cannot animateSlide outside of animateCapture!"
- + " Animation state = " + mAnimState);
- return;
- }
mCaptureAnimManager.animateSlide();
mListener.requestRender();
}
@@ -384,7 +375,7 @@ public class CameraScreenNail extends SurfaceTextureScreenNail {
case ANIM_CAPTURE_START:
copyPreviewTexture(canvas);
mListener.onCaptureTextureCopied();
- mCaptureAnimManager.startAnimation(x, y, width, height);
+ mCaptureAnimManager.startAnimation();
mAnimState = ANIM_CAPTURE_RUNNING;
break;
}
diff --git a/src/com/android/camera/CaptureAnimManager.java b/src/com/android/camera/CaptureAnimManager.java
index f6e112d7e..6e8092566 100644
--- a/src/com/android/camera/CaptureAnimManager.java
+++ b/src/com/android/camera/CaptureAnimManager.java
@@ -16,6 +16,7 @@
package com.android.camera;
+import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.SystemClock;
@@ -24,6 +25,7 @@ import android.view.animation.Interpolator;
import com.android.gallery3d.R;
import com.android.gallery3d.glrenderer.GLCanvas;
+import com.android.gallery3d.glrenderer.NinePatchTexture;
import com.android.gallery3d.glrenderer.RawTexture;
/**
@@ -66,6 +68,8 @@ public class CaptureAnimManager {
private int mMarginTop;
private int mSize;
private Resources mResources;
+ private NinePatchTexture mBorder;
+ private int mShadowSize;
public static int getAnimationDuration() {
return TIME_SLIDE2;
@@ -74,12 +78,9 @@ public class CaptureAnimManager {
/* preview: camera preview view.
* review: view of picture just taken.
*/
- public CaptureAnimManager() {
-
- }
-
- public void setResources(Resources res) {
- mResources = res;
+ public CaptureAnimManager(Context ctx) {
+ mBorder = new NinePatchTexture(ctx, R.drawable.capture_thumbnail_shadow);
+ mResources = ctx.getResources();
}
public void setOrientation(int displayRotation) {
@@ -102,16 +103,15 @@ public class CaptureAnimManager {
mAnimType = ANIM_BOTH;
}
- // x, y, w and h: the rectangle area where the animation takes place.
- public void startAnimation(int x, int y, int w, int h) {
+ public void startAnimation() {
mAnimStartTime = SystemClock.uptimeMillis();
- setAnimationGeometry(x, y, w, h);
}
private void setAnimationGeometry(int x, int y, int w, int h) {
mMarginRight = mResources.getDimensionPixelSize(R.dimen.capture_margin_right);
mMarginTop = mResources.getDimensionPixelSize(R.dimen.capture_margin_top);
mSize = mResources.getDimensionPixelSize(R.dimen.capture_size);
+ mShadowSize = mResources.getDimensionPixelSize(R.dimen.capture_border);
mOffset = mMarginRight + mSize;
// Set the views to the initial positions.
mDrawWidth = w;
@@ -192,6 +192,8 @@ public class CaptureAnimManager {
} else if (animStep == ANIM_HOLD2) {
preview.directDraw(canvas, (int) mX, (int) mY, mDrawWidth, mDrawHeight);
review.draw(canvas, mHoldX, mHoldY, mHoldW, mHoldH);
+ mBorder.draw(canvas, (int) mHoldX - mShadowSize, (int) mHoldY - mShadowSize,
+ (int) mHoldW + 2 * mShadowSize, (int) mHoldH + 2 * mShadowSize);
} else if (animStep == ANIM_SLIDE2) {
float fraction = (float)(timeDiff) / (TIME_SLIDE2 - TIME_HOLD2);
float x = mHoldX;
@@ -212,6 +214,8 @@ public class CaptureAnimManager {
break;
}
preview.directDraw(canvas, (int) mX, (int) mY, mDrawWidth, mDrawHeight);
+ mBorder.draw(canvas, (int) x - mShadowSize, (int) y - mShadowSize,
+ (int) mHoldW + 2 * mShadowSize, (int) mHoldH + 2 * mShadowSize);
review.draw(canvas, (int) x, (int) y, mHoldW, mHoldH);
}
return true;
diff --git a/src/com/android/camera/CountDownTimerPreference.java b/src/com/android/camera/CountDownTimerPreference.java
index 0bbf6bc9d..9c66dda8c 100644
--- a/src/com/android/camera/CountDownTimerPreference.java
+++ b/src/com/android/camera/CountDownTimerPreference.java
@@ -21,25 +21,20 @@ import android.util.AttributeSet;
import com.android.gallery3d.R;
-import java.util.List;
-
-/* CountDownTimerPreference generates entries (i.e. what users see in the UI),
- * and entry values (the actual value recorded in preference) in
- * initCountDownTimeChoices(Context context), rather than reading the entries
- * from a predefined list. When the entry values are a continuous list of numbers,
- * (e.g. 0-60), it is more efficient to auto generate the list than to predefine it.*/
public class CountDownTimerPreference extends ListPreference {
- private final static int MAX_DURATION = 60;
+ private static final int[] DURATIONS = {
+ 0, 1, 2, 3, 4, 5, 10, 15, 20, 30, 60
+ };
public CountDownTimerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
initCountDownDurationChoices(context);
}
private void initCountDownDurationChoices(Context context) {
- CharSequence[] entryValues = new CharSequence[MAX_DURATION + 1];
- CharSequence[] entries = new CharSequence[MAX_DURATION + 1];
- for (int i = 0; i <= MAX_DURATION; i++) {
- entryValues[i] = Integer.toString(i);
+ CharSequence[] entryValues = new CharSequence[DURATIONS.length];
+ CharSequence[] entries = new CharSequence[DURATIONS.length];
+ for (int i = 0; i < DURATIONS.length; i++) {
+ entryValues[i] = Integer.toString(DURATIONS[i]);
if (i == 0) {
entries[0] = context.getString(R.string.setting_off); // Off
} else {
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index f29ed4a8b..d0f21ed68 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -16,34 +16,28 @@
package com.android.camera;
-import android.content.Context;
import android.content.res.Resources;
import android.hardware.Camera.Parameters;
-import android.view.LayoutInflater;
import com.android.camera.ui.AbstractSettingPopup;
+import com.android.camera.ui.CountdownTimerPopup;
import com.android.camera.ui.ListPrefSettingPopup;
-import com.android.camera.ui.MoreSettingPopup;
import com.android.camera.ui.PieItem;
import com.android.camera.ui.PieItem.OnClickListener;
import com.android.camera.ui.PieRenderer;
-import com.android.camera.ui.TimerSettingPopup;
import com.android.gallery3d.R;
+import java.util.Locale;
+
public class PhotoMenu extends PieController
- implements MoreSettingPopup.Listener,
- TimerSettingPopup.Listener,
+ implements CountdownTimerPopup.Listener,
ListPrefSettingPopup.Listener {
private static String TAG = "CAM_photomenu";
private final String mSettingOff;
private PhotoUI mUI;
- private String[] mOtherKeys;
- // First level popup
- private MoreSettingPopup mPopup;
- // Second level popup
- private AbstractSettingPopup mSecondPopup;
+ private AbstractSettingPopup mPopup;
private CameraActivity mActivity;
public PhotoMenu(CameraActivity activity, PhotoUI ui, PieRenderer pie) {
@@ -56,9 +50,9 @@ public class PhotoMenu extends PieController
public void initialize(PreferenceGroup group) {
super.initialize(group);
mPopup = null;
- mSecondPopup = null;
PieItem item = null;
final Resources res = mActivity.getResources();
+ Locale locale = res.getConfiguration().locale;
// the order is from left to right in the menu
// hdr
@@ -108,22 +102,42 @@ public class PhotoMenu extends PieController
if (group.findPreference(CameraSettings.KEY_RECORD_LOCATION) != null) {
item = makeSwitchItem(CameraSettings.KEY_RECORD_LOCATION, true);
more.addItem(item);
+ if (mActivity.isSecureCamera()) {
+ // Prevent location preference from getting changed in secure camera mode
+ item.setEnabled(false);
+ }
}
- // settings popup
- mOtherKeys = new String[] {
- CameraSettings.KEY_PICTURE_SIZE,
- CameraSettings.KEY_FOCUS_MODE,
- CameraSettings.KEY_TIMER,
- CameraSettings.KEY_TIMER_SOUND_EFFECTS,
- };
- item = makeItem(R.drawable.ic_settings_holo_light);
- item.setLabel(res.getString(R.string.camera_menu_settings_label));
+ // countdown timer
+ final ListPreference ctpref = group.findPreference(CameraSettings.KEY_TIMER);
+ final ListPreference beeppref = group.findPreference(CameraSettings.KEY_TIMER_SOUND_EFFECTS);
+ item = makeItem(R.drawable.ic_timer);
+ item.setLabel(res.getString(R.string.pref_camera_timer_title).toUpperCase(locale));
item.setOnClickListener(new OnClickListener() {
@Override
public void onClick(PieItem item) {
- if (mPopup == null) {
- initializePopup();
- }
+ CountdownTimerPopup timerPopup = (CountdownTimerPopup) mActivity.getLayoutInflater().inflate(
+ R.layout.countdown_setting_popup, null, false);
+ timerPopup.initialize(ctpref, beeppref);
+ timerPopup.setSettingChangedListener(PhotoMenu.this);
+ mUI.dismissPopup();
+ mPopup = timerPopup;
+ mUI.showPopup(mPopup);
+ }
+ });
+ more.addItem(item);
+ // image size
+ item = makeItem(R.drawable.ic_imagesize);
+ final ListPreference sizePref = group.findPreference(CameraSettings.KEY_PICTURE_SIZE);
+ item.setLabel(res.getString(R.string.pref_camera_picturesize_title).toUpperCase(locale));
+ item.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(PieItem item) {
+ ListPrefSettingPopup popup = (ListPrefSettingPopup) mActivity.getLayoutInflater().inflate(
+ R.layout.list_pref_setting_popup, null, false);
+ popup.initialize(sizePref);
+ popup.setSettingChangedListener(PhotoMenu.this);
+ mUI.dismissPopup();
+ mPopup = popup;
mUI.showPopup(mPopup);
}
});
@@ -145,50 +159,18 @@ public class PhotoMenu extends PieController
}
@Override
- public void reloadPreferences() {
- super.reloadPreferences();
- if (mPopup != null) {
- mPopup.reloadPreference();
- }
- }
-
- @Override
- // Hit when an item in the second-level popup gets selected
+ // Hit when an item in a popup gets selected
public void onListPrefChanged(ListPreference pref) {
- if (mPopup != null && mSecondPopup != null) {
- mUI.dismissPopup(true);
- mPopup.reloadPreference();
+ if (mPopup != null) {
+ mUI.dismissPopup();
}
onSettingChanged(pref);
}
- @Override
- public void overrideSettings(final String ... keyvalues) {
- super.overrideSettings(keyvalues);
- if (mPopup == null) initializePopup();
- mPopup.overrideSettings(keyvalues);
- }
-
- protected void initializePopup() {
- LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
-
- MoreSettingPopup popup = (MoreSettingPopup) inflater.inflate(
- R.layout.more_setting_popup, null, false);
- popup.setSettingChangedListener(this);
- popup.initialize(mPreferenceGroup, mOtherKeys);
- if (mActivity.isSecureCamera()) {
- // Prevent location preference from getting changed in secure camera mode
- popup.setPreferenceEnabled(CameraSettings.KEY_RECORD_LOCATION, false);
- }
- mPopup = popup;
- }
-
- public void popupDismissed(boolean topPopupOnly) {
- // if the 2nd level popup gets dismissed
- if (mSecondPopup != null) {
- mSecondPopup = null;
- if (topPopupOnly) mUI.showPopup(mPopup);
+ public void popupDismissed() {
+ // the popup gets dismissed
+ if (mPopup != null) {
+ mPopup = null;
}
}
@@ -217,29 +199,4 @@ public class PhotoMenu extends PieController
super.onSettingChanged(pref);
}
- @Override
- // Hit when an item in the first-level popup gets selected, then bring up
- // the second-level popup
- public void onPreferenceClicked(ListPreference pref) {
- if (mSecondPopup != null) return;
-
- LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- if (CameraSettings.KEY_TIMER.equals(pref.getKey())) {
- TimerSettingPopup timerPopup = (TimerSettingPopup) inflater.inflate(
- R.layout.timer_setting_popup, null, false);
- timerPopup.initialize(pref);
- timerPopup.setSettingChangedListener(this);
- mUI.dismissPopup(true);
- mSecondPopup = timerPopup;
- } else {
- ListPrefSettingPopup basic = (ListPrefSettingPopup) inflater.inflate(
- R.layout.list_pref_setting_popup, null, false);
- basic.initialize(pref);
- basic.setSettingChangedListener(this);
- mUI.dismissPopup(true);
- mSecondPopup = basic;
- }
- mUI.showPopup(mSecondPopup);
- }
}
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 5475b98f6..3a2c6ecfd 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -357,7 +357,7 @@ public class PhotoUI implements PieListener,
mFaceView.setBlockDraw(!full);
}
if (mPopup != null) {
- dismissPopup(false, full);
+ dismissPopup(full);
}
if (mGestures != null) {
mGestures.setEnabled(full);
@@ -389,7 +389,7 @@ public class PhotoUI implements PieListener,
public boolean removeTopLevelPopup() {
// Remove the top level popup or dialog box and return true if there's any
if (mPopup != null) {
- dismissPopup(true);
+ dismissPopup();
return true;
}
return false;
@@ -408,11 +408,11 @@ public class PhotoUI implements PieListener,
mGestures.addTouchReceiver(mPopup);
}
- public void dismissPopup(boolean topPopupOnly) {
- dismissPopup(topPopupOnly, true);
+ public void dismissPopup() {
+ dismissPopup(true);
}
- private void dismissPopup(boolean topOnly, boolean fullScreen) {
+ private void dismissPopup(boolean fullScreen) {
if (fullScreen) {
mActivity.showUI();
mBlocker.setVisibility(View.VISIBLE);
@@ -423,7 +423,7 @@ public class PhotoUI implements PieListener,
((FrameLayout) mRootView).removeView(mPopup);
mPopup = null;
}
- mMenu.popupDismissed(topOnly);
+ mMenu.popupDismissed();
}
public void onShowSwitcherPopup() {
@@ -445,9 +445,10 @@ public class PhotoUI implements PieListener,
// Remove all the popups/dialog boxes
boolean ret = false;
if (mPopup != null) {
- dismissPopup(false);
+ dismissPopup();
ret = true;
}
+ onShowSwitcherPopup();
return ret;
}
@@ -508,7 +509,7 @@ public class PhotoUI implements PieListener,
@Override
public void onPieOpened(int centerX, int centerY) {
- dismissPopup(false);
+ dismissPopup();
mActivity.cancelActivityTouchHandling();
mActivity.setSwipingEnabled(false);
if (mFaceView != null) {
diff --git a/src/com/android/camera/ui/TimerSettingPopup.java b/src/com/android/camera/ui/CountdownTimerPopup.java
index 983c7f21b..7c3572b55 100644
--- a/src/com/android/camera/ui/TimerSettingPopup.java
+++ b/src/com/android/camera/ui/CountdownTimerPopup.java
@@ -16,37 +16,35 @@
package com.android.camera.ui;
-import java.util.Locale;
-
import android.content.Context;
-import android.content.res.Resources;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.Button;
-import android.widget.CompoundButton;
+import android.widget.CheckBox;
import android.widget.NumberPicker;
-import android.widget.Switch;
-import android.widget.TextView;
+import android.widget.NumberPicker.OnValueChangeListener;
import com.android.camera.ListPreference;
import com.android.gallery3d.R;
+import java.util.Locale;
+
/**
- * This is a popup window that allows users to turn on/off time lapse feature,
- * and to select a time interval for taking a time lapse video.
+ * This is a popup window that allows users to specify a countdown timer
*/
-public class TimerSettingPopup extends AbstractSettingPopup {
+public class CountdownTimerPopup extends AbstractSettingPopup {
private static final String TAG = "TimerSettingPopup";
private NumberPicker mNumberSpinner;
- private Switch mTimerSwitch;
private String[] mDurations;
- private ListPreference mPreference;
+ private ListPreference mTimer;
+ private ListPreference mBeep;
private Listener mListener;
private Button mConfirmButton;
- private TextView mHelpText;
- private View mTimePicker;
+ private View mPickerTitle;
+ private CheckBox mTimerSound;
+ private View mSoundTitle;
static public interface Listener {
public void onListPrefChanged(ListPreference pref);
@@ -56,65 +54,62 @@ public class TimerSettingPopup extends AbstractSettingPopup {
mListener = listener;
}
- public TimerSettingPopup(Context context, AttributeSet attrs) {
+ public CountdownTimerPopup(Context context, AttributeSet attrs) {
super(context, attrs);
}
- public void initialize(ListPreference preference) {
- mPreference = preference;
-
+ public void initialize(ListPreference timer, ListPreference beep) {
+ mTimer = timer;
+ mBeep = beep;
// Set title.
- mTitle.setText(mPreference.getTitle());
+ mTitle.setText(mTimer.getTitle());
// Duration
- CharSequence[] entries = mPreference.getEntryValues();
- mDurations = new String[entries.length - 1];
+ CharSequence[] entries = mTimer.getEntryValues();
+ mDurations = new String[entries.length];
Locale locale = getResources().getConfiguration().locale;
+ mDurations[0] = getResources().getString(R.string.setting_off); // Off
for (int i = 1; i < entries.length; i++)
- mDurations[i-1] = String.format(locale, "%d",
- Integer.parseInt(entries[i].toString()));
+ mDurations[i] = String.format(locale, "%d", Integer.parseInt(entries[i].toString()));
int durationCount = mDurations.length;
mNumberSpinner = (NumberPicker) findViewById(R.id.duration);
mNumberSpinner.setMinValue(0);
mNumberSpinner.setMaxValue(durationCount - 1);
mNumberSpinner.setDisplayedValues(mDurations);
mNumberSpinner.setWrapSelectorWheel(false);
-
- mTimerSwitch = (Switch) findViewById(R.id.timer_setting_switch);
- mHelpText = (TextView) findViewById(R.id.set_timer_help_text);
+ mNumberSpinner.setOnValueChangedListener(new OnValueChangeListener() {
+ @Override
+ public void onValueChange(NumberPicker picker, int oldValue, int newValue) {
+ setTimeSelectionEnabled(newValue != 0);
+ }
+ });
mConfirmButton = (Button) findViewById(R.id.timer_set_button);
- mTimePicker = findViewById(R.id.time_duration_picker);
+ mPickerTitle = findViewById(R.id.set_time_interval_title);
// Disable focus on the spinners to prevent keyboard from coming up
mNumberSpinner.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
- mTimerSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- setTimeSelectionEnabled(isChecked);
- }
- });
mConfirmButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
updateInputState();
}
});
+ mTimerSound = (CheckBox) findViewById(R.id.sound_check_box);
+ mSoundTitle = findViewById(R.id.beep_title);
}
private void restoreSetting() {
- int index = mPreference.findIndexOfValue(mPreference.getValue());
+ int index = mTimer.findIndexOfValue(mTimer.getValue());
if (index == -1) {
Log.e(TAG, "Invalid preference value.");
- mPreference.print();
+ mTimer.print();
throw new IllegalArgumentException();
- } else if (index == 0) {
- // default choice: time lapse off
- mTimerSwitch.setChecked(false);
- setTimeSelectionEnabled(false);
} else {
- mTimerSwitch.setChecked(true);
- setTimeSelectionEnabled(true);
- mNumberSpinner.setValue(index - 1);
+ setTimeSelectionEnabled(index != 0);
+ mNumberSpinner.setValue(index);
}
+ boolean checked = mBeep.findIndexOfValue(mBeep.getValue()) != 0;
+ mTimerSound.setChecked(checked);
}
@Override
@@ -130,8 +125,9 @@ public class TimerSettingPopup extends AbstractSettingPopup {
}
protected void setTimeSelectionEnabled(boolean enabled) {
- mHelpText.setVisibility(enabled ? GONE : VISIBLE);
- mTimePicker.setVisibility(enabled ? VISIBLE : GONE);
+ mPickerTitle.setVisibility(enabled ? VISIBLE : INVISIBLE);
+ mTimerSound.setEnabled(enabled);
+ mSoundTitle.setEnabled(enabled);
}
@Override
@@ -139,15 +135,11 @@ public class TimerSettingPopup extends AbstractSettingPopup {
}
private void updateInputState() {
- if (mTimerSwitch.isChecked()) {
- int newId = mNumberSpinner.getValue() + 1;
- mPreference.setValueIndex(newId);
- } else {
- mPreference.setValueIndex(0);
- }
-
+ mTimer.setValueIndex(mNumberSpinner.getValue());
+ mBeep.setValueIndex(mTimerSound.isChecked() ? 1 : 0);
if (mListener != null) {
- mListener.onListPrefChanged(mPreference);
+ mListener.onListPrefChanged(mTimer);
+ mListener.onListPrefChanged(mBeep);
}
}
}
diff --git a/src/com/android/gallery3d/filtershow/crop/CropActivity.java b/src/com/android/gallery3d/filtershow/crop/CropActivity.java
index 0558e4a7e..fcbf7bb50 100644
--- a/src/com/android/gallery3d/filtershow/crop/CropActivity.java
+++ b/src/com/android/gallery3d/filtershow/crop/CropActivity.java
@@ -73,7 +73,14 @@ public class CropActivity extends Activity {
private static final int SELECT_PICTURE = 1; // request code for picker
private static final int DEFAULT_COMPRESS_QUALITY = 90;
- public static final int MAX_BMAP_IN_INTENT = 990000;
+ /**
+ * The maximum bitmap size we allow to be returned through the intent.
+ * Intents have a maximum of 1MB in total size. However, the Bitmap seems to
+ * have some overhead to hit so that we go way below the limit here to make
+ * sure the intent stays below 1MB.We should consider just returning a byte
+ * array instead of a Bitmap instance to avoid overhead.
+ */
+ public static final int MAX_BMAP_IN_INTENT = 750000;
// Flags
private static final int DO_SET_WALLPAPER = 1;