@@ -160,6 +160,8 @@ public void setShape(FrameLayout shineButtonFrame, ReadableMap shapeProps) {
160160
161161
162162 private Drawable generateVectorIcon (ReadableMap icon ) {
163+ Context context = reactContext .getApplicationContext ();
164+
163165 StrictMode .ThreadPolicy policy = new StrictMode .ThreadPolicy .Builder ().permitAll ().build ();
164166 StrictMode .setThreadPolicy (policy );
165167
@@ -169,11 +171,11 @@ private Drawable generateVectorIcon(ReadableMap icon) {
169171 String color = icon .getString ("color" );
170172 int size = icon .getInt ("size" );
171173
172- float scale = reactContext .getResources ().getDisplayMetrics ().density ;
174+ float scale = context .getResources ().getDisplayMetrics ().density ;
173175 String scaleSuffix = "@" + (scale == (int ) scale ? Integer .toString ((int ) scale ) : Float .toString (scale )) + "x" ;
174176 int fontSize = Math .round (size * scale );
175177
176- Typeface typeface = ReactFontManager .getInstance ().getTypeface (family , 0 , reactContext .getAssets ());
178+ Typeface typeface = ReactFontManager .getInstance ().getTypeface (family , 0 , context .getAssets ());
177179 Paint paint = new Paint ();
178180 paint .setTypeface (typeface );
179181 paint .setColor (Color .parseColor (color ));
@@ -186,6 +188,6 @@ private Drawable generateVectorIcon(ReadableMap icon) {
186188 Canvas canvas = new Canvas (bitmap );
187189 canvas .drawText (glyph , -textBounds .left , -textBounds .top , paint );
188190
189- return new BitmapDrawable (reactContext .getResources (), bitmap );
191+ return new BitmapDrawable (context .getResources (), bitmap );
190192 }
191193}
0 commit comments