Fixed viewing external images

pull/157/head
M66B 5 years ago
parent a7f455f159
commit 309001f156

@ -2109,6 +2109,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void onOpenImage(Drawable drawable) { private void onOpenImage(Drawable drawable) {
ImageView pv = new ZoomableImageView(context); ImageView pv = new ZoomableImageView(context);
pv.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
pv.setImageDrawable(drawable); pv.setImageDrawable(drawable);
// TODO: dialog fragment // TODO: dialog fragment

@ -414,8 +414,9 @@ public class HtmlHelper {
final LevelListDrawable lld = new LevelListDrawable(); final LevelListDrawable lld = new LevelListDrawable();
Drawable wait = res.getDrawable(R.drawable.baseline_hourglass_empty_24, theme); Drawable wait = res.getDrawable(R.drawable.baseline_hourglass_empty_24, theme);
lld.addLevel(0, 0, wait); lld.addLevel(1, 1, wait);
lld.setBounds(0, 0, px, px); lld.setBounds(0, 0, px, px);
lld.setLevel(1);
final Context context = view.getContext().getApplicationContext(); final Context context = view.getContext().getApplicationContext();
executor.submit(new Runnable() { executor.submit(new Runnable() {
@ -466,7 +467,7 @@ public class HtmlHelper {
d.setBounds(0, 0, bm.getWidth(), bm.getHeight()); d.setBounds(0, 0, bm.getWidth(), bm.getHeight());
post(d, source); post(d, source);
} catch (Throwable ex) { } catch (Throwable ex) {
// Show warning icon // Show broken icon
Log.w(ex); Log.w(ex);
int resid = (ex instanceof IOException && !(ex instanceof FileNotFoundException) int resid = (ex instanceof IOException && !(ex instanceof FileNotFoundException)
? R.drawable.baseline_cloud_off_24 ? R.drawable.baseline_cloud_off_24
@ -493,9 +494,9 @@ public class HtmlHelper {
d.setBounds(0, 0, w, h); d.setBounds(0, 0, w, h);
} }
lld.addLevel(1, 1, d); lld.addLevel(0, 0, d);
lld.setBounds(0, 0, w, h); lld.setBounds(0, 0, w, h);
lld.setLevel(1); lld.setLevel(0);
view.setText(view.getText()); view.setText(view.getText());
} }

Loading…
Cancel
Save