Skip to content

Allow toggling of visible scrollbar indicators#4523

Merged
vakrilov merged 8 commits intoNativeScript:masterfrom
sitefinitysteve:ScrollViewUpdates
Jul 11, 2017
Merged

Allow toggling of visible scrollbar indicators#4523
vakrilov merged 8 commits intoNativeScript:masterfrom
sitefinitysteve:ScrollViewUpdates

Conversation

@sitefinitysteve
Copy link
Copy Markdown
Contributor

Implements #4522

Okay, so I wasn't able to get the tests running here locally... kept crashing. I took the source and put it in a hello world to test with.

@ns-bot ns-bot added the cla: yes label Jul 6, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@vakrilov
Copy link
Copy Markdown
Contributor

vakrilov commented Jul 7, 2017

Hey @sitefinitysteve - thanks for the effort.
We have recently published a contributing guideline. You can give it a try - it explains how to run and write unit tests.
That said - unit tests are really essential for maintaining the quality of the project, so we would appreciate if you can write test to test this feature. There are bunch of other scroll-view related tests here.

@sitefinitysteve
Copy link
Copy Markdown
Contributor Author

sitefinitysteve commented Jul 7, 2017 via email

@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 7, 2017
@vakrilov
Copy link
Copy Markdown
Contributor

vakrilov commented Jul 7, 2017

run ci

@sitefinitysteve
Copy link
Copy Markdown
Contributor Author

Okay I added a test, I can't get it to run on iOS (per the docs), but seems to pass on Android (I mean fails on someones grid test though...

@vakrilov
Copy link
Copy Markdown
Contributor

run ci

@sitefinitysteve
Copy link
Copy Markdown
Contributor Author

I can't see the unit test build failed results... internal server or has to be published back out?

@vakrilov
Copy link
Copy Markdown
Contributor

Hi,
The unit test app failed due to some changes in the CI we are currently making internally.
I will trigger a new build as soon as the changes are done and will notify you if there are failing tests.

Thanks for the unit tests.
One other thing would you mind renaming the new property:

  • scrollBar -> scrollBarVisible
  • scrollBarProperty -> scrollBarVisibleProperty

@sitefinitysteve
Copy link
Copy Markdown
Contributor Author

Sure, one step further, scrollBarIndicatorVisible?

@vakrilov
Copy link
Copy Markdown
Contributor

That's even better.

@vakrilov
Copy link
Copy Markdown
Contributor

run ci


public _onOrientationChanged() {
// NOOP
this.updateScrollBarVisibility(this.scrollBar);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting TypeScript transpile error here:
error TS2339: Property 'scrollBar' does not exist on type 'ScrollView'.
Should be this.scrollBarIndicatorVisible

return 0;
}

get scrollBarIndicatorVisible(): boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this just:
public scrollBarIndicatorVisible: boolean;
This property will be re-defined when registering the property, so returning a value can confuse someone that this is the actual implementation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is similar to the orientation property in the beginning of the class - you can also move it there

orientationProperty.register(ScrollViewBase);

export const scrollBarIndicatorVisibleProperty = new Property<ScrollViewBase, boolean>({
name: "scrollBar", defaultValue: true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the name -> "scrollBarIndicatorVisible"

this.waitUntilTestElementLayoutIsValid();

if (app.ios) {
TKUnit.assertEqual(this.testView.ios.showsHorizontalScrollIndicator, true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use nativeView instead of ios/android

@vakrilov
Copy link
Copy Markdown
Contributor

Hi @sitefinitysteve
I've requested some changes. After the rename the project isn't building.
It is a good idea to build the project and make sure all tests are green when pushing in the PR branch.

If you are still having problems running the tests on both platforms - just ping me on slack to get this sorted. Being able to write and run the unit test is an essential prerequisite to a successful PR.

@sitefinitysteve
Copy link
Copy Markdown
Contributor Author

sitefinitysteve commented Jul 11, 2017 via email

@vakrilov
Copy link
Copy Markdown
Contributor

run ci

@vakrilov vakrilov merged commit 3dbcf08 into NativeScript:master Jul 11, 2017
@lock
Copy link
Copy Markdown

lock bot commented Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants