code: public void setImagesData(List data) {
          if (data == null || data.isEmpty()) {
              this.setVisibility(GONE);
              return;
          } else {
              this.setVisibility(VISIBLE);
          }
  
          if (mMaxSize > 0 && data.size() > mMaxSize) {
              data = data.subList(0, mMaxSize);
          }
  
          int[] gridParam = calculateGridParam(data.size());
          mRowCount = gridParam[0];
          mColumnCount = gridParam[1];
          if (mImgDataList == null) {
              int i = 0;
              while (i < data.size()) {
                  ImageView iv = getImageView(i);
                  if (iv == null)
                      return;
                  addView(iv, generateDefaultLayoutParams());
                  i++;
              }
          } else {
              int oldViewCount = mImgDataList.size();
              int newViewCount = data.size();
              if (oldViewCount > newViewCount) {
                  removeViews(newViewCount, oldViewCount - newViewCount);
              } else if (oldViewCount < newViewCount) {
                  for (int i = oldViewCount; i < newViewCount; i++) {
                      ImageView iv = getImageView(i);
                      if (iv == null) {
                          return;
                      }
                      addView(iv, generateDefaultLayoutParams());
                  }
              }
          }
          mImgDataList = data;
          requestLayout();
      }
docs: 设置图片数据
  
  @param data 图片数据集合