当前位置: 移动技术网 > IT编程>移动开发>Android > Android 仿微信图像拍摄和选择界面功能(代码分享)

Android 仿微信图像拍摄和选择界面功能(代码分享)

2019年07月24日  | 移动技术网IT编程  | 我要评论

ug教程网,黄英的图片,代孕皇妃

 插件运行后的画面如下:

下面这张图对图像进行筛选,根据照片产生的源头分(qq和微信和相机)

这里写图片描述

点击某文件夹后,可以查看该文件夹下包含的所有的图片

这里写图片描述

图片选择界面

这里写图片描述

选中后就跳到已经选择界面的窗口,并且可以对该吃图片上传进行简要的描述

这里写图片描述

首先我想说明的是这个插件默认是不进行图片筛选的,打开app后会有几十个文件夹,但是个人认为开发中常用的图片基本都来自于qq中拍摄的照片,微信中拍摄的照片,以及相机直接拍摄的照片,因此我对这个插件进行过滤以及文件夹名称的更改,具体做法,主要是对albumhelper类buildimagesbucketlist方法中的do-while循环进行稍微修改

do {
        string _id = cur.getstring(photoidindex);
        string name = cur.getstring(photonameindex);
        string path = cur.getstring(photopathindex);
        string title = cur.getstring(phototitleindex);
        string size = cur.getstring(photosizeindex);
        string bucketname = cur.getstring(bucketdisplaynameindex);
        string bucketid = cur.getstring(bucketidindex);
        string picasaid = cur.getstring(picasaidindex);     
        if (bucketname.equals("camera") || bucketname.equals("weixin")) {
          if (path.contains("storage/emulated/0")
              && bucketname.equals("camera")) {
            bucketname = "qq";
          }
          if (path.contains("storage/emulated/0")
              && bucketname.equals("weixin")) {
            bucketname = "微信";
          }
          if (!path.contains("storage/emulated/0")
              && bucketname.equals("camera")) {
            bucketname = "相机";
          }
          imagebucket bucket = bucketlist.get(bucketid);
          if (bucket == null) {
            bucket = new imagebucket();
            bucketlist.put(bucketid, bucket);
            bucket.imagelist = new arraylist<imageitem>();
            bucket.bucketname = bucketname;
          }
          bucket.count++;
          imageitem imageitem = new imageitem();
          imageitem.imageid = _id;
          imageitem.imagepath = path;
          imageitem.thumbnailpath = thumbnaillist.get(_id);
          bucket.imagelist.add(imageitem);
        }
      } while (cur.movetonext());
    }

默认这个插件图片选择界面的完成按钮只显示一半,因此要对布局界面做一个简单的修改

这里写图片描述

以上所述是小编给大家介绍的android 仿微信图像拍摄和选择界面功能,希望对大家有所帮助

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网