From: David A. Velasco Date: Wed, 23 Oct 2013 14:42:48 +0000 (+0200) Subject: Removed unused menu a preference resources, and related code X-Git-Tag: oc-android-1.5.5~144^2~4 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/528db9b1928051a7f1a4ea4340ee910d3a2c4cff?ds=inline;hp=--cc Removed unused menu a preference resources, and related code --- 528db9b1928051a7f1a4ea4340ee910d3a2c4cff diff --git a/res/menu/session_context_menu.xml b/res/menu/session_context_menu.xml deleted file mode 100644 index e488902b..00000000 --- a/res/menu/session_context_menu.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/res/xml/preferences_new_session.xml b/res/xml/preferences_new_session.xml deleted file mode 100644 index 8327bf09..00000000 --- a/res/xml/preferences_new_session.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 56c23349..0d96becb 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/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); diff --git a/src/com/owncloud/android/ui/activity/PreferencesNewSession.java b/src/com/owncloud/android/ui/activity/PreferencesNewSession.java deleted file mode 100644 index c43b29f2..00000000 --- a/src/com/owncloud/android/ui/activity/PreferencesNewSession.java +++ /dev/null @@ -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 . - * - */ - -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(); - } - -}