From 5d6ba2495ac456ca5b3c2f943bb2af909494f4c4 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Wed, 23 Oct 2013 11:15:44 +0200 Subject: [PATCH] Removed unused code for ownCloud extensions and strings related --- AndroidManifest.xml | 2 - res/values/strings.xml | 5 +- .../ExtensionsAvailableActivity.java | 35 ---- .../extensions/ExtensionsAvailableDialog.java | 68 -------- .../extensions/ExtensionsListActivity.java | 155 ------------------ 5 files changed, 1 insertion(+), 264 deletions(-) delete mode 100644 src/com/owncloud/android/extensions/ExtensionsAvailableActivity.java delete mode 100644 src/com/owncloud/android/extensions/ExtensionsAvailableDialog.java delete mode 100644 src/com/owncloud/android/extensions/ExtensionsListActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ac8c150693..951301ecb1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -153,8 +153,6 @@ - - diff --git a/res/values/strings.xml b/res/values/strings.xml index 124c42f544..f3f78c293d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -105,7 +105,6 @@ "Local: %1$s" "Remote: %1$s" There is not space enough to copy the selected files into the %1$s folder. Would like to move them into instead? - %1$s cannot track your device. Please check your location settings Please, insert your App PIN Enter your App PIN The PIN will be requested every time the app is started @@ -165,8 +164,6 @@ The server does not support this authentication method This version of ownCloud doesn\'t support multiaccount - Extensions available! - Looks like your server instance is supporting advanced extensions. Would you like to see extensions available for android ? Keep file up to date Rename Remove @@ -188,7 +185,7 @@ "Unexpected problem ; please select the file from a different app" No file was selected - Login with oAuth2. + Login with oAuth2 Connecting to oAuth2 server… The identity of the site could not be verified diff --git a/src/com/owncloud/android/extensions/ExtensionsAvailableActivity.java b/src/com/owncloud/android/extensions/ExtensionsAvailableActivity.java deleted file mode 100644 index 7b39931ce9..0000000000 --- a/src/com/owncloud/android/extensions/ExtensionsAvailableActivity.java +++ /dev/null @@ -1,35 +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.extensions; - -import android.os.Bundle; -import android.support.v4.app.FragmentManager; - -import com.actionbarsherlock.app.SherlockFragmentActivity; - -public class ExtensionsAvailableActivity extends SherlockFragmentActivity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - FragmentManager fm = getSupportFragmentManager(); - ExtensionsAvailableDialog ead = new ExtensionsAvailableDialog(); - ead.show(fm, "extensions_available_dialog"); - } -} diff --git a/src/com/owncloud/android/extensions/ExtensionsAvailableDialog.java b/src/com/owncloud/android/extensions/ExtensionsAvailableDialog.java deleted file mode 100644 index 15db896b89..0000000000 --- a/src/com/owncloud/android/extensions/ExtensionsAvailableDialog.java +++ /dev/null @@ -1,68 +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.extensions; - -import com.owncloud.android.Log_OC; -import com.owncloud.android.R; -import android.content.Intent; -import android.os.Bundle; -import android.support.v4.app.DialogFragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.View.OnClickListener; -import android.widget.Button; - -public class ExtensionsAvailableDialog extends DialogFragment implements - OnClickListener { - - public ExtensionsAvailableDialog() { - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.extensions_available_dialog, - container); - Button btnYes = (Button) view.findViewById(R.id.buttonYes); - Button btnNo = (Button) view.findViewById(R.id.buttonNo); - btnYes.setOnClickListener(this); - btnNo.setOnClickListener(this); - getDialog().setTitle(R.string.extensions_avail_title); - return view; - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.buttonYes: { - Intent i = new Intent(getActivity(), ExtensionsListActivity.class); - startActivity(i); - getActivity().finish(); - } - break; - case R.id.buttonNo: - getActivity().finish(); - break; - default: - Log_OC.e("EAD", "Button with unknown id clicked " + v.getId()); - } - } - -} diff --git a/src/com/owncloud/android/extensions/ExtensionsListActivity.java b/src/com/owncloud/android/extensions/ExtensionsListActivity.java deleted file mode 100644 index 2f7290e8a6..0000000000 --- a/src/com/owncloud/android/extensions/ExtensionsListActivity.java +++ /dev/null @@ -1,155 +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.extensions; - -import java.util.HashMap; -import java.util.LinkedList; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.methods.GetMethod; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import com.owncloud.android.Log_OC; -import com.owncloud.android.utils.OwnCloudVersion; - - -import android.R; -import android.app.ListActivity; -import android.os.Bundle; -import android.os.Handler; -import android.widget.SimpleAdapter; - -public class ExtensionsListActivity extends ListActivity { - - private static final String packages_url = "http://alefzero.eu/a/packages.php"; - - private Thread mGetterThread; - private final Handler mHandler = new Handler(); - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mGetterThread = new Thread(new JsonGetter()); - mGetterThread.start(); - } - - public void done(JSONArray a) { - LinkedList> ll = new LinkedList>(); - for (int i = 0; i < a.length(); ++i) { - try { - ExtensionApplicationEntry ela = new ExtensionApplicationEntry( - ((JSONObject) a.get(i))); - HashMap ss = new HashMap(); - ss.put("NAME", ela.getName()); - ss.put("DESC", ela.getDescription()); - ll.add(ss); - } catch (JSONException e) { - e.printStackTrace(); - } - } - setListAdapter(new SimpleAdapter(this, ll, R.layout.simple_list_item_2, - new String[] { "NAME", "DESC" }, new int[] { - android.R.id.text1, android.R.id.text2 })); - - } - - private class JsonGetter implements Runnable { - - @Override - public void run() { - HttpClient hc = new HttpClient(); - GetMethod gm = new GetMethod(packages_url); - final JSONArray ar; - try { - hc.executeMethod(gm); - Log_OC.e("ASD", gm.getResponseBodyAsString() + ""); - ar = new JSONObject(gm.getResponseBodyAsString()) - .getJSONArray("apps"); - } catch (Exception e) { - e.printStackTrace(); - return; - } - - mHandler.post(new Runnable() { - @Override - public void run() { - done(ar); - } - }); - - } - - } - - private class ExtensionApplicationEntry { - private static final String APP_NAME = "name"; - private static final String APP_VERSION = "version"; - private static final String APP_DESC = "description"; - private static final String APP_ICON = "icon"; - private static final String APP_URL = "download"; - private static final String APP_PLAYID = "play_id"; - - private String mName, mDescription, mIcon, mDownload, mPlayId; - private OwnCloudVersion mVersion; - - public ExtensionApplicationEntry(JSONObject appentry) { - try { - mName = appentry.getString(APP_NAME); - mDescription = appentry.getString(APP_DESC); - mIcon = appentry.getString(APP_ICON); - mDownload = appentry.getString(APP_URL); - mPlayId = appentry.getString(APP_PLAYID); - mVersion = new OwnCloudVersion(appentry.getString(APP_VERSION)); - } catch (JSONException e) { - e.printStackTrace(); - } - } - - public String getName() { - return mName; - } - - public String getDescription() { - return mDescription; - } - - @SuppressWarnings("unused") - public String getIcon() { - return mIcon; - } - - @SuppressWarnings("unused") - public String getDownload() { - return mDownload; - } - - @SuppressWarnings("unused") - public String getPlayId() { - return mPlayId; - } - - @SuppressWarnings("unused") - public OwnCloudVersion getVersion() { - return mVersion; - } - } - -}