Control showing message count via a prefs checkbox

Off by default on non-DEBUG builds, but still available.
This commit is contained in:
Eric House 2019-12-29 08:33:38 -08:00
parent 381efc9ddb
commit 15239d4a6c
6 changed files with 17 additions and 2 deletions

View file

@ -464,7 +464,7 @@ public class ConnStatusHandler {
- scratchR.height()) );
drawIn( canvas, res, R.drawable.multigame__gen, scratchR );
if ( BuildConfig.DEBUG && 0 < s_moveCount ) {
if ( 0 < s_moveCount && XWPrefs.moveCountEnabled( context ) ) {
String str = String.format( "%d", s_moveCount );
s_fillPaint.setColor( Color.BLACK );
canvas.drawText( str, s_rect.left + (s_rect.width() / 2),

View file

@ -335,7 +335,7 @@ public class GameListItem extends LinearLayout
findViewById( R.id.has_chat_marker )
.setVisibility( hasChat ? View.VISIBLE : View.GONE );
if ( BuildConfig.DEBUG ) {
if ( XWPrefs.moveCountEnabled( m_context ) ) {
TextView tv = (TextView)findViewById( R.id.n_pending );
int nPending = summary.nPacketsPending;
String str = nPending == 0 ? "" : String.format( "%d", nPending );

View file

@ -61,6 +61,12 @@ public class XWPrefs {
return getPrefsBoolean( context, R.string.key_enable_dup_invite, false );
}
public static boolean moveCountEnabled( Context context )
{
return getPrefsBoolean( context, R.string.key_enable_pending_count,
BuildConfig.DEBUG );
}
public static boolean getIgnoreFCM( Context context )
{
String curValue =

View file

@ -126,6 +126,7 @@
<string name="key_na_dicts">key_na_dicts</string>
<string name="key_enable_debug">key_enable_debug</string>
<string name="key_enable_dup_invite">key_enable_dup_invite</string>
<string name="key_enable_pending_count">key_enable_pending_count</string>
<string name="key_enable_sms_toself">key_enable_sms_toself</string>
<string name="key_show_fcm">key_show_fcm2</string>
<string name="key_nag_intervals">key_nag_intervals</string>

View file

@ -2197,6 +2197,8 @@
<string name="enable_dupes_title">Accept duplicate invites</string>
<string name="xlations_locale">Fake locale for translation</string>
<string name="enable_dupes_summary">Accept invitations more than once</string>
<string name="enable_pending_count_title">Show Pending messages</string>
<string name="enable_pending_count_summary">Show number not yet acknowledged</string>
<string name="nag_intervals">Reminder intervals (minutes1,minutes2,…)</string>
<string name="enable_sms_toself_title">Short-circuit SMS to self</string>
<string name="enable_sms_toself_summary">Skip radio when phone numbers same</string>

View file

@ -390,6 +390,12 @@
android:defaultValue="false"
/>
<CheckBoxPreference android:key="@string/key_enable_pending_count"
android:title="@string/enable_pending_count_title"
android:summary="@string/enable_pending_count_summary"
android:defaultValue="@bool/DEBUG"
/>
<PreferenceScreen android:title="@string/pref_group_relay_title"
android:summary="@string/pref_group_relay_summary"
android:key="@string/pref_group_relay_title"