mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
first cut at accepting input when running. Won't work when whole app is in background.
This commit is contained in:
parent
347ff60434
commit
919e44f21e
1 changed files with 12 additions and 0 deletions
|
@ -47,6 +47,7 @@ public class ChatDelegate extends DelegateBase {
|
|||
private static final String INTENT_KEY_NAMES = "intent_key_names";
|
||||
private static final String INTENT_KEY_LOCS = "intent_key_locs";
|
||||
|
||||
private static ChatDelegate s_visibleThis;
|
||||
private long m_rowid;
|
||||
private int m_curPlayer;
|
||||
private String[] m_names;
|
||||
|
@ -116,6 +117,7 @@ public class ChatDelegate extends DelegateBase {
|
|||
@Override
|
||||
protected void onResume()
|
||||
{
|
||||
s_visibleThis = this;
|
||||
m_jniThreadRef = JNIThread.getRetained( m_rowid );
|
||||
Assert.assertNotNull( m_jniThreadRef );
|
||||
super.onResume();
|
||||
|
@ -125,6 +127,7 @@ public class ChatDelegate extends DelegateBase {
|
|||
protected void onPause()
|
||||
{
|
||||
m_jniThreadRef.release();
|
||||
s_visibleThis = null;
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
@ -219,6 +222,15 @@ public class ChatDelegate extends DelegateBase {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean append( long rowid, String msg, int fromIndx )
|
||||
{
|
||||
boolean handled = null != s_visibleThis
|
||||
&& s_visibleThis.m_rowid == rowid;
|
||||
if ( handled ) {
|
||||
s_visibleThis.addRow( msg, fromIndx );
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
||||
public static void startForResult( Delegator delegator,
|
||||
RequestCode requestCode,
|
||||
|
|
Loading…
Add table
Reference in a new issue