Files
mattermost-mobile/patches/react-native-vector-icons+9.0.0.patch
2021-10-29 14:38:20 -03:00

26 lines
1.5 KiB
Diff

diff --git a/node_modules/react-native-vector-icons/android/src/main/java/com/oblador/vectoricons/VectorIconsModule.java b/node_modules/react-native-vector-icons/android/src/main/java/com/oblador/vectoricons/VectorIconsModule.java
index 9e666b4..5d5830b 100755
--- a/node_modules/react-native-vector-icons/android/src/main/java/com/oblador/vectoricons/VectorIconsModule.java
+++ b/node_modules/react-native-vector-icons/android/src/main/java/com/oblador/vectoricons/VectorIconsModule.java
@@ -46,7 +46,8 @@ public class VectorIconsModule extends ReactContextBaseJavaModule {
protected String createGlyphImagePath(String fontFamily, String glyph, Integer fontSize, Integer color) throws java.io.IOException, FileNotFoundException {
Context context = getReactApplicationContext();
File cacheFolder = context.getCacheDir();
- String cacheFolderPath = cacheFolder.getAbsolutePath() + "/";
+ String cacheFolderPath = cacheFolder.getAbsolutePath() + "/vectorIcons/";
+ File vectorIconsFolder = new File(cacheFolderPath);
float scale = context.getResources().getDisplayMetrics().density;
String scaleSuffix = "@" + (scale == (int) scale ? Integer.toString((int) scale) : Float.toString(scale)) + "x";
@@ -57,6 +58,10 @@ public class VectorIconsModule extends ReactContextBaseJavaModule {
String cacheFileUrl = "file://" + cacheFilePath;
File cacheFile = new File(cacheFilePath);
+ if (!vectorIconsFolder.exists()) {
+ vectorIconsFolder.mkdirs();
+ }
+
if(cacheFile.exists()) {
return cacheFileUrl;
}