Skip to content

Commit 10b29b1

Browse files
committed
display duration of audio and video files
1 parent 6aaca00 commit 10b29b1

File tree

8 files changed

+30
-3
lines changed

8 files changed

+30
-3
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/PropertiesDialog.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ class PropertiesDialog : DialogFragment() {
4545
properties_resolution.visibility = View.VISIBLE
4646
properties_resolution.text = mItem.resolution
4747
} else if (mItem.isAudio(context)) {
48-
48+
properties_duration_label.visibility = View.VISIBLE
49+
properties_duration.visibility = View.VISIBLE
50+
properties_duration.text = mItem.getDuration(context)
4951
} else if (mItem.isVideo(context)) {
50-
52+
properties_duration_label.visibility = View.VISIBLE
53+
properties_duration.visibility = View.VISIBLE
54+
properties_duration.text = mItem.getDuration(context)
5155
}
5256

5357
val file = File(mItem.path)

app/src/main/res/layout/item_properties.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout
3-
android:id="@+id/properties_holder"
43
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:id="@+id/properties_holder"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
android:orientation="vertical"
@@ -102,4 +102,21 @@
102102
android:textColor="@android:color/black"
103103
android:visibility="gone"/>
104104

105+
<TextView
106+
android:id="@+id/properties_duration_label"
107+
android:layout_width="match_parent"
108+
android:layout_height="wrap_content"
109+
android:layout_marginTop="@dimen/smtfp_activity_margin"
110+
android:text="@string/duration"
111+
android:textSize="@dimen/smtfp_details_text_size"
112+
android:visibility="gone"/>
113+
114+
<TextView
115+
android:id="@+id/properties_duration"
116+
android:layout_width="match_parent"
117+
android:layout_height="wrap_content"
118+
android:padding="@dimen/smtfp_small_margin"
119+
android:textColor="@android:color/black"
120+
android:visibility="gone"/>
121+
105122
</LinearLayout>

app/src/main/res/values-de/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<string name="last_modified">Last modified</string>
4646
<string name="files_count">Files inside</string>
4747
<string name="resolution">Resolution</string>
48+
<string name="duration">Duration</string>
4849

4950
<plurals name="items_deleted">
5051
<item quantity="one">1 Datei/Ordner gelöscht</item>

app/src/main/res/values-it/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<string name="last_modified">Ultima modifica</string>
4646
<string name="files_count">File contenuti</string>
4747
<string name="resolution">Resolution</string>
48+
<string name="duration">Duration</string>
4849

4950
<plurals name="items_deleted">
5051
<item quantity="one">1 elemento eliminato</item>

app/src/main/res/values-ja/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<string name="last_modified">Last modified</string>
4646
<string name="files_count">Files inside</string>
4747
<string name="resolution">Resolution</string>
48+
<string name="duration">Duration</string>
4849

4950
<plurals name="items_deleted">
5051
<item quantity="one">1 アイテムを削除しました</item>

app/src/main/res/values-pt-rPT/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<string name="last_modified">Última modificação</string>
4646
<string name="files_count">Ficheiros no interior</string>
4747
<string name="resolution">Resolution</string>
48+
<string name="duration">Duration</string>
4849

4950
<plurals name="items_deleted">
5051
<item quantity="one">1 item eliminado</item>

app/src/main/res/values-sv/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<string name="last_modified">Last modified</string>
4646
<string name="files_count">Files inside</string>
4747
<string name="resolution">Resolution</string>
48+
<string name="duration">Duration</string>
4849

4950
<plurals name="items_deleted">
5051
<item quantity="one">1 objekt borttagen</item>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<string name="last_modified">Last modified</string>
4646
<string name="files_count">Files inside</string>
4747
<string name="resolution">Resolution</string>
48+
<string name="duration">Duration</string>
4849

4950
<plurals name="items_deleted">
5051
<item quantity="one">1 item deleted</item>

0 commit comments

Comments
 (0)