hide/show hint at top of games list via a preference rather than the

number of games in the list, and modify hint text to point to the
prefs setting.
This commit is contained in:
Andy2 2011-03-11 06:44:25 -08:00
parent c909f91a61
commit 28f3ad316b
5 changed files with 28 additions and 20 deletions

View file

@ -39,6 +39,7 @@
<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_hide_intro">key_hide_intro</string>
<string name="key_notagain_sync">key_notagain_sync</string>
<string name="key_notagain_chat">key_notagain_chat</string>

View file

@ -221,6 +221,9 @@
<string name="hide_title">Hide titlebar</string>
<string name="hide_title_summary">Hiding the game name lets the
board be slightly larger</string>
<string name="hide_intro">Hide main-page hint</string>
<string name="hide_intro_summary">It\'s useful only when you\'re starting
out...</string>
<string name="peek_other">View tiles out-of-turn</string>
<string name="peek_other_summary">Tapping on scoreboard name shows
that player\'s tiles</string>
@ -291,8 +294,8 @@
<string name="empty">Empty cell/background</string>
<string name="clr_crosshairs">Crosshairs color</string>
<string name="advanced">Advanced</string>
<string name="advanced_summary">You may never need these...</string>
<string name="advanced">For debugging</string>
<string name="advanced_summary">You should never need these...</string>
<string name="relay_host">Relay address</string>
<string name="dict_host">Dictionary download URL</string>
<string name="logging_on">Enable logging</string>
@ -399,7 +402,7 @@
<string name="connect_one_hour">Hourly</string>
<string name="connect_six_hours">Every six hours</string>
<string name="connect_daily">Once every day</string>
<string name="connect_never">Never connect</string>
<string name="connect_never">Never check</string>
<string name="notify_sound">Play sound</string>
<string name="notify_vibrate">Vibrate</string>
@ -533,7 +536,7 @@
<string name="empty_games_list">Use one of the buttons below to
create a game. Then tap the game to play or long-tap it for
other options.</string>
<string name="empty_games_list2">This hint will disappear
whenever there are more than two games in the list.</string>
<string name="empty_games_list2">You can hide this in the
Appearance section of Settings (via the menu key).</string>
</resources>

View file

@ -54,16 +54,21 @@
<!-- android:summary="@string/color_tiles_summary" -->
<!-- android:defaultValue="true" -->
<!-- /> -->
<CheckBoxPreference android:key="@string/key_show_arrow"
android:title="@string/show_arrow"
android:summary="@string/show_arrow_summary"
android:defaultValue="true"
<CheckBoxPreference android:key="@string/key_hide_intro"
android:title="@string/hide_intro"
android:summary="@string/hide_intro_summary"
android:defaultValue="false"
/>
<CheckBoxPreference android:key="@string/key_hide_title"
android:title="@string/hide_title"
android:summary="@string/hide_title_summary"
android:defaultValue="true"
/>
<CheckBoxPreference android:key="@string/key_show_arrow"
android:title="@string/show_arrow"
android:summary="@string/show_arrow_summary"
android:defaultValue="true"
/>
<PreferenceScreen android:title="@string/prefs_colors"
android:summary="@string/prefs_colors_summary"

View file

@ -217,6 +217,11 @@ public class GamesList extends XWListActivity
super.onStart();
DispatchNotify.SetRelayIDsHandler( this );
boolean hide = CommonPrefs.getHideIntro( this );
int hereOrGone = hide ? View.GONE : View.VISIBLE;
View hint = findViewById( R.id.empty_games_list );
hint.setVisibility( hereOrGone );
// TelephonyManager mgr =
// (TelephonyManager)getSystemService( Context.TELEPHONY_SERVICE );
// m_phoneStateListener = new XWPhoneStateListener();
@ -243,17 +248,6 @@ public class GamesList extends XWListActivity
super.onDestroy();
}
@Override
public void onContentChanged()
{
int count = DBUtils.gamesList( this ).length;
int hereOrGone = count > 2 ? View.GONE : View.VISIBLE;
View hint = findViewById( R.id.empty_games_list );
hint.setVisibility( hereOrGone );
super.onContentChanged();
}
// DispatchNotify.HandleRelaysIface interface
public void HandleRelaysIDs( final String[] relayIDs )
{

View file

@ -254,6 +254,11 @@ public class CommonPrefs {
return getPrefsBoolean( context, R.string.key_notify_vibrate, false );
}
public static boolean getHideIntro( Context context )
{
return getPrefsBoolean( context, R.string.key_hide_intro, false );
}
public static boolean getPrefsBoolean( Context context, int keyID,
boolean defaultValue )
{