mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
setColorFilter used if android.os.Build.VERSION.SDK_INT >= 21 (#3143)
This commit is contained in:
@ -282,6 +282,10 @@ export class SegmentedBarStyler implements style.Styler {
|
||||
for (let tabIndex = 0; tabIndex < tabHost.getTabWidget().getTabCount(); tabIndex++) {
|
||||
let vg = <android.view.ViewGroup>tabHost.getTabWidget().getChildTabViewAt(tabIndex);
|
||||
|
||||
var backgroundDrawable = vg.getBackground();
|
||||
if (android.os.Build.VERSION.SDK_INT >= 21 && backgroundDrawable && types.isFunction(backgroundDrawable.setColorFilter)) {
|
||||
backgroundDrawable.setColorFilter(newValue, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
} else {
|
||||
let stateDrawable = new android.graphics.drawable.StateListDrawable();
|
||||
|
||||
let arr = (<any>Array).create("int", 1);
|
||||
@ -297,6 +301,7 @@ export class SegmentedBarStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static resetSelectedBackgroundColorProperty(v: view.View, nativeValue: Array<android.graphics.drawable.Drawable>) {
|
||||
let tabHost = <android.widget.TabHost>v._nativeView;
|
||||
|
Reference in New Issue
Block a user