Removed unused menu a preference resources, and related code
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 23 Oct 2013 14:42:48 +0000 (16:42 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 23 Oct 2013 14:42:48 +0000 (16:42 +0200)
res/menu/session_context_menu.xml [deleted file]
res/xml/preferences_new_session.xml [deleted file]
src/com/owncloud/android/ui/activity/Preferences.java
src/com/owncloud/android/ui/activity/PreferencesNewSession.java [deleted file]

diff --git a/res/menu/session_context_menu.xml b/res/menu/session_context_menu.xml
deleted file mode 100644 (file)
index e488902..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ownCloud Android client application
-
-  Copyright (C) 2012  Bartek Przybylski
-  Copyright (C) 2012-2013 ownCloud Inc.
-
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License version 2,
-  as published by the Free Software Foundation.
-
-  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 General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-<menu
-  xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/SessionContextEdit" android:title="Edit"></item>
-    <item android:id="@+id/SessionContextRemove" android:title="REmove"></item>
-</menu>
diff --git a/res/xml/preferences_new_session.xml b/res/xml/preferences_new_session.xml
deleted file mode 100644 (file)
index 8327bf0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ownCloud Android client application
-
-  Copyright (C) 2012  Bartek Przybylski
-  Copyright (C) 2012-2013 ownCloud Inc.
-
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License version 2,
-  as published by the Free Software Foundation.
-
-  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 General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-<PreferenceScreen
-  xmlns:android="http://schemas.android.com/apk/res/android">
-    <EditTextPreference></EditTextPreference>
-    <EditTextPreference></EditTextPreference>
-</PreferenceScreen>
index 56c2334..0d96bec 100644 (file)
@@ -281,21 +281,6 @@ public class Preferences extends SherlockPreferenceActivity {
         Intent intent;
 
         switch (item.getItemId()) {
         Intent intent;
 
         switch (item.getItemId()) {
-        //case R.id.addSessionItem:
-        case 1:
-            intent = new Intent(this, PreferencesNewSession.class);
-            startActivityForResult(intent, mNewSession);
-            break;
-        case R.id.SessionContextEdit:
-            intent = new Intent(this, PreferencesNewSession.class);
-            intent.putExtra("sessionId", mSessions.get(mSelectedMenuItem)
-                    .getEntryId());
-            intent.putExtra("sessionName", mSessions.get(mSelectedMenuItem)
-                    .getName());
-            intent.putExtra("sessionURL", mSessions.get(mSelectedMenuItem)
-                    .getUrl());
-            startActivityForResult(intent, mEditSession);
-            break;
         case android.R.id.home:
             intent = new Intent(getBaseContext(), FileDisplayActivity.class);
             intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
         case android.R.id.home:
             intent = new Intent(getBaseContext(), FileDisplayActivity.class);
             intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
diff --git a/src/com/owncloud/android/ui/activity/PreferencesNewSession.java b/src/com/owncloud/android/ui/activity/PreferencesNewSession.java
deleted file mode 100644 (file)
index c43b29f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/* ownCloud Android client application\r
- *   Copyright (C) 2012 Bartek Przybylski\r
- *   Copyright (C) 2012-2013 ownCloud Inc.\r
- *\r
- *   This program is free software: you can redistribute it and/or modify\r
- *   it under the terms of the GNU General Public License version 2,\r
- *   as published by the Free Software Foundation.\r
- *\r
- *   This program is distributed in the hope that it will be useful,\r
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *   GNU General Public License for more details.\r
- *\r
- *   You should have received a copy of the GNU General Public License\r
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- *\r
- */\r
-\r
-package com.owncloud.android.ui.activity;\r
-\r
-import android.accounts.AccountAuthenticatorActivity;\r
-import android.app.Activity;\r
-import android.os.Bundle;\r
-import android.view.View;\r
-import android.view.View.OnClickListener;\r
-\r
-public class PreferencesNewSession extends AccountAuthenticatorActivity\r
-        implements OnClickListener {\r
-    @Override\r
-    public void onCreate(Bundle savedInstanceState) {\r
-        super.onCreate(savedInstanceState);\r
-        // setContentView(R.layout.add_new_session);\r
-        /*\r
-         * EditText et;// = (EditText)\r
-         * findViewById(R.id.newSession_sessionName);\r
-         * \r
-         * et = (EditText) findViewById(R.id.newSession_URL); if\r
-         * (getIntent().hasExtra("sessionURL")) { try { URI uri = new\r
-         * URI(getIntent().getStringExtra("sessionURL")); String url =\r
-         * uri.getHost(); if (uri.getPort() != -1) { url += ":" +\r
-         * String.valueOf(uri.getPort()); } if (uri.getPath() != null) { url +=\r
-         * uri.getPath(); } else { url += "/"; } et.setText(url); et =\r
-         * (EditText) findViewById(R.id.newSession_username); if\r
-         * (uri.getAuthority() != null) { if (uri.getUserInfo().indexOf(':') !=\r
-         * -1) { et.setText(uri.getUserInfo().substring(0,\r
-         * uri.getUserInfo().indexOf(':'))); et = (EditText)\r
-         * findViewById(R.id.newSession_password);\r
-         * et.setText(uri.getUserInfo().substring\r
-         * (uri.getUserInfo().indexOf(':')+1)); } else {\r
-         * et.setText(uri.getUserInfo()); } }\r
-         * \r
-         * } catch (URISyntaxException e) { Log.e(TAG, "Incorrect URI syntax " +\r
-         * e.getLocalizedMessage()); } }\r
-         * \r
-         * mReturnData = new Intent(); setResult(Activity.RESULT_OK,\r
-         * mReturnData); ((Button)\r
-         * findViewById(R.id.button1)).setOnClickListener(this); ((Button)\r
-         * findViewById(R.id.button2)).setOnClickListener(this);\r
-         */\r
-    }\r
-\r
-    @Override\r
-    protected void onResume() {\r
-        super.onResume();\r
-    }\r
-\r
-    public void onClick(View v) {\r
-        /*\r
-         * switch (v.getId()) { case R.id.button1: Intent intent = new Intent();\r
-         * if (getIntent().hasExtra("sessionId")) { intent.putExtra("sessionId",\r
-         * getIntent().getIntExtra("sessionId", -1)); } //String sessionName =\r
-         * ((EditText)\r
-         * findViewById(R.id.newSession_sessionName)).getText().toString(); //\r
-         * if (sessionName.trim().equals("") || !isNameValid(sessionName)) { //\r
-         * Toast.makeText(this, R.string.new_session_session_name_error,\r
-         * Toast.LENGTH_LONG).show(); // break; // } URI uri = prepareURI(); if\r
-         * (uri != null) { //intent.putExtra("sessionName", sessionName);\r
-         * intent.putExtra("sessionURL", uri.toString());\r
-         * setResult(Activity.RESULT_OK, intent); AccountManager accMgr =\r
-         * AccountManager.get(this); Account a = new Account("OwnCloud",\r
-         * AccountAuthenticatorService.ACCOUNT_TYPE);\r
-         * accMgr.addAccountExplicitly(a, "asd", null); finish(); } break; case\r
-         * R.id.button2: setResult(Activity.RESULT_CANCELED); finish(); break; }\r
-         */\r
-    }\r
-\r
-    /*\r
-     * private URI prepareURI() { URI uri = null; String url = ""; try { String\r
-     * username = ((EditText)\r
-     * findViewById(R.id.newSession_username)).getText().toString().trim();\r
-     * String password = ((EditText)\r
-     * findViewById(R.id.newSession_password)).getText().toString().trim();\r
-     * String hostname = ((EditText)\r
-     * findViewById(R.id.newSession_URL)).getText().toString().trim(); String\r
-     * scheme; if (hostname.matches("[A-Za-z]://")) { scheme =\r
-     * hostname.substring(0, hostname.indexOf("://")+3); hostname =\r
-     * hostname.substring(hostname.indexOf("://")+3); } else { scheme =\r
-     * "http://"; } if (!username.equals("")) { if (!password.equals("")) {\r
-     * username += ":" + password + "@"; } else { username += "@"; } } url =\r
-     * scheme + username + hostname; Log.i(TAG, url); uri = new URI(url); }\r
-     * catch (URISyntaxException e) { Log.e(TAG, "Incorrect URI syntax " +\r
-     * e.getLocalizedMessage()); Toast.makeText(this,\r
-     * R.string.new_session_uri_error, Toast.LENGTH_LONG).show(); } return uri;\r
-     * }\r
-     * \r
-     * private boolean isNameValid(String string) { return\r
-     * string.matches("[A-Za-z0-9 _-]*"); }\r
-     */\r
-\r
-    @Override\r
-    public void onBackPressed() {\r
-        setResult(Activity.RESULT_CANCELED);\r
-        super.onBackPressed();\r
-    }\r
-\r
-}\r