diff --git a/app/src/main/java/com/fox2code/mmm/module/ModuleHolder.java b/app/src/main/java/com/fox2code/mmm/module/ModuleHolder.java index 59edeaf..98461c9 100644 --- a/app/src/main/java/com/fox2code/mmm/module/ModuleHolder.java +++ b/app/src/main/java/com/fox2code/mmm/module/ModuleHolder.java @@ -146,11 +146,15 @@ public final class ModuleHolder implements Comparable { // now, we just had to make it more fucking complicated, didn't we? // we now have pref_background_update_check_excludes_version, which is a id:version stringset of versions the user may want to "skip" // oh, and because i hate myself, i made ^ at the beginning match that version and newer, and $ at the end match that version and older - Set stringSet = MainApplication.getSharedPreferences("mmm").getStringSet("pref_background_update_check_excludes_version", new HashSet<>()); + Set stringSetT = MainApplication.getSharedPreferences("mmm").getStringSet("pref_background_update_check_excludes_version", new HashSet<>()); String version = ""; - if (stringSet.contains(moduleInfo.id)) { + Set stringSet = stringSetT; + Timber.d(stringSet.toString()); + if (stringSet.contains(this.moduleInfo.id)) { // get the one matching - version = stringSet.stream().filter(s -> s.startsWith(moduleInfo.id)).findFirst().orElse(""); + Timber.d("found mod in ig ver"); + version = stringSet.stream().filter(s -> s.startsWith(this.moduleInfo.id)).findFirst().orElse(""); + Timber.d("igV:%s", version); } String remoteVersionCode = String.valueOf(moduleInfo.updateVersionCode); if (repoModule != null) { @@ -164,19 +168,24 @@ public final class ModuleHolder implements Comparable { // now find out if user wants up to and including this version, or this version and newer // if it starts with ^, it's this version and newer, if it ends with $, it's this version and older if (version.startsWith("^")) { + Timber.d("igV start with"); // this version and newer if (wantsVersion <= remoteVersionCodeInt || wantsVersion <= localVersionCode) { // if it is, we skip it + Timber.d("igu true"); ignoreUpdate = true; } } else if (version.endsWith("$")) { + Timber.d("igV end with"); // this version and older if (wantsVersion >= remoteVersionCodeInt || wantsVersion >= localVersionCode) { // if it is, we skip it + Timber.d("igu true"); ignoreUpdate = true; } } else if (wantsVersion == remoteVersionCodeInt || wantsVersion == localVersionCode) { // if it is, we skip it + Timber.d("igu true"); ignoreUpdate = true; } } diff --git a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java index ca1c868..c72d69c 100644 --- a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java +++ b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java @@ -667,7 +667,13 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { Timber.d("ok clicked"); // for every module, get the text field and save it to the stringset Set stringSetTemp = new HashSet<>(); + String prevMod = ""; for (int i = 0; i < layout.getChildCount(); i++) { + if (layout.getChildAt(i) instanceof MaterialTextView) { + MaterialTextView mv = (MaterialTextView) layout.getChildAt(i); + prevMod = mv.getText().toString(); + continue; + }; EditText editText = (EditText) layout.getChildAt(i); String text = editText.getText().toString(); if (!text.isEmpty()) { @@ -675,7 +681,8 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { // so we remove all non-numbers and non ^ and $ text = text.replaceAll("[^0-9^$]", ""); // we have to use module id even though we show name - stringSetTemp.add(localModuleInfos.stream().filter(localModuleInfo -> localModuleInfo.name.equals(editText.getHint().toString())).findFirst().orElse(null).id + ":" + text); + String finalprevMod = prevMod; + stringSetTemp.add(localModuleInfos.stream().filter(localModuleInfo -> localModuleInfo.name.equals(finalprevMod)).findFirst().orElse(null).id + ":" + text); Timber.d("text is %s for %s", text, editText.getHint().toString()); } else { Timber.d("text is empty for %s", editText.getHint().toString());