itsdrnoob / DataMonitor

Data usage monitoring app for android.
GNU General Public License v3.0
532 stars 50 forks source link

Add x day(s) remaining to home screen #183

Closed Eco-Gaming closed 11 months ago

Eco-Gaming commented 1 year ago

This PR adds x day(s) remaining to the active plan on the home screen. I also included a German translation for it. (Also this is my first PR, I hope I'm doing this right)

itsdrnoob commented 1 year ago

@Eco-Gaming Thanks for the PR. Appreciate the effort. I'll be looking into this soon.

Eco-Gaming commented 1 year ago

With my current code it will invalidate a lot of translations, i just realized i can fix that by adding an extra string for the days remaining and then just add a %2$s at the end of label_plan_validity. I'm going to do that later today.

Eco-Gaming commented 1 year ago

In the above commit I literally just added | %2$s to all the strings, I hope that works in all languages grammar wise. I didn't do it for Arabic because I have no clue how Arabic syntax works. Also while poking around in the getPlanValidity() method, I think on line 518 it should be just > instead of >= (I also added a comment in that line). With the current implementation (>=) and the renewal date set to 06/21, it shows the plan being valid until July 21st instead of June 21st. Changing the aforementioned line seems to fix that.