WiP activity for notifications

This commit is contained in:
AndyScherzinger 2017-03-27 00:55:20 +02:00
parent 4efc1c0d83
commit e2c0688beb
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
6 changed files with 187 additions and 1 deletions

View File

@ -76,6 +76,7 @@
</activity>
<activity android:name=".ui.activity.ManageAccountsActivity" />
<activity android:name=".ui.activity.UserInfoActivity" />
<activity android:name=".ui.activity.NotificationsActivity" />
<activity android:name=".ui.activity.ParticipateActivity" />
<activity android:name=".ui.activity.ActivitiesListActivity"/>
<activity android:name=".ui.activity.FolderSyncActivity" />

View File

@ -405,7 +405,10 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
activityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(activityIntent);
break;
case R.id.nav_folder_sync:
case R.id.nav_notifications:
Intent notificationsIntent = new Intent(getApplicationContext(), NotificationsActivity.class);
startActivity(notificationsIntent);
break; case R.id.nav_folder_sync:
Intent folderSyncIntent = new Intent(getApplicationContext(), FolderSyncActivity.class);
startActivity(folderSyncIntent);
break;

View File

@ -0,0 +1,78 @@
/**
* Nextcloud Android client application
*
* @author Andy Scherzinger
* Copyright (C) 2017 Andy Scherzinger
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) 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.os.Bundle;
import android.view.MenuItem;
import com.owncloud.android.R;
import com.owncloud.android.lib.common.utils.Log_OC;
/**
* Activity displaying all server side stored activity items.
*/
public class NotificationsActivity extends FileActivity {
private static final String TAG = NotificationsActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
Log_OC.v(TAG, "onCreate() start");
super.onCreate(savedInstanceState);
setContentView(R.layout.notifications_layout);
// setup toolbar
setupToolbar();
// setup drawer
setupDrawer(R.id.nav_notifications);
getSupportActionBar().setTitle(getString(R.string.drawer_item_notifications));
setupContent();
}
/**
* sets up the UI elements and loads all activity items.
*/
private void setupContent() {
// TODO add all (recycler) view relevant code + data loading + adapter etc.
}
@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;
}
}

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Nextcloud Android client application
Copyright (C) 2017 Andy Scherzinger
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"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical"
android:visibility="visible"
android:layout_marginRight="-3dp"
android:layout_marginLeft="-3dp"
android:layout_marginBottom="-3dp"/>
<LinearLayout
android:id="@android:id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ProgressBar
android:id="@+id/notificationsSyncProgressBar"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="center_horizontal"/>
<TextView
android:id="@+id/progressText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="@dimen/standard_half_margin"
android:text="@string/notifications_loading_activity"
android:textSize="26sp"/>
</LinearLayout>
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="@dimen/standard_margin"
android:gravity="center"
android:text="@string/notifications_no_results"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
<include
layout="@layout/drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"/>
</android.support.v4.widget.DrawerLayout>

View File

@ -73,6 +73,11 @@
android:orderInCategory="0"
android:title="@string/drawer_item_recently_modified"
android:visible="false"/>
<item
android:orderInCategory="0"
android:id="@+id/nav_notifications"
android:icon="@drawable/ic_notification"
android:title="@string/drawer_item_notifications"/>
<item
android:orderInCategory="0"
android:id="@+id/nav_folder_sync"

View File

@ -34,6 +34,7 @@
<string name="drawer_item_settings">Settings</string>
<string name="drawer_item_uploads_list">Uploads</string>
<string name="drawer_item_activities">Activities</string>
<string name="drawer_item_notifications">Notifications</string>
<string name="drawer_quota">%1$s of %2$s used</string>
<string name="drawer_close">Close</string>
<string name="drawer_open">Open</string>
@ -580,6 +581,9 @@
<string name="activity_list_loading_activity">Loading activities&#8230;</string>
<string name="activity_list_no_results">No activities found.</string>
<string name="notifications_loading_activity">Loading notifications&#8230;</string>
<string name="notifications_no_results">No notifications.</string>
<string name="upload_file_dialog_title">Input upload filename and filetype</string>
<string name="upload_file_dialog_filename">Filename</string>
<string name="upload_file_dialog_filetype">Filetype</string>