Skip to content
Snippets Groups Projects
Commit ec88ee31 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Improve the medialibrary scan progress UI

Fixes #2011
parent 94244f43
No related branches found
No related tags found
1 merge request!984Improve the medialibrary scan progress UI
Pipeline #98277 passed with stage
in 2 minutes and 37 seconds
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/background_default_darker">
</solid>
<corners android:radius="24dp">
</corners>
</shape>
\ No newline at end of file
......@@ -85,7 +85,6 @@
<dimen name="fastscroller_track_padding">5dp</dimen>
<dimen name="audio_player_cover_margin">8dp</dimen>
<dimen name="audio_player_elevation">8dp</dimen>
<dimen name="progress_layout_height">20dp</dimen>
<dimen name="dialog_sd_wisard_width">320dp</dimen>
<dimen name="dialog_sd_wisard_height">420dp</dimen>
......
......@@ -25,7 +25,7 @@
<androidx.appcompat.widget.ViewStubCompat
android:id="@+id/scan_viewstub"
android:layout_width="match_parent"
android:layout_height="@dimen/progress_layout_height"
android:layout_height="wrap_content"
app:layout_anchor="@+id/navigation"
app:layout_anchorGravity="top"
android:layout_gravity="top"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/scan_progress_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/progress_layout_height">
<ProgressBar
android:id="@+id/scan_progress_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:max="100"
style="@android:style/Widget.ProgressBar.Horizontal"
android:progressDrawable="?attr/progress_mini_player"
android:background="?attr/background_default" />
android:layout_height="wrap_content">
<TextView
android:id="@+id/scan_progress_text"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginBottom="8dp"
android:background="@drawable/rounded_corners_scan_progress"
android:gravity="center"
android:maxLines="1"
android:textColor="?attr/font_default"
android:paddingStart="16dp"
android:paddingTop="4dp"
android:paddingEnd="16dp"
android:paddingBottom="4dp"
android:text="@string/loading_medialibrary"
android:textSize="12sp" />
</RelativeLayout>
\ No newline at end of file
android:textColor="?attr/font_default"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/scan_progress_bar"
app:layout_constraintStart_toStartOf="parent" />
<ProgressBar
android:id="@+id/scan_progress_bar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="4dp"
android:background="?attr/background_default"
android:max="100"
android:progressDrawable="?attr/progress_mini_player"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -22,7 +22,7 @@
<androidx.appcompat.widget.ViewStubCompat
android:id="@+id/scan_viewstub"
android:layout_width="match_parent"
android:layout_height="@dimen/progress_layout_height"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout="@layout/scan_progress" />
......
......@@ -343,7 +343,7 @@ class MediaParsingService : LifecycleService(), DevicesDiscoveryCb {
lastNotificationTime = currentTime
val discovery = withContext(Dispatchers.Default) {
val progressText = when {
parsing > 0 -> getString(R.string.ml_parse_media) + " " + parsing + "%"
parsing > 0 -> getString(R.string.ml_parse_media) + " " + parsing + "% · " + Uri.parse(currentDiscovery).lastPathSegment
currentDiscovery != null -> getString(R.string.ml_discovering) + " " + Uri.decode(currentDiscovery?.removeFileProtocole())
else -> getString(R.string.ml_parse_media)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment