wlky / AnkiDroid-Wear

Anki for Android Wear devices
GNU General Public License v2.0
48 stars 11 forks source link

[Proof of concept] Added autosizing of text and updated the project #30

Closed LemmusLemmus closed 2 years ago

LemmusLemmus commented 3 years ago

I've implemented a form of text autosizing (#29) and customizable text padding, as well as updated the target sdk to api 28 and necessarily migrated the project to AndroidX. I also updated the min sdk to api 23, which was necessary in order to check if the screen was round easily (there are of course other methods to do so which do not necessitate raising the min sdk, but none as straightforward). I might give updating the project even further a try, assuming that I do not hit a brick wall in the process ;/

The method is imperfect and as such this is merely a proof of concept. It should however work well in most cases.

I used a dummy TextView to get the correct text size, as Autosizing does not work well inside a ScrollView. Even though this isn't an ideal solution, it is not the main reason for the messy code, but rather the fact that Autosizing prioritizes increasing font size over not splitting words in the middle, something which can result in very unsightly text. The code to fix this issue is also imperfect, among other things I had to change the word break strategy.

Some identified problems:

Some things that needs to be done:

As a side note, is there a particular reason as to why the rect. wear activity TextView has clickable and focusable set to true, whereas the round wear activity does not?

LemmusLemmus commented 3 years ago

Notable new additions (still very much a mere proof of concept):

Screenshots (using a round screen): Front of card: screen Back of card: screen(1) Scrolling between the card sides: screen(2) Using (sliding) the rounded button: screen(3)

Comments with //P in the code means that the code is very much personal and not (yet) adapted for general use.

Some additional identified problems: