Gallery3 D

[color=green][size=large][list]
[*]网上找的比较好的学习Gallery3D的资料
[*]进度
[*]把它安装到模拟器上
[/list][/size][/color]

网上找的比较好的学习Gallery3D的资料
[url]http://www.linuxgraphics.cn/android/gallery3d_render.html[/url]

[url]http://www.eoeandroid.com/thread-23080-1-1.html[/url]

[url]http://www.linuxgraphics.cn/android/index.html[/url]

[url]http://developer.51cto.com/art/201001/180764.htm[/url]


进度:
HudLayer 144:

[quote]PopupMenu.Option[] deleteOptions = {
new PopupMenu.Option(context.getResources().getString(Res.string.confirm_delete), resources
.getDrawable(Res.drawable.icon_delete), new Runnable() {
public void run() {
deleteSelection();
}
}),
new PopupMenu.Option(context.getResources().getString(Res.string.cancel), resources
.getDrawable(Res.drawable.icon_cancel), new Runnable() {
public void run() {

}
}), };[/quote]

MediaFeed 244:删除文件
public void performOperation(final int operation, final ArrayList<MediaBucket> mediaBuckets, final Object data)


ImageManager.java:

 protected Void execute() throws InterruptedException, ExecutionException {
Log.d(TAG, "-----------------------------------execute()");
boolean complete = false;
try {
String[] projection = new String[] { ImageColumns._ID, ImageColumns.MINI_THUMB_MAGIC };
Cursor c = mCr.query(mUri, projection, null, null, null);
try {
c.moveToPosition(0);
} finally {
c.close();
}
ContentValues values = new ContentValues();
values.put(ImageColumns.MINI_THUMB_MAGIC, 0);
mCr.update(mUri, values, null, null);
OutputStream outputStream = null;
try {
outputStream = mCr.openOutputStream(mUri);
if (outputStream != null) {
outputStream.write(mJpegData);
}
} catch (IOException ex) {
// TODO: report error to caller
Log.e(TAG, "Cannot open file: " + mUri, ex);
} finally {
Util.closeSilently(outputStream);
}
complete = true;
return null;
} finally {
if (!complete) {
try {
Log.d(TAG, "-------------execute()--------mCr.delete()..."); //zhang execute delete
mCr.delete(mUri, null, null);
} catch (Throwable t) {
// ignore it while clean up.
}
}
}
}
}



LocalDataSource.java:删除


public boolean performOperation(int operation, ArrayList<MediaBucket> mediaBuckets, Object data) {
Log.d(TAG, "performOperation");
int numBuckets = mediaBuckets.size();
ContentResolver cr = mContext.getContentResolver();
switch (operation) {
case MediaFeed.OPERATION_DELETE:
for (int i = 0; i < numBuckets; ++i) {
MediaBucket bucket = mediaBuckets.get(i);
MediaSet set = bucket.mediaSet;
ArrayList<MediaItem> items = bucket.mediaItems;
if (set != null && items == null) {
// TODO bulk delete
// remove the entire bucket
final Uri uriImages = Images.Media.EXTERNAL_CONTENT_URI;
final Uri uriVideos = Video.Media.EXTERNAL_CONTENT_URI;
final String whereImages = Images.ImageColumns.BUCKET_ID + "=" + Long.toString(set.mId);
final String whereVideos = Video.VideoColumns.BUCKET_ID + "=" + Long.toString(set.mId);
Log.d(TAG, "-------not excecute^^^^^^^^^^^^performOperation : switch (operation) : case: MediaFeed.OPERATION_DELETE");
Log.d(TAG, "-------not excecute---cr.delete(uriImages, whereImages, null)");
cr.delete(uriImages, whereImages, null);
cr.delete(uriVideos, whereVideos, null);
//CacheService.markDirty();
}
if (set != null && items != null) {
// We need to remove these items from the set.
int numItems = items.size();
try {
for (int j = 0; j < numItems; ++j) {
MediaItem item = items.get(j);
cr.delete(Uri.parse(item.mContentUri), null, null);//zhanglb这句注掉后就不能删除sd卡中的文件了,而且重新打开Gallery,文件又回来了
Log.d(TAG, "execute here when delete the image=======cr.delete(Uri.parse(item.mContentUri), null, null)");
}
} catch (Exception e) {
// If the database operation failed for any reason.
;
}
set.updateNumExpectedItems();
set.generateTitle(true);
//CacheService.markDirty(set.mId);
}
}
break;
case MediaFeed.OPERATION_ROTATE:
for (int i = 0; i < numBuckets; ++i) {
MediaBucket bucket = mediaBuckets.get(i);
ArrayList<MediaItem> items = bucket.mediaItems;
if (items == null) {
continue;
}
float angleToRotate = ((Float) data).floatValue();
if (angleToRotate == 0) {
return true;
}
int numItems = items.size();
for (int j = 0; j < numItems; ++j) {
rotateItem(items.get(j), angleToRotate);
}
}
break;
}
return true;
}


我尝试过[size=large]把它安装到模拟器上[/size],成功了,命令如下:
$ adb remount
#$ adb push <dir>/SinaNews/bin/SinaNews.apk /system/app/ //系统应用

但是连上真机就不行了,虽然终端提示安装成功但是设备上根本没有改变,重启机器也不行。

后来我尝试先把真机上那个Gallery卸掉,但是用“sudo adb uninstall + 包名”的时候根本就卸不掉,提示adb: not found。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值