diff --git a/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/frontend/MainActivity.java b/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/frontend/MainActivity.java index d1304cf72..43015b91a 100644 --- a/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/frontend/MainActivity.java +++ b/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/frontend/MainActivity.java @@ -25,6 +25,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; +import android.widget.TextView; import android.widget.Toast; import org.joda.time.DateTime; @@ -499,34 +500,34 @@ public void onClick(DialogInterface dialog, int which) { private void supportPolicyHint() { - Account account = app.getAccount(); - if (!app.getLibrary().isSupportContract() && !account.isSupportPolicyHintSeen()) { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(MainActivity.this); + String pkey_time = "notice_support"; + if (System.currentTimeMillis() - sp.getLong(pkey_time, 0) > 24 * 60 * 60 * 1000) { findViewById(R.id.support_policy_hint).setVisibility(View.VISIBLE); + + if (app.getLibrary().isSupportContract()) { + ((TextView) findViewById(R.id.tvSupportHint)).setText(R.string.support_policy_hint_support); + } else { + ((TextView) findViewById(R.id.tvSupportHint)).setText(R.string.support_policy_hint); + } + findViewById(R.id.btMoreInfo).setOnClickListener(v -> { Intent websiteIntent = new Intent(Intent.ACTION_VIEW); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { - // Chrome custom tabs - Bundle extras = new Bundle(); - extras.putBinder("android.support.customtabs.extra.SESSION", null); - extras.putInt("android.support.customtabs.extra.TOOLBAR_COLOR", - ContextCompat.getColor(this, R.color.primary_red)); - websiteIntent.putExtras(extras); - } - String url = "https://opac.app/en/support-policy/"; - String languageCode = Locale.getDefault().getLanguage().toLowerCase(); - if (Arrays.asList("de", "en", "fr").contains(languageCode)) { - url = String.format("https://opac.app/%s/support-policy/", languageCode); + String url; + if (app.getLibrary().isSupportContract()) { + url = "https://play.google.com/store/apps/details?id=de.subkom.mobilopac"; + } else { + url = "https://opac.app/"; } - websiteIntent.setData(Uri.parse(url)); startActivity(websiteIntent); - }); findViewById(R.id.btGotIt).setOnClickListener(v -> { + sp.edit() + .putLong(pkey_time, System.currentTimeMillis()) + .apply(); findViewById(R.id.support_policy_hint).setVisibility(View.GONE); - account.setSupportPolicyHintSeen(true); - new AccountDataSource(this).update(account); }); } else { findViewById(R.id.support_policy_hint).setVisibility(View.GONE); diff --git a/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/reminder/SyncAccountJob.java b/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/reminder/SyncAccountJob.java index b799bb93b..88307f0a9 100644 --- a/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/reminder/SyncAccountJob.java +++ b/opacclient/opacapp/src/main/java/de/geeksfactory/opacclient/reminder/SyncAccountJob.java @@ -25,6 +25,7 @@ import android.util.Log; import org.joda.time.DateTime; +import org.joda.time.Days; import org.joda.time.Hours; import org.json.JSONException; @@ -171,8 +172,8 @@ private void updateLibraryConfig() { PreferenceDataSource prefs = new PreferenceDataSource(getApplicationContext()); if (prefs.getLastLibraryConfigUpdate() != null && prefs.getLastLibraryConfigUpdate() - .isAfter(DateTime.now().minus(Hours.ONE))) { - Log.d(TAG, "Do not run updateLibraryConfig as last run was less than an hour ago."); + .isAfter(DateTime.now().minus(Days.days(3)))) { + Log.d(TAG, "Do not run updateLibraryConfig as last run was less than three days ago."); return; } diff --git a/opacclient/opacapp/src/main/res/values-de/strings.xml b/opacclient/opacapp/src/main/res/values-de/strings.xml index 605bbcb10..4001781a6 100644 --- a/opacclient/opacapp/src/main/res/values-de/strings.xml +++ b/opacclient/opacapp/src/main/res/values-de/strings.xml @@ -343,9 +343,8 @@ Buchcover werden geladen und angezeigt, wenn verfügbar Buchcover werden nur über WLAN geladen Sie können auch die Liste nach unten ziehen, um die Daten neu zu laden. - Für die Nutzung dieser Bibliothek in der App gibt es - keinen kostenfreien Support, eventuelle zukünftige Fehler werden wahrscheinlich nicht - behoben. + Diese App wird nicht mehr gepflegt und wird keine Updates mehr erhalten. Vielen Dank allen Nutzern für 12 ereignisreiche Jahre. + This wird nicht mehr gepflegt und wird keine Updates mehr erhalten. Wir empfehlen alternativ die App mobilOPAC, die für viele Bibliotheken ähnliche Funktionen anbietet. mehr Infos Fällige Medien verlängern Wirklich alle fälligen Medien verlängern? In manchen Bibliotheken können für manche Medien Gebühren anfallen. diff --git a/opacclient/opacapp/src/main/res/values/strings.xml b/opacclient/opacapp/src/main/res/values/strings.xml index 20b40bb72..873c4dd29 100644 --- a/opacclient/opacapp/src/main/res/values/strings.xml +++ b/opacclient/opacapp/src/main/res/values/strings.xml @@ -342,8 +342,8 @@ Cover images will be loaded and displayed if available Cover images will only be loaded on WiFi You can also pull down the list to refresh the data. - We provide no free support for use of this library in the - app, problems that may occur in the future will probably not be fixed. + This app is no longer under development and will no longer receive updates. It\'s been a great 12 years, thank you all. + This app is no longer under development and will no longer receive updates. We recommend the app mobilOPAC instead, which offers similar functionality for many libraries. more info Renew due items Really renew all due items? In some libraries this might cause fees.