Skip to content

Instantly share code, notes, and snippets.

View janicduplessis's full-sized avatar
🤖
beep

Janic Duplessis janicduplessis

🤖
beep
View GitHub Profile
- name: Restore yarn workspaces
id: yarn-cache
uses: actions/cache@master
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
import * as React from 'react';
import {
EmitterSubscription,
Keyboard,
KeyboardEvent,
LayoutAnimation,
Platform,
Dimensions,
ScreenRect,
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import {
InitialState,
NavigationContainer,
NavigationContainerProps,
NavigationContainerRef,
} from '@react-navigation/core';
import * as React from 'react';
import { InteractionManager } from 'react-native';
+ import com.facebook.react.modules.network.OkHttpClientProvider;
+ import okhttp3.OkHttpClient;
+ import okhttp3.brotli.BrotliInterceptor;
...
public void onCreate() {
super.onCreate();
+ OkHttpClientProvider.setOkHttpClientFactory(() -> {
@janicduplessis
janicduplessis / androidx-class-mapping.csv
Last active May 20, 2020 20:10
Update react-native libraries under node_modules to androidx
Support Library class Android X class
android.support.v8.renderscript.Allocation android.renderscript.Allocation
android.support.v8.renderscript.Element android.renderscript.Element
android.support.v8.renderscript.RenderScript android.renderscript.RenderScript
android.support.v8.renderscript.ScriptIntrinsicBlur android.renderscript.ScriptIntrinsicBlur
android.support.transition.AnimatorUtils androidx.transition.AnimatorUtils
android.support.transition.ArcMotion androidx.transition.ArcMotion
android.support.transition.AutoTransition androidx.transition.AutoTransition
android.support.transition.ChangeBounds androidx.transition.ChangeBounds
android.support.transition.ChangeClipBounds androidx.transition.ChangeClipBounds
package com.th3rdwave;
import com.aakashns.reactnativedialogs.modules.DialogAndroid;
import com.facebook.react.TurboReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.annotations.ReactModuleList;
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import { Box, useDimensions, useSafeAreaInsets } from '@th3rdwave/ui';
import * as React from 'react';
import { updateSafeAreaInsets } from './metrics';
/**
* This is a hack to simulate iOS keyboard behavior on Android. We use the
* keyboard behavior that causes the window to resize and make sure
* the min height stays the same when we detect that the keyboard opens.
*/
export function AppMinHeightWrapper({
import * as React from 'react';
import PropTypes from 'prop-types';
type Props = {
disabled?: boolean;
children: React.ReactNode;
};
export class WindowScrollContext extends React.Component<Props> {
// https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js#L470
import * as React from 'react';
export function useDisableBodyScroll(disabled: boolean): void {
const scrollPosition = React.useRef(0);
React.useEffect(() => {
// Don't do anything if scroll is already blocked somewhere else.
if (!disabled || document.body.style.position === 'fixed') {
return undefined;
}
scrollPosition.current = window.scrollY;
import * as React from 'react';
import { Image, View, StyleSheet, ViewStyle, ImageProps } from 'react-native';
type ImageURISource = Readonly<{
uri?: string | undefined;
}>;
type Props = {
style?: ViewStyle | null | undefined;
lowResSource: ImageURISource;