love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
200 stars 70 forks source link

Drag-n-drop file is not working. #256

Open SweetSea-ButImNotSweet opened 11 months ago

SweetSea-ButImNotSweet commented 11 months ago

Model

Galaxy J7 Prime, Android 8.1

Video file:

https://cdn.discordapp.com/attachments/329400828920070144/1163073721049809006/2023_10_15_18.07.13.mp4?ex=653e3fcf&is=652bcacf&hm=856621ffe7ac6dd6e920fbbfd1b0b042d6c3315ee038a61927bd96e277c61d3b&

I forget to tap "Custom BG" to check but the game doesn't get the image dropped and you may already noticed the animation of the dragging file is "coming back" not "disappear/fading out at the spot"

How to reproduce

Requirment: you have to turn on "Force activity/app can be resizable" since love2d doesn't allow split screen (Restart required if you change this option)

1: Open an known app that support drag-n-drop: example Gallery or Files by Google (I will call it A) 2: Run any game or code have known working love.filedropped call or using this one (by Miku AuahDark) (I will call it B)

local file = {size = 0, path = ""}

function love.draw()
  love.graphics.print(string.format("%s\n%d", file.path, file.size), 100, 100)
end

function love.filedropped(f)
  file.path = f:getFilename()
  file.size = f:getSize()
end

3: Enable split screen 4: Try to do drag and drop any file from the window A to window B

Expected behavior

Depend, but the game/code should get the "love.filedropped" working

MikuAuahDark commented 10 months ago

It's an interesting feature request but I don't think we'll implement this on LOVE 11.x branch.

SweetSea-ButImNotSweet commented 10 months ago

It's an interesting feature request but I don't think we'll implement this on LOVE 11.x branch.

Thanks god, finally you answered, I was worrying that I made this request in wrong repo and I need to move this request elsewhere Anyway thanks, I will look forward to LOVE 12

MikuAuahDark commented 10 months ago

I consider it feature request because implementing this in Android requires hacking around the SDL Android implementation. So the best way would be asking SDL devs to implement this. Unfortunately SDL2 is in maintenance mode so there won't be a new feature request but it may worth take a shot for SDL3.