improve corrupt-game experience

add padding to alert, remove cancel button, clean up warning text, and
confirm delete.
This commit is contained in:
Eric House 2020-10-29 11:29:10 -07:00
parent b165072bed
commit 04000ddf7e
3 changed files with 21 additions and 14 deletions

View file

@ -1357,6 +1357,7 @@ public class GamesListDelegate extends ListDelegateBase
makeConfirmThenBuilder( R.string.unsafe_open_warning,
Action.QUARANTINE_CLEAR )
.setPosButton( R.string.unsafe_open_disregard )
.setNegButton( 0 )
.setActionPair( Action.QUARANTINE_DELETE,
R.string.button_delete )
.setParams( rowid, summary )
@ -1501,7 +1502,7 @@ public class GamesListDelegate extends ListDelegateBase
mkListAdapter();
break;
case DELETE_GAMES:
deleteGames( (long[])params[0], false );
deleteGames( (long[])params[0], (Boolean)params[1] );
break;
case OPEN_GAME:
doOpenGame( params );
@ -1514,8 +1515,7 @@ public class GamesListDelegate extends ListDelegateBase
break;
case QUARANTINE_DELETE:
rowid = (long)params[0];
deleteGames( new long[] {rowid}, true );
deleteIfConfirmed( new long[] {(long)params[0]}, true );
break;
case CLEAR_SELS:
@ -2076,12 +2076,7 @@ public class GamesListDelegate extends ListDelegateBase
break;
case R.id.games_game_delete:
String msg = getQuantityString( R.plurals.confirm_seldeletes_fmt,
selRowIDs.length, selRowIDs.length );
makeConfirmThenBuilder( msg, Action.DELETE_GAMES )
.setPosButton( R.string.button_delete )
.setParams( selRowIDs )
.show();
deleteIfConfirmed( selRowIDs, false );
break;
case R.id.games_game_rematch:
@ -2148,7 +2143,7 @@ public class GamesListDelegate extends ListDelegateBase
// DEBUG only
case R.id.games_game_invites:
msg = GameUtils.getSummary( m_activity, selRowIDs[0] )
String msg = GameUtils.getSummary( m_activity, selRowIDs[0] )
.conTypes.toString( m_activity, true );
msg = getString( R.string.invites_net_fmt, msg );
@ -2700,6 +2695,16 @@ public class GamesListDelegate extends ListDelegateBase
}
}
private void deleteIfConfirmed( long[] rowids, boolean skipTell )
{
String msg = getQuantityString( R.plurals.confirm_seldeletes_fmt,
rowids.length, rowids.length );
makeConfirmThenBuilder( msg, Action.DELETE_GAMES )
.setPosButton( R.string.button_delete )
.setParams( rowids, skipTell )
.show();
}
private void deleteGames( long[] rowids, boolean skipTell )
{
for ( long rowid : rowids ) {

View file

@ -11,6 +11,7 @@
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="8dp"
>
<TextView android:id="@+id/msg"

View file

@ -2568,10 +2568,11 @@
<string name="history_pause_fmt">Paused by: %1$s.</string>
<string name="history_msg_fmt"> Message: %1$s.</string>
<string name="history_autopause">Auto-paused.</string>
<string name="unsafe_open_warning">CrossWords seems to have
crashed recently while this game was open. It may be damaged, and
opening it might cause another crash. Do you want to try opening
it anyway?</string>
<string name="unsafe_open_warning">This game did not close
properly last time it was opened. \n\nThat can happen when
CrossWords is force-closed, but it is possible that the game is
damaged and will cause a crash when opened. If that happens you
may want to delete it.</string>
<string name="unsafe_open_disregard">Open anyway</string>
<string name="word_blocked_by_phony">Word or words not found in wordlist %2$s: %1$s.</string>
<string name="gamel_menu_logs">Debug logs</string>