Darkempire78 / OpenCalc

A simple and beautiful calculator for Android
GNU General Public License v3.0
740 stars 83 forks source link

Add timestamps to history results #159

Closed lefterisgar closed 1 year ago

lefterisgar commented 1 year ago

Fixes #82. I'm not sure if you are okay with the paddings, spacing, etc... Here is a quick screenshot: Screenshot_20230213-005107_crDroid Home

Darkempire78 commented 1 year ago

I found an issue, if you upgrade the app with this version, the app will crash because the former history does not have the time element

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.darkempire78.opencalculator, PID: 8075
    java.lang.NumberFormatException: null
        at java.lang.Long.parseLong(Long.java:699)
        at java.lang.Long.parseLong(Long.java:861)
        at com.darkempire78.opencalculator.HistoryAdapter$HistoryViewHolder.bind(HistoryAdapter.kt:62)
        at com.darkempire78.opencalculator.HistoryAdapter.onBindViewHolder(HistoryAdapter.kt:29)
        at com.darkempire78.opencalculator.HistoryAdapter.onBindViewHolder(HistoryAdapter.kt:14)
lefterisgar commented 1 year ago

I found an issue, if you upgrade the app with this version, the app will crash because the former history does not have the time element

Oh, I see. How can we handle this? Delete history? Old entries without timestamps may result in visual glitches or something. I don't know...

Darkempire78 commented 1 year ago

Oh, I see. How can we handle this? Delete history? Old entries without timestamps may result in visual glitches or something. I don't know...

I fixed it (09cab89), it removes the time text if it does not exist

lefterisgar commented 1 year ago

Is the resolution better now?

Darkempire78 commented 1 year ago

It may be beter to display "Today", "Yesterday" or "December 1, 2022" instead of "2min ago" We can group all the calculations of one day. Now each calculation has its own date even if I made them with 2 seconds difference

lefterisgar commented 1 year ago

It may be beter to display "Today", "Yesterday" or "December 1, 2022" We can group all the calculations of one day. Now each calculation has its own date even if I made them with 2 seconds difference

Yes, that is a valid issue. I changed the resolution but grouping is too difficult for me.

Darkempire78 commented 1 year ago

Yes, that is a valid issue. I changed the resolution but grouping is too difficult for me.

@lefterisgar It's not a problem, push your update, I will group them

Darkempire78 commented 1 year ago

@lefterisgar I grouped the elements by date, what do you think about the UI ? 😀

lefterisgar commented 1 year ago

@lefterisgar I grouped the elements by date, what do you think about the UI ? grinning

I think it looks reeeally cool! Thanks for the improvements!

Darkempire78 commented 1 year ago

Thank you too for the pull resquest!