mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
hook up long click to [de]select
This commit is contained in:
parent
fd817a98da
commit
64a5aab456
1 changed files with 15 additions and 1 deletions
|
@ -45,7 +45,8 @@ import org.eehouse.android.xw4.DlgDelegate.Action;
|
|||
import org.eehouse.android.xw4.jni.GameSummary;
|
||||
|
||||
public class StudyList extends XWListActivity
|
||||
implements OnItemSelectedListener, SelectableItem {
|
||||
implements OnItemSelectedListener, SelectableItem,
|
||||
View.OnLongClickListener {
|
||||
|
||||
public static final int NO_LANG = -1;
|
||||
|
||||
|
@ -186,6 +187,18 @@ public class StudyList extends XWListActivity
|
|||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// View.OnLongClickListener interface
|
||||
//////////////////////////////////////////////////
|
||||
public boolean onLongClick( View view )
|
||||
{
|
||||
boolean success = view instanceof SelectableItem.LongClickHandler;
|
||||
if ( success ) {
|
||||
((SelectableItem.LongClickHandler)view).longClicked();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// SelectableItem interface
|
||||
//////////////////////////////////////////////////
|
||||
|
@ -353,6 +366,7 @@ public class StudyList extends XWListActivity
|
|||
item.setPosition( position );
|
||||
item.setText( m_words[position] );
|
||||
item.setSelected( m_checkeds.contains(position) );
|
||||
item.setOnLongClickListener( StudyList.this );
|
||||
DbgUtils.logf( "getView(position=%d) => %H", position, item );
|
||||
return item;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue