在JB2版本上,在camera中拍照/录像,后点击右下角缩略图/向左滑动来查看图片/视频,当点击“删除”menu来删除所有的image/video后,camera preview只显示在屏幕左边约四分之一的地方,向右滑动后进入camera preview界面。如何在通过“删除”菜单来删除所有内容后自动回到cemera preview界面
修改方法如下:
(1) Gallery2\src\com\android\gallery3d\data\FilterEmptyPromptSet.java文件中:标签:info,...,删除,预览,mSize,camera,android,itemCount From: https://blog.51cto.com/u_15170706/6114561
@Override
public int getMediaItemCount() {
int itemCount = mBaseSet.getMediaItemCount();
if (itemCount > 0) {
return itemCount;
} else {
return 0;
}
}
(2) Gallery2\src\com\android\gallery3d\app\PhotoDataAdapter.java文件中:
private class UpdateContent implements Callable<Void> {
...
public Void call() throws Exception {
...
if (info.size != mSize) {
mSize = info.size;
if (mContentEnd > mSize) mContentEnd = mSize;
if (mActiveEnd > mSize) mActiveEnd = mSize;
}
///M: indexHint needs to be limited to [0, mSize)
if(mSize>0 && info.indexHint >= mSize){
info.indexHint = mSize-1;
}
...
}//end call()
...
}