1 package com.netease.nimlib.sdk.nos.util;
3 import android.util.DisplayMetrics;
15 return NosUtil.appendQueryParams(url, toImageThumbParams(thumb, width, height));
20 if (originH > 0 && originW > 0) {
21 int ration = (originW > originH ? originW / originH : originH / originW);
25 int width = SDKCache.getOptions().thumbnailSize;
27 DisplayMetrics dm = SDKCache.getContext().getApplicationContext().getResources().getDisplayMetrics();
28 width = Math.min(dm.widthPixels, dm.heightPixels) / 2;
30 return NosUtil.appendQueryParams(url, toImageThumbParams(thumb, width, width));
34 if (!checkImageThumb(thumb, width, height)) {
35 throw new IllegalArgumentException(
"width=" + width +
", height=" + height);
38 StringBuilder sb =
new StringBuilder();
40 sb.append(
"thumbnail=");
42 sb.append(toImageThumbMethod(thumb));
45 sb.append(
"&imageView");
52 if (width < 0 || height < 0) {
59 return width > 0 || height > 0;
63 return width > 0 && height > 0;
79 throw new IllegalArgumentException(
"thumb: " + thumb);
static final String makeImageThumbUrl(String url, NosThumbParam.ThumbType thumb, int width, int height)
static final String makeImageThumbUrl(String url, int originW, int originH)