Browse Source

fix for triggering the main drawer menu items from "participate", changed participate icon and checkable behavior, don't show settings etc when showing accounts

Andy Scherzinger 8 năm trước cách đây
mục cha
commit
660e5a8923

+ 1 - 1
res/menu/drawer_menu.xml

@@ -60,7 +60,7 @@
     <!--
       all items in this group MUST have orderInCategory="3" set
     -->
-    <group>
+    <group android:id="@+id/drawer_menu_bottom" android:checkableBehavior="single">
         <item
             android:orderInCategory="3"
             android:id="@+id/nav_settings"

+ 7 - 7
res/values/setup.xml

@@ -72,13 +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>
+    <string name="fdroid_beta_link" translatable="false">https://f-droid.org/repository/browse/?fdid=com.nextcloud.android.beta</string>
+    <string name="beta_apk_link" translatable="false">https://github.com/nextcloud/android/raw/beta/apks/latest.apk</string>
+    <string name="play_store_register_beta" translatable="false">https://play.google.com/apps/testing/com.nextcloud.client</string>
+    <string name="fdroid_link" translatable="false">https://f-droid.org/repository/browse/?fdid=com.nextcloud.client</string>
+    <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>
 
 </resources>
 

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

@@ -524,10 +524,12 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
                 mAccountChooserToggle.setImageResource(R.drawable.ic_up);
                 mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true);
                 mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, false);
+                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, false);
             } else {
                 mAccountChooserToggle.setImageResource(R.drawable.ic_down);
                 mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false);
                 mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, true);
+                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, true);
             }
         }
     }

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

@@ -1,5 +1,27 @@
+/**
+ *   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/>.
+ */
 package com.owncloud.android.ui.activity;
 
+import android.content.Intent;
 import android.os.Bundle;
 import android.text.Html;
 import android.text.method.LinkMovementMethod;
@@ -9,7 +31,7 @@ import android.widget.TextView;
 import com.owncloud.android.R;
 
 /**
- * Created by tobi on 03.09.16.
+ * Activity providing information about ways to participate in the app's development.
  */
 public class ParticipateActivity extends FileActivity {
 
@@ -24,9 +46,12 @@ public class ParticipateActivity extends FileActivity {
 
         // setup drawer
         setupDrawer(R.id.nav_participate);
-
         getSupportActionBar().setTitle(getString(R.string.actionbar_participate));
 
+        setupContent();
+    }
+
+    private void setupContent() {
         TextView betaView = (TextView) findViewById(R.id.participate_betaView);
         if (betaView != null) {
             betaView.setMovementMethod(LinkMovementMethod.getInstance());
@@ -62,14 +87,28 @@ public class ParticipateActivity extends FileActivity {
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
-        if (item.getItemId() == android.R.id.home) {
+        boolean retval;
+        switch (item.getItemId()) {
+            case android.R.id.home: {
                 if (isDrawerOpen()) {
                     closeDrawer();
                 } else {
                     openDrawer();
                 }
+            }
+
+            default:
+                retval = super.onOptionsItemSelected(item);
         }
+        return retval;
+    }
 
-        return true;
+    @Override
+    public void showFiles(boolean onDeviceOnly) {
+        super.showFiles(onDeviceOnly);
+        Intent fileDisplayActivity = new Intent(getApplicationContext(),
+                FileDisplayActivity.class);
+        fileDisplayActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        startActivity(fileDisplayActivity);
     }
 }