Skip to content

Commit

Permalink
v2.0.1: minor fix - persist data after deletion of rule
Browse files Browse the repository at this point in the history
  • Loading branch information
warren-bank committed Oct 21, 2019
1 parent 1f01f20 commit 0f1643f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public class PreferenceActivity extends Activity {
private ArrayList<ListItem> listItems;
private ArrayAdapter<ListItem> listAdapter;

// ---------------------------------------------------------------------------------------------
// Data Mutation:
// ---------------------------------------------------------------------------------------------

private void handleDataSetChange() {
listAdapter.notifyDataSetChanged();
Preferences.setListItems(PreferenceActivity.this, listItems);
}

// ---------------------------------------------------------------------------------------------
// Lifecycle Events:
// ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -124,7 +133,7 @@ private void showEditDialog(final int position) {
public void onClick(View v) {
if (!isAdd) {
listItems.remove(position);
listAdapter.notifyDataSetChanged();
handleDataSetChange();
}
dialog.dismiss();
}
Expand Down Expand Up @@ -164,10 +173,8 @@ public void onClick(View v) {
}
}

listAdapter.notifyDataSetChanged();
handleDataSetChange();
dialog.dismiss();

Preferences.setListItems(PreferenceActivity.this, listItems);
}
});

Expand Down
4 changes: 2 additions & 2 deletions android-studio-project/constants.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project.ext {
releaseVersionCode = Integer.parseInt("002000011", 10)
releaseVersion = '002.00.00-11API'
releaseVersionCode = Integer.parseInt("002000111", 10)
releaseVersion = '002.00.01-11API'
minSdkVersion = 11
targetSdkVersion = 28
compileSdkVersion = 28
Expand Down

0 comments on commit 0f1643f

Please sign in to comment.