Created
May 12, 2020 12:23
-
-
Save zo0m/c2717085c3f65e20a5344b30f8999acd to your computer and use it in GitHub Desktop.
Appcelerator Titanium Android ListView access via Hyperloop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ListView = require('android.widget.ListView'); | |
const View = require('android.view.View'); | |
const ViewGroup = require('android.view.ViewGroup'); | |
(function (tiList) { | |
const listWrapper = new View(tiList); | |
const nativeListView = ViewGroup.cast(listWrapper).getChildAt(1); | |
const list = ListView.cast(nativeListView); | |
list.smoothScrollToPositionFromTop((itemIndex + 1 /* 1st section*/), 0, 100); | |
setTimeout(function () { | |
list.setSelectionFromTop((itemIndex + 1 /* 1st section*/), 0); | |
}, 200); | |
})($.eventsFeed); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment