hiroshiyui / GuilelessBopomofo

Guileless Bopomofo(樸實注音鍵盤)- A Bopomofo(注音符號)software keyboard (aka input method editor) on Android, which is utilizing libchewing for intelligent phonetic processing.
Other
91 stars 5 forks source link

Deprecate GuilelessBopomofoServiceContext #28

Closed hiroshiyui closed 1 year ago

hiroshiyui commented 1 year ago

GuilelessBopomofoServiceContext retains GuilelessBopomofoService, which causes memory leaking.

I should refactor related codes, the best result is GuilelessBopomofoServiceContext being eliminated.

It's a huge and difficult task, though.

hiroshiyui commented 1 year ago

Perhaps I could bring Observer / Pub-Sub / EventBus patterns back. :thinking:

hiroshiyui commented 1 year ago

A simpler, but also uglier way is passing the required objects or attributes as method call parameters.

hiroshiyui commented 1 year ago

A simpler, but also uglier way is passing the required objects or attributes as method call parameters.

Not that easy as I may think, for each ViewBinding and its GestureListener...

hiroshiyui commented 1 year ago

Reference 821e365fb1e51b17e92db2ae040e50afd4a33082 to build EventBus events again.

hiroshiyui commented 1 year ago

If I change several Views to Fragment, then I can control theirs life-cycle, which is good for EventBus.

But it's a pity that Fragment belongs to Activity, and in InputMethodService I can use 'Views' only.

hiroshiyui commented 1 year ago

If I change several Views to Fragment, then I can control theirs life-cycle, which is good for EventBus.

But it's a pity that Fragment belongs to Activity, and in InputMethodService I can use 'Views' only.

Never mind, put register/unregister calls in onAttachedToWindow() & onDetachedFromWindow() solves this issue.

hiroshiyui commented 1 year ago

Most tasks were done. Before release a new version, I have to test the whole behaviors.

hiroshiyui commented 1 year ago

Fixed in release 1.9.5