Home XmlResourceParser Resources.getXml() returning different result when using gradle Android plugin 3.0.x
Reply: 0

XmlResourceParser Resources.getXml() returning different result when using gradle Android plugin 3.0.x

Maher Hanafi
1#
Maher Hanafi Published in 2018-01-13 01:00:39Z

I am working on a Launcher App for Android based on Google Launcher3. I recently updated to use the latest gradle Android plugin 3.0.x (upgrading from 2.3.1) using Android Studio 3.0 with Java.

java classpath 'com.android.tools.build:gradle:3.0.0'

For some reason, parsing XML resource file is returning different value when using version 3.0.x of the Android gradle plugin causing my Launcher to break.

Here is how XML is loaded:

XmlResourceParser parser = context.getResources().getXml(R.xml.device_profiles)

And here is the XML content to load:

<profiles xmlns:launcher="http://schemas.android.com/apk/res-auto/com.nano.launcher3" >

  <profile
    launcher:name="Super Short Stubby"
    launcher:minWidthDps="255"
    launcher:minHeightDps="300"
    launcher:numRows="2"
    launcher:numColumns="3"
    launcher:numFolderRows="2"
    launcher:numFolderColumns="3"
    launcher:minAllAppsPredictionColumns="3"
    launcher:iconSize="48"
    launcher:iconTextSize="13.0"
    launcher:numHotseatIcons="3"
    launcher:hotseatIconSize="48"
    launcher:defaultLayoutId="@xml/default_workspace_3x3"
    />

  <profile
    launcher:name="Shorter Stubby"
    launcher:minWidthDps="255"
    launcher:minHeightDps="400"
    launcher:numRows="3"
    launcher:numColumns="3"
    launcher:numFolderRows="3"
    launcher:numFolderColumns="3"
    launcher:minAllAppsPredictionColumns="3"
    launcher:iconSize="48"
    launcher:iconTextSize="13.0"
    launcher:numHotseatIcons="3"
    launcher:hotseatIconSize="48"
    launcher:defaultLayoutId="@xml/default_workspace_3x3"
    />

The full XML file is found here: https://android.googlesource.com/platform/packages/apps/Launcher3/+/android-8.1.0_r3/res/xml/device_profiles.xml

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.389875 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO