Files
NativeScript/apps/tests/ui/search-bar/search-bar-tests-native.android.ts
Nathanael Anderson b259cde7fd Adding Search Hint text color; since this is not accessible from the standard style/theming xml files.
Added Tests so that it will verify the search bar color is changing.
2015-05-27 11:50:56 -05:00

23 lines
701 B
TypeScript

import colorModule = require("color");
import searchBarModule = require("ui/search-bar");
function getTextView(bar: android.widget.SearchView): android.widget.TextView {
if (bar) {
var id = bar.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
if (id) {
return <android.widget.TextView> bar.findViewById(id);
}
}
return undefined;
}
export function getNativeHintColor(searchBar: searchBarModule.SearchBar): colorModule.Color {
var textView = getTextView(searchBar.android);
if (textView) {
return new colorModule.Color(textView.getHintTextColors().getDefaultColor());
}
return undefined;
}