package com.android.camera;
-import android.app.AlertDialog.Builder;
import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.drawable.Drawable;
import android.preference.ListPreference;
-import android.os.Parcel;
-import android.os.Parcelable;
import android.util.AttributeSet;
/** {@code BooleanListPreference} is used for those {@code SharedPreference}
package com.android.camera;
-import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.preference.ListPreference;
-import android.os.Parcel;
-import android.os.Parcelable;
import android.util.AttributeSet;
public class IconListPreference extends ListPreference {
import com.android.camera.gallery.DrmImageList;
import com.android.camera.gallery.IImage;
import com.android.camera.gallery.IImageList;
-import com.android.camera.gallery.Image;
import com.android.camera.gallery.ImageList;
import com.android.camera.gallery.ImageListUber;
import com.android.camera.gallery.SingleImageList;
import com.android.camera.gallery.VideoObject;
import android.content.ContentResolver;
-import android.content.ContentUris;
import android.content.ContentValues;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.provider.DrmStore;
import android.provider.MediaStore;
import android.provider.MediaStore.Images;
-import android.provider.MediaStore.Images.ImageColumns;
import android.util.Log;
import java.io.File;
import android.graphics.PixelFormat;
import android.os.Handler;
import android.os.Message;
-import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceGroup;
import android.view.WindowManager.LayoutParams;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
-import android.widget.CheckBox;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ListView;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;
-import android.view.View;
import android.view.ViewGroup.LayoutParams;
-import android.view.animation.AlphaAnimation;
-import android.view.animation.Animation;
import android.widget.ImageView;
import java.io.BufferedInputStream;
view.startAnimation(anim);
return anim;
}
-
- public static <T> T checkNotNull(T object) {
- if (object == null) throw new NullPointerException();
- return object;
- }
}
import android.content.ContentResolver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
-import android.media.ThumbnailUtil;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore.Images;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
/**
* Represents a particular image and provides access to the underlying bitmap
mDisplayName = displayName;
}
- protected abstract Bitmap.CompressFormat compressionType();
-
- /**
- * Take a given bitmap and compress it to a file as described
- * by the Uri parameter.
- *
- * @param bitmap the bitmap to be compressed/stored
- * @param uri where to store the bitmap
- * @return true if we succeeded
- */
- protected boolean compressImageToFile(Bitmap bitmap, Uri uri) {
- OutputStream outputStream = null;
- try {
- outputStream = mContentResolver.openOutputStream(uri);
- bitmap.compress(compressionType(), 75, outputStream);
- return true;
- } catch (FileNotFoundException ex) {
- return false;
- } catch (IOException ex) {
- return false;
- } finally {
- Util.closeSilently(outputStream);
- }
- }
-
public String getDataPath() {
return mDataPath;
}
import android.content.ContentResolver;
import android.content.ContentUris;
-import android.content.ContentValues;
import android.database.Cursor;
-import android.graphics.Bitmap;
import android.net.Uri;
-import android.provider.BaseColumns;
-import android.provider.MediaStore.Images.Thumbnails;
import android.util.Log;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
// ((BaseImageList) getContainer()).invalidateCursor();
}
- @Override
- protected Bitmap.CompressFormat compressionType() {
- String mimeType = getMimeType();
- if ("image/png".equals(mimeType)) {
- return Bitmap.CompressFormat.PNG;
- } else if ("image/gif".equals(mimeType)) {
- return Bitmap.CompressFormat.PNG;
- }
- return Bitmap.CompressFormat.JPEG;
- }
-
public boolean isReadonly() {
String mimeType = getMimeType();
return !"image/jpeg".equals(mimeType) && !"image/png".equals(mimeType);
mExif.setAttribute(tag, value);
}
- public void saveImageContents(Bitmap image, String filePath) {
- Uri uri = mContainer.contentUri(mId);
- compressImageToFile(image, uri);
- }
-
private void loadExifData() {
try {
mExif = new ExifInterface(mDataPath);
}
@Override
- protected Bitmap.CompressFormat compressionType() {
- return Bitmap.CompressFormat.JPEG;
- }
-
- @Override
public boolean equals(Object other) {
if (other == null || !(other instanceof VideoObject)) return false;
return fullSizeImageUri().equals(