Dumped XML Layout File padding positions not behaving correctly
<p>I've been trying to figure out how to make some sense of a dumped XML layout, and it's progressing 'pretty good'. The only thing I'm currently unsure about is the following:</p>

<p>When I use the command:</p>

<pre><code>aapt dump xmltree &lt;pathofapk&gt; &lt;pathofxmlfile&gt;
</code></pre>

<p>I get the following result:</p>

<pre><code>   N: android=http://schemas.android.com/apk/res/android
  E: LinearLayout (line=2)
    A: android:orientation(0x010100c4)=(type 0x10)0x1
    A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
    A: android:layout_height(0x010100f5)=(type 0x10)0xffffffff
    E: LinearLayout (line=7)
      A: android:orientation(0x010100c4)=(type 0x10)0x0
      A: android:background(0x010100d4)=@0x7f020004
      A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
      A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
      E: ImageView (line=12)
        A: android:gravity(0x010100af)=(type 0x11)0x3
        A: android:layout_gravity(0x010100b3)=(type 0x11)0x13
        A: android:id(0x010100d0)=@0x7f090021
        A: android:paddingLeft(0x010100d6)=(type 0x5)0xa01
        A: android:paddingTop(0x010100d7)=(type 0x5)0x401
        A: android:layout_width(0x010100f4)=(type 0x10)0xfffffffe
        A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
        A: android:src(0x01010119)=@0x7f020006
    E: ScrollView (line=21)
      A: android:orientation(0x010100c4)=(type 0x10)0x1
      A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
      A: android:layout_height(0x010100f5)=(type 0x10)0xffffffff
      A: android:layout_weight(0x01010181)=(type 0x4)0x3f800000
      E: LinearLayout (line=25)
        A: android:orientation(0x010100c4)=(type 0x10)0x1
        A: android:id(0x010100d0)=@0x7f09002d
        A: android:padding(0x010100d5)=(type 0x5)0xa01
        A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
        A: android:layout_height(0x010100f5)=(type 0x10)0xffffffff
        E: EditText (line=29)
          A: android:layout_gravity(0x010100b3)=(type 0x11)0x51
          A: android:id(0x010100d0)=@0x7f09002e
          A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
          A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
          A: android:text(0x0101014f)="" (Raw: "")
          A: android:hint(0x01010150)=@0x7f070050
        E: EditText (line=36)
          A: android:layout_gravity(0x010100b3)=(type 0x11)0x51
          A: android:id(0x010100d0)=@0x7f09002f
          A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
          A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
          A: android:text(0x0101014f)="" (Raw: "")
          A: android:hint(0x01010150)=@0x7f070051
          A: android:password(0x0101015c)=(type 0x12)0xffffffff
        E: LinearLayout (line=44)
          A: android:orientation(0x010100c4)=(type 0x10)0x0
          A: android:padding(0x010100d5)=(type 0x5)0xa01
          A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
          A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
          E: Button (line=48)
            A: android:id(0x010100d0)=@0x7f090030
            A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
            A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
            A: android:text(0x0101014f)=@0x7f07000a
            A: android:layout_weight(0x01010181)=(type 0x4)0x3f800000
          E: Button (line=54)
            A: android:id(0x010100d0)=@0x7f090031
            A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff
            A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe
            A: android:text(0x0101014f)=@0x7f070003
            A: android:layout_weight(0x01010181)=(type 0x4)0x3f800000
</code></pre>

<p>That's all good, but what I'm trying to figure out is how to convert the following code into the XML layout file:</p>

<pre><code>    A: android:paddingLeft(0x010100d6)=(type 0x5)0xa01
    A: android:paddingTop(0x010100d7)=(type 0x5)0x401
</code></pre>

<p>Converting those values to decimal would result in:</p>

<pre><code>paddingLeft:2561
paddingTop:1025
</code></pre>

<p>All good, but I've been trying to figure out what the (type 0x5 means). With all other types, the result is defined in the Android.util.TypedValue.class file</p>

<p>Decompiling that, gives the following result for 0x5:</p>

<pre><code>      // Field descriptor #8 I
  public static final int TYPE_DIMENSION = 5;
</code></pre>

<p>Makes sense, in a way. But, I need to know what kind of value it is, so looking down, I find the following value:</p>

<pre><code>  // Field descriptor #8 I
  public static final int COMPLEX_UNIT_MM = 5;
</code></pre>

<p>But, when I try to use 2561mm and 1025mm (It's a tad much anyway, 25cm is.. larger than my screen), The whole screen is filled with the 'parent LinearLayout'. </p>

<p>I have no clue what's wrong.. can anyone enlighten me on this subject?</p>

<p>Greetings,</p>

<p>Mats</p>
