[TIMOB-16005] Android: Small device textfield issue in landscape mode
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-03-09T02:24:11.000+0000 |
| Affected Version/s | Release 3.1.3 |
| Fix Version/s | Release 6.1.0 |
| Components | Android |
| Labels | android, community, notable |
| Reporter | Jignesh Kasundra |
| Assignee | Frankie Merzadyan |
| Created | 2013-09-20T11:20:18.000+0000 |
| Updated | 2017-05-22T12:59:03.000+0000 |
Description
in small android device > landscap mode > when we enter the focus in to textfied the area is get expanded to full screen
---------------------------------
how to prevent this behavior?
Hi Jignesh Kasundra, Could you share some test case.I think your textfield height is not set properly as a result you face this problem. Thanks
Hi Jignesh Kasundra, I have tested this in small device in landscape mode it works well. Here is the code so lets try it
Thanksvar win = Ti.UI.createWindow({backgroundColor: 'white', layout:'vertical' }); // Create a TextField. var aTextField = Ti.UI.createTextField({ height : Titanium.UI.SIZE, top : 10, width : Titanium.UI.FILL, hintText : 'This is hint text', softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS, // Android only keyboardType : Ti.UI.KEYBOARD_DEFAULT, returnKeyType : Ti.UI.RETURNKEY_DEFAULT, borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED }); // Listen for return events. aTextField.addEventListener('return', function(e) { aTextField.blur(); alert('Input was: ' + aTextField.value); }); // Add to the parent view. win.add(aTextField); // Create a TextField. var aTextField1 = Ti.UI.createTextField({ height : Titanium.UI.SIZE, top : 10, width : Titanium.UI.FILL, hintText : 'This is hint text', softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS, // Android only keyboardType : Ti.UI.KEYBOARD_DEFAULT, returnKeyType : Ti.UI.RETURNKEY_DEFAULT, borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED }); // Listen for return events. aTextField1.addEventListener('return', function(e) { aTextField1.blur(); alert('Input was: ' + aTextField1.value); }); // Add to the parent view. win.add(aTextField1); win.open();Hi.... Motiur Rahman this solution is not working for me when i test one titanium android emulator landscape mode or also on small device.... my problem is just like --------> http://developer.appcelerator.com/question/145494/disable-fullscreen-textareakeyboard-while-landscape-in-android Note:- ------------- we can set this behavior in navite android app. http://developer.android.com/guide/topics/ui/controls/text.html but how with titanium?
Hi.... Motiur do you checked above stuff ...?
Reopening and moving this ticket to TIMOB as an enhancement request. Android provides a way to override the default behavior by way of android:imeOptions attribute that we may want to consider exposing in Titanium SDK. http://developer.android.com/guide/topics/ui/controls/text.html Section: Adding Other Keyboard Flags Related Q&A threads: https://developer.appcelerator.com/question/145497/how-to-set-androidimeoptions-property http://developer.appcelerator.com/question/145494/disable-fullscreen-textareakeyboard-while-landscape-in-android
Test code:
Demo gif: !http://migaweb.de/key.gif! PR: https://github.com/appcelerator/titanium_mobile/pull/8785var win = Ti.UI.createWindow({ layout: "vertical", backgroundColor: '#fff' }); // --------------------- textfields var tf1 = Ti.UI.createTextField({ value: "default", left: 10, right: 10, color: "#000", borderWidth: 1, borderColor: "#000", bottom: 10 }) var tf2 = Ti.UI.createTextField({ value: "no fullscreen", left: 10, right: 10, fullscreen: false, color: "#000", borderWidth: 1, borderColor: "#000", bottom: 10 }) var tf3 = Ti.UI.createTextField({ value: "fullscreen", left: 10, right: 10, fullscreen: true, color: "#000", borderWidth: 1, borderColor: "#000" }); // --------------------- Textarea var ta1 = Ti.UI.createTextArea({ value: "default", left: 10, right: 10, height: 40, color: "#000", borderWidth: 1, borderColor: "#000", bottom: 10 }); var ta2 = Ti.UI.createTextArea({ value: "no fullscreen", left: 10, right: 10, height: 40, color: "#000", borderWidth: 1, borderColor: "#000", bottom: 10 }); var ta3 = Ti.UI.createTextArea({ value: "fullscreen", left: 10, right: 10, height: 40, color: "#000", borderWidth: 1, borderColor: "#000", bottom: 10 }); // test methods console.log(tf1.getFullscreen()); console.log(tf2.fullscreen); console.log(tf3.fullscreen); ta2.fullscreen = false; ta3.setFullscreen(true); win.add(tf1); win.add(tf2); win.add(tf3); win.add(ta1); win.add(ta2); win.add(ta3); win.open();Thanks [~michael]! :-) Scheduling for 6.2.0 for now, depending on the progress we made for 6.1.0 the next weeks.
[~michael] Could you create a 6_1_X backport for this? The team wants to include it into 6.1.0 as well. We'd do it otherwise, no problem! Thanks!
[~hansknoechel] it looks like that is already in 6_1_X :-)
Whoops, you're right!
Verified the fix in 6.1.0.v20170508081747. Studio Ver: 4.9.0.201704240654 SDK Ver: 6.1.0.v20170508081747 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.2 Appc NPM: 4.2.9 Appc CLI: 6.2.0 Ti CLI Ver: 5.0.12 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: > google Nexus 6 --- Android 6.0.1 > google Nexus 6P --- Android 7.1.1
Amazinggg!!!!! Thanks for this