Files
APKDownloader/app/src/main/res/layout/view_download.xml
Aayush Gupta f851a5ad3e Improvements to download progress UI
Switch to LinearProgressIndicator where possible and show an indeterminate
progress bar while download progress is below 1%

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2023-12-31 15:54:05 +05:30

121 lines
4.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?><!--
~ Aurora Store
~ Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
~
~ Aurora Store is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 2 of the License, or
~ (at your option) any later version.
~
~ Aurora Store is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
~
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:attr/selectableItemBackground"
android:paddingStart="@dimen/padding_small"
android:paddingEnd="@dimen/padding_small">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_download"
android:layout_width="@dimen/icon_size_medium"
android:layout_height="@dimen/icon_size_medium"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/margin_small"
android:src="@drawable/bg_placeholder" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/img_download"
android:divider="@drawable/divider_alt"
android:orientation="vertical"
android:showDividers="middle">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/txt_title"
style="@style/AuroraTextStyle.Line1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="viewStart"
tools:text="App Name" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/txt_status"
style="@style/AuroraTextStyle.Line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="viewStart"
tools:text="Status" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_download"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:indeterminate="false"
android:max="100"
app:indicatorColor="@color/colorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:trackColor="@android:color/darker_gray"
app:trackCornerRadius="10dp"
tools:progress="75" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/txt_progress"
style="@style/AuroraTextStyle.Line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="viewStart"
tools:text="75%" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/txt_eta"
style="@style/AuroraTextStyle.Line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="center"
tools:text="15 sec" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/txt_speed"
style="@style/AuroraTextStyle.Line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="viewEnd"
tools:text="1.5Mb/s" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>