Allow toggling of visible scrollbar indicators (#4523)

* Allow toggling of visible scrollbar indicators

* Add unit test

* Make what the prop does more clear

* Fix tslint

* Rename property per @vakrilov

* Missed string property rename

* Move property from method

* Update orientationChanged to use new property name
This commit is contained in:
Steve McNiven-Scott
2017-07-11 11:14:29 -04:00
committed by Alexander Vakrilov
parent 57cf2314ee
commit 3dbcf088be
5 changed files with 85 additions and 5 deletions

View File

@ -1,5 +1,5 @@
import { ScrollEventData } from ".";
import { ScrollViewBase, layout } from "./scroll-view-common";
import { ScrollViewBase, layout, scrollBarIndicatorVisibleProperty } from "./scroll-view-common";
export * from "./scroll-view-common";
@ -44,6 +44,17 @@ export class ScrollView extends ScrollViewBase {
return nativeView.getScrollableLength() / layout.getDisplayDensity();
}
[scrollBarIndicatorVisibleProperty.getDefault](): boolean {
return true;
}
[scrollBarIndicatorVisibleProperty.setNative](value: boolean) {
if (this.orientation === "horizontal") {
this.nativeView.setHorizontalScrollBarEnabled(value);
} else {
this.nativeView.setVerticalScrollBarEnabled(value);
}
}
public scrollToVerticalOffset(value: number, animated: boolean) {
const nativeView = this.nativeView;
if (nativeView && this.orientation === "vertical") {