diff --git a/app/build.gradle b/app/build.gradle index 3d3fc74..3217c81 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "org.williamsonministry.prayercards" minSdkVersion 21 targetSdkVersion 30 - versionCode 10 - versionName '1.4.2' + versionCode 11 + versionName '1.4.3' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } diff --git a/app/src/main/java/org/williamsonministry/prayercards/CardRecViewAdapter.java b/app/src/main/java/org/williamsonministry/prayercards/CardRecViewAdapter.java index 507c4a4..ea1cc1e 100644 --- a/app/src/main/java/org/williamsonministry/prayercards/CardRecViewAdapter.java +++ b/app/src/main/java/org/williamsonministry/prayercards/CardRecViewAdapter.java @@ -312,6 +312,12 @@ public ViewHolder(@NonNull View itemView) { @Override public void onItemClear() { + + //This is trying to fix a rare bug when I think two cards get the same list order somehow. Hard to recreate + for (int i = 0; i < allPrayerCards.size(); i++) { + allPrayerCards.get(i).setListOrder(i); + } + asyncSave(); } } diff --git a/app/src/main/java/org/williamsonministry/prayercards/SaveCardsToDbJobService.java b/app/src/main/java/org/williamsonministry/prayercards/SaveCardsToDbJobService.java index 9f2d53d..164420c 100644 --- a/app/src/main/java/org/williamsonministry/prayercards/SaveCardsToDbJobService.java +++ b/app/src/main/java/org/williamsonministry/prayercards/SaveCardsToDbJobService.java @@ -1,6 +1,7 @@ package org.williamsonministry.prayercards; import android.app.IntentService; +import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; @@ -31,6 +32,13 @@ protected void onHandleIntent(@Nullable Intent intent) { ArrayList allCards = intent.getParcelableArrayListExtra(ALL_PRAYERCARDS_ARRAYLIST_KEY); DataBaseHelper dataBaseHelper = new DataBaseHelper(this); dataBaseHelper.saveAllCards(allCards); + +// try { +// Thread.sleep(5000); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + editor4.putBoolean("SAVE_FINISH", true); editor4.apply(); Log.d(TAG, "onHandleIntent: Save Ended"); diff --git a/build.gradle b/build.gradle index e0318ef..9b826b6 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.0' + classpath 'com.android.tools.build:gradle:7.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files