I have a linearLayout which is focusable, so I can use it with the
trackball, when focused i want to change the background to a different
drawable - but it looks like the view needs refreshing/redrawing
somehow. I know it gets focus as the imageView state changes when i
move the trackball.
anyone know how to trigger the linearLayout(ll) to refresh?
code below:
llv.setFocusable(true);
llv.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
ImageView lh_img=(ImageView)v.findViewById(R.id.lh_img);
LinearLayout ll = (LinearLayout)v;
if (hasFocus) {
ll.setBackgroundResource(R.drawable.bg_listsel);
lh_img.setPressed(true);
} else {
ll.setBackgroundResource(R.drawable.bg_header);
lh_img.setPressed(false);
}
//ll.getParent().recomputeViewAttributes(ll);
// need to trigger the ll view torefresh somehow.
}
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---