diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs
index 9469cefff63..915739086d5 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs
@@ -1125,6 +1125,12 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
#ffffffff
#ffffffff
+",
+ };
+ var dimen = new AndroidItem.AndroidResource ("Resources\\values\\dimen.xml") {
+ TextContent = () => @"
+
+ 17dp
",
};
var libProj = new XamarinAndroidLibraryProject () {
@@ -1132,6 +1138,7 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
ProjectName = "Lib1",
AndroidResources = {
theme,
+ dimen,
},
};
libProj.SetProperty ("AndroidUseManagedDesignTimeResourceGenerator", "True");
@@ -1178,6 +1185,7 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
StringAssert.Contains ("Icon", designerContents, $"{designerFile} should contain Resources.Drawable.Icon");
StringAssert.Contains ("Main", designerContents, $"{designerFile} should contain Resources.Layout.Main");
StringAssert.Contains ("material_grey_50", designerContents, $"{designerFile} should contain Resources.Color.material_grey_50");
+ StringAssert.DoesNotContain ("main_text_item_size", designerContents, $"{designerFile} should not contain Resources.Dimension.main_text_item_size");
StringAssert.DoesNotContain ("theme_devicedefault_background", designerContents, $"{designerFile} should not contain Resources.Color.theme_devicedefault_background");
libBuilder.Target = "Build";
Assert.IsTrue (libBuilder.Build (libProj), "Library project should have built");
@@ -1197,7 +1205,9 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
StringAssert.Contains ("Icon", designerContents, $"{designerFile} should contain Resources.Drawable.Icon");
StringAssert.Contains ("Main", designerContents, $"{designerFile} should contain Resources.Layout.Main");
StringAssert.Contains ("material_grey_50", designerContents, $"{designerFile} should contain Resources.Color.material_grey_50");
+ StringAssert.Contains ("main_text_item_size", designerContents, $"{designerFile} should contain Resources.Dimension.main_text_item_size");
StringAssert.Contains ("theme_devicedefault_background", designerContents, $"{designerFile} should contain Resources.Color.theme_devicedefault_background");
+ StringAssert.Contains ("main_text_item_size", designerContents, $"{designerFile} should contain Resources.Dimension.main_text_item_size");
StringAssert.Contains ("SomeColor", designerContents, $"{designerFile} should contain Resources.Color.SomeColor");
appBuilder.Target = "SignAndroidPackage";
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Expected/GenerateDesignerFileExpected.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Expected/GenerateDesignerFileExpected.cs
index b7bb908884f..6564a091752 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Expected/GenerateDesignerFileExpected.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Expected/GenerateDesignerFileExpected.cs
@@ -40,6 +40,22 @@ private Animator()
}
}
+ public partial class Dimension
+ {
+
+ // aapt resource value: 0x7F090002
+ public const int main_text_item_size = 2131296258;
+
+ static Dimension()
+ {
+ global::Android.Runtime.ResourceIdManager.UpdateIdValues();
+ }
+
+ private Dimension()
+ {
+ }
+ }
+
public partial class Drawable
{
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManagedResourceParserTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManagedResourceParserTests.cs
index 3a667f35e84..c7b4a640c6d 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManagedResourceParserTests.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManagedResourceParserTests.cs
@@ -49,6 +49,11 @@ public class ManagedResourceParserTests : BaseTest {
android:valueTo=""0""
android:valueType=""floatType"" />";
+ const string Dimen = @"
+
+ 17dp
+";
+
[Test]
public void GenerateDesignerFile ()
{
@@ -66,6 +71,7 @@ public void GenerateDesignerFile ()
File.WriteAllText (Path.Combine (Root, path, "lp", "res", "animator", "slide_in_bottom.xml"), Animator);
File.WriteAllText (Path.Combine (Root, path, "lp", "res", "font", "arial.ttf"), "");
File.WriteAllText (Path.Combine (Root, path, "lp", "res", "values", "strings.xml"), StringsXml2);
+ File.WriteAllText (Path.Combine (Root, path, "lp", "res", "values", "dimen.xml"), Dimen);
using (var stream = typeof (XamarinAndroidCommonProject).Assembly.GetManifestResourceStream ("Xamarin.ProjectTools.Resources.Base.Icon.png")) {
var icon_binary_mdpi = new byte [stream.Length];
stream.Read (icon_binary_mdpi, 0, (int)stream.Length);
diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/ManagedResourceParser.cs b/src/Xamarin.Android.Build.Tasks/Utilities/ManagedResourceParser.cs
index 467d254bce4..74e14abfb08 100644
--- a/src/Xamarin.Android.Build.Tasks/Utilities/ManagedResourceParser.cs
+++ b/src/Xamarin.Android.Build.Tasks/Utilities/ManagedResourceParser.cs
@@ -370,6 +370,8 @@ void CreateResourceField (string root, string fieldName, XmlReader element = nul
CreateIntField (drawable, fieldName);
break;
case "dimen":
+ CreateIntField (dimension, fieldName);
+ break;
case "font":
CreateIntField (font, fieldName);
break;