[TIMOB-25333] Android: SearchBar height should default to Ti.UI.SIZE like iOS instead of FILL
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 9.3.0 |
Components | Android |
Labels | SearchBar, android, engSchedule, parity |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2017-09-22T17:58:34.000+0000 |
Updated | 2020-11-20T00:24:54.000+0000 |
Description
*Summary:*
The "SearchBar" height on Android defaults to Ti.UI.FILL, but iOS defaults to Ti.UI.SIZE. The default on Android should be changed to match iOS' behavior for parity.
Also, setting the height explicitly to Ti.UI.SIZE on Android does not work at all and it still does a FILL instead.
*Test Code:*
var window = Ti.UI.createWindow(
{
layout: "vertical",
fullscreen: true,
});
window.add(Ti.UI.createSearchBar(
{
showCancel: true,
barColor: "#008800",
width: Ti.UI.FILL,
// height: Ti.UI.SIZE,
}));
window.add(Ti.UI.createLabel(
{
text: "Search Bar Test",
height: Ti.UI.FILL,
}));
window.open();
*Alternative Solution:*
Instead of fixing the Java "TiUISearchBar.java" code's height issue, we could instead replace Titanium's custom search bar implementation to use Android's native "SearchView" feature as suggested by [TIMOB-16886]. Titanium's "Ti.UI.Android.SearchView" feature does not have this height issue and is native. So, the idea is to keep the "SearchBarProxy.java" but have it map to SearchView instead. However, this may be a breaking change and perhaps should only be done in a major rev of Titanium.
Attachments
File | Date | Size |
---|---|---|
android-bad.png | 2017-09-22T18:01:06.000+0000 | 26058 |
ios-good.png | 2017-09-22T18:01:06.000+0000 | 37371 |
I've confirmed that the following PR resolves this issue... https://github.com/appcelerator/titanium_mobile/pull/12029