mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
18 lines
712 B
TypeScript
18 lines
712 B
TypeScript
import segmentedBarModule = require("ui/segmented-bar");
|
|
|
|
export function getNativeItemsCount(bar: segmentedBarModule.SegmentedBar): number {
|
|
return (<android.widget.TabHost>bar.android).getTabWidget().getTabCount();
|
|
}
|
|
|
|
export function checkNativeItemsTextColor(bar: segmentedBarModule.SegmentedBar): boolean {
|
|
var isValid = true;
|
|
|
|
for (var tabIndex = 0; tabIndex < bar.android.getTabWidget().getTabCount(); tabIndex++) {
|
|
var tabChild = <android.view.ViewGroup>bar.android.getTabWidget().getChildTabViewAt(tabIndex);
|
|
var t = <android.widget.TextView>tabChild.getChildAt(1);
|
|
|
|
isValid = bar.color && bar.color.android === t.getCurrentTextColor();
|
|
}
|
|
|
|
return isValid;
|
|
} |