-
Notifications
You must be signed in to change notification settings - Fork 4k
Remove additional letters #18837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
johnmlee101
merged 6 commits into
Expensify:main
from
kaushiktd:remove-additional-letters
May 16, 2023
Merged
Remove additional letters #18837
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5498816
Remove additional letters
kaushiktd e8cfc3a
Remove additional letters
kaushiktd 19f06b2
Remove additional letters
kaushiktd 927c1a8
Remove additional letters
kaushiktd 87db39a
Remove additional letters
kaushiktd f15a4b1
Remove additional letters
kaushiktd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
android/app/src/main/java/com/expensify/chat/RNTextInputResetModule.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package com.expensify.chat; | ||
|
|
||
| import com.facebook.react.bridge.ReactApplicationContext; | ||
| import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
| import com.facebook.react.bridge.ReactMethod; | ||
| import com.facebook.react.bridge.Callback; | ||
| import com.facebook.react.uimanager.UIManagerModule; | ||
| import com.facebook.react.uimanager.UIBlock; | ||
| import com.facebook.react.uimanager.NativeViewHierarchyManager; | ||
| import android.content.Context; | ||
| import android.view.View; | ||
| import android.widget.TextView; | ||
| import android.view.inputmethod.InputMethodManager; | ||
| import android.util.Log; | ||
|
|
||
| public class RNTextInputResetModule extends ReactContextBaseJavaModule { | ||
|
|
||
| private final ReactApplicationContext reactContext; | ||
|
|
||
| public RNTextInputResetModule(ReactApplicationContext reactContext) { | ||
| super(reactContext); | ||
| this.reactContext = reactContext; | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return "RNTextInputReset"; | ||
| } | ||
|
|
||
| // Props to https://github.com/MattFoley for this temporary hack | ||
| // https://github.com/facebook/react-native/pull/12462#issuecomment-298812731 | ||
| @ReactMethod | ||
| public void resetKeyboardInput(final int reactTagToReset) { | ||
| UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class); | ||
| uiManager.addUIBlock(new UIBlock() { | ||
| @Override | ||
| public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) { | ||
| InputMethodManager imm = (InputMethodManager) getReactApplicationContext().getBaseContext().getSystemService(Context.INPUT_METHOD_SERVICE); | ||
| if (imm != null) { | ||
| View viewToReset = nativeViewHierarchyManager.resolveView(reactTagToReset); | ||
| imm.restartInput(viewToReset); | ||
| } | ||
| } | ||
| }); | ||
| } | ||
| } |
28 changes: 28 additions & 0 deletions
28
android/app/src/main/java/com/expensify/chat/RNTextInputResetPackage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.expensify.chat; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
|
|
||
| import com.facebook.react.ReactPackage; | ||
| import com.facebook.react.bridge.NativeModule; | ||
| import com.facebook.react.bridge.ReactApplicationContext; | ||
| import com.facebook.react.uimanager.ViewManager; | ||
| import com.facebook.react.bridge.JavaScriptModule; | ||
|
|
||
| public class RNTextInputResetPackage implements ReactPackage { | ||
| @Override | ||
| public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
| return Arrays.<NativeModule>asList(new RNTextInputResetModule(reactContext)); | ||
| } | ||
|
|
||
| // Deprecated from RN 0.47 | ||
| public List<Class<? extends JavaScriptModule>> createJSModules() { | ||
| return Collections.emptyList(); | ||
| } | ||
|
|
||
| @Override | ||
| public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { | ||
| return Collections.emptyList(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.