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-16878] Android: Refactored ScrollableView #9696
Conversation
- [TIMOB-16878] Fixed bug where ScrollableView ignores top-most child view's layout properties. * Prevented properties width, height, top, bottom, left, and right from working. * Fixed by wrapping view with a TiCompositeLayout, which is needed to handle these layout properties. - [TIMOB-25539] Fixed crash caused by adding non-Titanium view to ScrollableView. - [TIMOB-25625] Modified left/right page arrows to be density scaled. - [TIMOB-25626] Fixed ScrollableView to support Ti.UI.SIZE for width. * Android's "ViewPager" Java class does not natively support WRAP_CONTENT. * Refactored onMeasure() code to re-size width/height of container based on largest child view in this case. - Removed API Level 9 guards from code. (Outdated code. Min API Level is currently 16.)
… Replaces "moveNext" and "movePrev". - Successfully tested on Android and iOS. (Have not tested on Windows.)
…16878] - [TIMOB-5996] Modified ScrollalbeView.removeView() to support integer indexes like iOS. - [TIMOB-15780] Fixed ScrollableView.setCurrentPage() to not fire a "scrollend" event. * Event should only be fired when dragged or for methods that trigger scrolling animations. - [TIMOB-25634] Modified ScrollableView so that "cacheSize" property can be set dynamically like iOS. - [TIMOB-25636] Fixed bug where calling ScrollableView setters cause a crash if parent window is closed. * Bug was introduced in Titanium 7.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
Although, a minor change could be made.
{ | ||
// Do not allow given size to be less than min. (iOS min size is 3.) | ||
if (value < ScrollableViewProxy.MIN_CACHE_SIZE) { | ||
StringBuilder stringBuilder = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the reason behind StringBuilder
here? We could just do this:
Log.w(TAG, "ScrollableView 'cacheSize' cannot be set less than " +
ScrollableViewProxy.MIN_CACHE_SIZE + ". Given value: " + value);
@jquick-axway Looks like there's lint issues that need resolving |
Generated by 🚫 dangerJS |
JIRA:
Summary:
ScrollableView.removeView()
to support integer indexes like iOS.ScrollableView.setCurrentPage()
to not fire a "scrollend" event.TiCompositeLayout
, which is needed to handle these layout properties.Ti.UI.SIZE
for width.ViewPager
Java class does not natively supportWRAP_CONTENT
.cacheSize
property can be set dynamically like iOS.setCacheSize()
andgetCacheSize()
.Test 1:
This test ensures border applied to ScrollableView does not cause a crash.
Test 2:
Test that left/right page arrows are now density scaled. Note that the overlaid arrows used to be too tiny on high DPI devices.
Test 3:
Tests ScrollableView Ti.UI.SIZE support for TIMOB-25626. Also tests layout fix for TIMOB-16878.
Test 4:
Test dynamically changing
cacheSize
property.ScrollableViewCacheSizeTest.js
attached to TIMOB-25634 on Android.Test 5:
ScrollableViewAddRemoveTest.js
attached to TIMOB-15780 on Android.@@@ [scrollend]
does not get logged when it programmatically changes pages. This is the fix for TIMOB-15780.[dragstart]
,[scroll]
,[dragend]
, and[scrollend]
get logged when you scroll via the touchscreen yourself.