[TIMOB-28228] Android: Add TableView "moveable" support
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-01-27T18:23:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.3.1 |
Components | Android |
Labels | TableView, android, parity |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2020-11-06T01:51:33.000+0000 |
Updated | 2021-04-27T16:45:12.000+0000 |
Description
*Summary:*
On iOS, a TableView's rows can be moved via drag-and-drop by setting the
TableView
object's "editing" and "moveable" properties to true
. We should add the same on Android for parity.
_(Note that "moveable" property is ignored unless "editing" is set true
.)_
https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-property-moveable
*Note:*
iOS also allows you to configure each row's "moveable" property as well. If undefined, then the row defaults to using the TableView
's "moveable" property value.
https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableViewRow-property-moveable
master: https://github.com/appcelerator/titanium_mobile/pull/12298
Would this work same as on iOS? For me nothing happens if I set TableView's
moving
property to true and rows are still not moveable. Not sure what I'm missing. Is there any example for Android somewhere? I can't find it in KitchenSink.[~appsol], you have to "long press" the row on Android before you can start dragging it. That's the built-in native behavior. The phone will typically vibrate when long pressed and the row will show a drop-shadow elevation. There is sample code in the above github link.
@Joshua Quick Ah the problem turned out to be the spelling :) Everywhere the property name is *_"moveable" _*but in the above Github example its *_"movable"_* Changing the property name to "movable" on Android worked.
[~appsol], you're right. The spelling between Android and iOS for this property is inconsistent. And Android's spelling does not match the api docs.