Skip to content

Commit

Permalink
Merge pull request #2376 from bryan-m-hughes/timob-9370
Browse files Browse the repository at this point in the history
Timob 9370 Kinetic and elastic scrolling.
  • Loading branch information
cb1kenobi committed Jun 14, 2012
2 parents 9cb17dd + 3b86ca2 commit 2fc01fc
Show file tree
Hide file tree
Showing 21 changed files with 976 additions and 759 deletions.
13 changes: 9 additions & 4 deletions apidoc/Titanium/UI/ScrollView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ events:
- name: decelerating
summary: Indicates whether the scroll is decelerating.
type: Boolean
platforms: [iphone, ipad]
platforms: [iphone, ipad, mobileweb]

- name: dragging
summary: |
Expand All @@ -111,6 +111,11 @@ events:
summary: Y coordinate of the event from the `source` view's coordinate system.
type: Number

- name: scrollEnd
summary: Fired when the view has stopped moving completely.
platforms: [mobileweb]
since: "2.1.0"

- name: dragStart
summary: Fired when the scrollable region starts being dragged.
description: |
Expand Down Expand Up @@ -169,7 +174,7 @@ properties:
This property takes precedence over the `horizontalBounce` and `verticalBounce` properties.
type: Boolean
default: false
platforms: [iphone, ipad]
platforms: [iphone, ipad, mobileweb]

- name: horizontalBounce
summary: Determines whether horizontal scroll bounce of the scrollable region is enabled.
Expand All @@ -184,7 +189,7 @@ properties:
`verticalBounce` properties.
type: Boolean
default: true
platforms: [iphone, ipad]
platforms: [iphone, ipad, mobileweb]

- name: maxZoomScale
summary: Maximum scaling factor of the scrollable region and its content.
Expand Down Expand Up @@ -252,7 +257,7 @@ properties:
`verticalBounce` properties.
type: Boolean
default: true
platforms: [iphone, ipad]
platforms: [iphone, ipad, mobileweb]

- name: zoomScale
summary: Scaling factor of the scrollable region and its content.
Expand Down
45 changes: 28 additions & 17 deletions apidoc/Titanium/UI/ScrollableView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,6 @@ events:
summary: Y coordinate of the event from the `source` view's coordinate system.
type: Number

- name: scrollEnd
summary: Fired when the view has stopped moving completely.
platforms: [iphone, ipad, android]
since: "2.1.0"

properties:
- name: currentPage
summary: Index of the currently visible view of <Titanium.UI.ScrollableView.views>.
type: Number

- name: view
summary: The currently visible view.
type: Titanium.UI.View

- name: singletap
summary: Fired when the device detects a single tap against this view.
platforms: [iphone, ipad]
Expand Down Expand Up @@ -227,8 +213,11 @@ events:

- name: scroll
summary: Fired repeatedly as the view is being scrolled.
platforms: [iphone, ipad, android]
since: "2.1.0"
description: |
Prior to 2.1, the scroll event did not fire consistently on all platforms. On iOS and Mobile
Web, it fired when scrolling ended, and on Android, it fired when drag ended. You can restore
the pre-2.1 behavior by listening for the `scrollEnd` or `dragEnd` events instead.
platforms: [iphone, ipad, android, mobileweb]
properties:

- name: currentPage
Expand All @@ -246,9 +235,31 @@ events:
summary: The currently visible view.
type: Titanium.UI.View

- name: scrollEnd
summary: Fired when the view has stopped moving completely.
platforms: [iphone, ipad, android, mobileweb]
since: "2.1.0"

properties:
- name: currentPage
summary: Index of the currently visible view of <Titanium.UI.ScrollableView.views>.
type: Number

- name: view
summary: The currently visible view.
type: Titanium.UI.View

- name: dragStart
summary: Fired when the scrollable region starts being dragged.
description: |
A dragging gesture is when a touch remains in contact with the display to physically drag
the view, as opposed to it being the result of scrolling momentum.
since: "2.1.0"
platforms: [mobileweb]

- name: dragEnd
summary: Fired when the scrolling drag gesture on the view has been completed.
platforms: [android]
platforms: [android, mobileweb]
since: "2.1.0"
properties:

Expand Down
8 changes: 4 additions & 4 deletions apidoc/Titanium/UI/TableView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ events:

- name: delete
summary: Fired when a table row is deleted by the user.
platforms: [iphone, ipad, mobileweb]
platforms: [iphone, ipad]
properties:
- name: detail
summary: Indicates whether the delete button was clicked. Always `false` for this event.
Expand Down Expand Up @@ -261,7 +261,7 @@ events:

- name: move
summary: Fired when a table row is moved by the user.
platforms: [iphone, ipad, mobileweb]
platforms: [iphone, ipad]
properties:
- name: globalPoint
summary: |
Expand Down Expand Up @@ -582,14 +582,14 @@ events:
description: |
A dragging gesture is when a touch remains in contact with the display to physically drag
the view, as opposed to it being the result of scrolling momentum.
platforms: [iphone, ipad]
platforms: [iphone, ipad, mobileweb]

- name: dragEnd
summary: Fired when the scrollable region stops being dragged.
description: |
A dragging gesture is when a touch remains in contact with the display to physically drag
the view, as opposed to it being the result of scrolling momentum.
platforms: [iphone, ipad]
platforms: [iphone, ipad, mobileweb]
properties:
- name: decelerate
summary: |
Expand Down
4 changes: 4 additions & 0 deletions mobileweb/titanium/Ti/Geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ define(["Ti/_/Evented", "Ti/_/lang", "Ti/Network"], function(Evented, lang, Netw
}
},

hasCompass: function() {
return compassSupport;
},

forwardGeocoder: function(address, callback) {
if (!require.is(address,"String")) {
return;
Expand Down
6 changes: 5 additions & 1 deletion mobileweb/titanium/Ti/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ define(
}
for (var i in rootNodesToLayout) {
node = rootNodesToLayout[i];
node._layout._doLayout(node, node._measuredWidth, node._measuredHeight, node._parent._layout._getWidth(node, node.width) === Ti.UI.SIZE, node._parent._layout._getHeight(node, node.height) === Ti.UI.SIZE);
node._layout._doLayout(node,
node._measuredWidth - node._borderLeftWidth - node._borderRightWidth,
node._measuredHeight - node._borderTopWidth - node._borderBottomWidth,
node._parent._layout._getWidth(node, node.width) === Ti.UI.SIZE,
node._parent._layout._getHeight(node, node.height) === Ti.UI.SIZE);
}

has("ti-instrumentation") && instrumentation.stopTest(self._layoutInstrumentationTest,
Expand Down
6 changes: 3 additions & 3 deletions mobileweb/titanium/Ti/UI/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ define(["Ti/_/declare", "Ti/_/UI/FontWidget", "Ti/_/dom", "Ti/_/css", "Ti/_/styl
currentIndex = 0,
currentTabIndex,
text = Locale._getString(this.textid, this.text);



// Handle null, undefined, etc edge case
if (!text) {
if (text === void 0) {
return "";
}
text += "";

// Convert \t and \n to &nbsp;'s and <br/>'s
while (currentIndex < text.length) {
Expand Down

0 comments on commit 2fc01fc

Please sign in to comment.