Wrong of Inconsistent Text Size

We never found miidio Recorder had a bug about wrong or inconsistent text size until someone emailed us something like that(all pictures are the reproduced ones not the one she emailed us):

wrong-recorder wrong-list wrong-widget

It is a nightmare for us to see such kind of picture. That’s impossible. We had tested many phones. Why the text are ran out of the box.

After examining the picture, we found the time counter is correct at the middle one and wrong at the left one. That’s the hint for us to find out the real problem: sp and dp. We forgot to change the unit of text size from dp to sp which is suggested by android. You may not know what is “SP” or “DP” if you are not an android programmer. To support multiple size of screen, android introduces the “density independent pixel”(dp) and “scale independent pixel”(sp).

All android programmers know dp is for UI size and sp is for text size. But not all of them know why and how to use them, including us. According to document from android: The sp scale factor depends on a user setting and the system scales the size the same as it does for dp. It should not cause this kind of problem.

The key clue to solve this problem is my mom’s phone. She felt the text size was to small for her and asked me to find a way to enlarge the text size. So, I opened the accessibility menu of setting to enable “large text” which is supported above android 4.0. Suddenly, all text became large.

large-text

With this experience, we had re-tested miidio Recorder under the same condition. And BINGO!!! We got the same situation. We just google some thing about sp, dp, and large text. One of post in stackoverflow gives us the answer:

“While sp (s for scaled) has scalable ratio: sp = px * ratio * scale. Where ratio never changes, but scale is user configurable. This scale can be used by people who need larger font sizes, for example, to use device more comfortably.”

And if we want the text to fit in a surrounding box, we should use dp instead of sp. So, we just reconfigure all pages from sp to dp. After that, the screen looks like:

correct-recorder correct-list correct-widget

This fix is included in version 2.3.1 which is released at last Friday.

Finally, we have to thanks the one who sent us the screenshot. That’s the reason we found this problem.


Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

 Post details 


 © 2017 - miidio Recorder 

Email
Print
Print