mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
put up indeterminate progress dialog when engine starts and at least
one blank's involved. Still needs to be made cancellable.
This commit is contained in:
parent
1c218513f1
commit
3976738990
2 changed files with 21 additions and 3 deletions
|
@ -180,6 +180,7 @@
|
|||
delete all games? This action cannot be undone.</string>
|
||||
|
||||
<string name="hints_allowed">Allow hints</string>
|
||||
<string name="progress_title">Searching for moves</string>
|
||||
<string name="use_timer">Enable game timer</string>
|
||||
<string name="color_tiles">Color tiles</string>
|
||||
<string name="color_tiles_summary">Draw tiles using color of
|
||||
|
|
|
@ -36,6 +36,7 @@ import java.util.concurrent.Semaphore;
|
|||
import android.net.Uri;
|
||||
import android.app.Dialog;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.Toast;
|
||||
|
@ -87,6 +88,8 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
|||
private Thread m_blockingThread;
|
||||
private JNIThread m_jniThread;
|
||||
|
||||
private ProgressDialog m_progress;
|
||||
|
||||
public class TimerRunnable implements Runnable {
|
||||
private int m_why;
|
||||
private int m_when;
|
||||
|
@ -882,14 +885,28 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
|||
public void engineStarting( int nBlanks )
|
||||
{
|
||||
Utils.logf( "engineStarting(%d)", nBlanks );
|
||||
// Looks like I'll need my own transparent/floating window to
|
||||
// show progress other than in the title bar (which I ain't
|
||||
// always got).
|
||||
if ( nBlanks > 0 ) {
|
||||
m_handler.post( new Runnable() {
|
||||
public void run() {
|
||||
String title = getString( R.string.progress_title );
|
||||
m_progress = ProgressDialog.show( BoardActivity.this,
|
||||
title, null, true );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
public void engineStopping()
|
||||
{
|
||||
Utils.logf( "engineStopping" );
|
||||
m_handler.post( new Runnable() {
|
||||
public void run() {
|
||||
if ( null != m_progress ) {
|
||||
m_progress.cancel();
|
||||
m_progress = null;
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
public String getUserString( int stringCode )
|
||||
|
|
Loading…
Reference in a new issue