Browse Source

Removed unused menu a preference resources, and related code

David A. Velasco 11 years ago
parent
commit
528db9b192

+ 0 - 24
res/menu/session_context_menu.xml

@@ -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>

+ 0 - 24
res/xml/preferences_new_session.xml

@@ -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>

+ 0 - 15
src/com/owncloud/android/ui/activity/Preferences.java

@@ -281,21 +281,6 @@ public class Preferences extends SherlockPreferenceActivity {
         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);

+ 0 - 116
src/com/owncloud/android/ui/activity/PreferencesNewSession.java

@@ -1,116 +0,0 @@
-/* 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/>.
- *
- */
-
-package com.owncloud.android.ui.activity;
-
-import android.accounts.AccountAuthenticatorActivity;
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.View;
-import android.view.View.OnClickListener;
-
-public class PreferencesNewSession extends AccountAuthenticatorActivity
-        implements OnClickListener {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        // setContentView(R.layout.add_new_session);
-        /*
-         * EditText et;// = (EditText)
-         * findViewById(R.id.newSession_sessionName);
-         * 
-         * et = (EditText) findViewById(R.id.newSession_URL); if
-         * (getIntent().hasExtra("sessionURL")) { try { URI uri = new
-         * URI(getIntent().getStringExtra("sessionURL")); String url =
-         * uri.getHost(); if (uri.getPort() != -1) { url += ":" +
-         * String.valueOf(uri.getPort()); } if (uri.getPath() != null) { url +=
-         * uri.getPath(); } else { url += "/"; } et.setText(url); et =
-         * (EditText) findViewById(R.id.newSession_username); if
-         * (uri.getAuthority() != null) { if (uri.getUserInfo().indexOf(':') !=
-         * -1) { et.setText(uri.getUserInfo().substring(0,
-         * uri.getUserInfo().indexOf(':'))); et = (EditText)
-         * findViewById(R.id.newSession_password);
-         * et.setText(uri.getUserInfo().substring
-         * (uri.getUserInfo().indexOf(':')+1)); } else {
-         * et.setText(uri.getUserInfo()); } }
-         * 
-         * } catch (URISyntaxException e) { Log.e(TAG, "Incorrect URI syntax " +
-         * e.getLocalizedMessage()); } }
-         * 
-         * mReturnData = new Intent(); setResult(Activity.RESULT_OK,
-         * mReturnData); ((Button)
-         * findViewById(R.id.button1)).setOnClickListener(this); ((Button)
-         * findViewById(R.id.button2)).setOnClickListener(this);
-         */
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-    }
-
-    public void onClick(View v) {
-        /*
-         * switch (v.getId()) { case R.id.button1: Intent intent = new Intent();
-         * if (getIntent().hasExtra("sessionId")) { intent.putExtra("sessionId",
-         * getIntent().getIntExtra("sessionId", -1)); } //String sessionName =
-         * ((EditText)
-         * findViewById(R.id.newSession_sessionName)).getText().toString(); //
-         * if (sessionName.trim().equals("") || !isNameValid(sessionName)) { //
-         * Toast.makeText(this, R.string.new_session_session_name_error,
-         * Toast.LENGTH_LONG).show(); // break; // } URI uri = prepareURI(); if
-         * (uri != null) { //intent.putExtra("sessionName", sessionName);
-         * intent.putExtra("sessionURL", uri.toString());
-         * setResult(Activity.RESULT_OK, intent); AccountManager accMgr =
-         * AccountManager.get(this); Account a = new Account("OwnCloud",
-         * AccountAuthenticatorService.ACCOUNT_TYPE);
-         * accMgr.addAccountExplicitly(a, "asd", null); finish(); } break; case
-         * R.id.button2: setResult(Activity.RESULT_CANCELED); finish(); break; }
-         */
-    }
-
-    /*
-     * private URI prepareURI() { URI uri = null; String url = ""; try { String
-     * username = ((EditText)
-     * findViewById(R.id.newSession_username)).getText().toString().trim();
-     * String password = ((EditText)
-     * findViewById(R.id.newSession_password)).getText().toString().trim();
-     * String hostname = ((EditText)
-     * findViewById(R.id.newSession_URL)).getText().toString().trim(); String
-     * scheme; if (hostname.matches("[A-Za-z]://")) { scheme =
-     * hostname.substring(0, hostname.indexOf("://")+3); hostname =
-     * hostname.substring(hostname.indexOf("://")+3); } else { scheme =
-     * "http://"; } if (!username.equals("")) { if (!password.equals("")) {
-     * username += ":" + password + "@"; } else { username += "@"; } } url =
-     * scheme + username + hostname; Log.i(TAG, url); uri = new URI(url); }
-     * catch (URISyntaxException e) { Log.e(TAG, "Incorrect URI syntax " +
-     * e.getLocalizedMessage()); Toast.makeText(this,
-     * R.string.new_session_uri_error, Toast.LENGTH_LONG).show(); } return uri;
-     * }
-     * 
-     * private boolean isNameValid(String string) { return
-     * string.matches("[A-Za-z0-9 _-]*"); }
-     */
-
-    @Override
-    public void onBackPressed() {
-        setResult(Activity.RESULT_CANCELED);
-        super.onBackPressed();
-    }
-
-}