From deea4bd69678efd9c545211f873cb07f350c30c8 Mon Sep 17 00:00:00 2001
From: Hans-Christoph Steiner <hans@eds.org>
Date: Thu, 22 Apr 2021 10:21:24 +0200
Subject: [PATCH] fully separate "Last Updated" icon from "Versions"

These two are the same shape, but different sizes, and this is an easy way
to manage the sizes.

closes #2148
---
 .../views/AppDetailsRecyclerViewAdapter.java      |  9 ++-------
 .../fdroid/fdroid/views/apps/AppListActivity.java |  2 +-
 .../{ic_access_time.xml => ic_last_updated.xml}   |  0
 app/src/main/res/drawable/ic_versions.xml         | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 8 deletions(-)
 rename app/src/main/res/drawable/{ic_access_time.xml => ic_last_updated.xml} (100%)
 create mode 100644 app/src/main/res/drawable/ic_versions.xml

diff --git a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java
index a19483892..b129a2fa0 100644
--- a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java
+++ b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java
@@ -844,11 +844,6 @@ public class AppDetailsRecyclerViewAdapter
         protected void updateExpandableItem(boolean isExpanded) {
             final int icon = getIcon();
             Drawable iconDrawable = ContextCompat.getDrawable(headerView.getContext(), icon);
-            if (icon == R.drawable.ic_access_time) {
-                assert iconDrawable != null;
-                iconDrawable = DrawableCompat.wrap(iconDrawable).mutate();
-                DrawableCompat.setTint(iconDrawable, Color.parseColor("#B4B4B4"));
-            }
             final Drawable expandLess = ContextCompat.getDrawable(headerView.getContext(), R.drawable.ic_expand_less);
             final Drawable expandMore = ContextCompat.getDrawable(headerView.getContext(), R.drawable.ic_expand_more);
             TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(headerView,
@@ -877,7 +872,7 @@ public class AppDetailsRecyclerViewAdapter
 
         @DrawableRes
         protected int getIcon() {
-            return R.drawable.ic_access_time;
+            return R.drawable.ic_versions;
         }
     }
 
@@ -888,7 +883,7 @@ public class AppDetailsRecyclerViewAdapter
             super(view);
             headerView = (TextView) view.findViewById(R.id.information);
             final Drawable accessTime = DrawableCompat.wrap(ContextCompat.getDrawable(headerView.getContext(),
-                    R.drawable.ic_access_time)).mutate();
+                    R.drawable.ic_versions)).mutate();
             DrawableCompat.setTint(accessTime, Color.parseColor("#B4B4B4"));
             TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(headerView,
                     accessTime, null, null, null);
diff --git a/app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java b/app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java
index 6d90edf14..f3bb912e7 100644
--- a/app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java
+++ b/app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java
@@ -125,7 +125,7 @@ public class AppListActivity extends AppCompatActivity implements LoaderManager.
 
         sortImage = (ImageView) findViewById(R.id.sort);
         final Drawable lastUpdated = DrawableCompat.wrap(ContextCompat.getDrawable(this,
-                R.drawable.ic_access_time)).mutate();
+                R.drawable.ic_last_updated)).mutate();
         DrawableCompat.setTint(lastUpdated, FDroidApp.isAppThemeLight() ? Color.BLACK : Color.WHITE);
         final Drawable words = DrawableCompat.wrap(ContextCompat.getDrawable(AppListActivity.this,
                 R.drawable.ic_sort)).mutate();
diff --git a/app/src/main/res/drawable/ic_access_time.xml b/app/src/main/res/drawable/ic_last_updated.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_access_time.xml
rename to app/src/main/res/drawable/ic_last_updated.xml
diff --git a/app/src/main/res/drawable/ic_versions.xml b/app/src/main/res/drawable/ic_versions.xml
new file mode 100644
index 000000000..fe48a2b22
--- /dev/null
+++ b/app/src/main/res/drawable/ic_versions.xml
@@ -0,0 +1,15 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="?attr/colorControlNormal"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    tools:ignore="VectorRaster">
+    <path
+        android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"
+        android:fillColor="#FFFFFF" />
+    <path
+        android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"
+        android:fillColor="#FFFFFF" />
+</vector>