前言:图片的加载,图片的处理,是Android开发程序员在开发中经常遇到的问题,比如,图片的压缩,图片批量的网络获取等。但是往往处理不当,就会报oom,那么如何解决这一类问题了,在分析了弘扬大牛的图片加载后,我觉得收益匪浅,下面,我就借花献佛,实现高效,批量,同时又避免出现oom,实现高效imageload。

分析:

不管是从网络还是本地的图片,加载都需要进行压缩,然后显示:用户要你压缩显示,会给我们什么?一个imageview,一个path,我们的职责就是压缩完成后显示上去。

废话不多说,直接分析上代码了:

1、本地图片的压缩

a、获得imageview想要显示的大小

想要压缩,我们第一步应该是获得imageview想要显示的大小,没大小肯定没办法压缩?

那么如何获得imageview想要显示的大小呢?

[java]view plaincopy
  1. /**
  2. * 根据ImageView获适当的压缩的宽和高
  3. *
  4. * @param imageView
  5. * @return
  6. */
  7. public static ImageSize getImageViewSize(ImageView imageView)
  8. {
  9. ImageSize imageSize = new ImageSize();
  10. DisplayMetrics displayMetrics = imageView.getContext().getResources()
  11. .getDisplayMetrics();
  12. LayoutParams lp = imageView.getLayoutParams();
  13. int width = imageView.getWidth();// 获取imageview的实际宽度
  14. if (width <= 0)
  15. {
  16. width = lp.width;// 获取imageview在layout中声明的宽度
  17. }
  18. if (width <= 0)
  19. {
  20. // width = imageView.getMaxWidth();// 检查最大值
  21. width = getImageViewFieldValue(imageView, "mMaxWidth");
  22. }
  23. if (width <= 0)
  24. {
  25. width = displayMetrics.widthPixels;
  26. }
  27. int height = imageView.getHeight();// 获取imageview的实际高度
  28. if (height <= 0)
  29. {
  30. height = lp.height;// 获取imageview在layout中声明的宽度
  31. }
  32. if (height <= 0)
  33. {
  34. height = getImageViewFieldValue(imageView, "mMaxHeight");// 检查最大值
  35. }
  36. if (height <= 0)
  37. {
  38. height = displayMetrics.heightPixels;
  39. }
  40. imageSize.width = width;
  41. imageSize.height = height;
  42. return imageSize;
  43. }
  44. public static class ImageSize
  45. {
  46. int width;
  47. int height;
  48. }

可以看到,我们拿到imageview以后:

首先企图通过getWidth获取显示的宽;有些时候,这个getWidth返回的是0;

那么我们再去看看它有没有在布局文件中书写宽;

如果布局文件中也没有精确值,那么我们再去看看它有没有设置最大值;

如果最大值也没设置,那么我们只有拿出我们的终极方案,使用我们的屏幕宽度;

总之,不能让它任性,我们一定要拿到一个合适的显示值。

可以看到这里或者最大宽度,我们用的反射,而不是getMaxWidth();维萨呢,因为getMaxWidth竟然要API 16,我也是醉了;为了兼容性,我们采用反射的方案。反射的代码就不贴了。

b、设置合适的inSampleSize

我们获得想要显示的大小,为了什么,还不是为了和图片的真正的宽高做比较,拿到一个合适的inSampleSize,去对图片进行压缩么。

那么首先应该是拿到图片的宽和高:

  1. // 获得图片的宽和高,并不把图片加载到内存中,把高和宽保存在我们的options里面:
  2. BitmapFactory.Options options = new BitmapFactory.Options();
  3. options.inJustDecodeBounds = true;
  4. BitmapFactory.decodeFile(path, options);

然后我们就可以happy的去计算inSampleSize了:

  1. /**
  2. * 根据需求的宽和高以及图片实际的宽和高计算SampleSize
  3. *
  4. * @param options
  5. * @param width
  6. * @param height
  7. * @return
  8. */
  9. public static int caculateInSampleSize(Options options, int reqWidth,
  10. int reqHeight)
  11. {
  12. int width = options.outWidth;
  13. int height = options.outHeight;
  14. int inSampleSize = 1;
  15. if (width > reqWidth || height > reqHeight)
  16. {
  17. int widthRadio = Math.round(width * 1.0f / reqWidth);
  18. int heightRadio = Math.round(height * 1.0f / reqHeight);
  19. inSampleSize = Math.max(widthRadio, heightRadio);
  20. }
  21. return inSampleSize;
  22. }

options里面存了实际的宽和高;reqWidth和reqHeight就是我们之前得到的想要显示的大小;经过比较,得到一个合适的inSampleSize;

有了inSampleSize:

  1. options.inSampleSize = ImageSizeUtil.caculateInSampleSize(options,
  2. width, height);
  3. // 使用获得到的InSampleSize再次解析图片
  4. options.inJustDecodeBounds = false;
  5. Bitmap bitmap = BitmapFactory.decodeFile(path, options);
  6. return bitmap;

2、网络图片的压缩

a、直接下载存到sd卡,然后采用本地的压缩方案。这种方式当前是在硬盘缓存开启的情况下,如果没有开启呢?

b、使用BitmapFactory.decodeStream(is, null, opts);

  1. /**
  2. * 根据url下载图片在指定的文件
  3. *
  4. * @param urlStr
  5. * @param file
  6. * @return
  7. */
  8. public static Bitmap downloadImgByUrl(String urlStr, ImageView imageview)
  9. {
  10. FileOutputStream fos = null;
  11. InputStream is = null;
  12. try
  13. {
  14. URL url = new URL(urlStr);
  15. HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  16. is = new BufferedInputStream(conn.getInputStream());
  17. is.mark(is.available());
  18. Options opts = new Options();
  19. opts.inJustDecodeBounds = true;
  20. Bitmap bitmap = BitmapFactory.decodeStream(is, null, opts);
  21. //获取imageview想要显示的宽和高
  22. ImageSize imageViewSize = ImageSizeUtil.getImageViewSize(imageview);
  23. opts.inSampleSize = ImageSizeUtil.caculateInSampleSize(opts,
  24. imageViewSize.width, imageViewSize.height);
  25. opts.inJustDecodeBounds = false;
  26. is.reset();
  27. bitmap = BitmapFactory.decodeStream(is, null, opts);
  28. conn.disconnect();
  29. return bitmap;
  30. } catch (Exception e)
  31. {
  32. e.printStackTrace();
  33. } finally
  34. {
  35. try
  36. {
  37. if (is != null)
  38. is.close();
  39. } catch (IOException e)
  40. {
  41. }
  42. try
  43. {
  44. if (fos != null)
  45. fos.close();
  46. } catch (IOException e)
  47. {
  48. }
  49. }
  50. return null;
  51. }

注意本地加载和网络加载的区别:

基本和本地压缩差不多,也是两次取样,当然需要注意一点,我们的is进行了包装,以便可以进行reset();直接返回的is是不能使用两次的。

3,图片加载框架的架构设计分析

我们的图片压缩加载完了,那么就应该放入我们的LruCache,然后设置到我们的ImageView上。

1、单例,包含一个LruCache用于管理我们的图片;

2、任务队列,我们每来一次加载图片的请求,我们会封装成Task存入我们的TaskQueue;

3、包含一个后台线程,这个线程在第一次初始化实例的时候启动,然后会一直在后台运行;任务呢?还记得我们有个任务队列么,有队列存任务,得有人干活呀;所以,当每来一次加载图片请求的时候,我们同时发一个消息到后台线程,后台线程去使用线程池去TaskQueue去取一个任务执行;

4、调度策略;3中说了,后台线程去TaskQueue去取一个任务,这个任务不是随便取的,有策略可以选择,一个是FIFO,一个是LIFO,我倾向于后者。

好了,基本就这些结构,接下来看我们具体的实现。

4,具体的实现

  1. public static ImageLoader getInstance(int threadCount, Type type)
  2. {
  3. if (mInstance == null)
  4. {
  5. synchronized (ImageLoader.class)
  6. {
  7. if (mInstance == null)
  8. {
  9. mInstance = new ImageLoader(threadCount, type);
  10. }
  11. }
  12. }
  13. return mInstance;
  14. }

构造方法

  1. /**
  2. * 图片加载类
  3. *
  4. * @author zhy
  5. *
  6. */
  7. public class ImageLoader
  8. {
  9. private static ImageLoader mInstance;
  10. /**
  11. * 图片缓存的核心对象
  12. */
  13. private LruCache<String, Bitmap> mLruCache;
  14. /**
  15. * 线程池
  16. */
  17. private ExecutorService mThreadPool;
  18. private static final int DEAFULT_THREAD_COUNT = 1;
  19. /**
  20. * 队列的调度方式
  21. */
  22. private Type mType = Type.LIFO;
  23. /**
  24. * 任务队列
  25. */
  26. private LinkedList<Runnable> mTaskQueue;
  27. /**
  28. * 后台轮询线程
  29. */
  30. private Thread mPoolThread;
  31. private Handler mPoolThreadHandler;
  32. /**
  33. * UI线程中的Handler
  34. */
  35. private Handler mUIHandler;
  36. private Semaphore mSemaphorePoolThreadHandler = new Semaphore(0);
  37. private Semaphore mSemaphoreThreadPool;
  38. private boolean isDiskCacheEnable = true;
  39. private static final String TAG = "ImageLoader";
  40. public enum Type
  41. {
  42. FIFO, LIFO;
  43. }
  44. private ImageLoader(int threadCount, Type type)
  45. {
  46. init(threadCount, type);
  47. }
  48. /**
  49. * 初始化
  50. *
  51. * @param threadCount
  52. * @param type
  53. */
  54. private void init(int threadCount, Type type)
  55. {
  56. initBackThread();
  57. // 获取我们应用的最大可用内存
  58. int maxMemory = (int) Runtime.getRuntime().maxMemory();
  59. int cacheMemory = maxMemory / 8;
  60. mLruCache = new LruCache<String, Bitmap>(cacheMemory)
  61. {
  62. @Override
  63. protected int sizeOf(String key, Bitmap value)
  64. {
  65. return value.getRowBytes() * value.getHeight();
  66. }
  67. };
  68. // 创建线程池
  69. mThreadPool = Executors.newFixedThreadPool(threadCount);
  70. mTaskQueue = new LinkedList<Runnable>();
  71. mType = type;
  72. mSemaphoreThreadPool = new Semaphore(threadCount);
  73. }
  74. /**
  75. * 初始化后台轮询线程
  76. */
  77. private void initBackThread()
  78. {
  79. // 后台轮询线程
  80. mPoolThread = new Thread()
  81. {
  82. @Override
  83. public void run()
  84. {
  85. Looper.prepare();
  86. mPoolThreadHandler = new Handler()
  87. {
  88. @Override
  89. public void handleMessage(Message msg)
  90. {
  91. // 线程池去取出一个任务进行执行
  92. mThreadPool.execute(getTask());
  93. try
  94. {
  95. mSemaphoreThreadPool.acquire();
  96. } catch (InterruptedException e)
  97. {
  98. }
  99. }
  100. };
  101. // 释放一个信号量
  102. mSemaphorePoolThreadHandler.release();
  103. Looper.loop();
  104. };
  105. };
  106. mPoolThread.start();
  107. }

在贴构造的时候,顺便贴出所有的成员变量;

在构造中我们调用init,init中可以设置后台加载图片线程数量和加载策略;init中首先初始化后台线程initBackThread(),可以看到这个后台线程,实际上是个Looper最终在那不断的loop,我们还初始化了一个mPoolThreadHandler用于发送消息到此线程;

接下来就是初始化mLruCache  , mThreadPool ,mTaskQueue 等;

loadImage

构造完成以后,当然是使用了,用户调用loadImage传入(final String path, final ImageView imageView,final boolean isFromNet)就可以完成本地或者网络图片的加载。

  1. /**
  2. * 根据path为imageview设置图片
  3. *
  4. * @param path
  5. * @param imageView
  6. */
  7. public void loadImage(final String path, final ImageView imageView,
  8. final boolean isFromNet)
  9. {
  10. imageView.setTag(path);
  11. if (mUIHandler == null)
  12. {
  13. mUIHandler = new Handler()
  14. {
  15. public void handleMessage(Message msg)
  16. {
  17. // 获取得到图片,为imageview回调设置图片
  18. ImgBeanHolder holder = (ImgBeanHolder) msg.obj;
  19. Bitmap bm = holder.bitmap;
  20. ImageView imageview = holder.imageView;
  21. String path = holder.path;
  22. // 将path与getTag存储路径进行比较
  23. if (imageview.getTag().toString().equals(path))
  24. {
  25. imageview.setImageBitmap(bm);
  26. }
  27. };
  28. };
  29. }
  30. // 根据path在缓存中获取bitmap
  31. Bitmap bm = getBitmapFromLruCache(path);
  32. if (bm != null)
  33. {
  34. refreashBitmap(path, imageView, bm);
  35. } else
  36. {
  37. addTask(buildTask(path, imageView, isFromNet));
  38. }

首先我们为imageview.setTag;然后初始化一个mUIHandler,不用猜,这个mUIHandler用户更新我们的imageview,因为这个方法肯定是主线程调用的。

然后调用:getBitmapFromLruCache(path);根据path在缓存中获取bitmap;如果找到那么直接去设置我们的图片;

  1. private void refreashBitmap(final String path, final ImageView imageView,
  2. Bitmap bm)
  3. {
  4. Message message = Message.obtain();
  5. ImgBeanHolder holder = new ImgBeanHolder();
  6. holder.bitmap = bm;
  7. holder.path = path;
  8. holder.imageView = imageView;
  9. message.obj = holder;
  10. mUIHandler.sendMessage(message);
  11. }

可以看到,如果找到图片,则直接使用UIHandler去发送一个消息,当然了携带了一些必要的参数,然后UIHandler的handleMessage中完成图片的设置;

handleMessage中拿到path,bitmap,imageview;记得必须要:

// 将path与getTag存储路径进行比较
if (imageview.getTag().toString().equals(path))
{
imageview.setImageBitmap(bm);
}

否则会造成图片混乱。

如果没找到,则通过buildTask去新建一个任务,在addTask到任务队列。

buildTask就比较复杂了,因为还涉及到本地和网络,所以我们先看addTask代码:

  1. private synchronized void addTask(Runnable runnable)
  2. {
  3. mTaskQueue.add(runnable);
  4. // if(mPoolThreadHandler==null)wait();
  5. try
  6. {
  7. if (mPoolThreadHandler == null)
  8. mSemaphorePoolThreadHandler.acquire();
  9. } catch (InterruptedException e)
  10. {
  11. }
  12. mPoolThreadHandler.sendEmptyMessage(0x110);
  13. }

很简单,就是runnable加入TaskQueue,与此同时使用mPoolThreadHandler(这个handler还记得么,用于和我们后台线程交互。)去发送一个消息给后台线程,叫它去取出一个任务执行;具体代码:

  1. mPoolThreadHandler = new Handler()
  2. {
  3. @Override
  4. public void handleMessage(Message msg)
  5. {
  6. // 线程池去取出一个任务进行执行
  7. mThreadPool.execute(getTask());

直接使用mThreadPool线程池,然后使用getTask去取一个任务。

  1. /**
  2. * 从任务队列取出一个方法
  3. *
  4. * @return
  5. */
  6. private Runnable getTask()
  7. {
  8. if (mType == Type.FIFO)
  9. {
  10. return mTaskQueue.removeFirst();
  11. } else if (mType == Type.LIFO)
  12. {
  13. return mTaskQueue.removeLast();
  14. }
  15. return null;
  16. }

getTask代码也比较简单,就是根据Type从任务队列头或者尾进行取任务。

现在你会不会好奇,任务里面到底什么代码?其实我们也就剩最后一段代码了buildTask

  1. /**
  2. * 根据传入的参数,新建一个任务
  3. *
  4. * @param path
  5. * @param imageView
  6. * @param isFromNet
  7. * @return
  8. */
  9. private Runnable buildTask(final String path, final ImageView imageView,
  10. final boolean isFromNet)
  11. {
  12. return new Runnable()
  13. {
  14. @Override
  15. public void run()
  16. {
  17. Bitmap bm = null;
  18. if (isFromNet)
  19. {
  20. File file = getDiskCacheDir(imageView.getContext(),
  21. md5(path));
  22. if (file.exists())// 如果在缓存文件中发现
  23. {
  24. Log.e(TAG, "find image :" + path + " in disk cache .");
  25. bm = loadImageFromLocal(file.getAbsolutePath(),
  26. imageView);
  27. } else
  28. {
  29. if (isDiskCacheEnable)// 检测是否开启硬盘缓存
  30. {
  31. boolean downloadState = DownloadImgUtils
  32. .downloadImgByUrl(path, file);
  33. if (downloadState)// 如果下载成功
  34. {
  35. Log.e(TAG,
  36. "download image :" + path
  37. + " to disk cache . path is "
  38. + file.getAbsolutePath());
  39. bm = loadImageFromLocal(file.getAbsolutePath(),
  40. imageView);
  41. }
  42. } else
  43. // 直接从网络加载
  44. {
  45. Log.e(TAG, "load image :" + path + " to memory.");
  46. bm = DownloadImgUtils.downloadImgByUrl(path,
  47. imageView);
  48. }
  49. }
  50. } else
  51. {
  52. bm = loadImageFromLocal(path, imageView);
  53. }
  54. // 3、把图片加入到缓存
  55. addBitmapToLruCache(path, bm);
  56. refreashBitmap(path, imageView, bm);
  57. mSemaphoreThreadPool.release();
  58. }
  59. };
  60. }
  61. private Bitmap loadImageFromLocal(final String path,
  62. final ImageView imageView)
  63. {
  64. Bitmap bm;
  65. // 加载图片
  66. // 图片的压缩
  67. // 1、获得图片需要显示的大小
  68. ImageSize imageSize = ImageSizeUtil.getImageViewSize(imageView);
  69. // 2、压缩图片
  70. bm = decodeSampledBitmapFromPath(path, imageSize.width,
  71. imageSize.height);
  72. return bm;
  73. }

我们新建任务,说明在内存中没有找到缓存的bitmap;我们的任务就是去根据path加载压缩后的bitmap返回即可,然后加入LruCache,设置回调显示。

首先我们判断是否是网络任务?

如果是,首先去硬盘缓存中找一下,(硬盘中文件名为:根据path生成的md5为名称)。

如果硬盘缓存中没有,那么去判断是否开启了硬盘缓存:

开启了的话:下载图片,使用loadImageFromLocal本地加载图片的方式进行加载(压缩的代码前面已经详细说过);

如果没有开启:则直接从网络获取(压缩获取的代码,前面详细说过);

如果不是网络图片:直接loadImageFromLocal本地加载图片的方式进行加载

经过上面,就获得了bitmap;然后加入addBitmapToLruCache,refreashBitmap回调显示图片。

  1. /**
  2. * 将图片加入LruCache
  3. *
  4. * @param path
  5. * @param bm
  6. */
  7. protected void addBitmapToLruCache(String path, Bitmap bm)
  8. {
  9. if (getBitmapFromLruCache(path) == null)
  10. {
  11. if (bm != null)
  12. mLruCache.put(path, bm);
  13. }
  14. }

到此,我们所有的代码就分析完成了;缓存的图片位置:在SD卡的Android/data/项目packageName/cache中:

注意事项:

第一个:mSemaphorePoolThreadHandler = new Semaphore(0); 用于控制我们的mPoolThreadHandler的初始化完成,我们在使用mPoolThreadHandler会进行判空,如果为null,会通过mSemaphorePoolThreadHandler.acquire()进行阻塞;当mPoolThreadHandler初始化结束,我们会调用.release();解除阻塞。

第二个:mSemaphoreThreadPool = new Semaphore(threadCount);这个信号量的数量和我们加载图片的线程个数一致;每取一个任务去执行,我们会让信号量减一;每完成一个任务,会让信号量+1,再去取任务;目的是什么呢?为什么当我们的任务到来时,如果此时在没有空闲线程,任务则一直添加到TaskQueue中,当线程完成任务,可以根据策略去TaskQueue中去取任务,只有这样,我们的LIFO才有意义。

调用方式:

在要使用批量加载的activity或者片段调用一下方法即可:

1:先实例化

private ImageLoader mImageLoader;

mImageLoader = ImageLoader.getInstance(3, Type.LIFO);

2:找到要使用的imagevie

imageview.setImageResource(R.drawable.pictures_no);  //设置预加载

mImageLoader.loadImage(getItem(position), imageview, true);

Android实现图片的高效批量加载相关推荐

  1. android listview 图片闪烁,listView异步加载图片导致图片错位、闪烁、重复的问题的解决...

    androidListView是android中重要的控件,几乎每一个项目都会用到.但是在使用中我们避免不 了会出现一些问题,包括一些滑动事件的处理,例如:ListView中嵌套scrollView, ...

  2. 高效地加载图片(一) 高效地加载大图

    1.Read Bitmap Dimensions and Type 读取图片的尺寸和类型 //创建一个Options,用于保存图片的参数 BitmapFactory.Options options = ...

  3. android glide图片灰色,glide 显示 加载不出来 图片 - CSDN博客

    问题 本来想写个Demo用下glide,虽说之前用过,但是只是简单地使用,并没有深入研究.但是,却遇到问题: 新建好项目之后,在布局中加了ImageView. xmlns:tools="ht ...

  4. 2021年大数据HBase(十五):HBase的Bulk Load批量加载操作

    全网最详细的大数据HBase文章系列,强烈建议收藏加关注! 新文章都已经列出历史文章目录,帮助大家回顾前面的知识重点. 目录 系列历史文章 HBase的Bulk Load批量加载操作 一.Bulk L ...

  5. Oracle通过OCI批量加载需要注意的问题

    ORACLE调用接口(Oracle Call Interface简称OCI)提供了一组可对ORACLE数据库进行存取的接口子例程(函数),通过在第三代程序设计语言(如C语言)中进行调用可达到存取ORA ...

  6. Android插件化开发之动态加载技术简单易懂的介绍方式

    转载地方:https://segmentfault.com/a/1190000004062866 基本信息 Author:kaedea GitHub:android-dynamical-loading ...

  7. android 自定义view 动画效果,Android自定义view实现阻尼效果的加载动画

    效果: 需要知识: 1. 二次贝塞尔曲线 2. 动画知识 3. 基础自定义view知识 先来解释下什么叫阻尼运动 阻尼振动是指,由于振动系统受到摩擦和介质阻力或其他能耗而使振幅随时间逐渐衰减的振动,又 ...

  8. android 皮肤包换肤之Resources加载(一)

    Android 换肤之资源(Resources)加载(一) 本系列计划3篇: Android 换肤之资源(Resources)加载(一) - 本篇 setContentView() / LayoutI ...

  9. 携程Android App插件化和动态加载实践

    转载自:http://www.infoq.com/cn/articles/ctrip-android-dynamic-loading?email=947091870@qq.com 编者按:本文为携程无 ...

最新文章

  1. 根据二叉树的前序遍历和中序遍历重建二叉树
  2. MSFNet:多重空间融合网络进行实时语义分割(北航和旷视联合提出)
  3. H5的学习从0到1-H5的实体(14)
  4. 下防火墙命令与centos7下防火墙命令区别
  5. PowerPoint出现“受保护的视图,Office已检测到该文件存在问题。编辑此文件可能会损坏您的计算机。”的提示
  6. Delphi 关键 重启 注销
  7. 服务器centos怎么部署_我什么都不会,怎么拥有自己的个人博客呢
  8. Spring 事务失效的 8 大场景,看看你都遇到过几个?
  9. mybatis按datetime条件查询,参数为时间戳时
  10. H5网页漫画小说苹果cms模板源码/支持对接公众号/支持三级分销
  11. vijos1942——小岛 Floyed
  12. 微服务不是架构演变的终点!
  13. PyPI 官方仓库遭遇挖矿恶意组件投毒
  14. html京东 重置代码,拟写京东登录界面(HTML - CSS)
  15. 统统卸载!再见了,流氓顽固软件!
  16. 谈谈win10的简单美化
  17. 大陆人怎么去香港银行开户?
  18. 转载:解决采集UTF-8网页空格变成问号乱码
  19. 百度地图API学习---隐藏百度版权标志
  20. 【python】模拟淘宝的客服自动回复系统-socket,json,time模块的应用

热门文章

  1. 【车联网】一文了解5G在车联网中的应用
  2. 如何对待逐渐疏远的朋友?
  3. selenium + plantomjs 实现自动化测试01
  4. 京东CEO徐雷:京东抗疫救灾 从来不惜力不算账
  5. 理想汽车CEO李想深夜回应“水银事件”:百分百支持你去报案
  6. 小米折叠屏手机真机现身:疑似跳票两年的MIX 4……
  7. 错失黄金时期、连年亏损,国美App改名也难“真快乐”
  8. 阿里拍卖官方客服全面升级 推出一对一教你“一站式服务”
  9. 小米11渲染图曝光:屏下摄像头技术现身还有方形5摄相机模组
  10. 只有一条数据线了?iOS 14暗示苹果不在iPhone 12中附赠耳机