VTS includes large scale support for jumping between different files and following references. Additionally VTS will help you recognize different types of resources with displaying previews or other helpful hints.
This tutorial will simply explain how the Jumping and Preview features for XML documents work in VTS.
Extensive support has been added for jumping between resources in xml files. As long as the reference is an internal reference and not one to a framework apk, the following resources are supported: Animations, Arrays, Bools, Colors, Dimensions, Drawables, Intergers, Plurals, Strings, and Styles.
- I will use SystemUI.apk from ICS Tranquility Rom for the HTC Evo 4G LTE as an example.
- Once you setup the project, go to res/layout and open status_bar.xml
- Look at line 7, notice the android_textColor referece.
- Now press Ctrl and left click on the “@color/white” value, and just like that VTS open up colors.xml and hightlihts the color named “white“.
- Now look at line 23, notice the android:layout_width reference.
- Again, press Ctrl and left click on the “@dimen/status_bar_icon_size” value, and VTS will open up dimens.xml and highlight the dimension named “status_bar_icon_size“.
Notice on that on this jump, status_bar_icon_size references another dimension. In this case its “@android:dimen/status_bar_icon_size“. When you see “@android” (framework-res.apk) or “@com.htc” (com.htc.resources.apk), this means that the app is using values from an external source. In this case its framework-res.apk. As long as the reference is an internal value, the jumping feature will work.
The preview feature is pretty much self explanatory. When you hover over a drawable or string reference with your mouse, a preview of the image/string will appear. Again this is only true as long as the image is an internal image and not being called from an external source.
- Again, I will use the SystemUI.apk from ICS Tranquility Rom as an example
- Go to res/drawable and open alert_bar_background.xml
- Look at line 5, notice the “@drawable/alert_bar_background_normal” value, and hover your mouse over it.
- A popup will appear displaying the image. Now you can press Ctrl and left click the image to open the source image.
- As explained above, the exact same happens for string resources. A popup with the actual text will appear.
- Another useful feature is the color preview in all xml documents. If VTS detects a raw color value or a reference to a color, it automatically underlines the text in the referenced color.
The one thing to remember is that these features will not work on external references, so if you see “@android” or “@com.htc” the jumping and preview features will not work.