Files
lineageos_updater/res/layout-large-notouch/update_item_view.xml
Michael W 9ad96eca85 Updater: Move progress next to progressbar
Author: Michael W <baddaemon87@gmail.com>
Date:   Fri Feb 11 18:16:02 2022 +0100

    Updater: Move progress next to progressbar

    * The progress text can get very long, resulting in jumping marquee text
    * In order to reduce the length, move the percentage out of the text
      and next to the progressbar
    * The behavior can be observed e.g. on pro1 in german, where the button
      is also wider due to the german text

    Change-Id: I0276182efed757c0929b31434edad9be548b841c

Author: Timi Rautamäki <timi.rautamaki@gmail.com>
Date:   Thu Mar 3 16:12:16 2022 +0000

    fixup! Updater: Move progress next to progressbar

    Fix crash on ATV devices by applying same layout changes to
    layout-large-notouch.

    Change-Id: Id6eabcf8b1960106eb63bd15bcf97f9b4cf0bbc8

Change-Id: I8aed4c35c6ac4261c0536a6b263d63f5b1fd11ba
2022-03-07 14:08:01 +00:00

121 lines
4.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
android:nextFocusRight="@+id/update_action"
app:cardBackgroundColor="@color/tv_card_background"
app:cardCornerRadius="0dp"
app:contentPadding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/build_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.87"
android:drawablePadding="8dp"
android:maxLines="1"
android:paddingBottom="8sp"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
tools:text="LineageOS 15.1" />
<TextView
android:id="@+id/build_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="14sp"
tools:text="29 February 2018" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/progress"
android:visibility="invisible"
tools:visibility="visible">
<ProgressBar
android:id="@+id/progress_bar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingTop="4sp"
tools:progress="65" />
<TextView
android:id="@+id/progress_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingEnd="8dp"
tools:text="65%" />
</LinearLayout>
<TextView
android:id="@+id/progress_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/progress"
android:ellipsize="marquee"
android:singleLine="true"
android:visibility="invisible"
tools:text="162 of 300 MB (3 minutes left)"
tools:visibility="visible" />
<TextView
android:id="@+id/build_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="8sp"
android:singleLine="true"
tools:text="300 MB"
tools:visibility="invisible" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageButton
android:id="@+id/update_menu"
style="?android:attr/actionOverflowButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:padding="8dp"
android:contentDescription="@null" />
<Button
android:id="@id/update_action"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
tools:text="Pause" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>