Skip to content

Commit

Permalink
bump versoin string to 0.4.3 and fix landscape offset (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman333 authored Feb 4, 2020
1 parent 6d3850d commit cc8c67e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { Platform, StatusBar, Dimensions } from "react-native";

const { height, width } = Dimensions.get("window");
const standardLength = width > height ? width : height;
const offset =
width > height ? 0 : Platform.OS === "ios" ? 78 : StatusBar.currentHeight; // iPhone X style SafeAreaView size in portrait

const deviceHeight = isIphoneX()
? standardLength - 78 // iPhone X style SafeAreaView size in portrait
: Platform.OS === "android"
? standardLength - StatusBar.currentHeight
: standardLength;
const deviceHeight =
isIphoneX() || Platform.OS === "android"
? standardLength - offset
: standardLength;

export function RFPercentage(percent) {
const heightPercent = (percent * deviceHeight) / 100;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-responsive-fontsize",
"version": "0.4.2",
"version": "0.4.3",
"main": "index.js",
"typings": "index.d.ts",
"description": "Simple method for resposive fontSize based on screen-size of the device in React-Native",
Expand Down

0 comments on commit cc8c67e

Please sign in to comment.