tobiasKaminsky 8 жил өмнө
parent
commit
a24f89be16

+ 1 - 0
AndroidManifest.xml

@@ -73,6 +73,7 @@
             </intent-filter>
         </activity>
         <activity android:name=".ui.activity.ManageAccountsActivity" />
+        <activity android:name=".ui.activity.ParticipateActivity" />
         <activity android:name=".ui.activity.UploadFilesActivity" />
         <activity android:name=".ui.activity.ReceiveExternalFilesActivity"
                   android:taskAffinity=""

+ 100 - 0
res/layout/participate_layout.xml

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ownCloud Android client application
+
+  Copyright (C) 2016 ownCloud Inc.
+
+  This program is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License version 2,
+  as published by the Free Software Foundation.
+
+  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 General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/drawer_layout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clickable="true"
+    android:fitsSystemWindows="true">
+
+    <!-- The main content view -->
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <include
+            layout="@layout/toolbar_standard"/>
+
+        <ScrollView
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:id="@+id/scrollView">
+
+            <LinearLayout
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <TextView
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:text="@string/participate_header"
+                    android:id="@+id/participate_header"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:layout_margin="5dp"
+                    android:layout_marginBottom="10dp"/>
+
+                <TextView
+                    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"/>
+
+                <TextView
+                    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"/>
+
+                <TextView
+                    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"/>
+
+                <TextView
+                    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"/>
+            </LinearLayout>
+        </ScrollView>
+
+    </LinearLayout>
+
+    <include
+        layout="@layout/drawer"
+        android:layout_width="240dp"
+        android:layout_height="match_parent"
+        android:layout_gravity="start"/>
+
+</android.support.v4.widget.DrawerLayout>

+ 5 - 0
res/menu/drawer_menu.xml

@@ -66,6 +66,11 @@
             android:id="@+id/nav_settings"
             android:icon="@drawable/ic_settings"
             android:title="@string/actionbar_settings"/>
+        <item
+            android:orderInCategory="3"
+            android:id="@+id/nav_participate"
+            android:icon="@drawable/file_vcard"
+            android:title="@string/actionbar_participate"/>
     </group>
 
     <!--

+ 3 - 0
res/values/setup.xml

@@ -71,6 +71,9 @@
     <!--Destination mail for sending log files -->
     <string name="mail_logger"></string>
 
+    <!-- Participate links -->
+    <string name="beta_apk_link">https://github.com/nextcloud/android/raw/beta/apks/latest.apk</string>
+
 </resources>
 
 

+ 6 - 0
res/values/strings.xml

@@ -469,6 +469,12 @@
     <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"><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>
     <plurals name="items_selected_count">
         <!--
              As a developer, you should always supply "one" and "other"

+ 5 - 0
src/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -272,6 +272,11 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
                                         Preferences.class);
                                 startActivity(settingsIntent);
                                 break;
+                            case R.id.nav_participate:
+                                Intent participateIntent = new Intent(getApplicationContext(),
+                                        ParticipateActivity.class);
+                                startActivity(participateIntent);
+                                break;
                             case R.id.drawer_menu_account_add:
                                 createAccount();
                                 break;

+ 67 - 0
src/com/owncloud/android/ui/activity/ParticipateActivity.java

@@ -0,0 +1,67 @@
+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.
+ */
+public class ParticipateActivity extends FileActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.participate_layout);
+
+        // setup toolbar
+        setupToolbar();
+
+        // setup drawer
+        setupDrawer(R.id.nav_participate);
+
+        getSupportActionBar().setTitle(getString(R.string.actionbar_participate));
+
+        TextView betaView = (TextView) findViewById(R.id.participate_betaView);
+        if (betaView != null) {
+            betaView.setMovementMethod(LinkMovementMethod.getInstance());
+        }
+
+        TextView rcView = (TextView) findViewById(R.id.participate_rcView);
+        if (rcView != null) {
+            rcView.setMovementMethod(LinkMovementMethod.getInstance());
+        }
+
+        TextView participateView = (TextView) findViewById(R.id.participate_participateView);
+        if (participateView != null) {
+            participateView.setMovementMethod(LinkMovementMethod.getInstance());
+        }
+
+        TextView contributeView = (TextView) findViewById(R.id.participate_contributeView);
+        if (contributeView != null) {
+            contributeView.setMovementMethod(LinkMovementMethod.getInstance());
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+                if (isDrawerOpen()) {
+                    closeDrawer();
+                } else {
+                    openDrawer();
+                }
+        }
+
+        return true;
+    }
+}