|
@@ -4,11 +4,15 @@ import android.graphics.drawable.Drawable;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.CountDownTimer;
|
|
import android.os.CountDownTimer;
|
|
import android.text.Editable;
|
|
import android.text.Editable;
|
|
|
|
+
|
|
|
|
+import com.bumptech.glide.Glide;
|
|
|
|
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
import com.emato.ich.utils.Log;
|
|
import com.emato.ich.utils.Log;
|
|
import android.view.Gravity;
|
|
import android.view.Gravity;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
|
|
+import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
import android.widget.Toast;
|
|
import android.widget.Toast;
|
|
|
|
|
|
@@ -88,28 +92,16 @@ public class TakeCodeFragment extends Fragment {
|
|
String url = activity.getConfigMap().get(SystemConfigConstant.cabinet_take_object_qrcode_url);
|
|
String url = activity.getConfigMap().get(SystemConfigConstant.cabinet_take_object_qrcode_url);
|
|
|
|
|
|
if (getActivity() != null && activity.getConfigMap().size() > 0 && !StringUtils.isNullOrEmpty(url)) {
|
|
if (getActivity() != null && activity.getConfigMap().size() > 0 && !StringUtils.isNullOrEmpty(url)) {
|
|
- ICSPClient.getWeChatMPImage(url, new Callback() {
|
|
|
|
- @Override
|
|
|
|
- public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
|
|
|
- Log.e(TAG, "onFailure: 请求微信公众号图片错误! 网络异常! ", e);
|
|
|
|
- LoggingUtils.sendErrorLog("业务异常: 请求微信公众号图片错误! 网络异常! ", e);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
|
|
|
|
- getActivity().runOnUiThread(() -> {
|
|
|
|
- try {
|
|
|
|
- InputStream is = response.body().byteStream();
|
|
|
|
- final Drawable d = Drawable.createFromStream(is, "src");
|
|
|
|
- binding.textView.setBackground(d);
|
|
|
|
- is.close();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- Log.e(TAG, "onResponse: 设置图片异常! ", e);
|
|
|
|
- LoggingUtils.sendErrorLog("业务异常: 取件码输入页面设置图片异常! ", e);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ try {
|
|
|
|
+ ImageView imageView = view.findViewById(R.id.textView);
|
|
|
|
+ Glide.with(view).load(url)
|
|
|
|
+ .skipMemoryCache(true)//跳过内存缓存
|
|
|
|
+ .diskCacheStrategy(DiskCacheStrategy.NONE)//不缓冲disk硬盘中
|
|
|
|
+ .into(imageView);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ Log.e(TAG, "onResponse: Glide设置图片异常! ", e);
|
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: Glide请求微信公众号图片异常! ", e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 选中输入框
|
|
// 选中输入框
|