-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-10368] iOS: Expose "color" and "hintTextColor" to Ti.UI.SearchBar #9772
Changes from 2 commits
b63e9cd
b99d464
f73fbdf
ee5dfd3
fcafe03
63646a7
5016e58
964d7c3
84e1094
d7fc4e6
d20c4f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,11 +165,28 @@ properties: | |
since: "5.4.0" | ||
platforms: [iphone,ipad] | ||
|
||
- name: color | ||
summary: Color of the text in this text field, as a color name or hex triplet. | ||
description: | | ||
For information about color values, see the "Colors" section of <Titanium.UI>. | ||
type: String | ||
platforms: [iphone, ipad] | ||
since: "7.1.0" | ||
|
||
- name: hintText | ||
summary: Text to show when the search bar field is not focused. | ||
type: String | ||
default: On iOS, "Search"; on Android, no hint text. | ||
|
||
- name: hintTextColor | ||
summary: Hint text color to display when the field is empty. | ||
platforms: [iphone, ipad] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Android already supports this property too. |
||
since: "7.1.0" | ||
description: | | ||
Sets the color of the <Titanium.UI.TextField.hintText>. | ||
type: String | ||
default: The platform's default hint text color. | ||
|
||
- name: hinttextid | ||
summary: | | ||
Key identifying a string from the locale file to use for the | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* global Ti */ | ||
/* eslint no-unused-expressions: "off" */ | ||
'use strict'; | ||
var should = require('./utilities/assertions'); | ||
|
||
describe('Titanium.UI.SearchBar', function () { | ||
var win; | ||
|
||
afterEach(function () { | ||
if (win) { | ||
win.close(); | ||
} | ||
win = null; | ||
}); | ||
|
||
// TODO: Expose on Android / Windows as well | ||
// We have in in Ti.UI.Android.SearchView for Android, but need more parity here | ||
it.ios('.hintTextColor', function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Android can run this unit test too. |
||
var searchBar = Ti.UI.createSearchBar({ | ||
hintText: 'Enter E-Mail ...', | ||
hintTextColor: 'red' | ||
}); | ||
should(searchBar.getHintTextColor).be.a.Function; | ||
should(searchBar.hintTextColor).eql('red'); | ||
should(searchBar.getHintTextColor()).eql('red'); | ||
searchBar.hintTextColor = 'blue'; | ||
should(searchBar.hintTextColor).eql('blue'); | ||
should(searchBar.getHintTextColor()).eql('blue'); | ||
}); | ||
|
||
// TODO: Expose on Android / Windows as well | ||
it.ios('.color', function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Android can run this unit test. |
||
var searchBar = Ti.UI.createSearchBar({ | ||
color: 'red' | ||
}); | ||
should(searchBar.getColor).be.a.Function; | ||
should(searchBar.color).eql('red'); | ||
should(searchBar.getColor()).eql('red'); | ||
searchBar.color = 'blue'; | ||
should(searchBar.color).eql('blue'); | ||
should(searchBar.getColor()).eql('blue'); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android already supports this, just wasn't documented. Would you mind adding "android" to the supported platform list please?