Browse Source

revamped participation activity content based on the feedback

Andy Scherzinger 8 years ago
parent
commit
07f5d9546e

BIN
res/drawable-xxxhdpi/fdroid.png


BIN
res/drawable-xxxhdpi/playstore.png


+ 84 - 16
res/layout/participate_layout.xml

@@ -46,42 +46,110 @@
                 android:padding="@dimen/standard_padding">
 
                 <TextView
-                    android:id="@+id/participate_header"
+                    android:id="@+id/participate_headline"
                     android:layout_width="fill_parent"
-                    android:layout_height="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:text="@string/participate_testing_headline"
+                    android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+                <TextView
+                    android:id="@+id/participate_testing_bug_text"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
                     android:paddingBottom="@dimen/standard_half_padding"
-                    android:text="@string/participate_header"
+                    android:text="@string/participate_testing_bug_text"
                     android:textAppearance="?android:attr/textAppearanceMedium"/>
 
+                <android.support.v7.widget.AppCompatButton
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:onClick="onReportIssueClick"
+                    android:text="@string/participate_testing_report_text"
+                    android:theme="@style/Button.Primary"/>
+
                 <TextView
-                    android:id="@+id/participate_betaView"
+                    android:id="@+id/participate_text"
                     android:layout_width="fill_parent"
-                    android:layout_height="fill_parent"
+                    android:layout_height="wrap_content"
                     android:paddingBottom="@dimen/standard_half_padding"
-                    android:text="@string/participate_beta"
+                    android:paddingTop="@dimen/standard_half_padding"
+                    android:text="@string/participate_testing_version_text"
                     android:textAppearance="?android:attr/textAppearanceMedium"/>
 
                 <TextView
-                    android:id="@+id/participate_rcView"
+                    android:id="@+id/participate_release_candidate_headline"
                     android:layout_width="fill_parent"
-                    android:layout_height="fill_parent"
-                    android:paddingBottom="@dimen/standard_half_padding"
-                    android:text="@string/participate_release_candidate"
+                    android:layout_height="wrap_content"
+                    android:text="@string/participate_release_candidate_headline"
+                    android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+                <TextView
+                    android:id="@+id/participate_release_candidate_text"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:text="@string/participate_release_candidate_text"
                     android:textAppearance="?android:attr/textAppearanceMedium"/>
 
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+
+                    <ImageButton
+                        android:id="@+id/participate_release_candidate_playstore"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@color/white"
+                        android:onClick="onGetRCPlayStoreClick"
+                        android:padding="0dp"
+                        android:src="@drawable/playstore"/>
+
+                    <ImageButton
+                        android:id="@+id/participate_release_candidate_fdroid"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@color/white"
+                        android:onClick="onGetRCFDroidClick"
+                        android:padding="0dp"
+                        android:src="@drawable/fdroid"/>
+
+                </LinearLayout>
+
                 <TextView
-                    android:id="@+id/participate_participateView"
+                    android:id="@+id/participate_beta_headline"
                     android:layout_width="fill_parent"
-                    android:layout_height="fill_parent"
-                    android:paddingBottom="@dimen/standard_half_padding"
-                    android:text="@string/participate_participate"
+                    android:layout_height="wrap_content"
+                    android:text="@string/participate_beta_headline"
+                    android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+                <TextView
+                    android:id="@+id/participate_beta_text"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:text="@string/participate_beta_text"
                     android:textAppearance="?android:attr/textAppearanceMedium"/>
 
+                <ImageButton
+                    android:id="@+id/participate_beta_fdroid"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:onClick="onGetBetaFDroidClick"
+                    android:padding="0dp"
+                    android:src="@drawable/fdroid"/>
+
+                <TextView
+                    android:id="@+id/participate_contribute_headline"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/participate_contribute_headline"
+                    android:textAppearance="?android:attr/textAppearanceLarge"/>
+
                 <TextView
-                    android:id="@+id/participate_contributeView"
+                    android:id="@+id/participate_contribute_text"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/participate_contribute"
+                    android:text="@string/participate_contribute_text"
+                    android:paddingLeft="@dimen/standard_half_padding"
                     android:textAppearance="?android:attr/textAppearanceMedium"/>
             </LinearLayout>
         </ScrollView>

+ 1 - 1
res/menu/drawer_menu.xml

@@ -70,7 +70,7 @@
             android:orderInCategory="3"
             android:id="@+id/nav_participate"
             android:icon="@drawable/ic_participate"
-            android:title="@string/actionbar_participate"/>
+            android:title="@string/drawer_participate"/>
     </group>
 
     <!--

+ 1 - 0
res/values/setup.xml

@@ -79,6 +79,7 @@
     <string name="irc_weblink" translatable="false">http://webchat.freenode.net?channels=nextcloud-mobile</string>
     <string name="help_link" translatable="false">https://help.nextcloud.com/c/clients/android</string>
     <string name="contributing_link" translatable="false">https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md</string>
+    <string name="report_issue_link" translatable="false">https://github.com/nextcloud/android/issues</string>
 
 </resources>
 

+ 15 - 6
res/values/strings.xml

@@ -469,12 +469,21 @@
     <string name="actionbar_search">Search</string>
     <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">&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>\nWe offer two different previews of the upcoming version:</string>
+    <string name="drawer_participate">Participate</string>
+    <string name="participate_testing_headline">Help us testing</string>
+    <string name="participate_testing_bug_text">Found a bug? Something is odd?</string>
+    <string name="participate_testing_report_text">Report an issue on Github</string>
+    <string name="participate_testing_version_text">Interested in helping us testing the next Version?</string>
+    <string name="participate_beta_headline">Test the Beta version</string>
+    <string name="participate_beta_text">This includes all upcoming features and is very bleeding edge. Bugs/errors can occur and if they do, please report them to us. &lt;a href="%2$s">Download the APK&lt;/a> or</string>
+    <string name="participate_release_candidate_headline">Release candidate</string>
+    <string name="participate_release_candidate_text">The release candidate (RC) is a snapshot of the upcoming
+        release and it is expected to be stable. Testing your individual setup could help to ensure this. Sign up for testing on the Play store or manually look in the \"versions\" section on F-Droid.</string>
+    <string name="participate_contribute_headline">Actively Contribute</string>
+    <string name="participate_contribute_text">&lt;ul>&lt;li>Join the chat on IRC: &lt;a
+        href="%1$s">#nextcloud-mobile&lt;/a>&lt;/li>&lt;li>Help others on the &lt;a
+        href="%2$s>forum&lt;/a>&lt;/li>&lt;li>Be part of the Team and contribute as a developer: &lt;a
+        href="https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md">Github CONTRIBUTING.md&lt;/a>&lt;/li&lt;/ul></string>
     <plurals name="items_selected_count">
         <!--
              As a developer, you should always supply "one" and "other"

+ 51 - 47
src/com/owncloud/android/ui/activity/ParticipateActivity.java

@@ -1,31 +1,33 @@
 /**
- *   Nextcloud Android client application
+ * Nextcloud Android client application
  *
- *   @author Andy Scherzinger
- *   @author Tobias Kaminsky
- *   Copyright (C) 2016 Andy Scherzinger
- *   Copyright (C) 2016 Nextcloud
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- *   License as published by the Free Software Foundation; either
- *   version 3 of the License, or any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- *   You should have received a copy of the GNU Affero General Public
- *   License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * @author Andy Scherzinger
+ * @author Tobias Kaminsky
+ * Copyright (C) 2016 Andy Scherzinger
+ * Copyright (C) 2016 Nextcloud
+ * <p/>
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ * <p/>
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ * <p/>
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package com.owncloud.android.ui.activity;
 
 import android.content.Intent;
+import android.net.Uri;
 import android.os.Bundle;
 import android.text.Html;
 import android.text.method.LinkMovementMethod;
 import android.view.MenuItem;
+import android.view.View;
 import android.widget.TextView;
 
 import com.owncloud.android.R;
@@ -46,43 +48,45 @@ public class ParticipateActivity extends FileActivity {
 
         // setup drawer
         setupDrawer(R.id.nav_participate);
-        getSupportActionBar().setTitle(getString(R.string.actionbar_participate));
+        getSupportActionBar().setTitle(getString(R.string.drawer_participate));
 
         setupContent();
     }
 
     private void setupContent() {
-        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 betaView = (TextView) findViewById(R.id.participate_beta_text);
+        betaView.setMovementMethod(LinkMovementMethod.getInstance());
+        betaView.setText(Html.fromHtml(getString(R.string.participate_beta_text,
+                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 rcView = (TextView) findViewById(R.id.participate_release_candidate_text);
+        rcView.setMovementMethod(LinkMovementMethod.getInstance());
 
-        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))));
-        }
+        TextView contributeView = (TextView) findViewById(R.id.participate_contribute_text);
+        contributeView.setMovementMethod(LinkMovementMethod.getInstance());
+        contributeView.setText(Html.fromHtml(
+                getString(R.string.participate_contribute_text,
+                        getString(R.string.irc_weblink),
+                        getString(R.string.help_link)
+                )));
+    }
+
+    public void onReportIssueClick(View view) {
+        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.report_issue_link))));
+    }
+
+    public void onGetBetaFDroidClick(View view) {
+        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.fdroid_beta_link))));
+    }
+
+    public void onGetRCFDroidClick(View view) {
+        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.fdroid_link))));
+    }
+
+    public void onGetRCPlayStoreClick(View view) {
+        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.play_store_register_beta))));
     }
 
     @Override