How to use the react-native-device-info.isTablet function in react-native-device-info

To help you get started, we’ve selected a few react-native-device-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-native-community / react-native-device-info / example / App.js View on Github external
getConstantDeviceInfo() {
    let deviceJSON = {};

    deviceJSON.uniqueId = DeviceInfo.getUniqueId();
    deviceJSON.deviceId = DeviceInfo.getDeviceId();
    deviceJSON.bundleId = DeviceInfo.getBundleId();
    deviceJSON.systemName = DeviceInfo.getSystemName();
    deviceJSON.systemVersion = DeviceInfo.getSystemVersion();
    deviceJSON.version = DeviceInfo.getVersion();
    deviceJSON.readableVersion = DeviceInfo.getReadableVersion();
    deviceJSON.buildNumber = DeviceInfo.getBuildNumber();
    deviceJSON.isTablet = DeviceInfo.isTablet();
    deviceJSON.appName = DeviceInfo.getApplicationName();
    deviceJSON.brand = DeviceInfo.getBrand();
    deviceJSON.model = DeviceInfo.getModel();
    deviceJSON.deviceType = DeviceInfo.getDeviceType();

    return deviceJSON;
  }
github celo-org / celo-monorepo / packages / react-components / analytics / CeloAnalytics.tsx View on Github external
InstanceID: await DeviceInfo.getInstanceId(),
    LastUpdateTime: await DeviceInfo.getLastUpdateTime(),
    Manufacturer: await DeviceInfo.getManufacturer(),
    MaxMemory: await DeviceInfo.getMaxMemory(),
    Model: DeviceInfo.getModel(),
    ReadableVersion: DeviceInfo.getReadableVersion(),
    SerialNumber: await DeviceInfo.getSerialNumber(),
    SystemName: DeviceInfo.getSystemName(),
    SystemVersion: DeviceInfo.getSystemVersion(),
    TotalDiskCapacity: await DeviceInfo.getTotalDiskCapacity(),
    TotalMemory: await DeviceInfo.getTotalMemory(),
    UniqueID: DeviceInfo.getUniqueId(),
    UserAgent: await DeviceInfo.getUserAgent(),
    Version: DeviceInfo.getVersion(),
    isEmulator: await DeviceInfo.isEmulator(),
    isTablet: DeviceInfo.isTablet(),
  }
}
github guardian / editions / projects / Apps / editionsSrc / src / helpers / screen.ts View on Github external
export const imageForScreenSize = async (): Promise => {
    const persisted = await AsyncStorage.getItem(IMAGE_SIZE_KEY)
    const persistedSize = imageSizes.find(_ => _ == persisted)
    if (persistedSize != undefined) {
        return persistedSize
    }
    const isTablet = DeviceInfo.isTablet()
    const screenSize = isTablet ? maxScreenSize() : minScreenSize()
    const size = convertImageSizeToImageDescription(
        screenSizeToImageSize(screenSize),
    )
    await AsyncStorage.setItem(IMAGE_SIZE_KEY, size)
    return size
}
github mattermost / mattermost-mobile / app / init / global_event_handler.js View on Github external
onOrientationChange = (dimensions) => {
        if (this.store) {
            const {dispatch} = this.store;
            if (DeviceInfo.isTablet()) {
                dispatch(setDeviceAsTablet());
            }

            const {height, width} = dimensions.window;
            const orientation = height > width ? 'PORTRAIT' : 'LANDSCAPE';

            dispatch(setDeviceOrientation(orientation));
            dispatch(setDeviceDimensions(height, width));
        }
    };
github tomzaku / react-native-cba-starter-kit / src / base / react-native / src / router / util / make.tsx View on Github external
   return ramda.mapObjIndexed((item) => DeviceInfo.isTablet() && item.tablet && ramda.mergeDeepRight(item.tablet, item.phone) || item.phone, routes) as  Record
}
github zzorba / ArkhamCards / components / CardDetailView / TwoSidedCardComponent.tsx View on Github external
} = this.props;
    if ((card.hidden || backFirst) && (card.hidden || card.spoiler) && !this.state.showBack && card.code !== RANDOM_BASIC_WEAKNESS) {
      return (
github mattermost / mattermost-mobile / app / constants / device.js View on Github external
import keyMirror from 'mattermost-redux/utils/key_mirror';

const deviceTypes = keyMirror({
    CONNECTION_CHANGED: null,
    DEVICE_DIMENSIONS_CHANGED: null,
    DEVICE_TYPE_CHANGED: null,
    DEVICE_ORIENTATION_CHANGED: null,
    STATUSBAR_HEIGHT_CHANGED: null,
});

export default {
    ...deviceTypes,
    DOCUMENTS_PATH: `${RNFetchBlobFS.dirs.CacheDir}/Documents`,
    IMAGES_PATH: `${RNFetchBlobFS.dirs.CacheDir}/Images`,
    IS_IPHONE_WITH_INSETS: DeviceInfo.getModel().includes('iPhone X') || DeviceInfo.getModel().includes('iPhone 11'),
    IS_TABLET: DeviceInfo.isTablet(),
    VIDEOS_PATH: `${RNFetchBlobFS.dirs.CacheDir}/Videos`,
    PERMANENT_SIDEBAR_SETTINGS: '@PERMANENT_SIDEBAR_SETTINGS',
};