use setBackground rather than setBackgroundColor to fix not reverting on 4.4 (and maybe earlier)

This commit is contained in:
Eric House 2014-04-01 06:27:19 -07:00
parent 9351eb257b
commit eff00c1743

View file

@ -20,24 +20,26 @@
package org.eehouse.android.xw4;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.view.View;
public class DrawSelDelegate {
private View m_view;
private Drawable m_origDrawable;
private static ColorDrawable s_selDrawable =
new ColorDrawable( XWApp.SEL_COLOR );
protected DrawSelDelegate( View view )
{
m_view = view;
m_origDrawable = view.getBackground();
}
protected void showSelected( boolean selected )
{
if ( selected ) {
m_origDrawable = m_view.getBackground();
m_view.setBackgroundColor( XWApp.SEL_COLOR );
m_view.setBackgroundDrawable( s_selDrawable );
} else {
m_view.setBackgroundDrawable( m_origDrawable );
}