davidsansome / tsurukame

Tsurukame is an unofficial WaniKani app for iOS. It helps you learn Japanese Kanji.
https://tsurukame.app
Apache License 2.0
263 stars 63 forks source link

Apple Watch support #119

Open waltiz opened 5 years ago

waltiz commented 5 years ago

It would be great to have Apple Watch support. This would consist in an Apple Watch complication that shows a different kanji every now and then, maybe based on the wall of shame or some other criteria.

dysnomian commented 5 years ago

I would love to have a count of my available reviews as a complication.

mzsanford commented 5 years ago

I recently did a professional project based on iOS app extensions so I may take a crack at this. The options for complications have some serious design limitations, as your can see in the Human Interface Guidelines. I've started a little bit of testing to see how often it can refresh and such.

Some things that could be included, depending on what's interesting to people:

Those are in roughly the order they seem useful to me, but comment if you have other thoughts (@dysnomian , @waltiz ). The way complications are structured the app can only present one. Either (A) a single type needs to be chosen, (B) the type is chosen can be driven by the complication type (large is review count, small is level, etc), or (C) I need to add a settings screen to choose which. Option (C) is the only one that adds significant work.

The original request was for a random item but I feel the small space will make that difficult. It also has the downside of subverting the Wanikani SRS goals. Having said that I'll test it out

mzsanford commented 4 years ago

Just in case anyone is following along, my current tests are below using real data transferred from the phone app. Allowing untethered data updates is much more complicated so I've pushed that off until later. Note:

Settings - Review Counts (default) Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-20 at 12 55 30

Review Count Complications Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-20 at 12 55 33

Note: fake progress bars Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-20 at 12 55 40

Settings - Level Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-20 at 12 55 24

Level Complications Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-20 at 12 55 20 Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-20 at 12 55 11

UInt2048 commented 4 years ago

This is great! I can't wait, and I agree with your choices so far. I would love this on my Watch! Thank you! If you choose to add a random item, I believe it should be of the items that have less than 80% of reviews correct (critical items). This random item could be in the small complication in the tick marks on the California watch face, for example.

mzsanford commented 4 years ago

@turtlemaster19 said:

This random item could be in the small complication in the tick marks on the California watch face, for example.

It turns out that just using text for that complication requires that it be two lines. The kanji on the SF font are so small that it is hard to decipher. I added some test code to generate an image and composite the kanji into the middle of it, since images can be full sized. I have not yet figured out how to generate the list of criticals (kanji only, no vocab given the space) and if/how I could include the meaning in this UX. With all of that said it looks like this:

Random Kanji Complication - No gauge Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-22 at 13 45 08

Random Kanji - Gauge Showing Correct Percentage Simulator Screen Shot - Apple Watch Series 5 - 44mm - 2019-11-22 at 13 47 11

UInt2048 commented 4 years ago

I was referring to this complication, sorry for the confusion: 52C126AC-895F-43FB-834C-52FB3DB0C2AC

mzsanford commented 4 years ago

@turtlemaster19 I can't find a watch face in the simulator that replicates that complication. I checked both the handy cheat sheet and the Apple docs. The closest I found is the CLKComplicationFamily.graphicBezel family (image below). Are you running a beta version of watchOS by chance? If not it would help if you send the name of the watch face as displayed when you deep tap but before you tap "Customize". Also let me know what model of Apple Watch this is, maybe it's something version dependent.

a8d83f55-c625-42e0-9551-038ea9c0eba0

UInt2048 commented 4 years ago

Series 4, optional complication on California. Similar to that one on the Infogram, but it doesn't offer the circle.

https://9to5mac.com/2019/06/20/watchos-6-customizing-california-apple-watch-face/

mzsanford commented 4 years ago

@turtlemaster19 thank you for the info. I was missing it because it only becomes available once you change the face shape of the California to "circular", I was on the default "full screen". It turns out it uses the existing "utilitarianLarge" family so I'll make sure to test that.

UInt2048 commented 4 years ago

I opened #219 because we should have consistent level naming between a Tsurukame Watch app and the Tsurukame iOS/macOS app that already exists. The half-level was a good idea, so we should do this in the main app if we are going to do it on the watch.

mzsanford commented 4 years ago

Is anyone on this thread is interested in testing please send me your Apple ID email address and I'll see if I can get what I have so far posted to TestFlight (using a new app identifier, only for TestFlight and not general release). You can send the Apple ID via https://gitter.im/tsurukame/testers or via email to (matt AT my_github_username dot com).

UInt2048 commented 4 years ago

@mzsanford Done! By the way, on the hour, sometimes the complication won't update the review count. P.S. Why did you change the Watch icon?

mzsanford commented 4 years ago

I had trouble fitting the current Tsurukame icon into the small space on the Apple Watch, it turns into a jumble of lines. I intend to go back and work on that before posting the PR.

UInt2048 commented 4 years ago

Okay, makes sense. Happy Holidays!

UInt2048 commented 4 years ago

@mzsanford When you do read this, I propose two things:

  1. When the hour changes, the complication often won't update.
  2. Although the data can be "stale", this could be simply due to not opening WK at all. Is it possible to display the data that is there? It could be more useful for testing to see what it will display.
UInt2048 commented 4 years ago

If there aren't any Reviews in the next hour, even if there are Reviews available, it will only show the time until the new Reviews come, and won't show the number available.

UInt2048 commented 4 years ago

@mzsanford Once the user has moved the Radicals out of Lesson stage, can it go from Level 19.5 to Level 20, and show the new Level data?

mzsanford commented 4 years ago

@turtlemaster19 I'm working on getting the current implementation reviewed and then I'll start thinking about the half-level improvement.

UInt2048 commented 4 years ago

Sounds good!

aposp commented 4 years ago

Is anyone unable to use the Watch complication? I had an error that said the information on this watch was some 800 hours out of date (according to Google, right about when WK switched over to a new API). Although that message with the hour count seems to have disappeared I'm still told to open the app on my phone to refresh the data. Is this a known issue or do I have a problem with my watch, phone, or WK installation?

UInt2048 commented 4 years ago

@aposp Unfortunately, at the moment, the complication doesn't have stand-alone support.

However, if you do open the app with the watch in the Tsurukame app, it should sync still for you, right? It does for me!

Tsurukame has always used APIv2 from the very beginning, so the APIv1 end-of-life wouldn't do anything.

aposp commented 4 years ago

Thanks for the response. I just checked and the Watch app itself showed an update ~5min ago (since that update and my comment, both my phone and watch have been restarted). Seems like it was just acting strange due to not being used before. Thanks again!

UInt2048 commented 4 years ago

@aposp No problem, glad to hear it's working now!