mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
initial navigation setup for menu and activity
This commit is contained in:
parent
9f67ced1dd
commit
cf4498d17c
12 changed files with 145 additions and 0 deletions
|
@ -74,8 +74,10 @@
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".ui.activity.ManageAccountsActivity" />
|
<activity android:name=".ui.activity.ManageAccountsActivity" />
|
||||||
<activity android:name=".ui.activity.ParticipateActivity" />
|
<activity android:name=".ui.activity.ParticipateActivity" />
|
||||||
|
<activity android:name=".ui.activity.FolderSyncActivity" />
|
||||||
<activity android:name=".ui.activity.UploadFilesActivity" />
|
<activity android:name=".ui.activity.UploadFilesActivity" />
|
||||||
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
|
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
|
||||||
|
|
||||||
android:taskAffinity=""
|
android:taskAffinity=""
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:theme="@style/Theme.ownCloud.NoActionBar">
|
android:theme="@style/Theme.ownCloud.NoActionBar">
|
||||||
|
|
BIN
res/drawable-hdpi/ic_cloud_check.png
Normal file
BIN
res/drawable-hdpi/ic_cloud_check.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 820 B |
BIN
res/drawable-hdpi/ic_uploads.png
Normal file
BIN
res/drawable-hdpi/ic_uploads.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 284 B |
BIN
res/drawable-mdpi/ic_cloud_check.png
Normal file
BIN
res/drawable-mdpi/ic_cloud_check.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 608 B |
BIN
res/drawable-xhdpi/ic_cloud_check.png
Normal file
BIN
res/drawable-xhdpi/ic_cloud_check.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
BIN
res/drawable-xxhdpi/ic_cloud_check.png
Normal file
BIN
res/drawable-xxhdpi/ic_cloud_check.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
res/drawable-xxxhdpi/ic_cloud_check.png
Normal file
BIN
res/drawable-xxxhdpi/ic_cloud_check.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
65
res/layout/folder_sync_layout.xml
Normal file
65
res/layout/folder_sync_layout.xml
Normal file
|
@ -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>
|
|
@ -37,6 +37,11 @@
|
||||||
android:id="@+id/nav_uploads"
|
android:id="@+id/nav_uploads"
|
||||||
android:icon="@drawable/ic_uploads"
|
android:icon="@drawable/ic_uploads"
|
||||||
android:title="@string/drawer_item_uploads_list"/>
|
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>
|
</group>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -475,6 +475,7 @@
|
||||||
<string name="actionbar_search">Search</string>
|
<string name="actionbar_search">Search</string>
|
||||||
<string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
|
<string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
|
||||||
<string name="learn_more">Learn more</string>
|
<string name="learn_more">Learn more</string>
|
||||||
|
<string name="drawer_folder_sync">Folder Sync</string>
|
||||||
<string name="drawer_participate">Participate</string>
|
<string name="drawer_participate">Participate</string>
|
||||||
<string name="participate_testing_headline">Help us testing</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_bug_text">Found a bug? Something is odd?</string>
|
||||||
|
|
|
@ -267,6 +267,10 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
||||||
uploadListIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
uploadListIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
startActivity(uploadListIntent);
|
startActivity(uploadListIntent);
|
||||||
break;
|
break;
|
||||||
|
case R.id.nav_folder_sync:
|
||||||
|
Intent folderSyncIntent = new Intent(getApplicationContext(),FolderSyncActivity.class);
|
||||||
|
startActivity(folderSyncIntent);
|
||||||
|
break;
|
||||||
case R.id.nav_settings:
|
case R.id.nav_settings:
|
||||||
Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class);
|
Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class);
|
||||||
startActivity(settingsIntent);
|
startActivity(settingsIntent);
|
||||||
|
|
68
src/com/owncloud/android/ui/activity/FolderSyncActivity.java
Normal file
68
src/com/owncloud/android/ui/activity/FolderSyncActivity.java
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue