React-native-gifted-chat: Fixed the keyboard issue on android without adjustResize on manifest

Created on 21 Dec 2018  路  7Comments  路  Source: FaridSafi/react-native-gifted-chat

There are a bunch of issues around keyboard pushing up the toolbar / not having to hardcode adjustResize on the manifest since other screens might need to have adjustPan etc.

I am finally able to crack it without updating manifest file or importing an outdated library.
@FaridSafi how can i incorporate my changes and contribute to this project? My changes include adding bridge code.

wontfix

Most helpful comment

Hey there @jsochurek ,
I added a bridge method which can be called on every screen you want the soft input mode to be changed. That way you don't need to hardcode the resize option in the manifest file.

Something like this :

@ReactMethod
   public void setSoftInputMode(final int softInputMode) {
        final Activity activity = getCurrentActivity();
        if (activity == null) {
            return;
        }
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                activity.getWindow().setSoftInputMode(softInputMode);
            }
        });
    }

All 7 comments

can you share your code?

Hey there @jsochurek ,
I added a bridge method which can be called on every screen you want the soft input mode to be changed. That way you don't need to hardcode the resize option in the manifest file.

Something like this :

@ReactMethod
   public void setSoftInputMode(final int softInputMode) {
        final Activity activity = getCurrentActivity();
        if (activity == null) {
            return;
        }
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                activity.getWindow().setSoftInputMode(softInputMode);
            }
        });
    }

This worked great for me, thanks @nandiniparimi1107 !!

is this implemented? i have some issues with the keyboard as well

Same issues鈥攁re there plans to incorporate this into the library without having to eject from Expo?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@nandiniparimi1107 could you give a few more details or an example on how to use your bridge method?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tafelito picture tafelito  路  3Comments

emilkarl picture emilkarl  路  3Comments

cerberusv2px picture cerberusv2px  路  3Comments

luisar picture luisar  路  3Comments

jasonwcfan picture jasonwcfan  路  3Comments