Browse Source

initial navigation setup for menu and activity

Andy Scherzinger 8 years ago
parent
commit
30669c9677

+ 2 - 0
AndroidManifest.xml

@@ -74,8 +74,10 @@
         </activity>
         <activity android:name=".ui.activity.ManageAccountsActivity" />
         <activity android:name=".ui.activity.ParticipateActivity" />
+        <activity android:name=".ui.activity.FolderSyncActivity" />
         <activity android:name=".ui.activity.UploadFilesActivity" />
         <activity android:name=".ui.activity.ReceiveExternalFilesActivity"
+                  
                   android:taskAffinity=""
                   android:excludeFromRecents="true"
                   android:theme="@style/Theme.ownCloud.NoActionBar">

BIN
res/drawable-hdpi/ic_cloud_check.png


BIN
res/drawable-hdpi/ic_uploads.png


BIN
res/drawable-mdpi/ic_cloud_check.png


BIN
res/drawable-xhdpi/ic_cloud_check.png


BIN
res/drawable-xxhdpi/ic_cloud_check.png


BIN
res/drawable-xxxhdpi/ic_cloud_check.png


+ 65 - 0
res/layout/folder_sync_layout.xml

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  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/>.
+-->
+<android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout"
+                                        xmlns:android="http://schemas.android.com/apk/res/android"
+                                        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:id="@+id/scrollView"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:padding="@dimen/standard_padding">
+
+                <TextView
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:text="TODO"
+                    android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+            </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

@@ -37,6 +37,11 @@
             android:id="@+id/nav_uploads"
             android:icon="@drawable/ic_uploads"
             android:title="@string/drawer_item_uploads_list"/>
+        <item
+            android:orderInCategory="0"
+            android:id="@+id/nav_folder_sync"
+            android:icon="@drawable/ic_cloud_check"
+            android:title="@string/drawer_folder_sync"/>
     </group>
 
     <!--

+ 1 - 0
res/values/strings.xml

@@ -475,6 +475,7 @@
     <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="drawer_folder_sync">Folder Sync</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>

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

@@ -267,6 +267,10 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
                                 uploadListIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                                 startActivity(uploadListIntent);
                                 break;
+                            case R.id.nav_folder_sync:
+                                Intent folderSyncIntent = new Intent(getApplicationContext(),FolderSyncActivity.class);
+                                startActivity(folderSyncIntent);
+                                break;
                             case R.id.nav_settings:
                                 Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class);
                                 startActivity(settingsIntent);

+ 68 - 0
src/com/owncloud/android/ui/activity/FolderSyncActivity.java

@@ -0,0 +1,68 @@
+package com.owncloud.android.ui.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import com.owncloud.android.MainApp;
+import com.owncloud.android.R;
+
+/**
+ * Activity displaying all auto-synced folders and/or instant upload media folders.
+ */
+public class FolderSyncActivity extends DrawerActivity {
+    private static final String TAG = FolderSyncActivity.class.getSimpleName();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.folder_sync_layout);
+
+        // setup toolbar
+        setupToolbar();
+
+        // setup drawer
+        setupDrawer(R.id.nav_folder_sync);
+        getSupportActionBar().setTitle(getString(R.string.drawer_folder_sync));
+
+        setupContent();
+    }
+
+    private void setupContent() {
+        // TODO setup/initialize UI
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        boolean retval;
+        switch (item.getItemId()) {
+            case android.R.id.home: {
+                if (isDrawerOpen()) {
+                    closeDrawer();
+                } else {
+                    openDrawer();
+                }
+            }
+
+            default:
+                retval = super.onOptionsItemSelected(item);
+        }
+        return retval;
+    }
+
+    @Override
+    public void restart() {
+        Intent i = new Intent(this, FileDisplayActivity.class);
+        i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        startActivity(i);
+    }
+
+    @Override
+    public void showFiles(boolean onDeviceOnly) {
+        MainApp.showOnlyFilesOnDevice(onDeviceOnly);
+        Intent fileDisplayActivity = new Intent(getApplicationContext(), FileDisplayActivity.class);
+        fileDisplayActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        startActivity(fileDisplayActivity);
+    }
+}