From 01b8b68db77a22004168dd302ea1a4b2a5043b78 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Thu, 28 Mar 2019 17:01:07 -0700 Subject: [PATCH] Rename launcher:iconSize attribute to prevent overriding material A previous change [1] introduced the material library as a static library for the SecondaryDisplayLauncher. The material library defines a resource "attr/iconSize" with format="dimension" while Launcher3 defines a resource of the same name with format="float". The material resource is being overriden by the Launcher3 resource and is preventing aapt2 from disallowing multiple definitions of the same attribute with different formats. This change renames the Launcher3 iconSize so it will not collide with the material resource. [1] If183dd35a1d197c4a9a8225a021e36c4f1662587 Bug: 129146717 Test: build success and inspection of generated apk Change-Id: I5eb54ea606ddcfb47d5150b44906a8707203e905 --- go/res/xml/device_profiles.xml | 2 +- res/values/attrs.xml | 2 +- res/xml/device_profiles.xml | 18 +++++++++--------- .../launcher3/InvariantDeviceProfile.java | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go/res/xml/device_profiles.xml b/go/res/xml/device_profiles.xml index 92a2b6a819..0fd0eebfb9 100644 --- a/go/res/xml/device_profiles.xml +++ b/go/res/xml/device_profiles.xml @@ -30,7 +30,7 @@ launcher:name="Go Device" launcher:minWidthDps="296" launcher:minHeightDps="491.33" - launcher:iconSize="60" + launcher:iconImageSize="60" launcher:iconTextSize="14.0" launcher:canBeDefault="true" /> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 465504c250..43194d5cb6 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -123,7 +123,7 @@ - + diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml index 88b1bc95ae..82547d5217 100644 --- a/res/xml/device_profiles.xml +++ b/res/xml/device_profiles.xml @@ -30,7 +30,7 @@ launcher:name="Super Short Stubby" launcher:minWidthDps="255" launcher:minHeightDps="300" - launcher:iconSize="48" + launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -38,7 +38,7 @@ launcher:name="Shorter Stubby" launcher:minWidthDps="255" launcher:minHeightDps="400" - launcher:iconSize="48" + launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -57,7 +57,7 @@ launcher:name="Short Stubby" launcher:minWidthDps="275" launcher:minHeightDps="420" - launcher:iconSize="48" + launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -65,7 +65,7 @@ launcher:name="Stubby" launcher:minWidthDps="255" launcher:minHeightDps="450" - launcher:iconSize="48" + launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -73,7 +73,7 @@ launcher:name="Nexus S" launcher:minWidthDps="296" launcher:minHeightDps="491.33" - launcher:iconSize="48" + launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -81,7 +81,7 @@ launcher:name="Nexus 4" launcher:minWidthDps="359" launcher:minHeightDps="567" - launcher:iconSize="54" + launcher:iconImageSize="54" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -89,7 +89,7 @@ launcher:name="Nexus 5" launcher:minWidthDps="335" launcher:minHeightDps="567" - launcher:iconSize="54" + launcher:iconImageSize="54" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> @@ -108,7 +108,7 @@ launcher:name="Large Phone" launcher:minWidthDps="406" launcher:minHeightDps="694" - launcher:iconSize="56" + launcher:iconImageSize="56" launcher:iconTextSize="14.4" launcher:canBeDefault="true" /> @@ -116,7 +116,7 @@ launcher:name="Shorter Stubby" launcher:minWidthDps="255" launcher:minHeightDps="400" - launcher:iconSize="48" + launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:canBeDefault="true" /> diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 296afe7500..3e7f67bc64 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -543,7 +543,7 @@ public class InvariantDeviceProfile { canBeDefault = a.getBoolean( R.styleable.ProfileDisplayOption_canBeDefault, false); - iconSize = a.getFloat(R.styleable.ProfileDisplayOption_iconSize, 0); + iconSize = a.getFloat(R.styleable.ProfileDisplayOption_iconImageSize, 0); landscapeIconSize = a.getFloat(R.styleable.ProfileDisplayOption_landscapeIconSize, iconSize); iconTextSize = a.getFloat(R.styleable.ProfileDisplayOption_iconTextSize, 0);