Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27077] Android: Rewrite Ti.UI.TableView to use RecyclerView

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-03-12T18:49:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsAndroid
LabelsTableView, android
ReporterJoshua Quick
AssigneeGary Mathews
Created2019-05-13T17:50:20.000+0000
Updated2021-03-12T18:49:54.000+0000

Description

*Summary:* Titanium's [Ti.UI.TableView](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView) is currently implemented on Android via the Java [ListView](https://developer.android.com/reference/android/widget/ListView) class. We should re-implement Titanium's TableView to use Android's [RecyclerView](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html) instead. *Reason:* Google's RecyclerView offers the following features we would like to add for parity with iOS: * "Swipe Actions" for rows. * Drag-and-drop rows. The above can be done via Google's [ItemTouchHelper](https://developer.android.com/reference/android/support/v7/widget/helper/ItemTouchHelper) Java class in combination with their RecyclerView. *Note 1:* In Android Studio's UI designer, Google's ListView is listed under the "Legacy" widgets tab. Google isn't deprecating ListView, but they're clearly favoring RecyclerView over it. *Note 2:* In the future, we should rewrite Titanium's Ti.UI.ListView to use Google's RecyclerView as well, but it's better to test-the-waters with the much simpler Ti.UI.TableView first.

Attachments

FileDateSize
testCases.js2021-03-12T18:49:43.000+000046820

Comments

  1. Hans Knöchel 2019-05-17

    + 1000 for this. Draggable cells are the only Android limitation that bothers us right now.
  2. Brian García 2019-05-30

    Oh please yes
  3. Rodrigo Farfán 2019-09-09

    IMHO this is a must-have for Android. Ti ListView for iOS has editing & sorting features, but the lack of this feature on Android is a big parity gap. There's a good Android native library https://github.com/woxblom/DragListView that could help. Of course, without loosing Collections binding.
  4. Hans Knöchel 2019-09-09

    We developed this internally (actually based on DragListView). No collection binding (obviously), but it works quite performant and allows drag and drop for cells. It will probably be available in the marketplace later this month.
  5. Rodrigo Farfán 2019-09-09

    Do you need testing? I was about to start a module for this, but if you've got some progress on your side, I'll wait for it.
  6. Hans Knöchel 2020-03-02

    Quick question before more work goes into this: Should really the Ti.UI.TableView use RecyclerView and not the Ti.UI.ListView? The ListView API is already well abstracted and performant, which is a good start for RecyclerView. Also, everyone uses ListView on iOS already as it's significantly more performant than the TableView. I' m excited to see the progress!
  7. Rodrigo Farfán 2020-03-02

    100% agree with Hans. We use TableView almost nothing, not for saying absolutely nothing. ListView would be a better candidate to work with.
  8. Gary Mathews 2020-03-02

    [~hknoechel] We're starting with TableView as it's easier to transition over to using RecyclerView; from there we will transition ListView over, which is a little more complicated due to templating etc..
  9. Gary Mathews 2020-03-23

    master: https://github.com/appcelerator/titanium_mobile/pull/11556

JSON Source