DEV Community

Tong Liu
Tong Liu

Posted on

Reflect on Pull Request 3

Links

Issue
Pull Request

What did I do for PR3?

For this PR, I decided to keep contributing to Catima which was the one I contributed in PR2. This is because there was a subsequent issue with my PR2. The subsequent issue was that the empty state screen didn't scale well on small screens, although the UI works mostly fine on phones in modern days, if the screen height is smaller than the width (which could be horizontally orientated tablets), some components may overlap with other components or even don't show at all. The repository owner brought it up and was hoping for a fix. Since I've already gotten familiar with the code, I decided to work on it for my 3rd PR.## How did I fix the problem?
To fix this issue, I had to check the official document regarding support for different screen sizes, however, the official way of supporting different screen sizes did not work in my case, I turned to Google for help, from a post on Stackoverflow, I realized that there were 4 ways to optimize this issue and each of the solutions has their pros and cons. I tried the solutions one by one and none of them worked well until I tried to manually manipulate components to control which component should be shown on which screen height. After trying different thresholds of screen height for the UI to switch state by running it on Android Emulator, I found an optimized threshold height that could work on small screen phones without breaking the UI on regular phones. I submitted my code and created a PR and hoping for review from the repo owner, however, it didn't seem to be working well on the repo owner's phone and the owner suggested me a possible solution for this, although the suggested solution wasn't meant to solve the problem, I still feel thankful for the repo owner to bring that up to me. I tried to tweak the threshold screen height to fix this issue, however, it still didn't work for the scenario where the UI is scaled to the medium size (which disappears the icon and leaves the 2 lines of text). Then I communicated with the repo owner, and she made a reconsideration and finally decided to remove the medium scale factor and only keep the smallest scale factor. Finally, after the suggested fix from the repo owner, everything worked well.
Before scale
Before scale
After scale
After scale

What have I learned from this PR?

This PR has helped me to come to realization that the best way to learn something is actually doing it. For me, objective-oriented learning works better than theoretical-oriented learning, because objective-oriented learning can always help me to measure if the knowledge I learned can solve a practical problem to what extent and what could be the better alternative for it, which means that with objective-oriented learning, I can not only learn the knowledge but also, I will have a solid understanding about in which scenario should the knowledge be used.
So always, keep putting it into practice.

Top comments (0)