Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25792] Android: Improved nested horizontal scrolling support #9985

Merged
merged 7 commits into from Apr 18, 2018

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Apr 6, 2018

JIRA:

Summary:

  • Scrolling a horizontal ScrollView now disables vertical scrolling parent from scrolling.
    • This was the old Android behavior until Titanium 6.3.0 changed it. Now restored.
    • Now matches iOS' behavior.
  • Scrolling a TextField horizontally now disables vertical scrolling parent from scrolling.
    • If you dragged too far up/down, then parent ScrollView would cancel TextField horizontal scrolling and steal/intercept all touch events from there. Made TextField scrolling difficult.
  • Improved horizontal scrolling of a ScrollView set up with a RefreshControl.
    • If you dragged too far up/down, RefreshControl would cancel horizontal scrolling making it difficult to scroll.
  • Note that most of these issues were introduced when we added RefreshControl support. Google's Java SwipeRefreshLayout class ignores calls to requestDisallowTouchIntercept() which allowed parent views to steal touch events.

Nested horizontal ScrollView test:

  1. Build and run the code attached to TIMOB-25792 on Android.
  2. Start dragging one of the horizontal ScrollViews. (It's the box containing labels.)
  3. As you drag it horizontally, drag up or down.
  4. Verify that the parent vertical ScrollView does NOT scroll. You should only be able to scroll the horizontal ScrollView.
  5. Release your finger from the screen.
  6. Place your finger on the horizontal ScrollView and drag vertically up/down.
  7. Verify that you can only scroll the parent ScrollView vertically and you cannot scroll the horizontal ScrollView.

Nested TextField scrolling test:

  1. Build and run the code attached to TIMOB-25937 on Android.
  2. Start dragging on of the TextFields horizontally.
  3. As you drag it horizontally, drag up or down.
  4. Verify that the parent vertical ScrollView does NOT scroll. You should only be able to scroll the TextField.
  5. Release your finger from the screen.
  6. Place your finger on TextField and drag vertically up/down.
  7. Verify that you can only scroll the parent ScrollView vertically and you cannot scroll the TextField.

Horizontal ScrollView with RefreshControl test:

  1. Build and run the code attached to TIMOB-25939 on Android.
  2. Drag your finger horizontally to scroll the view, but keep your finger on the screen.
  3. While dragging horizontally, slowly drag your finger down and verify the RefreshControl is NOT displayed.
  4. While dragging, drag your finger horizontally and verify scroll view still scrolls.
  5. Release your finger to stop dragging.
  6. Start dragging downwards, but don't release your finger from the screen.
  7. Verify that RefreshControl is dragged down as you drag down your finger.
  8. While your finger is still on the screen, drag your finger horizontally.
  9. Verify that dragging horizontally does not scroll the ScrollView horizontally.

Note: The new change here is that you can only scroll one thing at a time. Either the horizontal ScrollView or the pull-down RefreshControl. You cannot switch to scrolling another UI component in the middle of the same drag. This makes it easier to use.

…ew should disable vertical scrolling.

- Solves regression introduced in Titanium 6.3.0 and restores old behavior, which also matches iOS' behavior.
…anceled by scrollable parent view

- This change requires "TiSwipeRefreshLayout" change introduced by [TIMOB-25792] to work.
…for commit [TIMOB-25937]

- Constructor was changed to "protected" by mistake.
@build build added the android label Apr 6, 2018
Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: PASS 👍

@lokeshchdhry
Copy link
Contributor

FR Passed.

Studio Ver: 5.1.0.201804161553
SDK Ver: 7.2.0 local build
OS Ver: 10.13.4
Xcode Ver: Xcode 9.3
Appc NPM: 4.2.13-2
Appc CLI: 7.0.3-master.38
Daemon Ver: 1.1.1
Ti CLI Ver: 5.1.0
Alloy Ver: 1.12.0
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 10
Devices: ⇨ google Nexus 6P --- Android 8.0.0
⇨ google Nexus 5 --- Android 6.0.1
Emulator: Android 4.1

@build build added the android label Apr 17, 2018
@build
Copy link
Contributor

build commented Apr 18, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@lokeshchdhry lokeshchdhry merged commit 192394f into tidev:master Apr 18, 2018
@sgtcoolguy sgtcoolguy modified the milestones: 7.2.0, 7.3.0 May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants