mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Android TabView should use tabTextColorProperty instead of colorProperty just like in iOS
This commit is contained in:
@ -4,7 +4,6 @@ import helper = require("../helper");
|
|||||||
import labelModule = require("ui/label");
|
import labelModule = require("ui/label");
|
||||||
import stackLayoutModule = require("ui/layouts/stack-layout");
|
import stackLayoutModule = require("ui/layouts/stack-layout");
|
||||||
import tabViewTestsNative = require("./tab-view-tests-native");
|
import tabViewTestsNative = require("./tab-view-tests-native");
|
||||||
import style = require("ui/styling/style");
|
|
||||||
import { resetStyleProperties } from "ui/core/view";
|
import { resetStyleProperties } from "ui/core/view";
|
||||||
|
|
||||||
// Using a TabView requires the "ui/tab-view" module.
|
// 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.");
|
assertFontsAreEqual(tabViewTestsNative.getNativeFont(this.testView), nativeFont, "Font must be bold 12 monospace after rebinding items.");
|
||||||
//console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
|
//console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
|
||||||
|
|
||||||
//console.log(`>>>>>>>>>>>>> RESET`);
|
console.log(`>>>>>>>>>>>>> RESET`);
|
||||||
resetStyleProperties(this.testView.style);
|
resetStyleProperties(this.testView.style);
|
||||||
assertFontsAreEqual(tabViewTestsNative.getNativeFont(this.testView), originalFont, "Font must be the original one after resetting the style.");
|
assertFontsAreEqual(tabViewTestsNative.getNativeFont(this.testView), originalFont, "Font must be the original one after resetting the style.");
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import {
|
|||||||
TabViewBase, TabViewItemBase, itemsProperty, selectedIndexProperty,
|
TabViewBase, TabViewItemBase, itemsProperty, selectedIndexProperty,
|
||||||
tabTextColorProperty, tabBackgroundColorProperty, selectedTabTextColorProperty,
|
tabTextColorProperty, tabBackgroundColorProperty, selectedTabTextColorProperty,
|
||||||
androidSelectedTabHighlightColorProperty, androidOffscreenTabLimitProperty,
|
androidSelectedTabHighlightColorProperty, androidOffscreenTabLimitProperty,
|
||||||
fontInternalProperty, traceCategory, View, colorProperty, layout, Color, Font, traceEnabled, traceWrite
|
fontInternalProperty, traceCategory, View, layout, Color, Font, traceEnabled, traceWrite
|
||||||
} from "./tab-view-common"
|
} from "./tab-view-common"
|
||||||
import { textTransformProperty, TextTransform, getTransformedText } from "ui/text-base";
|
import { textTransformProperty, TextTransform, getTransformedText } from "ui/text-base";
|
||||||
import { fromFileOrResource } from "image-source";
|
import { fromFileOrResource } from "image-source";
|
||||||
@ -323,10 +323,10 @@ export class TabView extends TabViewBase {
|
|||||||
this.setAdapter(value);
|
this.setAdapter(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
get [colorProperty.native](): number {
|
get [tabTextColorProperty.native](): number {
|
||||||
return this._tabLayout.getTabTextColor();
|
return this._tabLayout.getTabTextColor();
|
||||||
}
|
}
|
||||||
set [colorProperty.native](value: number | Color) {
|
set [tabTextColorProperty.native](value: number | Color) {
|
||||||
let color = value instanceof Color ? value.android : value;
|
let color = value instanceof Color ? value.android : value;
|
||||||
this._tabLayout.setTabTextColor(color);
|
this._tabLayout.setTabTextColor(color);
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,6 @@ export class TabView extends TabViewBase {
|
|||||||
this.setViewControllers(value);
|
this.setViewControllers(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get [tabTextColorProperty.native](): UIColor {
|
get [tabTextColorProperty.native](): UIColor {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user