From 979d9cff22806f213b420452ab4a68fcbaf021b6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 31 五月 2021 17:43:49 +0800
Subject: [PATCH] 1. 修复多项可能引起空指针崩溃的bug; 2. 新建子任务时默认执行人员从全体人员改为当前用户; 3. 新建子任务时默认执行时间强制固定为总任务对应的时段内,确保子任务执行时间不会超出总任务范围。
---
app/src/main/java/cn/flightfeather/thirdapp/adapter/CommonPagerAdapter.java | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/adapter/CommonPagerAdapter.java b/app/src/main/java/cn/flightfeather/thirdapp/adapter/CommonPagerAdapter.java
index a7be5aa..15cfe38 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/adapter/CommonPagerAdapter.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/adapter/CommonPagerAdapter.java
@@ -1,20 +1,16 @@
package cn.flightfeather.thirdapp.adapter;
import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.drawable.BitmapDrawable;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import com.bm.library.PhotoView;
+import com.bumptech.glide.Glide;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
-
-import cn.flightfeather.thirdapp.util.ScreenUtils;
-import cn.flightfeather.thirdapp.util.photo.PhotoUtil;
/**
* Created by hyhb01 on 2018/3/26.
@@ -57,9 +53,12 @@
@Override
public Object instantiateItem(ViewGroup container, int position) {
- Bitmap bm = PhotoUtil.decodeSampledBitmapFromResource(fileList.get(position).getAbsolutePath(), ScreenUtils.getScreenWidth(context), ScreenUtils.getScreenHeight(context));
- viewList.get(position).setImageBitmap(bm);
+// Bitmap bm = PhotoUtil.decodeSampledBitmapFromResource(fileList.get(position).getAbsolutePath(), ScreenUtils.getScreenWidth(context), ScreenUtils.getScreenHeight(context));
+// viewList.get(position).setImageBitmap(bm);
+ Glide.with(container)
+ .load(fileList.get(position))
+ .into(viewList.get(position));
container.addView(viewList.get(position));
return viewList.get(position);
@@ -67,15 +66,15 @@
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
- BitmapDrawable bitmapDrawable = (BitmapDrawable) viewList.get(position).getDrawable();
- viewList.get(position).setImageDrawable(null);
- if (bitmapDrawable != null) {
- Bitmap bitmap = bitmapDrawable.getBitmap();
- if (bitmap != null) {
- bitmap.recycle();
- System.gc();
- }
- }
+// BitmapDrawable bitmapDrawable = (BitmapDrawable) viewList.get(position).getDrawable();
+// viewList.get(position).setImageDrawable(null);
+// if (bitmapDrawable != null) {
+// Bitmap bitmap = bitmapDrawable.getBitmap();
+// if (bitmap != null) {
+// bitmap.recycle();
+// System.gc();
+// }
+// }
container.removeView(viewList.get(position));
}
--
Gitblit v1.9.3