mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Use gradle to integrate custom icon font
Per https://github.com/oblador/react-native-vector-icons#option-with-gradle-recommended. This should theoretically keep the font up to date in Android when we update the font file.
This commit is contained in:
@@ -96,7 +96,12 @@ apply from: "../../node_modules/react-native/react.gradle"
|
||||
|
||||
// add vector icons to project
|
||||
project.ext.vectoricons = [
|
||||
iconFontNames: [ 'MaterialCommunityIcons.ttf', 'MaterialIcons.ttf' ]
|
||||
iconFontsDir: "../../assets/fonts/",
|
||||
iconFontNames: [
|
||||
'MaterialCommunityIcons.ttf',
|
||||
'MaterialIcons.ttf',
|
||||
'inaturalisticons.ttf'
|
||||
]
|
||||
]
|
||||
|
||||
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
||||
|
||||
Binary file not shown.
BIN
assets/fonts/MaterialCommunityIcons.ttf
Normal file
BIN
assets/fonts/MaterialCommunityIcons.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/MaterialIcons.ttf
Normal file
BIN
assets/fonts/MaterialIcons.ttf
Normal file
Binary file not shown.
@@ -3,20 +3,21 @@
|
||||
* Usage: <INatIcon name="icon-name" size={20} color="#4F8EF7" />
|
||||
*/
|
||||
|
||||
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
|
||||
import createIconSet from "react-native-vector-icons/lib/create-icon-set";
|
||||
|
||||
export const glyphMap = {
|
||||
"notifications-bell": 57344,
|
||||
"hamburger-menu": 57345,
|
||||
"plus-sign": 57346,
|
||||
"compass-rose": 57347,
|
||||
"pen-and-paper": 57348,
|
||||
"microphone": 57350,
|
||||
"camera": 57355,
|
||||
microphone: 57350,
|
||||
camera: 57355,
|
||||
"triple-dots": 57352,
|
||||
"close-button-x": 57351,
|
||||
"comments-filled-in": 57353,
|
||||
"checkmark": 57354,
|
||||
"pencil": 57356,
|
||||
checkmark: 57354,
|
||||
pencil: 57356,
|
||||
"ios-people-updated-2": 57357,
|
||||
"cv-sparklylabel": 57358,
|
||||
"close-button-circle": 57349,
|
||||
@@ -30,11 +31,11 @@ export const glyphMap = {
|
||||
"identification-solid": 57366
|
||||
};
|
||||
|
||||
const iconSet = createIconSet(glyphMap, 'inaturalisticons', 'inaturalisticons.ttf');
|
||||
const iconSet = createIconSet( glyphMap, "inaturalisticons", "inaturalisticons.ttf" );
|
||||
|
||||
export default iconSet;
|
||||
export const {
|
||||
Button,
|
||||
getImageSource,
|
||||
getImageSourceSync,
|
||||
getImageSourceSync
|
||||
} = iconSet;
|
||||
|
||||
Reference in New Issue
Block a user