tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

feat(android): add x/y to ScrollView drag events #14102

Closed m1ga closed 1 month ago

m1ga commented 2 months ago

x/y position of the touch when using dragstart/dragend:

var win = Ti.UI.createWindow();

var scrollView = Ti.UI.createScrollView({
  showVerticalScrollIndicator: true,
  showHorizontalScrollIndicator: true,
  height: '80%',
  width: '80%'
});
var view = Ti.UI.createView({
  backgroundColor:'#336699',
  borderRadius: 10,
  top: 10,
  height: 2000,
  width: 1000
});
scrollView.add(view);
scrollView.addEventListener("dragstart", function(e){
    console.log(e.x, e.y);
})
scrollView.addEventListener("dragend", function(e){
    console.log(e.x, e.y);
})
win.add(scrollView);
win.open();
deckameron commented 1 month ago

Hi @m1ga I created the iOS version here.

m1ga commented 1 month ago

Awesome, thanks @deckameron