use of com.nolanlawson.keepscore.data.SavedGameAdapter in project KeepScore by nolanlawson.
the class MainActivity method onPause.
@Override
public void onPause() {
super.onPause();
log.d("onPause()");
// save which items were checked and where we are in the list
lastChecked = new HashSet<GameSummary>();
for (SavedGameAdapter subAdapter : adapter.getSubAdapters()) {
lastChecked.addAll(subAdapter.getChecked());
}
lastPosition = getListView().getFirstVisiblePosition();
}
use of com.nolanlawson.keepscore.data.SavedGameAdapter in project KeepScore by nolanlawson.
the class MainActivity method showDeleteSelectedDialog.
private void showDeleteSelectedDialog() {
final Set<GameSummary> games = new HashSet<GameSummary>();
for (SavedGameAdapter subAdapter : adapter.getSectionsMap().values()) {
games.addAll(subAdapter.getChecked());
}
String message = games.size() == 1 ? getString(R.string.text_game_will_be_deleted) : String.format(getString(R.string.text_games_will_be_deleted), games.size());
new AlertDialog.Builder(this).setCancelable(true).setTitle(R.string.title_confirm_delete).setMessage(message).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
deleteGames(games);
}
}).show();
}
Aggregations