mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
use setBackground rather than setBackgroundColor to fix not reverting on 4.4 (and maybe earlier)
This commit is contained in:
parent
9351eb257b
commit
eff00c1743
1 changed files with 4 additions and 2 deletions
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue