mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch
This commit is contained in:
commit
29b05b83ec
7 changed files with 47 additions and 8 deletions
|
@ -36,6 +36,8 @@
|
||||||
<string name="key_default_phonies">key_default_phonies2</string>
|
<string name="key_default_phonies">key_default_phonies2</string>
|
||||||
<string name="key_default_timerenabled">key_default_timerenabled</string>
|
<string name="key_default_timerenabled">key_default_timerenabled</string>
|
||||||
<string name="key_connect_frequency">key_connect_frequency</string>
|
<string name="key_connect_frequency">key_connect_frequency</string>
|
||||||
|
<string name="key_notify_sound">key_notify_sound</string>
|
||||||
|
<string name="key_notify_vibrate">key_notify_vibrate</string>
|
||||||
|
|
||||||
<string name="key_notagain_sync">key_notagain_sync</string>
|
<string name="key_notagain_sync">key_notagain_sync</string>
|
||||||
<string name="key_notagain_chat">key_notagain_chat</string>
|
<string name="key_notagain_chat">key_notagain_chat</string>
|
||||||
|
|
|
@ -256,6 +256,10 @@
|
||||||
<string name="prefs_behavior">Behavior</string>
|
<string name="prefs_behavior">Behavior</string>
|
||||||
<string name="prefs_behavior_summary">Settings controlling app behavior</string>
|
<string name="prefs_behavior_summary">Settings controlling app behavior</string>
|
||||||
|
|
||||||
|
<string name="network_behavior">Network settings</string>
|
||||||
|
<string name="network_behavior_summary">Settings that apply to
|
||||||
|
networked games</string>
|
||||||
|
|
||||||
<string name="default_dict">Game dictionary</string>
|
<string name="default_dict">Game dictionary</string>
|
||||||
<string name="default_phonies">Handle phonies</string>
|
<string name="default_phonies">Handle phonies</string>
|
||||||
<string name="phonies_spinner_prompt">How to handle \"phonies\"
|
<string name="phonies_spinner_prompt">How to handle \"phonies\"
|
||||||
|
@ -394,6 +398,10 @@
|
||||||
<string name="connect_daily">Once every day</string>
|
<string name="connect_daily">Once every day</string>
|
||||||
<string name="connect_never">Never connect</string>
|
<string name="connect_never">Never connect</string>
|
||||||
|
|
||||||
|
<string name="notify_sound">Play sound</string>
|
||||||
|
<string name="notify_vibrate">Vibrate</string>
|
||||||
|
<string name="notify_other_summary">When opponent moves arrive</string>
|
||||||
|
|
||||||
<string name="public_names_progress">Fetching public rooms for
|
<string name="public_names_progress">Fetching public rooms for
|
||||||
%d-player games in %s.</string>
|
%d-player games in %s.</string>
|
||||||
<string name="no_name_found_f">No public rooms found for %d-player
|
<string name="no_name_found_f">No public rooms found for %d-player
|
||||||
|
|
|
@ -156,7 +156,11 @@
|
||||||
android:summary="@string/peek_other_summary"
|
android:summary="@string/peek_other_summary"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
/>
|
/>
|
||||||
|
</PreferenceScreen>
|
||||||
|
|
||||||
|
<PreferenceScreen android:title="@string/network_behavior"
|
||||||
|
android:summary="@string/network_behavior_summary"
|
||||||
|
>
|
||||||
<org.eehouse.android.xw4.PollListPreference
|
<org.eehouse.android.xw4.PollListPreference
|
||||||
android:key="@string/key_connect_frequency"
|
android:key="@string/key_connect_frequency"
|
||||||
android:title="@string/connect_frequency"
|
android:title="@string/connect_frequency"
|
||||||
|
@ -164,6 +168,17 @@
|
||||||
android:entryValues="@array/connect_frequencies_values"
|
android:entryValues="@array/connect_frequencies_values"
|
||||||
android:defaultValue="900"
|
android:defaultValue="900"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<CheckBoxPreference android:key="@string/key_notify_sound"
|
||||||
|
android:title="@string/notify_sound"
|
||||||
|
android:summary="@string/notify_other_summary"
|
||||||
|
android:defaultValue="true"
|
||||||
|
/>
|
||||||
|
<CheckBoxPreference android:key="@string/key_notify_vibrate"
|
||||||
|
android:title="@string/notify_vibrate"
|
||||||
|
android:summary="@string/notify_other_summary"
|
||||||
|
android:defaultValue="false"
|
||||||
|
/>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
<PreferenceScreen android:title="@string/advanced"
|
<PreferenceScreen android:title="@string/advanced"
|
||||||
|
|
|
@ -145,8 +145,10 @@ public class BoardActivity extends XWActivity {
|
||||||
case QUERY_REQUEST_BLK:
|
case QUERY_REQUEST_BLK:
|
||||||
case QUERY_INFORM_BLK:
|
case QUERY_INFORM_BLK:
|
||||||
ab = new AlertDialog.Builder( this )
|
ab = new AlertDialog.Builder( this )
|
||||||
.setTitle( m_dlgTitle )
|
|
||||||
.setMessage( m_dlgBytes );
|
.setMessage( m_dlgBytes );
|
||||||
|
if ( 0 != m_dlgTitle ) {
|
||||||
|
ab.setTitle( m_dlgTitle );
|
||||||
|
}
|
||||||
lstnr = new DialogInterface.OnClickListener() {
|
lstnr = new DialogInterface.OnClickListener() {
|
||||||
public void onClick( DialogInterface dialog,
|
public void onClick( DialogInterface dialog,
|
||||||
int whichButton ) {
|
int whichButton ) {
|
||||||
|
|
|
@ -58,7 +58,6 @@ public class GamesList extends XWListActivity
|
||||||
private static final int SHOW_SUBST = WARN_NODICT + 2;
|
private static final int SHOW_SUBST = WARN_NODICT + 2;
|
||||||
|
|
||||||
private GameListAdapter m_adapter;
|
private GameListAdapter m_adapter;
|
||||||
private String m_invalPath = null;
|
|
||||||
private String m_missingDict;
|
private String m_missingDict;
|
||||||
private Handler m_handler;
|
private Handler m_handler;
|
||||||
private String m_missingDictName;
|
private String m_missingDictName;
|
||||||
|
@ -206,7 +205,6 @@ public class GamesList extends XWListActivity
|
||||||
String path = addGame( true );
|
String path = addGame( true );
|
||||||
GameUtils.doConfig( GamesList.this, path,
|
GameUtils.doConfig( GamesList.this, path,
|
||||||
RelayGameActivity.class );
|
RelayGameActivity.class );
|
||||||
m_invalPath = path;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -290,9 +288,7 @@ public class GamesList extends XWListActivity
|
||||||
public void onWindowFocusChanged( boolean hasFocus )
|
public void onWindowFocusChanged( boolean hasFocus )
|
||||||
{
|
{
|
||||||
super.onWindowFocusChanged( hasFocus );
|
super.onWindowFocusChanged( hasFocus );
|
||||||
if ( hasFocus && null != m_invalPath ) {
|
if ( hasFocus ) {
|
||||||
m_adapter.inval( m_invalPath );
|
|
||||||
m_invalPath = null;
|
|
||||||
onContentChanged();
|
onContentChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -422,7 +418,6 @@ public class GamesList extends XWListActivity
|
||||||
GameUtils.launchGame( this, path );
|
GameUtils.launchGame( this, path );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_invalPath = path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean handleMenuItem( int menuID, int position )
|
private boolean handleMenuItem( int menuID, int position )
|
||||||
|
@ -457,7 +452,6 @@ public class GamesList extends XWListActivity
|
||||||
break;
|
break;
|
||||||
case R.id.list_item_config:
|
case R.id.list_item_config:
|
||||||
GameUtils.doConfig( this, path, GameConfig.class );
|
GameUtils.doConfig( this, path, GameConfig.class );
|
||||||
m_invalPath = path;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.list_item_new_from:
|
case R.id.list_item_new_from:
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.io.DataOutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.eehouse.android.xw4.jni.GameSummary;
|
import org.eehouse.android.xw4.jni.GameSummary;
|
||||||
|
import org.eehouse.android.xw4.jni.CommonPrefs;
|
||||||
|
|
||||||
public class RelayService extends Service {
|
public class RelayService extends Service {
|
||||||
|
|
||||||
|
@ -81,7 +82,14 @@ public class RelayService extends Service {
|
||||||
Notification notification =
|
Notification notification =
|
||||||
new Notification( R.drawable.icon48x48, title,
|
new Notification( R.drawable.icon48x48, title,
|
||||||
System.currentTimeMillis() );
|
System.currentTimeMillis() );
|
||||||
|
|
||||||
notification.flags |= Notification.FLAG_AUTO_CANCEL;
|
notification.flags |= Notification.FLAG_AUTO_CANCEL;
|
||||||
|
if ( CommonPrefs.getSoundNotify( this ) ) {
|
||||||
|
notification.flags |= Notification.DEFAULT_SOUND;
|
||||||
|
}
|
||||||
|
if ( CommonPrefs.getVibrateNotify( this ) ) {
|
||||||
|
notification.flags |= Notification.DEFAULT_VIBRATE;
|
||||||
|
}
|
||||||
|
|
||||||
notification.
|
notification.
|
||||||
setLatestEventInfo( this, title,
|
setLatestEventInfo( this, title,
|
||||||
|
|
|
@ -248,6 +248,16 @@ public class CommonPrefs {
|
||||||
return getPrefsBoolean( context, R.string.key_hide_title, true );
|
return getPrefsBoolean( context, R.string.key_hide_title, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean getSoundNotify( Context context )
|
||||||
|
{
|
||||||
|
return getPrefsBoolean( context, R.string.key_notify_sound, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getVibrateNotify( Context context )
|
||||||
|
{
|
||||||
|
return getPrefsBoolean( context, R.string.key_notify_vibrate, false );
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean getPrefsBoolean( Context context, int keyID,
|
public static boolean getPrefsBoolean( Context context, int keyID,
|
||||||
boolean defaultValue )
|
boolean defaultValue )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue