Giter Site home page Giter Site logo

watcherding / react-native-android-keyboard-adjust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zubricky/react-native-android-keyboard-adjust

0.0 2.0 0.0 8 KB

Change the input mode for the Android keyboard in a React Native app

Java 97.71% JavaScript 2.29%

react-native-android-keyboard-adjust's Introduction

react-native-android-keyboard-adjust

Change the input mode for the Android keyboard in a React Native app.

If you are having issues with the default keyboard screen adjust modes and need an easy way to instantly switch them in your app. Quickly go from Pan to Resize to Nothing to get the screen displayed perfectly with the keyboard.

Adjust Nothing Example

adjust nothing keyboard down adjust nothing keyboard up

Adjust Resize Example

adjust resize keyboard down adjust resize keyboard up

Installation instructions for Android

Install the package

npm install --save react-native-android-keyboard-adjust

Update android/app/build.gradle

Add compile project(":react-native-android-keyboard-adjust") to dependencies:

dependencies {
    ...
    compile project(":react-native-android-keyboard-adjust")
    ...
 }

Update android/settings.gradle

...
include ':react-native-android-keyboard-adjust'
project(':react-native-android-keyboard-adjust').projectDir = new File(settingsDir, '../node_modules/react-native-android-keyboard-adjust/android')
...

Update MainActivity.java in your project

Import the package

import net.zubricky.AndroidKeyboardAdjust.AndroidKeyboardAdjustPackage;

Add the package to the getPackages method

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        ...
        new AndroidKeyboardAdjustPackage(this)
    );
}

Example

import AndroidKeyboardAdjust from 'react-native-android-keyboard-adjust';

AndroidKeyboardAdjust.setAdjustNothing();
AndroidKeyboardAdjust.setAdjustPan();
AndroidKeyboardAdjust.setAdjustResize();
AndroidKeyboardAdjust.setAdjustUnspecified();
AndroidKeyboardAdjust.setAlwaysVisible();
AndroidKeyboardAdjust.setAlwaysHidden();
AndroidKeyboardAdjust.setVisible();
AndroidKeyboardAdjust.setHidden();
AndroidKeyboardAdjust.setUnchanged();

react-native-android-keyboard-adjust's People

Contributors

liuchungui avatar zubricky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.