Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
06198b5f
Commit
06198b5f
authored
5 years ago
by
Nicolas Pomepuy
Committed by
Geoffrey Métais
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use user's locale time format for TV
(cherry picked from commit
ea8df450
)
parent
4729705c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/tv/TimeUpdater.kt
+4
-2
4 additions, 2 deletions
vlc-android/src/org/videolan/vlc/gui/tv/TimeUpdater.kt
with
4 additions
and
2 deletions
vlc-android/src/org/videolan/vlc/gui/tv/TimeUpdater.kt
+
4
−
2
View file @
06198b5f
...
...
@@ -30,6 +30,7 @@ import androidx.fragment.app.FragmentActivity
import
androidx.lifecycle.Lifecycle
import
androidx.lifecycle.LifecycleObserver
import
androidx.lifecycle.OnLifecycleEvent
import
java.text.DateFormat
import
java.util.*
private
const
val
TAG
=
"VLC/TimeUpdater"
...
...
@@ -37,8 +38,9 @@ private const val TAG = "VLC/TimeUpdater"
class
TimeUpdater
(
private
val
activity
:
Activity
,
private
val
tv
:
TextView
)
:
LifecycleObserver
{
private
fun
updateTime
()
{
val
calendar
=
Calendar
.
getInstance
()
tv
.
text
=
String
.
format
(
"%d:%02d"
,
calendar
[
Calendar
.
HOUR_OF_DAY
],
calendar
[
Calendar
.
MINUTE
])
val
format
=
DateFormat
.
getTimeInstance
(
DateFormat
.
SHORT
,
Locale
.
getDefault
())
tv
.
text
=
format
.
format
(
Date
())
}
@OnLifecycleEvent
(
Lifecycle
.
Event
.
ON_START
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment