目前基本复现微信的朋友圈的浏览效果
直接上效果图吧!

感觉不错的话多多支持吧

由于代码比较多,目前只将核心的适配器代码放出来,如果需要全部的话,下载源码吧,源码地址在最后

适配器代码:

private static List<GridListBean> listBeans = new LinkedList<>();
public int resource;
public GridListAdapter(@NonNull Context context, int source, @NonNull List<GridListBean> objects) {super(context, source, objects);listBeans = objects;resource = source;
}public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {GridListBean gridListBean = getItem(position);@SuppressLint("ViewHolder") View view = LayoutInflater.from(getContext()).inflate(resource, parent, false); TextView title = view.findViewById(R.id.title);title.setText(gridListBean.getTitle());TextView content = view.findViewById(R.id.content);content.setText(gridListBean.getContent());TextView time = view.findViewById(R.id.time);time.setText(gridListBean.getTime());ImageView avatar = view.findViewById(R.id.avatar);ImageView img_one = view.findViewById(R.id.img_one);ImageView img_two = view.findViewById(R.id.img_two);ImageView img_three = view.findViewById(R.id.img_three);ImageView img_four = view.findViewById(R.id.img_four);ImageView img_five = view.findViewById(R.id.img_five);ImageView img_six = view.findViewById(R.id.img_six);ImageView img_seven = view.findViewById(R.id.img_seven);ImageView img_eight = view.findViewById(R.id.img_eight);ImageView img_nine = view.findViewById(R.id.img_nine);try {BitmapDrawable[] drawable = SourceHolder.getInstance().getSource(getItem(position).getImgUrl()[0]);ImageView[] imageViews = new ImageView[]{avatar, img_one, img_two, img_three, img_four, img_five, img_six, img_seven, img_eight, img_nine};if (drawable != null) {GridNumListener.setVisible(imageViews, drawable);} else {BitmapWorkerTask task = new BitmapWorkerTask(imageViews);task.execute(getItem(position).getImgUrl());}} catch (Exception e) {Log.d(String.valueOf(this), "加载图片异常..." + e.getMessage());}return view;
}@SuppressLint("StaticFieldLeak")
public class BitmapWorkerTask extends AsyncTask<String, Void, BitmapDrawable> {private final ImageView[] imageViews;String[] imageUrl = null;private BitmapWorkerTask(ImageView[] imageViews) {this.imageViews = imageViews;}protected BitmapDrawable doInBackground(String... params) {try {imageUrl = params;//获取当前图片的地址BitmapDrawable[] bitmapDrawable1 = new BitmapDrawable[10];for (int i = 0; i < imageUrl.length; i++) {Bitmap bitmap = downloadBitmap(imageUrl[i]);bitmapDrawable1[i] = new BitmapDrawable(getContext().getResources(), bitmap);}SourceHolder.getInstance().setSource(imageUrl[0], bitmapDrawable1);return bitmapDrawable1[0];} catch (Exception e) {return null;}}protected void onPostExecute(BitmapDrawable result) {super.onPostExecute(result);try {if (imageViews != null && result != null) {BitmapDrawable[] bitmapDrawables = SourceHolder.getInstance().getSource(imageUrl[0]);GridNumListener.setVisible(imageViews, bitmapDrawables);}} catch (Exception e) {e.printStackTrace();}}
}public Bitmap downloadBitmap(String imageUrl) {Bitmap bitmap = null;HttpURLConnection connection = null;try {URL url = new URL(imageUrl);connection = (HttpURLConnection) url.openConnection();connection.setConnectTimeout(5000);connection.setReadTimeout(3000);bitmap = BitmapFactory.decodeStream(connection.getInputStream());} catch (Exception e) {e.printStackTrace();} finally {if (connection != null) {connection.disconnect();}}return bitmap;
}

下载地址:点我下载

目前Gitee开源未审核过,还不能开源,后面记起来了的话再开源吧

Android(安卓)高仿微信朋友圈九宫格列表相关推荐

  1. android com.mylhyl,Android 高仿微信朋友圈拍照上传功能

    模仿微信朋友圈发布动态,输入文字支持文字多少高度自增,有一个最小输入框高度,输入文字有限制,不过这些都很easy! 1. photopicker的使用 这是一个支持选择多张图片,点击图片放大,图片之间 ...

  2. android 微信高仿,Android 高仿微信朋友圈拍照上传功能

    模仿微信朋友圈发布动态,输入文字支持文字多少高度自增,有一个最小输入框高度,输入文字有限制,不过这些都很easy! 1. PhotoPicker的使用 这是一个支持选择多张图片,点击图片放大,图片之间 ...

  3. Android 实现仿微信朋友圈九宫格图片+NineGridView+ImageWatcher(图片查看:1.预览,2.拖动,3.放大,4.左右滑动,5.长按保存到手机)的功能

    一.测试 实现: 二.添加依赖包: implementation 'androidx.appcompat:appcompat:1.1.0'implementation 'androidx.recycl ...

  4. android 微信朋友圈 全功能,Android仿微信朋友圈文字展开全文功能 Android自定义TextView仿微信朋友圈文字展开全文功能...

    Android自定义TextView仿微信朋友圈文字信息,展开全文功能 代码及注释如下: 首先写一个xml文件 showmore.xml: android:orientation="vert ...

  5. android 微信朋友圈 全功能,Android自定义TextView仿微信朋友圈文字展开全文功能

    Android自定义TextView仿微信朋友圈文字信息,展开全文功能 代码及注释如下: 首先写一个xml文件 showmore.xml: android:orientation="vert ...

  6. 仿微信朋友圈动态列表

    仿微信朋友圈动态列表,如下图: Demo下载

  7. Android 高仿微信朋友圈动态, 支持双击手势放大并滑动查看图片。

    转载请注明出处: http://blog.csdn.net/sk719887916/article/details/40348873 作者skay: 最近参与了开发一款旅行APP,其中包含实时聊天和动 ...

  8. 修改源码自定义SwipeRefreshLayout样式——高仿微信朋友圈下拉刷新

    上一篇文章里把SwipeRefreshLayout的原理简单过了一下,大致了解了其工作原理,不熟悉的可以去看一下:http://blog.csdn.net/u011443509/article/det ...

  9. android 高仿朋友圈title,Android之高仿微信朋友圈图片上传

    碰到过很多上传图片的功能,大多都是要求是仿微信,不论是单图还是多图,更不知道是出于什么原因要去仿微信,总之,作为开发人员,很无奈,今天就把这种需求总结出来了,方便以后使用,下面就开始撸...... 一 ...

最新文章

  1. 安装终端服务和终端服务授权,激活终端服务授权
  2. linux ie 插件目录在哪个文件夹里,Linux下的IE浏览器使用方法[图]
  3. linux服务器间文件夹拷贝
  4. mybatis学习(17):列名与属性名不一致的情况(使用别名)
  5. php 获取object_PHP反射机制实现自动依赖注入
  6. 最快的存储过程分页 50W
  7. jmeter在返回的json串中提取需要的值
  8. cadence16.6安装教程
  9. 深度置信网络的一个应用
  10. 配置git的合并工具mergetool不生成.orig文件
  11. 开机时HP Hotkey UWP Service占用内存过高
  12. (android文档原创翻译)管理Activity的生命周期一
  13. ue4开关门点击时onclicked事件没有触发的解决方案
  14. 2、快速选择工具和魔棒工具
  15. DOM解析,DOM4j
  16. java丐帮_java多线程学习笔记(二)
  17. 计算机算法类毕业答辩问题,深度学习毕业设计答辩问题
  18. mysql不停机主从配置
  19. 程序员不愿意加班的真相
  20. Django startapp

热门文章

  1. MyBatis研习录(12)——MyBatis一级缓存
  2. matlab微分方程稳定流形,基于matlab的lorenz系统仿真研究
  3. 回归问题的置信区间AUC_R:ggplot2各类回归模型的回归线绘制方法
  4. 张小龙唯一推荐的贝索斯演讲:善良比聪明更重要
  5. [SDOI 2016]征途
  6. 回归初心,近三万字详解 23 种设计模式(多图 + 代码)
  7. SPSS-卡方检验-论文常用
  8. 自己搭建了一个美团饿了么外卖cps红包的小程序裂变分销公众号
  9. com.motorola.home主屏幕意外停止 Defy+/Me525+
  10. vc2010c语言阶乘程序,我在C语言贴吧的第一个C(或C++)程序:可以计算10000阶乘的程序...