Android Designer does not support selectors as image

Hi,
I will keep it short (already typed once yesterday, but posting did not work).

The design view in the new version of IntelliJ does not support XML references as images.
E.g. using this as a background for a button does not render in designer.

Its a pity because nearly all button backgrounds are set this way (best practice to support click effects).

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
          android:drawable="@drawable/quiz_question_bg_single_active"/>
    <item android:state_pressed="false"
          android:state_enabled="true"
          android:drawable="@drawable/quiz_question_bg_single_passive"/>
    <item android:state_pressed="false"
          android:state_enabled="false"
          android:drawable="@drawable/quiz_question_bg_single_disabled"/>
</selector>

Anyone knows a workaround or if it is fixed in EAP?

Chris

PS: Replacing all references with the active reference is not an option, I would have to do this for 20 different buttons for debug, then switch back, and so on. Also risk to forget switching back is to great (everything will still work, the button would just not change color if clicked. None of my tests could detect this :-)

2 comments
Comment actions Permalink

Hello, it seems to be a bug in Google's rendering library, because Eclipse doesn't preview such buttons too. Please, submit a bug to Google Android issue tracker.

0
Comment actions Permalink

Done, if anyone wants to know the status of this issue, look here:

http://code.google.com/p/android/issues/detail?id=22926

0

Please sign in to leave a comment.