focus - Android: changing the pressed/focused ressource by code -


I am using some tweaks that allow the user to change the UI of his application with ressources from his SDcard is. It's really simple and nothing special, I just use "setImageDrawable" or "setImageBitmap".

This is really cool and all my users are happy to customize the UI.

But now, I would like to change the button-pressed / focused resources!

Now, when they click on it, they can not see anything and they probably click 10 times more problematic, it is not really comfortable.

That's why I would like to change the pressed / focused state program ...

Any suggestions?

You must have all your imagebutabs dribble the statuslist instead of bitmap drafts.

  ImageButton IB = new image button (this); State List Drawable SL = New State List Drainage (); Sl.addState (new int [] {android.R.attr.state_enabled}, yourDefaultDrawableHere); Sl.addState (new int [] {android.R.attr.state_pressed, android.R.attr.state_selected}, your image is Drebelhare); Ib.setImageDrawable (sl);  

Comments