فهرست منبع

Replace Test with Snackbar

tobiasKaminsky 7 سال پیش
والد
کامیت
a9b231e64d
2فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 5 2
      src/main/java/com/owncloud/android/ui/activity/Preferences.java
  2. 2 0
      src/main/res/values/strings.xml

+ 5 - 2
src/main/java/com/owncloud/android/ui/activity/Preferences.java

@@ -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;
                     }
                 });

+ 2 - 0
src/main/res/values/strings.xml

@@ -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>