mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
on Amazon-made devices only, sleep randomly during load of game
summary. This seems to work around a bug where only the last item in the list is clickable but once it's clicked events are received for every failed click up to that point.
This commit is contained in:
parent
9a23473b2f
commit
75602c47d8
1 changed files with 14 additions and 7 deletions
|
@ -22,6 +22,7 @@ package org.eehouse.android.xw4;
|
||||||
import android.widget.ListAdapter;
|
import android.widget.ListAdapter;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
@ -47,6 +48,8 @@ public class GameListAdapter extends XWListAdapter {
|
||||||
private Context m_context;
|
private Context m_context;
|
||||||
private LayoutInflater m_factory;
|
private LayoutInflater m_factory;
|
||||||
private int m_fieldID;
|
private int m_fieldID;
|
||||||
|
private static final boolean s_isFire =
|
||||||
|
Build.MANUFACTURER.equals( "Amazon" );
|
||||||
|
|
||||||
private class ViewInfo implements View.OnClickListener {
|
private class ViewInfo implements View.OnClickListener {
|
||||||
private View m_view;
|
private View m_view;
|
||||||
|
@ -123,13 +126,17 @@ public class GameListAdapter extends XWListAdapter {
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground( Void... unused )
|
protected Void doInBackground( Void... unused )
|
||||||
{
|
{
|
||||||
// force slow loading for debugging
|
// Without this, on the Fire only the last item in the
|
||||||
// try {
|
// list it tappable. Likely my fault, but this seems to
|
||||||
// Random random = new Random();
|
// work around it.
|
||||||
// int sleepTime = random.nextInt() % 3000;
|
if ( s_isFire ) {
|
||||||
// Thread.sleep( sleepTime );
|
try {
|
||||||
// } catch ( Exception e ) {
|
Random random = new Random();
|
||||||
// }
|
int sleepTime = 500 + (random.nextInt() % 500);
|
||||||
|
Thread.sleep( sleepTime );
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
}
|
||||||
|
}
|
||||||
View layout = m_factory.inflate( R.layout.game_list_item, null );
|
View layout = m_factory.inflate( R.layout.game_list_item, null );
|
||||||
boolean hideTitle = false;//CommonPrefs.getHideTitleBar(m_context);
|
boolean hideTitle = false;//CommonPrefs.getHideTitleBar(m_context);
|
||||||
GameSummary summary = DBUtils.getSummary( m_context, m_rowid );
|
GameSummary summary = DBUtils.getSummary( m_context, m_rowid );
|
||||||
|
|
Loading…
Reference in a new issue