wip
authortobiasKaminsky <tobias@kaminsky.me>
Thu, 5 Nov 2015 21:51:26 +0000 (22:51 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Thu, 5 Nov 2015 21:51:26 +0000 (22:51 +0100)
CHANGELOG.md
res/values/strings.xml
res/xml/preferences.xml
src/com/owncloud/android/ui/activity/Preferences.java

index a970f8e..3be88b4 100644 (file)
@@ -1,3 +1,9 @@
+# 2015-11-05
+- update master
+- fix #1244
+- add changelog
+- add check for update of beta version
+
 # 2015-11-02
 - PR [#1240](https://github.com/owncloud/android/pull/1240) "Set as wallpaper" merged
 - updated other PRs
index 6f435d3..9537dc7 100644 (file)
 
     <string name="share_sharee_unavailable">Sorry, your server version does not allow share with users within clients.
         \nPlease contact your administrator</string>
+    <string name="changelog">https://raw.githubusercontent.com/owncloud/android/beta/CHANGELOG.md</string>
 
 </resources>
index 29e8fe2..da8b7ba 100644 (file)
     <Preference android:title="@string/prefs_recommend" android:key="recommend" />
     <Preference android:title="@string/prefs_feedback" android:key="feedback" />
     <Preference android:title="@string/prefs_imprint" android:key="imprint" />
-                        
-       <Preference             android:id="@+id/about_app" 
-                                       android:title="@string/about_title" 
+
+       <Preference             android:id="@+id/about_app"
+                                       android:title="@string/about_title"
                                        android:key="about_app" />
 
        <Preference android:id="@+id/beta_link"
                                android:title="Download latest beta version"
                                android:key="beta_link" />
-       </PreferenceCategory>
 
+       <Preference android:id="@+id/changelog_link"
+               android:title="Changelog beta version"
+               android:key="changelog_link" />
 
+       </PreferenceCategory>
 </PreferenceScreen>
index 9f4415f..46b62b3 100644 (file)
@@ -496,21 +496,39 @@ public class Preferences extends PreferenceActivity
                     } catch (InterruptedException | ExecutionException e) {
                         e.printStackTrace();
                     }
-                    if (latestVersion == -1){
+                    if (latestVersion == -1) {
                         Toast.makeText(getApplicationContext(), "No information available!", Toast.LENGTH_SHORT).show();
                     }
-                    if (latestVersion > currentVersion){
-                            String betaLinkWeb = (String) getText(R.string.beta_link) + latestVersion + ".apk";
-                            if (betaLinkWeb != null && betaLinkWeb.length() > 0) {
-                                Uri uriUrl = Uri.parse(betaLinkWeb);
-                                Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
-                                startActivity(intent);
-                                return true;
-                            }
-                        } else {
-                            Toast.makeText(getApplicationContext(), "No new version available!", Toast.LENGTH_SHORT).show();
+                    if (latestVersion > currentVersion) {
+                        String betaLinkWeb = (String) getText(R.string.beta_link) + latestVersion + ".apk";
+                        if (betaLinkWeb != null && betaLinkWeb.length() > 0) {
+                            Uri uriUrl = Uri.parse(betaLinkWeb);
+                            Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
+                            startActivity(intent);
                             return true;
                         }
+                    } else {
+                        Toast.makeText(getApplicationContext(), "No new version available!", Toast.LENGTH_SHORT).show();
+                        return true;
+                    }
+                    return true;
+                }
+            });
+        }
+
+        /* Link to Beta apks */
+        Preference pChangelogLink =  findPreference("changelog_link");
+        if (pChangelogLink != null){
+            pChangelogLink.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+                @Override
+                public boolean onPreferenceClick(Preference preference) {
+                    String betaLinkWeb = getString(R.string.changelog);
+                    if (betaLinkWeb != null && betaLinkWeb.length() > 0) {
+                        Uri uriUrl = Uri.parse(betaLinkWeb);
+                        Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
+                        startActivity(intent);
+                        return true;
+                    }
                     return true;
                 }
             });