Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/commons/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
I18nManager,
AccessibilityInfo,
AccessibilityChangeEvent,
StatusBar
StatusBar,
PixelRatio
} from 'react-native';

export enum orientations {
Expand Down Expand Up @@ -190,7 +191,10 @@ const constants = {
},
/* Keyboard */
backspaceKey: 'Backspace',
enterKey: 'Enter'
enterKey: 'Enter',

/* Font scale */
getFontScale: PixelRatio.getFontScale
};

setStatusBarHeight();
Expand Down
4 changes: 2 additions & 2 deletions src/components/colorPicker/ColorPickerPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useRef} from 'react';
import {StyleSheet, TextInput, PixelRatio, I18nManager} from 'react-native';
import {StyleSheet, TextInput, I18nManager} from 'react-native';

import {Colors, Typography} from '../../style';
import {ColorPickerDialogProps} from './ColorPickerDialog';
Expand All @@ -22,7 +22,7 @@ const ColorPickerPreview = (props: PreviewProps) => {

const hex = getHexString(color);
const textColor = getTextColor(hex);
const fontScale = PixelRatio.getFontScale();
const fontScale = Constants.getFontScale();
const value = Colors.isTransparent(text) ? '000000' : text;

return (
Expand Down