pacjo / SmartspacerPlugins

Repository for my plugins for Smartspacer: Generic Weather, Local Battery, Sleep as Android and more
GNU General Public License v3.0
19 stars 3 forks source link

[Feature Request] Ankidroid integration #10

Closed tanhoaian01 closed 1 month ago

tanhoaian01 commented 1 month ago

Hello,

Please consider adding support for Ankidroid in Smartspacer. Ankidroid (Anki) is a free open-source flashcard application which many students use and love. Its communities (GitHub, Reddit) are pretty active and there's many supporting docs online (API Doc, etc). Ankidroid does have its own widget but I prefer to have it combined with smartspacer for less screen use (see below photo). Again, please consider making an Ankidroid-smartspacer plugin as I'm sure many will benefit from it.

Thanks and Best Regards, Alex.

Screenshot_2024-05-24-00-40-43-394_com teslacoilsw launcher

pacjo commented 1 month ago

Hi, I know Anki (I like it and use it regularly), so I'm quite eager to make it.

Any specific part you'd like to have? Will complication be enough, or is there enough data to warrant a whole target?

I think I'll try to use the API, we'll see how it goes.

pacjo commented 1 month ago

You know what? Turns out I really good at procrastinating studying...

anyway, here's the plugin. Work's fine for me with about 600 cards, updates as often as the widget. app-anki-release.zip

If everything works for you, I'll add it to the official repo in the next release.

tanhoaian01 commented 1 month ago

Omg you're so fast, @pacjo. Installing it now. Will try it out and get back to you in couples of days of testing. 🙌

tanhoaian01 commented 1 month ago

Hello, I have some feedbacks.

(1) Is it possible to select which data to show on the complication?

I would prefer to have the Anki icon + the number of Due cards only (🎴 21, etc). The more I review in Anki, the less true the estimated finish time would be.

(2) Is it possible to create a 'Due cards >0' requirement to prevent Anki from showing after completing studying?

When there's no due cards left, the complication still shows "ETA, due" which is kind of redundant. It would be better to get hidden away, especially since Smartspacer target only supports 2 complications at a time.

Besides that, it's actually quite good & in-synced with the Ankidroid original widget. Keep up the good work! 🌻

Screenshot_2024-05-25-23-53-10-773_com teslacoilsw launcher

pacjo commented 1 month ago

Is it possible to select which data to show on the complication?

Not right now, might add it later.

Is it possible to create a 'Due cards >0' requirement to prevent Anki from showing after completing studying?*l

Everything is possible..., but does it make sense to make it a requirement? I can just code the condition inside the complication itself.

I add requirements, when they can be used in multiple cases (like charging requirement in localbattery, since some users might prefer to show selected targets only under that condition). I can't think of a use case when you'd like to tie the visibility of target/complication other then Anki, to the amount of cards due. If there is one, or you have other reasons for the request, I can do the requirement.

When there's no due cards left, the complication still shows "ETA, due" which is kind of redundant.

Yeah, good catch.

Keep up the good work

As long as I have time to do so. Thanks

tanhoaian01 commented 1 month ago

Not right now, might add it later.

Thanks for considering. Just to confirm, it's not possible to have {🎴 due 21} or {🎴 21} at the moment?

Everything is possible..., but does it make sense to make it a requirement? I can just code the condition inside the complication itself.

I agree, I think I mixed up between the complication conditions and requirements. As long as the widget stays out of sight once all due cards have been studied, we're all good! 😄

pacjo commented 1 month ago

Just to confirm, it's not possible to have {🎴 due 21} or {🎴 21} at the moment?

You mean with the emoji? Not, it's all hard-coded right now, but it could be changed.

I can probably just add a text box, where you'd put something like: Anki: {due} / {eta} or 🎴 {due}, which would result in e.g. Anki 70 / 25 or 🎴 70 in the complication text. Would that work?

tanhoaian01 commented 1 month ago

No I mean the value {due} or due: {due} only. I use the 🎴 emoji to indicate the Anki icon. Yes, 🎴 70 would be nice. I like it compact and have great motivation when the number goes down. Can't wait for your next update!

pacjo commented 1 month ago

Ok, it should work. I didn't sit down to it yet, but a simple string substitution should allow for this.

pacjo commented 1 month ago

Screenshot_20240527-132141_Lawnchair (Debug)

Fixed empty text bug, added configuration and even emojis work.

app-anki-release.apk.zip

tanhoaian01 commented 1 month ago

Hello, I spot a small typo. The explanations are mixed up.

Screenshot_2024-05-27-22-02-58-812_nodomain pacjo smartspacer plugin anki

Besides that, everything's looking good. Really appreciate the hard work you put in; 🌻

pacjo commented 1 month ago

Fixed, thanks.

I'm closing this now, plugin will be available in the next release.

EDIT: no, I changed my mind. I'd like to add other thing to the next release, so I'll try to upload the plugin to the official repository soon (maybe tomorrow? we'll see) without waiting for another release.