Kuroba-Experimental
Kuroba-Experimental copied to clipboard
More date formats
The full date format for posts is month/day/year and this little detail triggers me like you wouldn't believe, so I would like more options. Either day/month/year or year/month/day are fine in my book.
Hi could I take on this issue?
Sure.
Probably it's not going to be as easy as it may seem. There is this class ThreadCellData
which holds a list of PostCellData
and PostCellData
is basically a class of precalculated and cached values that are used to draw PostCells
(basically posts that you see in thread/catalog).
So the place where the post date is calculated is in PostCellData.calculatePostTime()
. So basically you need to change that place. The hard part is that, you will probably notice it after implementing a new setting to change the date format, is that after changing the setting, the currently visible posts (in the recycler) will still have the same old date. That's because of the caching. What you need to do to make the visible posts updated right after the setting is changed is to add your new setting to PostCellData
and to the place where it's instantiated - ThreadCellData.postIndexedListToPostCellDataList()
. Every time the adapter is notified to redraw items, a diff-check happens to figure out what posts were changed and need to be updated. That's why you need to add your setting to the PostCellData
, otherwise postDataDiffers
will return false and the post won't be updated.
Okay thank you for the help.Are there any steps I need to take to run it properly in android studio?
No, you should be able to run it without any problems. But you maybe probably need to select the devDebug build flavor.