Эх сурвалжийг харах

add whats new screen for version 1.5

tobiaskaminsky 7 жил өмнө
parent
commit
b95aeeb51c

+ 11 - 0
src/main/java/com/owncloud/android/MainApp.java

@@ -219,6 +219,17 @@ public class MainApp extends MultiDexApplication {
         }
     }
 
+    // Non gradle build systems do not provide BuildConfig.VERSION_CODE
+    // so we must fallback to this method :(
+    public static String getVersionName() {
+        try {
+            String thisPackageName = getAppContext().getPackageName();
+            return getAppContext().getPackageManager().getPackageInfo(thisPackageName, 0).versionName;
+        } catch (PackageManager.NameNotFoundException e) {
+            return "";
+        }
+    }
+
     //  From AccountAuthenticator 
     //  public static final String AUTHORITY = "org.owncloud";
     public static String getAuthority() {

+ 6 - 1
src/main/java/com/owncloud/android/features/FeatureList.java

@@ -38,8 +38,10 @@ import java.util.regex.Pattern;
  */
 public class FeatureList {
     private static final boolean SHOW_ON_FIRST_RUN = true;
+    private static final boolean SHOW_ON_UPGRADE = false;
 
     private static final String VERSION_1_0_0 = "1.0.0";
+    private static final String VERSION_1_5_0 = "1.5.0";
     private static final String BETA_VERSION_0 = "0";
 
     static final private FeatureItem featuresList[] = {
@@ -54,6 +56,9 @@ public class FeatureList {
                     R.string.welcome_feature_3_title, R.string.welcome_feature_3_text,
                     VERSION_1_0_0, BETA_VERSION_0, SHOW_ON_FIRST_RUN),
             // Features introduced in certain point in time
+            new FeatureItem(R.drawable.what_new_instant_upload,
+                    R.string.whats_new_auto_upload_title, R.string.whats_new_auto_upload_content,
+                    VERSION_1_5_0, BETA_VERSION_0, SHOW_ON_UPGRADE)
     };
 
     static public FeatureItem[] get() {
@@ -156,7 +161,7 @@ public class FeatureList {
             return 0;
         }
         return Integer.parseInt(v[0])*(int)(10e6) +
-                Integer.parseInt(v[1])*(int)(10e4) +
+                Integer.parseInt(v[1])*(int)(10e3) +
                 Integer.parseInt(v[2])*100;
     }
 }

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java

@@ -141,7 +141,7 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
         } else if (isFirstRun()) {
             tv.setText(R.string.empty);
         } else {
-            tv.setText(R.string.whats_new_title);
+            tv.setText(String.format(getString(R.string.whats_new_title),  MainApp.getVersionName()));
         }
 
         updateNextButtonIfNeeded();

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

@@ -623,7 +623,7 @@
     <string name="storage_description_unknown">Unknown</string>
 
     <!-- What's new feature and texts to show -->
-    <string name="whats_new_title">What\'s new in Nextcloud</string>
+    <string name="whats_new_title">What\'s new in %1$s</string>
 
     <!-- Welcome to Nc intro features -->
     <string name="welcome_feature_1_title">A safe home for all your data</string>
@@ -632,9 +632,12 @@
     <string name="welcome_feature_2_title">Multi account</string>
     <string name="welcome_feature_2_text">Connect to all your clouds</string>
 
-    <string name="welcome_feature_3_title">Instant upload</string>
+    <string name="welcome_feature_3_title">Auto upload</string>
     <string name="welcome_feature_3_text">Keep your photos safe</string>
 
+    <string name="whats_new_auto_upload_title">Enhanced auto upload</string>
+    <string name="whats_new_auto_upload_content">\u2022 for all android versions\n\u2022 less battery consumption\n\u2022 more reliable, but not instant</string>
+
     <string name="whats_new_skip">Skip</string>
 
     <string name="fingerprint_scan_finger">Please scan your finger</string>