Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
Add deprecation note
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Jul 3, 2024
1 parent 101b8f9 commit 41d01cd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 2 additions & 3 deletions opacclient/opacapp/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@
<string name="load_covers_mobile_data_on">Buchcover werden geladen und angezeigt, wenn verfügbar</string>
<string name="load_covers_mobile_data_off">Buchcover werden nur über WLAN geladen</string>
<string name="account_ptr_hint">Sie können auch die Liste nach unten ziehen, um die Daten neu zu laden.</string>
<string name="support_policy_hint">Für die Nutzung dieser Bibliothek in der App gibt es
keinen kostenfreien Support, eventuelle zukünftige Fehler werden wahrscheinlich nicht
behoben.</string>
<string name="support_policy_hint">Diese App wird nicht mehr gepflegt und wird keine Updates mehr erhalten. Vielen Dank allen Nutzern für 12 ereignisreiche Jahre. </string>
<string name="support_policy_hint_support">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.</string>
<string name="support_policy_more_info">mehr Infos</string>
<string name="prolong_due">Fällige Medien verlängern</string>
<string name="prolong_due_confirm">Wirklich alle fälligen Medien verlängern? In manchen Bibliotheken können für manche Medien Gebühren anfallen.</string>
Expand Down
4 changes: 2 additions & 2 deletions opacclient/opacapp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@
<string name="load_covers_mobile_data_on">Cover images will be loaded and displayed if available</string>
<string name="load_covers_mobile_data_off">Cover images will only be loaded on WiFi</string>
<string name="account_ptr_hint">You can also pull down the list to refresh the data.</string>
<string name="support_policy_hint">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.</string>
<string name="support_policy_hint">This app is no longer under development and will no longer receive updates. It\'s been a great 12 years, thank you all.</string>
<string name="support_policy_hint_support">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.</string>
<string name="support_policy_more_info">more info</string>
<string name="prolong_due">Renew due items</string>
<string name="prolong_due_confirm">Really renew all due items? In some libraries this might cause fees.</string>
Expand Down

0 comments on commit 41d01cd

Please sign in to comment.