amake / orgro

An Org Mode file viewer for iOS and Android
https://orgro.org
GNU General Public License v3.0
452 stars 21 forks source link

Provide a viewer widget #8

Closed chaorace closed 4 years ago

chaorace commented 4 years ago

The app currently appears to be missing a viewer widget on Android (not sure about iOS). It would be nice to have specific files viewable on the launcher.

amake commented 4 years ago

I'm not a heavy Android user. Can you give me an example of an app that offers this?

("Widget" in Flutter means something very different, I think, so I also need a bit of help bridging the terminology gap.)

chaorace commented 4 years ago

I'm not an Android developer myself, so take this with a grain of salt... On Android, widgets are essentially embedded views that the app provides to application launchers via a standard system level API.

The requested widget would essentially just be a view of a specific org file embedded as-is in a widget for viewing from the homescreen.

Here's a comparable example from Orgzly: .

amake commented 4 years ago

Thanks, that's helpful. I think the key to whether this is feasible or not is whether you can get Flutter inside that embedded view.

chaorace commented 4 years ago

Flutter is essentially foreign to me, I wish I could provide more insight here...

Stack Overflow says there's no built-in support from Flutter for Android widgets. It doesn't necessarily seem impossible, though. Here's a walkthrough from 2018 demonstrating one way to do it.

Hmmm, disregard that link. I've read it over myself now and I'm no longer sure if that's really what I thought it was!

amake commented 4 years ago

The second link is about embedding a native view (e.g. implemented on the platform side in Java/Kotlin or Objective-C/Swift) inside Flutter, which is not what we’re looking for here.

This says that Android home widgets can only use very specific layouts called RemoteViews. Flutter can’t be embedded in these, so it’s just not possible.

I’m going to close this, but if it ever becomes possible then we can revisit it.