Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25333

Android: SearchBar height should default to Ti.UI.SIZE like iOS instead of FILL

    Details

    • Story Points:
      3
    • Sprint:
      2020 Sprint 22, 2020 Sprint 23

      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

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Joshua Quick
                Tester:
                Lokesh Choudhary
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-11182
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration