bitmapCache = new LruCache<>(cacheSize);
348 | SparseIntArray bitmapLeft = new SparseIntArray(size);
349 | SparseIntArray bitmapTop = new SparseIntArray(size);
350 | for (int i = 0; i < size; i++) {
351 | RecyclerView.ViewHolder holder = adapter.createViewHolder(recyclerView, adapter.getItemViewType(i));
352 | adapter.onBindViewSync(holder, i);
353 | RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) holder.itemView.getLayoutParams();
354 | holder.itemView.measure(
355 | View.MeasureSpec.makeMeasureSpec(recyclerView.getWidth() - layoutParams.leftMargin - layoutParams.rightMargin, View.MeasureSpec.EXACTLY),
356 | View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
357 | );
358 | holder.itemView.layout(
359 | layoutParams.leftMargin,
360 | layoutParams.topMargin,
361 | holder.itemView.getMeasuredWidth() + layoutParams.leftMargin,
362 | holder.itemView.getMeasuredHeight() + layoutParams.topMargin
363 | );
364 | holder.itemView.setDrawingCacheEnabled(true);
365 | holder.itemView.buildDrawingCache();
366 | Bitmap drawingCache = holder.itemView.getDrawingCache();
367 | if (drawingCache != null) {
368 | bitmapCache.put(String.valueOf(i), drawingCache);
369 | }
370 |
371 | height += layoutParams.topMargin;
372 | bitmapLeft.put(i, layoutParams.leftMargin);
373 | bitmapTop.put(i, height);
374 | height += holder.itemView.getMeasuredHeight() + layoutParams.bottomMargin;
375 | }
376 |
377 | bigBitmap = Bitmap.createBitmap(recyclerView.getMeasuredWidth(), height, Bitmap.Config.ARGB_8888);
378 | Canvas bigCanvas = new Canvas(bigBitmap);
379 | Drawable lBackground = recyclerView.getBackground();
380 | if (lBackground instanceof ColorDrawable) {
381 | ColorDrawable lColorDrawable = (ColorDrawable) lBackground;
382 | int lColor = lColorDrawable.getColor();
383 | bigCanvas.drawColor(lColor);
384 | }
385 |
386 | for (int i = 0; i < size; i++) {
387 | Bitmap bitmap = bitmapCache.get(String.valueOf(i));
388 | bigCanvas.drawBitmap(bitmap, bitmapLeft.get(i), bitmapTop.get(i), paint);
389 | bitmap.recycle();
390 | }
391 | }
392 | return bigBitmap;
393 | } catch (OutOfMemoryError oom) {
394 | return null;
395 | }
396 | }
397 |
398 | /**
399 | * 截图WebView,没有使用X5内核
400 | *
401 | * @param webView
402 | * @return
403 | */
404 | public static Bitmap shotWebView(WebView webView) {
405 | try {
406 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
407 | // Android5.0以上
408 | float scale = webView.getScale();
409 | int width = webView.getWidth();
410 | int height = (int) (webView.getContentHeight() * scale + 0.5);
411 | Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
412 | Canvas canvas = new Canvas(bitmap);
413 | webView.draw(canvas);
414 |
415 | // 保存图片
416 | savePicture(webView.getContext(), bitmap);
417 | return bitmap;
418 | } else {
419 | // Android5.0以下
420 | Picture picture = webView.capturePicture();
421 | int width = picture.getWidth();
422 | int height = picture.getHeight();
423 | if (width > 0 && height > 0) {
424 | Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
425 | Canvas canvas = new Canvas(bitmap);
426 | picture.draw(canvas);
427 |
428 | // 保存图片
429 | savePicture(webView.getContext(), bitmap);
430 | return bitmap;
431 | }
432 | return null;
433 | }
434 | } catch (OutOfMemoryError oom) {
435 | return null;
436 | }
437 | }
438 |
439 | /**
440 | * 保存图片
441 | *
442 | * @param context
443 | * @param bitmap
444 | */
445 | public static File savePicture(final Context context, Bitmap bitmap) {
446 |
447 | if (bitmap == null) {
448 | return null;
449 | }
450 |
451 | final File mFile;
452 | String path = Environment.getExternalStorageDirectory() + File.separator + FILE_DIR;
453 | final File dir = new File(path);
454 | if (!dir.exists()) {
455 | dir.mkdirs();
456 | }
457 |
458 | //当前时间通过MD5命名图片
459 | String fileName = getMD5(System.currentTimeMillis() + "").toUpperCase(Locale.getDefault());
460 | mFile = new File(dir, fileName);
461 | FileOutputStream out = null;
462 | try {
463 | out = new FileOutputStream(mFile.getAbsolutePath());
464 | bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
465 | out.flush();
466 | } catch (FileNotFoundException e) {
467 | e.printStackTrace();
468 | } catch (IOException e) {
469 | e.printStackTrace();
470 | } finally {
471 | try {
472 | if (null != out) {
473 | out.close();
474 | }
475 | if (!bitmap.isRecycled()) {
476 | bitmap.recycle();
477 | }
478 | } catch (IOException e) {
479 | e.printStackTrace();
480 | }
481 | }
482 |
483 | // 默认的压缩方法,多张图片只需要直接加入循环即可
484 | // File newFile = CompressHelper.getDefault(context.getApplicationContext()).compressToFile(mFile);
485 |
486 | File newFile = new CompressHelper.Builder(context.getApplicationContext())
487 | // 默认最大宽度为720
488 | .setMaxWidth(10000)
489 | // 默认最大高度为960
490 | .setMaxHeight(50000)
491 | // 默认压缩质量为80
492 | .setQuality(80)
493 | // 设置你需要修改的文件名
494 | .setFileName(fileName)
495 | // 设置默认压缩为jpg格式
496 | .setCompressFormat(Bitmap.CompressFormat.JPEG)
497 | // .setDestinationDirectoryPath(Environment.getExternalStoragePublicDirectory(
498 | // Environment.DIRECTORY_PICTURES).getAbsolutePath())
499 | .setDestinationDirectoryPath(dir.getAbsolutePath())
500 | .build()
501 | .compressToFile(mFile);
502 |
503 | //更新本地图库
504 | Uri uri = Uri.fromFile(newFile);
505 | Intent mIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
506 | context.sendBroadcast(mIntent);
507 |
508 | return newFile;
509 | }
510 |
511 | /**
512 | * MD5加密
513 | *
514 | * @param info
515 | */
516 | private static String getMD5(String info) {
517 | try {
518 | MessageDigest md5 = MessageDigest.getInstance("MD5");
519 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
520 | md5.update(info.getBytes(StandardCharsets.UTF_8));
521 | } else {
522 | md5.update(info.getBytes("UTF-8"));
523 | }
524 | byte[] encryption = md5.digest();
525 |
526 | StringBuilder strBuilder = new StringBuilder();
527 | for (int i = 0; i < encryption.length; i++) {
528 | if (Integer.toHexString(0xff & encryption[i]).length() == 1) {
529 | strBuilder.append("0").append(Integer.toHexString(0xff & encryption[i]));
530 | } else {
531 | strBuilder.append(Integer.toHexString(0xff & encryption[i]));
532 | }
533 | }
534 |
535 | return strBuilder.toString();
536 | } catch (Exception e) {
537 | return "";
538 | }
539 | }
540 | }
541 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wkz/share/utils/ScreenUtils.java:
--------------------------------------------------------------------------------
1 | package com.wkz.share.utils;
2 |
3 | import android.content.Context;
4 | import android.util.DisplayMetrics;
5 | import android.view.WindowManager;
6 |
7 | import java.util.Objects;
8 |
9 | /**
10 | * 屏幕相关工具类
11 | *
12 | * @author Administrator
13 | * @date 2018/5/21
14 | */
15 | public class ScreenUtils {
16 |
17 | private ScreenUtils() {
18 | /* cannot be instantiated */
19 | throw new UnsupportedOperationException("cannot be instantiated");
20 | }
21 |
22 | /**
23 | * 获得屏幕高度
24 | *
25 | * @param context
26 | * @return
27 | */
28 | public static int getScreenWidth(Context context) {
29 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
30 | DisplayMetrics outMetrics = new DisplayMetrics();
31 | Objects.requireNonNull(wm).getDefaultDisplay().getMetrics(outMetrics);
32 | return outMetrics.widthPixels;
33 | }
34 |
35 | /**
36 | * 获得屏幕宽度
37 | *
38 | * @param context
39 | * @return
40 | */
41 | public static int getScreenHeight(Context context) {
42 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
43 | DisplayMetrics outMetrics = new DisplayMetrics();
44 | Objects.requireNonNull(wm).getDefaultDisplay().getMetrics(outMetrics);
45 | return outMetrics.heightPixels;
46 | }
47 |
48 | /**
49 | * 获得状态栏的高度
50 | *
51 | * @param context
52 | * @return
53 | */
54 | public static int getStatusHeight(Context context) {
55 |
56 | int statusHeight = -1;
57 | try {
58 | Class> clazz = Class.forName("com.android.internal.R$dimen");
59 | Object object = clazz.newInstance();
60 | int height = Integer.parseInt(clazz.getField("status_bar_height")
61 | .get(object).toString());
62 | statusHeight = context.getResources().getDimensionPixelSize(height);
63 | } catch (Exception e) {
64 | e.printStackTrace();
65 | }
66 | return statusHeight;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wkz/share/utils/ViewUtils.java:
--------------------------------------------------------------------------------
1 | package com.wkz.share.utils;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 |
7 | /**
8 | * 视图工具类,设置某个view的padding/margin
9 | *
10 | * @author Administrator
11 | * @date 2018/3/28
12 | */
13 |
14 | public class ViewUtils {
15 |
16 | /**
17 | * 设置某个View的padding
18 | *
19 | * @param view 需要设置的view
20 | * @param isDp 需要设置的数值是否为DP
21 | * @param left 左边距
22 | * @param top 上边距
23 | * @param right 右边距
24 | * @param bottom 下边距
25 | */
26 | public static void setViewPadding(View view, boolean isDp, float left, float top, float right, float bottom) {
27 | if (view == null) {
28 | return;
29 | }
30 |
31 | int leftPx;
32 | int rightPx;
33 | int topPx;
34 | int bottomPx;
35 |
36 | if (isDp) {
37 | //根据DP与PX转换计算值
38 | leftPx = dp2px(view.getContext(), left);
39 | topPx = dp2px(view.getContext(), top);
40 | rightPx = dp2px(view.getContext(), right);
41 | bottomPx = dp2px(view.getContext(), bottom);
42 | } else {
43 | leftPx = (int) left;
44 | rightPx = (int) right;
45 | topPx = (int) top;
46 | bottomPx = (int) bottom;
47 | }
48 |
49 | //设置padding
50 | view.setPadding(leftPx, topPx, rightPx, bottomPx);
51 | }
52 |
53 | /**
54 | * 设置某个View的margin
55 | *
56 | * @param view 需要设置的view
57 | * @param isDp 需要设置的数值是否为DP
58 | * @param left 左边距
59 | * @param top 上边距
60 | * @param right 右边距
61 | * @param bottom 下边距
62 | */
63 | public static void setViewMargin(View view, boolean isDp, float left, float top, float right, float bottom) {
64 | if (view == null) {
65 | return;
66 | }
67 |
68 | int leftPx;
69 | int rightPx;
70 | int topPx;
71 | int bottomPx;
72 |
73 | ViewGroup.LayoutParams params = view.getLayoutParams();
74 | ViewGroup.MarginLayoutParams marginParams;
75 | //获取view的margin设置参数
76 | if (params instanceof ViewGroup.MarginLayoutParams) {
77 | marginParams = (ViewGroup.MarginLayoutParams) params;
78 | } else {
79 | //不存在时创建一个新的参数
80 | marginParams = new ViewGroup.MarginLayoutParams(params);
81 | }
82 |
83 | if (isDp) {
84 | //根据DP与PX转换计算值
85 | leftPx = dp2px(view.getContext(), left);
86 | topPx = dp2px(view.getContext(), top);
87 | rightPx = dp2px(view.getContext(), right);
88 | bottomPx = dp2px(view.getContext(), bottom);
89 | } else {
90 | leftPx = (int) left;
91 | rightPx = (int) right;
92 | topPx = (int) top;
93 | bottomPx = (int) bottom;
94 | }
95 | //设置margin
96 | marginParams.setMargins(leftPx, topPx, rightPx, bottomPx);
97 | view.setLayoutParams(marginParams);
98 | }
99 |
100 | /**
101 | * dp转px
102 | *
103 | * @param dpValue dp值
104 | * @return px值
105 | */
106 | public static int dp2px(Context context, float dpValue) {
107 | final float scale = context.getApplicationContext().getResources().getDisplayMetrics().density;
108 | return (int) (dpValue * scale + 0.5f);
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wkz/share/zxing/QRCode.java:
--------------------------------------------------------------------------------
1 | package com.wkz.share.zxing;
2 |
3 | /**
4 | * * _ _
5 | * * __ _(_)_ _(_) __ _ _ __
6 | * * \ \ / / \ \ / / |/ _` | '_ \
7 | * * \ V /| |\ V /| | (_| | | | |
8 | * * \_/ |_| \_/ |_|\__,_|_| |_|
9 | *
10 | * Created by vivian on 2016/11/28.
11 | */
12 |
13 | import android.graphics.Bitmap;
14 | import android.graphics.Matrix;
15 | import android.support.annotation.ColorInt;
16 |
17 | import com.google.zxing.BarcodeFormat;
18 | import com.google.zxing.EncodeHintType;
19 | import com.google.zxing.WriterException;
20 | import com.google.zxing.common.BitMatrix;
21 | import com.google.zxing.qrcode.QRCodeWriter;
22 | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
23 |
24 | import java.util.Hashtable;
25 |
26 | public class QRCode {
27 | private static int IMAGE_HALFWIDTH = 100;
28 |
29 | /**
30 | * 生成二维码,默认大小为500*500
31 | *
32 | * @param text 需要生成二维码的文字、网址等
33 | * @return bitmap
34 | */
35 | public static Bitmap createQRCode(String text) {
36 | return createQRCode(text, 500);
37 | }
38 |
39 | /**
40 | * 生成二维码
41 | *
42 | * @param text 文字或网址
43 | * @param size 生成二维码的大小
44 | * @return bitmap
45 | */
46 | public static Bitmap createQRCode(String text, int size) {
47 | try {
48 | Hashtable hints = new Hashtable<>();
49 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
50 | //去掉白边
51 | hints.put(EncodeHintType.MARGIN, 0);
52 |
53 | BitMatrix bitMatrix = new QRCodeWriter().encode(text,
54 | BarcodeFormat.QR_CODE, size, size, hints);
55 | int[] pixels = new int[size * size];
56 | for (int y = 0; y < size; y++) {
57 | for (int x = 0; x < size; x++) {
58 | if (bitMatrix.get(x, y)) {
59 | pixels[y * size + x] = 0xff000000;
60 | } else {
61 | pixels[y * size + x] = 0xffffffff;
62 | }
63 | }
64 | }
65 | Bitmap bitmap = Bitmap.createBitmap(size, size,
66 | Bitmap.Config.ARGB_8888);
67 | bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
68 | return bitmap;
69 | } catch (WriterException e) {
70 | e.printStackTrace();
71 | return null;
72 | }
73 | }
74 |
75 | /**
76 | * bitmap的颜色代替黑色的二维码
77 | *
78 | * @param text
79 | * @param size
80 | * @param mBitmap
81 | * @return
82 | */
83 | public static Bitmap createQRCodeWithLogo2(String text, int size, Bitmap mBitmap) {
84 | try {
85 | IMAGE_HALFWIDTH = size / 10;
86 | Hashtable hints = new Hashtable<>();
87 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
88 | //去掉白边
89 | hints.put(EncodeHintType.MARGIN, 0);
90 |
91 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
92 | BitMatrix bitMatrix = new QRCodeWriter().encode(text,
93 | BarcodeFormat.QR_CODE, size, size, hints);
94 |
95 | //将logo图片按matrix设置的信息缩放
96 | mBitmap = Bitmap.createScaledBitmap(mBitmap, size, size, false);
97 |
98 | int[] pixels = new int[size * size];
99 | int color = 0xffffffff;
100 | for (int y = 0; y < size; y++) {
101 | for (int x = 0; x < size; x++) {
102 | if (bitMatrix.get(x, y)) {
103 | pixels[y * size + x] = mBitmap.getPixel(x, y);
104 | } else {
105 | pixels[y * size + x] = color;
106 | }
107 |
108 | }
109 | }
110 | Bitmap bitmap = Bitmap.createBitmap(size, size,
111 | Bitmap.Config.ARGB_8888);
112 | bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
113 | return bitmap;
114 | } catch (WriterException e) {
115 | e.printStackTrace();
116 | return null;
117 | }
118 | }
119 |
120 | /**
121 | * bitmap作为底色
122 | *
123 | * @param text
124 | * @param size
125 | * @param mBitmap
126 | * @return
127 | */
128 | public static Bitmap createQRCodeWithLogo3(String text, int size, Bitmap mBitmap) {
129 | try {
130 | IMAGE_HALFWIDTH = size / 10;
131 | Hashtable hints = new Hashtable<>();
132 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
133 | //去掉白边
134 | hints.put(EncodeHintType.MARGIN, 0);
135 |
136 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
137 | BitMatrix bitMatrix = new QRCodeWriter().encode(text,
138 | BarcodeFormat.QR_CODE, size, size, hints);
139 |
140 | //将logo图片按matrix设置的信息缩放
141 | mBitmap = Bitmap.createScaledBitmap(mBitmap, size, size, false);
142 |
143 | int[] pixels = new int[size * size];
144 | int color = 0xfff92736;
145 | for (int y = 0; y < size; y++) {
146 | for (int x = 0; x < size; x++) {
147 | if (bitMatrix.get(x, y)) {
148 | pixels[y * size + x] = color;
149 | } else {
150 | pixels[y * size + x] = mBitmap.getPixel(x, y) & 0x66ffffff;
151 | }
152 | }
153 | }
154 | Bitmap bitmap = Bitmap.createBitmap(size, size,
155 | Bitmap.Config.ARGB_8888);
156 | bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
157 | return bitmap;
158 | } catch (WriterException e) {
159 | e.printStackTrace();
160 | return null;
161 | }
162 | }
163 |
164 | /**
165 | * 比方法2的颜色黑一些
166 | *
167 | * @param text
168 | * @param size
169 | * @param mBitmap
170 | * @return
171 | */
172 | public static Bitmap createQRCodeWithLogo4(String text, int size, Bitmap mBitmap) {
173 | try {
174 | IMAGE_HALFWIDTH = size / 10;
175 | Hashtable hints = new Hashtable<>();
176 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
177 | //去掉白边
178 | hints.put(EncodeHintType.MARGIN, 0);
179 |
180 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
181 | BitMatrix bitMatrix = new QRCodeWriter().encode(text,
182 | BarcodeFormat.QR_CODE, size, size, hints);
183 |
184 | //将logo图片按matrix设置的信息缩放
185 | mBitmap = Bitmap.createScaledBitmap(mBitmap, size, size, false);
186 |
187 | int[] pixels = new int[size * size];
188 | boolean flag = true;
189 | for (int y = 0; y < size; y++) {
190 | for (int x = 0; x < size; x++) {
191 | if (bitMatrix.get(x, y)) {
192 | if (flag) {
193 | flag = false;
194 | pixels[y * size + x] = 0xff000000;
195 | } else {
196 | pixels[y * size + x] = mBitmap.getPixel(x, y);
197 | flag = true;
198 | }
199 | } else {
200 | pixels[y * size + x] = 0xffffffff;
201 | }
202 | }
203 | }
204 | Bitmap bitmap = Bitmap.createBitmap(size, size,
205 | Bitmap.Config.ARGB_8888);
206 | bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
207 | return bitmap;
208 | } catch (WriterException e) {
209 | e.printStackTrace();
210 | return null;
211 | }
212 | }
213 |
214 | /**
215 | * 生成带logo的二维码
216 | *
217 | * @param text
218 | * @param size
219 | * @param mBitmap
220 | * @return
221 | */
222 | public static Bitmap createQRCodeWithLogo5(String text, int size, Bitmap mBitmap) {
223 | try {
224 | IMAGE_HALFWIDTH = size / 10;
225 | Hashtable hints = new Hashtable<>();
226 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
227 | //去掉白边
228 | hints.put(EncodeHintType.MARGIN, 0);
229 |
230 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
231 | BitMatrix bitMatrix = new QRCodeWriter().encode(text,
232 | BarcodeFormat.QR_CODE, size, size, hints);
233 |
234 | //将logo图片按matrix设置的信息缩放
235 | mBitmap = Bitmap.createScaledBitmap(mBitmap, size, size, false);
236 |
237 | //矩阵高度
238 | int width = bitMatrix.getWidth();
239 | //矩阵宽度
240 | int height = bitMatrix.getHeight();
241 | int halfW = width / 2;
242 | int halfH = height / 2;
243 |
244 | Matrix m = new Matrix();
245 | float sx = (float) 2 * IMAGE_HALFWIDTH / mBitmap.getWidth();
246 | float sy = (float) 2 * IMAGE_HALFWIDTH
247 | / mBitmap.getHeight();
248 | m.setScale(sx, sy);
249 | //设置缩放信息
250 | //将logo图片按martix设置的信息缩放
251 | mBitmap = Bitmap.createBitmap(mBitmap, 0, 0,
252 | mBitmap.getWidth(), mBitmap.getHeight(), m, false);
253 |
254 | int[] pixels = new int[size * size];
255 | for (int y = 0; y < size; y++) {
256 | for (int x = 0; x < size; x++) {
257 | if (x > halfW - IMAGE_HALFWIDTH && x < halfW + IMAGE_HALFWIDTH
258 | && y > halfH - IMAGE_HALFWIDTH
259 | && y < halfH + IMAGE_HALFWIDTH) {
260 | //该位置用于存放图片信息
261 | //记录图片每个像素信息
262 | pixels[y * width + x] = mBitmap.getPixel(x - halfW
263 | + IMAGE_HALFWIDTH, y - halfH + IMAGE_HALFWIDTH);
264 | } else {
265 | if (bitMatrix.get(x, y)) {
266 | pixels[y * size + x] = 0xff37b19e;
267 | } else {
268 | pixels[y * size + x] = 0xffffffff;
269 | }
270 | }
271 | }
272 | }
273 | Bitmap bitmap = Bitmap.createBitmap(size, size,
274 | Bitmap.Config.ARGB_8888);
275 | bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
276 | return bitmap;
277 | } catch (WriterException e) {
278 | e.printStackTrace();
279 | return null;
280 | }
281 | }
282 |
283 | /**
284 | * 修改三个顶角颜色的,带logo的二维码
285 | *
286 | * @param text 需要生成二维码的文字、网址等
287 | * @param size 生成二维码的大小
288 | * @param mBitmap 二维码中心图片
289 | * @return
290 | */
291 | public static Bitmap createQRCodeWithLogo6(String text, int size, Bitmap mBitmap, @ColorInt int vertexColor) {
292 | try {
293 | IMAGE_HALFWIDTH = size / 5;
294 | Hashtable hints = new Hashtable<>();
295 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
296 | //去掉白边
297 | hints.put(EncodeHintType.MARGIN, 0);
298 | /*
299 | * 设置容错级别,默认为ErrorCorrectionLevel.L
300 | * 因为中间加入logo所以建议你把容错级别调至H,否则可能会出现识别不了
301 | */
302 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
303 | BitMatrix bitMatrix = new QRCodeWriter().encode(text,
304 | BarcodeFormat.QR_CODE, size, size, hints);
305 |
306 | //将logo图片按matrix设置的信息缩放
307 | mBitmap = Bitmap.createScaledBitmap(mBitmap, size, size, false);
308 |
309 | //矩阵高度
310 | int width = bitMatrix.getWidth();
311 | //矩阵宽度
312 | int height = bitMatrix.getHeight();
313 | int halfW = width / 2;
314 | int halfH = height / 2;
315 |
316 | Matrix m = new Matrix();
317 | float sx = (float) 2 * IMAGE_HALFWIDTH / mBitmap.getWidth();
318 | float sy = (float) 2 * IMAGE_HALFWIDTH / mBitmap.getHeight();
319 | m.setScale(sx, sy);
320 | //设置缩放信息
321 | //将logo图片按matrix设置的信息缩放
322 | mBitmap = Bitmap.createBitmap(mBitmap, 0, 0,
323 | mBitmap.getWidth(), mBitmap.getHeight(), m, false);
324 |
325 | int[] pixels = new int[size * size];
326 | for (int y = 0; y < size; y++) {
327 | for (int x = 0; x < size; x++) {
328 | if (x > halfW - IMAGE_HALFWIDTH && x < halfW + IMAGE_HALFWIDTH
329 | && y > halfH - IMAGE_HALFWIDTH
330 | && y < halfH + IMAGE_HALFWIDTH) {
331 | //该位置用于存放图片信息
332 | //记录图片每个像素信息
333 | pixels[y * width + x] = mBitmap.getPixel(x - halfW
334 | + IMAGE_HALFWIDTH, y - halfH + IMAGE_HALFWIDTH);
335 | } else {
336 | if (bitMatrix.get(x, y)) {
337 | //二维码像素颜色
338 | pixels[y * size + x] = 0xff111111;
339 | if (x < 115 && (y < 115 || y >= size - 115) || (y < 115 && x >= size - 115)) {
340 | //顶角颜色
341 | pixels[y * size + x] = vertexColor;
342 | }
343 | } else {
344 | //背景颜色
345 | pixels[y * size + x] = 0xffffffff;
346 | }
347 | }
348 | }
349 | }
350 | Bitmap bitmap = Bitmap.createBitmap(size, size,
351 | Bitmap.Config.ARGB_8888);
352 | bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
353 | return bitmap;
354 | } catch (WriterException e) {
355 | e.printStackTrace();
356 | return null;
357 | }
358 | }
359 |
360 | }
361 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_0xffededed_cornersfive.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_0xffededed_cornersfive_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_0xffededed_cornersfive_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_0xffffffff_cornerstwo.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_list_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
25 |
26 |
33 |
34 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_scroll_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
24 |
25 |
32 |
33 |
43 |
44 |
59 |
60 |
74 |
75 |
88 |
89 |
93 |
94 |
104 |
105 |
112 |
113 |
120 |
121 |
128 |
129 |
130 |
131 |
132 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_web_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_share.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
22 |
23 |
24 |
30 |
31 |
41 |
42 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
25 |
26 |
41 |
42 |
56 |
57 |
83 |
84 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycler_item_recycler1.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
36 |
37 |
51 |
52 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycler_item_recycler2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
23 |
24 |
31 |
32 |
39 |
40 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycler_item_share_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
22 |
23 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_close_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_close_white.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_game_icon.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_game_icon.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_share_friend_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_share_friend_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_share_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_share_link.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_share_microblog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_share_microblog.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_share_qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_share_qq.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_share_qqspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_share_qqspace.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_share_wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/ic_share_wechat.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/pic_image.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/pic_image.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/pic_long_img1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/pic_long_img1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/pic_long_img2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/app/src/main/res/mipmap-xxxhdpi/pic_long_img2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
32 |
33 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 长截图分享
3 | 噫吁嚱,危乎高哉!蜀道之难,难于上青天!蚕丛及鱼凫,开国何茫然!尔来四万八千岁,不与秦塞通人烟。西当太白有鸟道,可以横绝峨眉巅。地崩山摧壮士死,然后天梯石栈相钩连。上有六龙回日之高标,下有冲波逆折之回川。黄鹤之飞尚不得过,猿猱欲度愁攀援。青泥何盘盘,百步九折萦岩峦。扪参历井仰胁息,以手抚膺坐长叹。
4 |
5 | 问君西游何时还?畏途巉岩不可攀。但见悲鸟号古木,雄飞雌从绕林间。又闻子规啼夜月,愁空山。蜀道之难,难于上青天,使人听此凋朱颜!连峰去天不盈尺,枯松倒挂倚绝壁。飞湍瀑流争喧豗,砯崖转石万壑雷。其险也如此,嗟尔远道之人胡为乎来哉!
6 |
7 | 剑阁峥嵘而崔嵬,一夫当关,万夫莫开。所守或匪亲,化为狼与豺。朝避猛虎,夕避长蛇;磨牙吮血,杀人如麻。锦城虽云乐,不如早还家。蜀道之难,难于上青天,侧身西望长咨嗟!\n\n壬戌之秋,七月既望,苏子与客泛舟游于赤壁之下。清风徐来,水波不兴。举酒属客,诵明月之诗,歌窈窕之章。少焉,月出于东山之上,徘徊于斗牛之间。白露横江,水光接天。纵一苇之所如,凌万顷之茫然。浩浩乎如冯虚御风,而不知其所止;飘飘乎如遗世独立,羽化而登仙。
8 |
9 | 于是饮酒乐甚,扣舷而歌之。歌曰:“桂棹兮兰桨,击空明兮溯流光。渺渺兮予怀,望美人兮天一方。”客有吹洞箫者,倚歌而和之。其声呜呜然,如怨如慕,如泣如诉,余音袅袅,不绝如缕。舞幽壑之潜蛟,泣孤舟之嫠妇。
10 |
11 | 苏子愀然,正襟危坐而问客曰:“何为其然也?”客曰:“月明星稀,乌鹊南飞,此非曹孟德之诗乎?西望夏口,东望武昌,山川相缪,郁乎苍苍,此非孟德之困于周郎者乎?方其破荆州,下江陵,顺流而东也,舳舻千里,旌旗蔽空,酾酒临江,横槊赋诗,固一世之雄也,而今安在哉?况吾与子渔樵于江渚之上,侣鱼虾而友麋鹿,驾一叶之扁舟,举匏樽以相属。寄蜉蝣于天地,渺沧海之一粟。哀吾生之须臾,羡长江之无穷。挟飞仙以遨游,抱明月而长终。知不可乎骤得,托遗响于悲风。”
12 |
13 | 苏子曰:“客亦知夫水与月乎?逝者如斯,而未尝往也;盈虚者如彼,而卒莫消长也。盖将自其变者而观之,则天地曾不能以一瞬;自其不变者而观之,则物与我皆无尽也,而又何羡乎!且夫天地之间,物各有主,苟非吾之所有,虽一毫而莫取。惟江上之清风,与山间之明月,耳得之而为声,目遇之而成色,取之无禁,用之不竭,是造物者之无尽藏也,而吾与子之所共适。”
14 |
15 | 客喜而笑,洗盏更酌。肴核既尽,杯盘狼籍。相与枕藉乎舟中,不知东方之既白。\n\n浔阳江头夜送客,枫叶荻花秋瑟瑟。主人下马客在船,举酒欲饮无管弦。醉不成欢惨将别,别时茫茫江浸月。
16 |
17 | 忽闻水上琵琶声,主人忘归客不发。寻声暗问弹者谁,琵琶声停欲语迟。移船相近邀相见,添酒回灯重开宴。千呼万唤始出来,犹抱琵琶半遮面。转轴拨弦三两声,未成曲调先有情。弦弦掩抑声声思,似诉平生不得志。低眉信手续续弹,说尽心中无限事。轻拢慢捻抹复挑,初为《霓裳》后《六幺》。大弦嘈嘈如急雨,小弦切切如私语。嘈嘈切切错杂弹,大珠小珠落玉盘。间关莺语花底滑,幽咽泉流冰下难。冰泉冷涩弦凝绝,凝绝不通声暂歇。别有幽愁暗恨生,此时无声胜有声。银瓶乍破水浆迸,铁骑突出刀枪鸣。曲终收拨当心画,四弦一声如裂帛。东船西舫悄无言,唯见江心秋月白。
18 |
19 | 沉吟放拨插弦中,整顿衣裳起敛容。自言本是京城女,家在虾蟆陵下住。十三学得琵琶成,名属教坊第一部。曲罢曾教善才服,妆成每被秋娘妒。五陵年少争缠头,一曲红绡不知数。钿头银篦击节碎,血色罗裙翻酒污。今年欢笑复明年,秋月春风等闲度。弟走从军阿姨死,暮去朝来颜色故。门前冷落鞍马稀,老大嫁作商人妇。商人重利轻别离,前月浮梁买茶去。去来江口守空船,绕船月明江水寒。夜深忽梦少年事,梦啼妆泪红阑干。
20 |
21 | 我闻琵琶已叹息,又闻此语重唧唧。同是天涯沦落人,相逢何必曾相识!我从去年辞帝京,谪居卧病浔阳城。浔阳地僻无音乐,终岁不闻丝竹声。住近湓江地低湿,黄芦苦竹绕宅生。其间旦暮闻何物?杜鹃啼血猿哀鸣。春江花朝秋月夜,往往取酒还独倾。岂无山歌与村笛?呕哑嘲哳难为听。今夜闻君琵琶语,如听仙乐耳暂明。莫辞更坐弹一曲,为君翻作《琵琶行》。感我此言良久立,却坐促弦弦转急。凄凄不似向前声,满座重闻皆掩泣。座中泣下谁最多?江州司马青衫湿。
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
30 |
31 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.4.0'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed May 16 15:34:33 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/preview/shot_listview.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/preview/shot_listview.jpeg
--------------------------------------------------------------------------------
/preview/shot_nestedscrollview.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/preview/shot_nestedscrollview.jpeg
--------------------------------------------------------------------------------
/preview/shot_recyclerview.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/preview/shot_recyclerview.jpeg
--------------------------------------------------------------------------------
/preview/shot_webview.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FPhoenixCorneaE/LongScreenShotShare/53ed232d02f1d4d7588bb3716e0744d6caee06df/preview/shot_webview.jpeg
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------