-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove old date time parser APIs (WPB-9934) #3171
Conversation
Built wire-android-staging-compat-pr-3171.apk is available for download |
Built wire-android-dev-debug-pr-3171.apk is available for download |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done.
Just a couple of small adjustments to make sure the test works in all machines, and further encourage dropping of String
for internal date representation.
About dropping String, take the Device
class for example. It has a registrationTime
, which we transform from Instant to String.
And then we format this String again in order to show it in the UI.
There are multiple places where we do this and we should drop it. Keep Instant all the way through until it's time to display in the UI.
app/src/main/kotlin/com/wire/android/util/DateAndTimeParsers.kt
Outdated
Show resolved
Hide resolved
app/src/test/kotlin/com/wire/android/util/DateTimeUtilKtTest.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/util/DateAndTimeParsers.kt
Outdated
Show resolved
Hide resolved
Built wire-android-staging-compat-pr-3171.apk is available for download |
Built wire-android-dev-debug-pr-3171.apk is available for download |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as always 🔥
Quality Gate passedIssues Measures |
Built wire-android-staging-compat-pr-3171.apk is available for download |
Built wire-android-dev-debug-pr-3171.apk is available for download |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Currently, the application has an excessive use of
SimpleDateFormat
in reloaded, this is mainly used for formatting dates in messages (conversation screen), devices, read receipts, to name a few.Causes (Optional)
Solutions
Upgrade to newer APIs, replacing:
SimpleDateFormat
forDateTimeFormatter
java.text
apis forjava.time
apisSome samples running in an emulator for
10_000_000
conversions has the following results.Testing
Test Coverage (Optional)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.