marco-alvarez / android-unused-resources

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

Does not take into consideration id references inside layouts (i.e. RelativeLayout) #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the tool
2. Find an id that is used to place views relative to it inside a RelativeLayout
3. Delete the id.

What is the expected output? What do you see instead?
There are no errors when running the application, it just messes up the UI.

What version of the product are you using? On what operating system?
Current latest:1.4.1

Please provide any additional information below.

I created a tool that automatically deletes the resources that have been found. 
Once it deletes all the "unused" ids, the relative layouts whose views ids have 
been deleted, is really messed up. That's how I figured out that dependencies 
for ids inside the same file and not being checked.

Original issue reported on code.google.com by pe...@instinctiv.com on 24 Nov 2011 at 8:05

GoogleCodeExporter commented 8 years ago
I have a such items inside RelativeLayout:

<ImageView
  android:id="@+id/logo"
  ... />

<ProgressBar
  ...
  android:layout_below="@+id/logo"
  ... />

"logo" will be reported as unused.

Original comment by helio...@gmail.com on 9 Dec 2011 at 9:14

GoogleCodeExporter commented 8 years ago
Your references should not not be layout_below="@+id/logo".  They should be 
layout_below="@id/logo".

@+id defines a new id.  @id references an id.

Original comment by skenned...@gmail.com on 9 Dec 2011 at 4:56