Replace Test with Snackbar

This commit is contained in:
tobiasKaminsky 2017-11-22 07:25:14 +01:00
parent 86340913a8
commit a9b231e64d
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
2 changed files with 7 additions and 2 deletions

View file

@ -47,6 +47,7 @@ import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.support.annotation.LayoutRes;
import android.support.design.widget.Snackbar;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
@ -193,7 +194,8 @@ public class Preferences extends PreferenceActivity
Log_OC.e(TAG, "Error detecting app version", e);
}
if (latestVersion == -1 || currentVersion == -1) {
Toast.makeText(getApplicationContext(), "No information available!", Toast.LENGTH_SHORT).show();
Snackbar.make(getListView(), R.string.dev_version_no_information_available,
Snackbar.LENGTH_SHORT).show();
}
if (latestVersion > currentVersion) {
String devApkLink = (String) getText(R.string.dev_link) + latestVersion + ".apk";
@ -202,7 +204,8 @@ public class Preferences extends PreferenceActivity
startActivity(intent);
return true;
} else {
Toast.makeText(getApplicationContext(), "No new version available!", Toast.LENGTH_SHORT).show();
Snackbar.make(getListView(), R.string.dev_version_no_new_version_available,
Snackbar.LENGTH_SHORT).show();
return true;
}
});

View file

@ -720,4 +720,6 @@
<string name="store_full_dev_desc">The Open Source Nextcloud Android app allows you to access all your files on your Nextcloud.\nThis is a dev version of the official Nextcloud app and includes brand-new, untested features which might lead to instabilities and data loss. The app is designed for users willing to test the new features and to report bugs if they occur. Do not use it for your productive work!\n\nThe dev version can be installed alongside the official Nextcloud app which is available at F-Droid, too. Once a day it is checked if the source code was updated, so there can be longer pauses between builds.</string>
<string name="prefs_category_dev">Dev</string>
<string name="dev_version_no_information_available">No information available!</string>
<string name="dev_version_no_new_version_available">No new version available!</string>
</resources>