IronBlossom / android-unused-resources

Automatically exported from code.google.com/p/android-unused-resources
0 stars 0 forks source link

Error reported in unused style does not check the parent #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. If you have a style that derives from a another style using "parent=" and 
the parent is not referenced anyplace - the tool reports the parent style as 
unused, even if the child style is used

What is the expected output? What do you see instead?
It should not report if the child style is used

What version of the product are you using? On what operating system?
3.1

Please provide any additional information below.

Original issue reported on code.google.com by bimat...@ubermind.com on 20 Sep 2011 at 6:19

GoogleCodeExporter commented 9 years ago
Can you provide an example of the declaration of the child style?

Something like:
<style name="test" parent="whatever"/>

I'm having a tough time reproducing this.

Original comment by skenned...@gmail.com on 21 Sep 2011 at 1:50

GoogleCodeExporter commented 9 years ago
Here is the exact style in my code and it reported the SegmentedButton is not 
used, since it was not directly used on my layout files.  
  <style name="SegmentedButton">
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_weight">1</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:button">@android:color/transparent</item>
        <item name="android:padding">4dp</item>
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:gravity">center</item>
        <item name="android:background">@drawable/segmented_center_bg</item>
        <item name="android:textSize">16dp</item>
    </style>
    <style name="SegmentedButtonLeft" parent="SegmentedButton">
        <item name="android:background">@drawable/segmented_left_bg</item>
    </style>

Original comment by bimat...@ubermind.com on 21 Sep 2011 at 7:22

GoogleCodeExporter commented 9 years ago
I wasn't aware you could reference a parent like that for a style.  Seems like 
an easy change.  It's not enough for a new release though - there's one other 
bug I want to fix first.

Original comment by skenned...@gmail.com on 21 Sep 2011 at 11:44

GoogleCodeExporter commented 9 years ago
Fixed in r28

Original comment by skenned...@gmail.com on 21 Sep 2011 at 11:50