mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Date format: add more comments and fix wrong format kind usage
This commit is contained in:
parent
c6178e504f
commit
18dcd6b9b1
@ -16,12 +16,29 @@
|
||||
|
||||
package im.vector.app.core.date
|
||||
|
||||
/* This will represent all kind of available date formats for the app.
|
||||
We will use the date Sep 7 2020 at 9:30am as an example.
|
||||
The formatting is depending of the current date.
|
||||
*/
|
||||
enum class DateFormatKind {
|
||||
// Will show date relative and time (today or yesterday or Sep 7 or 09/07/2020 at 9:30am)
|
||||
DEFAULT_DATE_AND_TIME,
|
||||
|
||||
// Will show hour or date relative (9:30am or yesterday or Sep 7 or 09/07/2020)
|
||||
ROOM_LIST,
|
||||
|
||||
// Will show full date (Sep 7 2020)
|
||||
TIMELINE_DAY_DIVIDER,
|
||||
|
||||
// Will show full date and time (Mon, Sep 7 2020, 9:30am)
|
||||
MESSAGE_DETAIL,
|
||||
|
||||
// Will only show time (9:30am)
|
||||
MESSAGE_SIMPLE,
|
||||
|
||||
// Will only show time (9:30am)
|
||||
EDIT_HISTORY_ROW,
|
||||
|
||||
// Will only show date relative (today or yesterday or Sep 7 or 09/07/2020)
|
||||
EDIT_HISTORY_HEADER
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ class ViewEditHistoryEpoxyController(private val context: Context,
|
||||
// need to display header with day
|
||||
genericItemHeader {
|
||||
id(evDate.hashCode())
|
||||
text(dateFormatter.format(evDate.timeInMillis, DateFormatKind.EDIT_HISTORY_ROW))
|
||||
text(dateFormatter.format(evDate.timeInMillis, DateFormatKind.EDIT_HISTORY_HEADER))
|
||||
}
|
||||
}
|
||||
lastDate = evDate
|
||||
|
@ -58,7 +58,7 @@ object VectorLocale {
|
||||
/**
|
||||
* Init this object
|
||||
*/
|
||||
fun init(context: Context, localeProvider: LocaleProvider) {
|
||||
fun init(context: Context) {
|
||||
this.context = context
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user