Commit 618c21f
feat(Android, Tabs): Update approach for loading external sources for tab icons (#3216)
## Description
In the initial approach, we used Coil image loading library. However,
after the 1st release, Coil has introduced several issues that had an
impact on the stability and maintainability.
After reevaluating other options, we've decided to try migrating to
Fresco. This choice aligns better because React Native also relies on
Fresco internally. Using Fresco should improve consistency with the RN
and reduce our maintenance overhead.
One known limitation is that Fresco doesn't support loading images in
SVG format. We’ll need to explore alternative strategies to adapt.
**Note**:
Slightly depends on:
#3214
Fresco doesn't support SVGs, so we decided to handle them by passing
assets via the `AndroidStudio` as vector icons - this approach
simplifies a lot of things, especially that
```
PlatformIconAndroid =
| {
type: 'drawableResourceAndroid';
name: string;
}
```
will cover SVGs, so we can omit adding a support here. I'll ensure to
mention there that SVG should be passed with `drawableResourceAndroid`
only.
## Changes
- Removed Coil
- Replaced logic for Coil ImageLoader with Fresco APIs
- Extracted ImageLoader to a separate file
## Test code and steps to reproduce
Tested with BottomTabs example.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes
---------
Co-authored-by: Kacper Kafara <[email protected]>1 parent 469fc70 commit 618c21f
File tree
3 files changed
+105
-95
lines changed- android
- src/main/java/com/swmansion/rnscreens/gamma/tabs
- image
3 files changed
+105
-95
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | 249 | | |
256 | 250 | | |
257 | 251 | | |
| |||
Lines changed: 9 additions & 89 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 3 | + | |
| 4 | + | |
10 | 5 | | |
11 | 6 | | |
12 | 7 | | |
| |||
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
34 | | - | |
35 | | - | |
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 33 | | |
47 | 34 | | |
48 | 35 | | |
| |||
206 | 193 | | |
207 | 194 | | |
208 | 195 | | |
209 | | - | |
210 | 196 | | |
211 | 197 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
217 | 204 | | |
218 | 205 | | |
219 | 206 | | |
220 | 207 | | |
221 | 208 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 209 | | |
290 | 210 | | |
291 | 211 | | |
| |||
Lines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
0 commit comments