NotificationsActivity.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * Nextcloud Android client application
  3. *
  4. * @author Andy Scherzinger
  5. * Copyright (C) 2017 Andy Scherzinger
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. package com.owncloud.android.ui.activity;
  21. import android.os.Bundle;
  22. import android.view.MenuItem;
  23. import com.owncloud.android.R;
  24. import com.owncloud.android.lib.common.utils.Log_OC;
  25. /**
  26. * Activity displaying all server side stored activity items.
  27. */
  28. public class NotificationsActivity extends FileActivity {
  29. private static final String TAG = NotificationsActivity.class.getSimpleName();
  30. @Override
  31. protected void onCreate(Bundle savedInstanceState) {
  32. Log_OC.v(TAG, "onCreate() start");
  33. super.onCreate(savedInstanceState);
  34. setContentView(R.layout.notifications_layout);
  35. // setup toolbar
  36. setupToolbar();
  37. // setup drawer
  38. setupDrawer(R.id.nav_notifications);
  39. getSupportActionBar().setTitle(getString(R.string.drawer_item_notifications));
  40. setupContent();
  41. }
  42. /**
  43. * sets up the UI elements and loads all activity items.
  44. */
  45. private void setupContent() {
  46. // TODO add all (recycler) view relevant code + data loading + adapter etc.
  47. }
  48. @Override
  49. public boolean onOptionsItemSelected(MenuItem item) {
  50. boolean retval;
  51. switch (item.getItemId()) {
  52. case android.R.id.home:
  53. if (isDrawerOpen()) {
  54. closeDrawer();
  55. } else {
  56. openDrawer();
  57. }
  58. default:
  59. retval = super.onOptionsItemSelected(item);
  60. }
  61. return retval;
  62. }
  63. }