Android TabView should use tabTextColorProperty instead of colorProperty just like in iOS

This commit is contained in:
Rossen Hristov
2017-01-03 12:53:21 +02:00
parent 25758d0803
commit 11f8da025b
3 changed files with 4 additions and 6 deletions

View File

@ -4,7 +4,6 @@ import helper = require("../helper");
import labelModule = require("ui/label");
import stackLayoutModule = require("ui/layouts/stack-layout");
import tabViewTestsNative = require("./tab-view-tests-native");
import style = require("ui/styling/style");
import { resetStyleProperties } from "ui/core/view";
// Using a TabView requires the "ui/tab-view" module.
@ -331,7 +330,7 @@ export class TabViewTest extends testModule.UITest<tabViewModule.TabView> {
assertFontsAreEqual(tabViewTestsNative.getNativeFont(this.testView), nativeFont, "Font must be bold 12 monospace after rebinding items.");
//console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
//console.log(`>>>>>>>>>>>>> RESET`);
console.log(`>>>>>>>>>>>>> RESET`);
resetStyleProperties(this.testView.style);
assertFontsAreEqual(tabViewTestsNative.getNativeFont(this.testView), originalFont, "Font must be the original one after resetting the style.");
}

View File

@ -2,7 +2,7 @@ import {
TabViewBase, TabViewItemBase, itemsProperty, selectedIndexProperty,
tabTextColorProperty, tabBackgroundColorProperty, selectedTabTextColorProperty,
androidSelectedTabHighlightColorProperty, androidOffscreenTabLimitProperty,
fontInternalProperty, traceCategory, View, colorProperty, layout, Color, Font, traceEnabled, traceWrite
fontInternalProperty, traceCategory, View, layout, Color, Font, traceEnabled, traceWrite
} from "./tab-view-common"
import { textTransformProperty, TextTransform, getTransformedText } from "ui/text-base";
import { fromFileOrResource } from "image-source";
@ -323,10 +323,10 @@ export class TabView extends TabViewBase {
this.setAdapter(value);
}
get [colorProperty.native](): number {
get [tabTextColorProperty.native](): number {
return this._tabLayout.getTabTextColor();
}
set [colorProperty.native](value: number | Color) {
set [tabTextColorProperty.native](value: number | Color) {
let color = value instanceof Color ? value.android : value;
this._tabLayout.setTabTextColor(color);
}

View File

@ -402,7 +402,6 @@ export class TabView extends TabViewBase {
this.setViewControllers(value);
}
get [tabTextColorProperty.native](): UIColor {
return null;
}