-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIMOB-23757] Fix TextField keyboard overlap
- Loading branch information
Gary Mathews
committed
Apr 3, 2017
1 parent
3b3ae5f
commit 2140339
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
27 changes: 27 additions & 0 deletions
27
android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIEditText.java
This file contains 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,27 @@ | ||
package ti.modules.titanium.ui.widget; | ||
|
||
import android.content.Context; | ||
import android.os.Build; | ||
import android.util.AttributeSet; | ||
import android.view.Gravity; | ||
import android.view.KeyEvent; | ||
import android.view.ViewGroup; | ||
import android.widget.EditText; | ||
|
||
public class TiUIEditText extends EditText { | ||
|
||
public TiUIEditText(Context context, AttributeSet attributeSet) { | ||
super(context, attributeSet); | ||
} | ||
|
||
@Override | ||
public boolean onKeyPreIme(int keyCode, KeyEvent event) { | ||
// TIMOB-23757: https://code.google.com/p/android/issues/detail?id=182191 | ||
if (Build.VERSION.SDK_INT < 24 && (getGravity() & Gravity.LEFT) == 0 && keyCode == KeyEvent.KEYCODE_BACK) { | ||
ViewGroup view = (ViewGroup) getParent(); | ||
view.setFocusableInTouchMode(true); | ||
view.requestFocus(); | ||
} | ||
return super.onKeyPreIme(keyCode, event); | ||
} | ||
} |
This file contains 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