Browse Source

links are now extracted to setup.xml

tobiasKaminsky 9 years ago
parent
commit
c206c944bc

+ 0 - 4
res/layout/participate_layout.xml

@@ -55,7 +55,6 @@
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="@string/participate_beta"
                     android:id="@+id/participate_betaView"
                     android:layout_margin="5dp"
                     android:layout_marginBottom="10dp"/>
@@ -64,7 +63,6 @@
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="@string/participate_release_candidate"
                     android:id="@+id/participate_rcView"
                     android:layout_margin="5dp"
                     android:layout_marginBottom="10dp"/>
@@ -73,7 +71,6 @@
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="@string/participate_participate"
                     android:id="@+id/participate_participateView"
                     android:layout_margin="5dp"
                     android:layout_marginBottom="10dp"/>
@@ -82,7 +79,6 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="@string/participate_contribute"
                     android:id="@+id/participate_contributeView"
                     android:layout_margin="5dp"
                     android:layout_marginBottom="10dp"/>

+ 6 - 0
res/values/setup.xml

@@ -72,7 +72,13 @@
     <string name="mail_logger"></string>
 
     <!-- Participate links -->
+    <string name="fdroid_beta_link">https://f-droid.org/repository/browse/?fdid=com.nextcloud.android.beta</string>
     <string name="beta_apk_link">https://github.com/nextcloud/android/raw/beta/apks/latest.apk</string>
+    <string name="play_store_register_beta">https://play.google.com/apps/testing/com.nextcloud.client</string>
+    <string name="fdroid_link">https://f-droid.org/repository/browse/?fdid=com.nextcloud.client</string>
+    <string name="irc_weblink">http://webchat.freenode.net?channels=nextcloud-mobile</string>
+    <string name="help_link">https://help.nextcloud.com/c/clients/android</string>
+    <string name="contributing_link">https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md</string>
 
 </resources>
 

+ 5 - 5
res/values/strings.xml

@@ -470,11 +470,11 @@
     <string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
     <string name="learn_more">Learn more</string>
     <string name="actionbar_participate">Participate</string>
-    <string name="participate_beta"><b>Beta version</b>\nThis includes all upcoming features and is very bleeding edge. Bugs/errors can occur and if they do, please report them to us.\nGet it\n<a href="https://f-droid.org/repository/browse/?fdid=com.nextcloud.android.beta">via F-Droid</a>\n<a href="@string/beta_apk_link">via APK</a></string>
-    <string name="participate_release_candidate"><b>Release candidate</b>\nA release candidate is a snapshot of the upcoming release. It is expected to be stable and has no bugs.\nTo ensure this, we need your help testing it on a vary of server versions/settings.\nGet it\n<a href="https://play.google.com/apps/testing/com.nextcloud.client">via Play Store</a> (Sign up for testing)\n<a href="https://f-droid.org/repository/browse/?fdfilter=nextcloud&amp;fdid=com.nextcloud.client">via F-Droid</a> (Manually look in the \"versions\" section.)</string>
-    <string name="participate_participate"><b>Participate</b>\nReport issues on <a href="https://github.com/nextcloud/android/issues">Github</a>\nJoin the chat on IRC: <a href="http://webchat.freenode.net?channels=nextcloud-mobile">#nextcloud-mobile</a>\nHelp others on the <a href="https://help.nextcloud.com">forum</a></string>
-    <string name="participate_contribute"><b>Contribute as a developer</b>\nEverybody is welcome to help us build this app. Just have a look at the open issues, read <a href="https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md">Contributing.md</a> or talk to us at <a href="http://webchat.freenode.net?channels=nextcloud-mobile">#nextcloud-mobile</a> on IRC about what can be enhanced.</string>
-    <string name="participate_header"><b>Help us testing</b>\nWe offer two different previews of the upcoming version:</string>
+    <string name="participate_beta">&lt;b>Beta version&lt;/b>&lt;br/>This includes all upcoming features and is very bleeding edge. Bugs/errors can occur and if they do, please report them to us.&lt;br>Get it&lt;br>&lt;a href="%1$s">via F-Droid&lt;/a>&lt;br>&lt;a href="%2$s">via APK&lt;/a></string>
+    <string name="participate_release_candidate">&lt;b>Release candidate&lt;/b>&lt;br>A release candidate is a snapshot of the upcoming release. It is expected to be stable and has no bugs.&lt;br>To ensure this, we need your help testing it on a vary of server versions/settings.&lt;br>Get it&lt;br>&lt;a href="%1$s">via Play Store&lt;/a> (Sign up for testing)&lt;br>&lt;a href="%2$s">via F-Droid&lt;/a> (Manually look in the \"versions\" section.)</string>
+    <string name="participate_participate">&lt;b>Participate&lt;/b>&lt;br>Report issues on &lt;a href="https://github.com/nextcloud/android/issues">Github&lt;/a>&lt;br>Join the chat on IRC: &lt;a href="%1$s">#nextcloud-mobile&lt;/a>&lt;br>Help others on the &lt;a href="%2$s">forum&lt;/a></string>
+    <string name="participate_contribute">&lt;b>Contribute as a developer&lt;/b>&lt;br>Everybody is welcome to help us build this app. Just have a look at the open issues, read &lt;a href="%1$s">Contributing.md&lt;/a> or talk to us at &lt;a href="%2$s">#nextcloud-mobile&lt;/a> on IRC about what can be enhanced.</string>
+    <string name="participate_header"><b>Help us testing</b><br/>We offer two different previews of the upcoming version:</string>
     <plurals name="items_selected_count">
         <!--
              As a developer, you should always supply "one" and "other"

+ 12 - 4
src/com/owncloud/android/ui/activity/ParticipateActivity.java

@@ -1,16 +1,12 @@
 package com.owncloud.android.ui.activity;
 
-import android.app.Activity;
 import android.os.Bundle;
 import android.text.Html;
 import android.text.method.LinkMovementMethod;
-import android.text.util.Linkify;
 import android.view.MenuItem;
 import android.widget.TextView;
 
 import com.owncloud.android.R;
-import com.owncloud.android.datamodel.UploadsStorageManager;
-import com.owncloud.android.ui.fragment.UploadListFragment;
 
 /**
  * Created by tobi on 03.09.16.
@@ -34,21 +30,33 @@ public class ParticipateActivity extends FileActivity {
         TextView betaView = (TextView) findViewById(R.id.participate_betaView);
         if (betaView != null) {
             betaView.setMovementMethod(LinkMovementMethod.getInstance());
+            betaView.setText(Html.fromHtml(getString(R.string.participate_beta,
+                                           getString(R.string.fdroid_beta_link),
+                                           getString(R.string.beta_apk_link))));
         }
 
         TextView rcView = (TextView) findViewById(R.id.participate_rcView);
         if (rcView != null) {
             rcView.setMovementMethod(LinkMovementMethod.getInstance());
+            rcView.setText(Html.fromHtml(getString(R.string.participate_release_candidate,
+                                         getString(R.string.play_store_register_beta),
+                                         getString(R.string.fdroid_link))));
         }
 
         TextView participateView = (TextView) findViewById(R.id.participate_participateView);
         if (participateView != null) {
             participateView.setMovementMethod(LinkMovementMethod.getInstance());
+            participateView.setText(Html.fromHtml(getString(R.string.participate_participate,
+                                                  getString(R.string.irc_weblink),
+                                                  getString(R.string.help_link))));
         }
 
         TextView contributeView = (TextView) findViewById(R.id.participate_contributeView);
         if (contributeView != null) {
             contributeView.setMovementMethod(LinkMovementMethod.getInstance());
+            contributeView.setText(Html.fromHtml(getString(R.string.participate_contribute,
+                                                 getString(R.string.contributing_link),
+                                                 getString(R.string.irc_weblink))));
         }
     }