mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
rename method
This commit is contained in:
parent
9ed1c21cf8
commit
3af3e4052f
2 changed files with 11 additions and 10 deletions
|
@ -71,7 +71,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
m_fieldID = fieldToID( fieldName );
|
m_fieldID = fieldToID( fieldName );
|
||||||
}
|
}
|
||||||
|
|
||||||
public long[] getPositions()
|
public long[] getGroupPositions()
|
||||||
{
|
{
|
||||||
Set<Long> keys = gameInfo().keySet(); // do not modify!!!!
|
Set<Long> keys = gameInfo().keySet(); // do not modify!!!!
|
||||||
if ( null == m_positions || m_positions.length != keys.size() ) {
|
if ( null == m_positions || m_positions.length != keys.size() ) {
|
||||||
|
@ -103,7 +103,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
{
|
{
|
||||||
int src = getGroupPosition( groupid );
|
int src = getGroupPosition( groupid );
|
||||||
int dest = src + moveBy;
|
int dest = src + moveBy;
|
||||||
long[] positions = getPositions();
|
long[] positions = getGroupPositions();
|
||||||
boolean success = 0 <= dest && dest < positions.length;
|
boolean success = 0 <= dest && dest < positions.length;
|
||||||
if ( success ) {
|
if ( success ) {
|
||||||
long tmp = positions[src];
|
long tmp = positions[src];
|
||||||
|
@ -127,7 +127,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
public long getRowIDFor( int group, int child )
|
public long getRowIDFor( int group, int child )
|
||||||
{
|
{
|
||||||
long rowid = DBUtils.ROWID_NOTFOUND;
|
long rowid = DBUtils.ROWID_NOTFOUND;
|
||||||
long[] rows = getRows( getPositions()[group] );
|
long[] rows = getRows( getGroupPositions()[group] );
|
||||||
if ( child < rows.length ) {
|
if ( child < rows.length ) {
|
||||||
rowid = rows[child];
|
rowid = rows[child];
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
|
|
||||||
public long getGroupIDFor( int groupPos )
|
public long getGroupIDFor( int groupPos )
|
||||||
{
|
{
|
||||||
long id = getPositions()[groupPos];
|
long id = getGroupPositions()[groupPos];
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
|
|
||||||
public int getChildrenCount( int groupPosition )
|
public int getChildrenCount( int groupPosition )
|
||||||
{
|
{
|
||||||
return getChildrenCount( getPositions()[groupPosition] );
|
return getChildrenCount( getGroupPositions()[groupPosition] );
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getChildrenCount( long groupID )
|
public int getChildrenCount( long groupID )
|
||||||
|
@ -336,7 +336,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
public String[] groupNames()
|
public String[] groupNames()
|
||||||
{
|
{
|
||||||
HashMap<Long,GameGroupInfo> info = gameInfo();
|
HashMap<Long,GameGroupInfo> info = gameInfo();
|
||||||
long[] positions = getPositions();
|
long[] positions = getGroupPositions();
|
||||||
String[] names = new String[ positions.length ];
|
String[] names = new String[ positions.length ];
|
||||||
for ( int ii = 0; ii < names.length; ++ii ) {
|
for ( int ii = 0; ii < names.length; ++ii ) {
|
||||||
names[ii] = info.get(positions[ii]).m_name;
|
names[ii] = info.get(positions[ii]).m_name;
|
||||||
|
@ -347,7 +347,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
public int getGroupPosition( long groupid )
|
public int getGroupPosition( long groupid )
|
||||||
{
|
{
|
||||||
int result = -1;
|
int result = -1;
|
||||||
long[] positions = getPositions();
|
long[] positions = getGroupPositions();
|
||||||
for ( int pos = 0; pos < positions.length; ++pos ) {
|
for ( int pos = 0; pos < positions.length; ++pos ) {
|
||||||
if ( positions[pos] == groupid ) {
|
if ( positions[pos] == groupid ) {
|
||||||
result = pos;
|
result = pos;
|
||||||
|
@ -376,7 +376,7 @@ public class GameListAdapter implements ExpandableListAdapter {
|
||||||
|
|
||||||
private GameGroupInfo getInfoForGroup( int groupPosition )
|
private GameGroupInfo getInfoForGroup( int groupPosition )
|
||||||
{
|
{
|
||||||
return gameInfo().get( getPositions()[groupPosition] );
|
return gameInfo().get( getGroupPositions()[groupPosition] );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deselectRows( long[] rowids )
|
private void deselectRows( long[] rowids )
|
||||||
|
|
|
@ -411,7 +411,7 @@ public class GamesList extends XWExpandableListActivity
|
||||||
// (TelephonyManager)getSystemService( Context.TELEPHONY_SERVICE );
|
// (TelephonyManager)getSystemService( Context.TELEPHONY_SERVICE );
|
||||||
// mgr.listen( m_phoneStateListener, PhoneStateListener.LISTEN_NONE );
|
// mgr.listen( m_phoneStateListener, PhoneStateListener.LISTEN_NONE );
|
||||||
// m_phoneStateListener = null;
|
// m_phoneStateListener = null;
|
||||||
long[] positions = m_adapter.getPositions();
|
long[] positions = m_adapter.getGroupPositions();
|
||||||
XWPrefs.setGroupPositions( this, positions );
|
XWPrefs.setGroupPositions( this, positions );
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
@ -771,7 +771,8 @@ public class GamesList extends XWExpandableListActivity
|
||||||
case R.id.list_item_new_from:
|
case R.id.list_item_new_from:
|
||||||
showNotAgainDlgThen( R.string.not_again_newfrom,
|
showNotAgainDlgThen( R.string.not_again_newfrom,
|
||||||
R.string.key_notagain_newfrom,
|
R.string.key_notagain_newfrom,
|
||||||
GamesActions.NEW_FROM.ordinal(), selRowIDs[0] );
|
GamesActions.NEW_FROM.ordinal(),
|
||||||
|
selRowIDs[0] );
|
||||||
break;
|
break;
|
||||||
case R.id.list_item_copy:
|
case R.id.list_item_copy:
|
||||||
GameSummary summary = DBUtils.getSummary( this, selRowIDs[0] );
|
GameSummary summary = DBUtils.getSummary( this, selRowIDs[0] );
|
||||||
|
|
Loading…
Reference in a new issue