From 9ad96eca85add960b3acb7716e89e9881fe4b0a1 Mon Sep 17 00:00:00 2001 From: Michael W Date: Fri, 11 Feb 2022 18:16:02 +0100 Subject: [PATCH] Updater: Move progress next to progressbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Michael W 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 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 --- res/layout-large-notouch/update_item_view.xml | 31 ++++++++++++++----- res/layout/update_item_view.xml | 31 ++++++++++++++----- res/values/strings.xml | 4 +-- .../lineageos/updater/UpdatesListAdapter.java | 18 +++++++---- 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/res/layout-large-notouch/update_item_view.xml b/res/layout-large-notouch/update_item_view.xml index b7b7fd8..c6898f2 100644 --- a/res/layout-large-notouch/update_item_view.xml +++ b/res/layout-large-notouch/update_item_view.xml @@ -49,25 +49,40 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"> - + tools:visibility="visible"> + + + + + - + tools:visibility="visible"> + + + + + LineageOS %1$s LineageOS %1$s - %2$s - %1$s of %2$s%3$s - %1$s of %2$s (%3$s) • %4$s + %1$s of %2$s + %1$s of %2$s (%3$s) Verifying update No new updates found. To manually check for new updates, use the Refresh button. diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index 3b75a54..c06b4e0 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -37,6 +37,7 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.CheckBox; import android.widget.ImageButton; +import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -104,8 +105,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter 0) { CharSequence etaString = StringGenerator.formatETA(mActivity, eta * 1000); viewHolder.mProgressText.setText(mActivity.getString( - R.string.list_download_progress_eta_new, downloaded, total, etaString, - percentage)); + R.string.list_download_progress_eta_newer, downloaded, total, etaString)); } else { viewHolder.mProgressText.setText(mActivity.getString( - R.string.list_download_progress_new, downloaded, total, percentage)); + R.string.list_download_progress_newer, downloaded, total)); } setButtonAction(viewHolder.mAction, Action.PAUSE, downloadId, true); viewHolder.mProgressBar.setIndeterminate(update.getStatus() == UpdateStatus.STARTING); @@ -196,14 +201,15 @@ public class UpdatesListAdapter extends RecyclerView.Adapter