lizuojing / android-unused-resources

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

Style file and Manifest. #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I have the following style in my style.xml file:
<style name="Theme.NoTitleBar.NoBackground" parent="android:Theme.NoTitleBar">
  <item name="android:windowBackground">@null</item>
</style>

And some activities in the Manifest.xml file like:

<activity android:name="net.eridem.myapp.MyActivity" 
android:theme="@style/Theme.NoTitleBar.NoBackground" 
android:screenOrientation="portrait"></activity>

And the script shows 
style     : Theme_NoTitleBar_NoBackground
as unused resource (but it is used) ;)

Hope this information is useful.
Very good APP!!
Miguel.

Original issue reported on code.google.com by eridem on 7 Jun 2011 at 10:24

GoogleCodeExporter commented 8 years ago
Hi, I've found another error:

It seems that when styles extends from a parent style, it doesn't work. This is 
my new error:

<style name="MyButton">
  <!-- whatever -->
</style>

<style name="MyButton.Ok">
  <item name="android:background">@drawable/mybutton_ok</item>
</style>

And later, used as common in a layout:

<Button 
  android:id="@+id/btn_ok" 
  style="@style/MyButton.Ok"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
  android:layout_gravity="center_vertical"
  android:text="@string/label_ok">
</Button>

And the exit from the script:
style     : MyButton_Ok

On the other bug (with the Manifest), the style extended from Theme.NoTitleBar 
and it was detected by the script as "unused". I think that both bugs are 
similar in that way.

Hope, again, this information is useful.
Miguel.

Original comment by eridem on 7 Jun 2011 at 10:39