2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ public static void setSrcCompatZoomOffset(ImageElementView view, String imagePat
54
54
}
55
55
}
56
56
57
+ @ BindingAdapter (value = { "srcCompat" }, requireAll =false )
58
+ public static void setSrcCompatZoomOffset (ImageView view , String imagePath ) {
59
+ if (imagePath != null ) {
60
+ if (imagePath .equals ("" )) {
61
+ view .setImageDrawable (ContextCompat .getDrawable (view .getContext (),R .drawable .ic_image_black_24dp ));
62
+ } else {
63
+ Glide .with (view .getContext ()).load (new File (imagePath )).into (view );
64
+ }
65
+ } else {
66
+ view .setImageDrawable (null );
67
+ }
68
+ }
69
+
57
70
@ BindingAdapter (value = { "srcCompat" }, requireAll =false )
58
71
public static void setSrcCompatZoomOffset (PaintElementView view , String imagePath ) {
59
72
if (imagePath != null ) {
Original file line number Diff line number Diff line change 26
26
app : layout_constraintStart_toEndOf =" parent"
27
27
app : layout_constraintTop_toBottomOf =" parent" >
28
28
29
+ <ImageView
30
+ android : id =" @+id/image_background"
31
+ android : layout_width =" match_parent"
32
+ android : layout_height =" match_parent"
33
+ android : alpha =" 0.2"
34
+ app : srcCompat =" @{element.zoom >= 100 ? null : element.imagePath}"
35
+ tools : visibility =" visible" />
36
+
29
37
<fr .nuage.souvenirs.view.ImageElementView
30
38
android : id =" @+id/image_imageview"
31
39
android : layout_width =" match_parent"
0 commit comments