@nativescript-community/ui-image 4.3.15 → 4.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [4.3.16](https://github.com/nativescript-community/ui-image/compare/v4.3.15...v4.3.16) (2023-09-29)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
* **android:** fix for image disappearing on fragment/ativity transitions. See https://github.com/facebook/fresco/issues/1446 ([b36d001](https://github.com/nativescript-community/ui-image/commit/b36d0012af443fadcdb969e901f7f0e69f4e0c80))
|
11
|
+
|
6
12
|
## [4.3.15](https://github.com/nativescript-community/ui-image/compare/v4.3.14...v4.3.15) (2023-09-28)
|
7
13
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-image",
|
3
|
-
"version": "4.3.
|
3
|
+
"version": "4.3.16",
|
4
4
|
"description": "Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.",
|
5
5
|
"main": "./index",
|
6
6
|
"sideEffects": false,
|
@@ -44,5 +44,5 @@
|
|
44
44
|
},
|
45
45
|
"license": "Apache-2.0",
|
46
46
|
"readmeFilename": "README.md",
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "7d5be4ee8fb3fcef33da045af7151873cd084b4b"
|
48
48
|
}
|
@@ -39,12 +39,24 @@ public class DraweeView extends SimpleDraweeView {
|
|
39
39
|
public boolean isUsingOutlineProvider = false;
|
40
40
|
private static Paint clipPaint;
|
41
41
|
|
42
|
+
private boolean mLegacyVisibilityHandlingEnabled = false;
|
43
|
+
|
44
|
+
private static boolean sGlobalLegacyVisibilityHandlingEnabled = true;
|
45
|
+
|
46
|
+
public static void setGlobalLegacyVisibilityHandlingEnabled(
|
47
|
+
boolean legacyVisibilityHandlingEnabled) {
|
48
|
+
sGlobalLegacyVisibilityHandlingEnabled = legacyVisibilityHandlingEnabled;
|
49
|
+
}
|
50
|
+
|
42
51
|
public DraweeView(Context context, GenericDraweeHierarchy hierarchy) {
|
43
52
|
super(context);
|
44
53
|
}
|
45
54
|
|
46
55
|
public DraweeView(Context context) {
|
47
56
|
super(context);
|
57
|
+
// In Android N and above, visibility handling for Drawables has been changed, which breaks
|
58
|
+
// activity transitions with DraweeViews.
|
59
|
+
mLegacyVisibilityHandlingEnabled = sGlobalLegacyVisibilityHandlingEnabled && context.getApplicationInfo().targetSdkVersion >= 24; //Build.VERSION_CODES.N
|
48
60
|
}
|
49
61
|
|
50
62
|
public DraweeView(Context context, AttributeSet attrs) {
|
@@ -55,6 +67,61 @@ public class DraweeView extends SimpleDraweeView {
|
|
55
67
|
super(context, attrs, defStyle);
|
56
68
|
}
|
57
69
|
|
70
|
+
@Override
|
71
|
+
protected void onAttachedToWindow() {
|
72
|
+
super.onAttachedToWindow();
|
73
|
+
maybeOverrideVisibilityHandling();
|
74
|
+
onAttach();
|
75
|
+
}
|
76
|
+
|
77
|
+
@Override
|
78
|
+
protected void onDetachedFromWindow() {
|
79
|
+
super.onDetachedFromWindow();
|
80
|
+
maybeOverrideVisibilityHandling();
|
81
|
+
onDetach();
|
82
|
+
}
|
83
|
+
|
84
|
+
@Override
|
85
|
+
public void onStartTemporaryDetach() {
|
86
|
+
super.onStartTemporaryDetach();
|
87
|
+
maybeOverrideVisibilityHandling();
|
88
|
+
onDetach();
|
89
|
+
}
|
90
|
+
|
91
|
+
@Override
|
92
|
+
public void onFinishTemporaryDetach() {
|
93
|
+
super.onFinishTemporaryDetach();
|
94
|
+
maybeOverrideVisibilityHandling();
|
95
|
+
onAttach();
|
96
|
+
}
|
97
|
+
|
98
|
+
@Override
|
99
|
+
protected void onVisibilityChanged(
|
100
|
+
View changedView,
|
101
|
+
int visibility) {
|
102
|
+
super.onVisibilityChanged(changedView, visibility);
|
103
|
+
maybeOverrideVisibilityHandling();
|
104
|
+
}
|
105
|
+
|
106
|
+
@Override
|
107
|
+
public void onVisibilityAggregated (boolean isVisible) {
|
108
|
+
super.onVisibilityAggregated(isVisible);
|
109
|
+
maybeOverrideVisibilityHandling();
|
110
|
+
}
|
111
|
+
|
112
|
+
private void maybeOverrideVisibilityHandling() {
|
113
|
+
if (mLegacyVisibilityHandlingEnabled) {
|
114
|
+
Drawable drawable = getDrawable();
|
115
|
+
if (drawable != null) {
|
116
|
+
drawable.setVisible(getVisibility() == VISIBLE, false);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
public void setLegacyVisibilityHandlingEnabled(boolean legacyVisibilityHandlingEnabled) {
|
122
|
+
mLegacyVisibilityHandlingEnabled = legacyVisibilityHandlingEnabled;
|
123
|
+
}
|
124
|
+
|
58
125
|
// private final Rect outlineRect = new RectF();
|
59
126
|
public void updateOutlineProvider() {
|
60
127
|
Drawable drawable = getBackground();
|
Binary file
|