package com.worldchip.apk;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.Buffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Matrix;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Display;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.Toast;
public class ImageGalleryView extends Activity{
private static final String TAG = "ImageGalleryView";
private static final String PREF_SLIDESHOW_REPEAT =
"pref_gallery_slideshow_repeat_key";
Gallery gallery=null;
Animation anim=null;
String[] paths=null;
List<String> mImagePathList;
private ImageGetter mGetter;
private final Random mRandom = new Random(System.currentTimeMillis());
boolean mPaused = true;
private boolean mSlideShowLoop = false;
private int mSlideShowInterval=1000;
private int mLastSlideShowImage;
int mCurrentPosition = 0;
// represents which style animation to use
private int mAnimationIndex;
private Animation [] mSlideShowInAnimation;
private Animation [] mSlideShowOutAnimation;
private SharedPreferences mPrefs;
// Choices for what adjacents to load.
private static final int[] sOrderAdjacents = new int[] {0, 1, -1};
private static final int[] sOrderSlideshow = new int[] {0};
GestureDetector mGestureDetector;
final GetterHandler mHandler = new GetterHandler();
static final int MODE_NORMAL = 1;
static final int MODE_SLIDESHOW = 2;
private int mMode = MODE_NORMAL;
// The image view displayed for normal mode.
private ImageViewTouch mCurrentImageView;
private Button mSaveConfirm;
private Button mSaveCancel;
// This is the cache for thumbnail bitmaps.
private BitmapCache mCache;
String path=null;
GalleryAdapter galleryAdapter=null;
private float scaleWidth=1, scaleHeight=1;
private int mSlideShowImageCurrent = 0;
private final ImageViewTouchBase [] mSlideShowImageViews =
new ImageViewTouchBase[2];
private Bitmap currentBitmap;
private Bitmap effectsBitmap;
private String currentPath;
private int currentPosition;
private int displayWidth, displayHeight;
//FLING PARMS
public static final int FLING_MIN_DISTANCE=100;
public static final int FLING_MIN_VELOCITY=200;
//Menu
public static final int ANIMATION = Menu.FIRST;
public static final int ROTATE = Menu.FIRST+1;
public static final int THUMBNAIL = Menu.FIRST+2;
public static final int SETUPFOR = Menu.FIRST+5;
public static final int DELETE = Menu.FIRST+6;
public static final int DETAILS = Menu.FIRST+3;
public static final int QUITE = Menu.FIRST+4;
public static final int EFFECTS = Menu.FIRST+7;
private void setupOnTouchListeners(View rootView) {
mGestureDetector = new GestureDetector(this, new MyGestureListener());
OnTouchListener rootListener = new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
mGestureDetector.onTouchEvent(event);
// We do not use the return value of
// mGestureDetector.onTouchEvent because we will not receive
// the "up" event if we return false for the "down" event.
return true;
}
};
rootView.setOnTouchListener(rootListener);
}
private class MyGestureListener extends
GestureDetector.SimpleOnGestureListener {
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY) {
//if (mPaused) return false;
ImageViewTouch imageView = mCurrentImageView;
if (imageView.getScale() > 1F) {
imageView.postTranslateCenter(-distanceX, -distanceY);
}
return true;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
// TODO Auto-generated method stub
if((e1.getX()-e2.getX()>FLING_MIN_DISTANCE)&&
Math.abs(velocityX)>FLING_MIN_VELOCITY)
{
moveNextOrPrevious(1);
}
else if((e2.getX()-e1.getX()>FLING_MIN_DISTANCE)&&
Math.abs(velocityX)>FLING_MIN_VELOCITY)
{
moveNextOrPrevious(-1);
}
return super.onFling(e1, e2, velocityX, velocityY);
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
//if (mPaused) return false;
//setMode(MODE_NORMAL);
//openOptionsMenu();
return true;
}
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
//if (mPaused) return false;
//showOnScreenControls();
//scheduleDismissOnScreenControls();
setMode(MODE_NORMAL);
openOptionsMenu();
return true;
}
@Override
public boolean onDown(MotionEvent e) {
// TODO Auto-generated method stub
return super.onDown(e);
}
@Override
public boolean onDoubleTap(MotionEvent e) {
//if (mPaused) return false;
ImageViewTouch imageView = mCurrentImageView;
// Switch between the original scale and 3x scale.
if (imageView.getScale() > 2F) {
mCurrentImageView.zoomTo(1f);
} else {
mCurrentImageView.zoomToPoint(3f, e.getX(), e.getY());
}
return true;
}
}
private Animation makeInAnimation(int id) {
Animation inAnimation = AnimationUtils.loadAnimation(this, id);
return inAnimation;
}
private Animation makeOutAnimation(int id) {
Animation outAnimation = AnimationUtils.loadAnimation(this, id);
return outAnimation;
}
private static int getPreferencesInteger(
SharedPreferences prefs, String key, int defaultValue) {
String value = prefs.getString(key, null);
try {
return value == null ? defaultValue : Integer.parseInt(value);
} catch (NumberFormatException ex) {
Log.e(TAG, "couldn't parse preference: " + value, ex);
return defaultValue;
}
}
void setMode(int mode) {
if (mMode == mode) {
return;
}
View slideshowPanel = findViewById(R.id.slideShowContainer);
View normalPanel = findViewById(R.id.abs);
Window win = getWindow();
mMode = mode;
if (mo
没有合适的资源?快使用搜索试试~ 我知道了~
源码 图片浏览器完整无BUG.rar
共130个文件
png:52个
xml:36个
java:32个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 184 浏览量
2023-03-27
07:39:01
上传
评论
收藏 227KB RAR 举报
温馨提示
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,本人不对所涉及的版权问题或内容负法律责任。如有侵权,请举报或通知本人删除。
资源推荐
资源详情
资源评论
收起资源包目录
源码 图片浏览器完整无BUG.rar (130个子文件)
proguard.cfg 1KB
.classpath 289B
ImageGalleryView.java 45KB
ImageManager.java 17KB
Util.java 14KB
ImageListView.java 13KB
ImageViewTouchBase.java 13KB
JoyImageViewActivity.java 11KB
ImageGetter.java 10KB
ImageListUber.java 10KB
BaseImageList.java 8KB
ImageCommon.java 7KB
R.java 7KB
DBAdapter.java 7KB
BitmapManager.java 6KB
BaseImage.java 5KB
UriImage.java 5KB
Image.java 5KB
ImageList.java 5KB
ImageGridView.java 4KB
ImageViewMain.java 4KB
GridViewAdapter.java 3KB
SaveingImageService.java 3KB
ListAdapter.java 3KB
ListViewAdapter.java 3KB
IImage.java 3KB
RotateBitmap.java 3KB
GalleryAdapter.java 2KB
LruCache.java 2KB
IImageList.java 2KB
Common.java 2KB
SingleImageList.java 2KB
USBDisconnectReceiver.java 786B
ImageInfo.java 322B
bk2.jpg 13KB
bk2.jpg 13KB
bk2.jpg 13KB
read_me.md 449B
read_me.md 449B
icon.png 5KB
icon.png 5KB
icon.png 5KB
icon.png 5KB
serach.png 4KB
serach.png 4KB
serach.png 4KB
usbhost.png 3KB
sdcard.png 3KB
usbhost.png 3KB
intenal.png 2KB
intenal.png 2KB
start.png 2KB
start.png 2KB
start.png 2KB
rotate.png 2KB
rotate.png 2KB
rotate.png 2KB
setupfor.png 1KB
setupfor.png 1KB
setupfor.png 1KB
pause.png 1KB
pause.png 1KB
pause.png 1KB
rotateright.png 1KB
rotateright.png 1KB
rotateright.png 1KB
sdcard.png 1KB
sdcard.png 1KB
rotateleft.png 1KB
rotateleft.png 1KB
rotateleft.png 1KB
details.png 1KB
details.png 1KB
details.png 1KB
rotate2.png 1KB
rotate2.png 1KB
rotate2.png 1KB
backto.png 1KB
backto.png 1KB
backto.png 1KB
switchfor.png 1KB
switchfor.png 1KB
intenal.png 1KB
intenal_bk.png 1KB
intenal_bk.png 1KB
delete.png 1KB
delete.png 1KB
delete.png 1KB
thumb.png 953B
thumb.png 953B
thumb.png 953B
org.eclipse.jdt.core.prefs 203B
.project 848B
default.properties 362B
strings.xml 3KB
strings.xml 3KB
gallery_view_bk.xml 2KB
AndroidManifest.xml 2KB
bounce_in.xml 2KB
bounce_out.xml 2KB
共 130 条
- 1
- 2
资源评论
荣华富贵8
- 粉丝: 215
- 资源: 7653
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功