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
diff --git a/go/res/xml/device_profiles.xml b/go/res/xml/device_profiles.xml
index 92a2b6a..0fd0eeb 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 465504c..43194d5 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -123,7 +123,7 @@
<attr name="minWidthDps" format="float" />
<attr name="minHeightDps" format="float" />
- <attr name="iconSize" format="float" />
+ <attr name="iconImageSize" format="float" />
<!-- landscapeIconSize defaults to iconSize, if not specified -->
<attr name="landscapeIconSize" format="float" />
<attr name="iconTextSize" format="float" />
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index 88b1bc9..82547d5 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 296afe7..3e7f67b 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -543,7 +543,7 @@
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);