-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e749f5d
commit f6bb519
Showing
92 changed files
with
1,562 additions
and
1,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
package com.ismartcoding.plain.data | ||
|
||
import kotlinx.datetime.Instant | ||
|
||
data class DVideoMeta( | ||
val width: Int, | ||
val height: Int, | ||
val rotation: Int, | ||
val duration: Long, | ||
val bitrate: Int, | ||
val bitrate: Long, | ||
val frameRate: Float, | ||
val title: String, | ||
val artist: String, | ||
val album: String, | ||
val genre: String, | ||
val date: String, | ||
val takenAt: Instant?, | ||
val writer: String, | ||
val composer: String, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/ismartcoding/plain/extensions/Instant.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.ismartcoding.plain.extensions | ||
|
||
import com.ismartcoding.plain.MainApp | ||
import com.ismartcoding.plain.features.locale.LocaleHelper | ||
import com.ismartcoding.plain.helpers.TimeAgoHelper | ||
import kotlinx.datetime.Instant | ||
import java.text.DateFormat | ||
import java.util.Calendar | ||
|
||
|
||
fun Instant.formatTime(): String { | ||
val c = Calendar.getInstance() | ||
c.timeInMillis = epochSeconds * 1000 | ||
return android.text.format.DateFormat.getTimeFormat(MainApp.instance) | ||
.format(c.time) | ||
} | ||
|
||
fun Instant.formatDateTime(): String { | ||
val c = Calendar.getInstance() | ||
c.timeInMillis = epochSeconds * 1000 | ||
return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, LocaleHelper.currentLocale()) | ||
.format(c.time) | ||
} | ||
|
||
fun Instant.timeAgo(): String { | ||
return TimeAgoHelper.getString(toEpochMilliseconds()) | ||
} | ||
|
||
fun Instant.formatDate(): String { | ||
val c = Calendar.getInstance() | ||
c.timeInMillis = epochSeconds * 1000 | ||
return DateFormat.getDateInstance(DateFormat.MEDIUM, LocaleHelper.currentLocale()) | ||
.format(c.time) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.