Removed unused landing page and strings related

This commit is contained in:
David A. Velasco 2013-10-23 10:46:29 +02:00
parent fed7ee2d1a
commit fbcd392251
4 changed files with 0 additions and 338 deletions

View file

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="main_files">Files</string>
<string name="main_music">Music</string>
<string name="main_contacts">Contacts</string>
<string name="main_calendar">Calendar</string>
<string name="main_bookmarks">Bookmarks</string>
<string name="main_settings">Settings</string>
<string name="main_tit_accsetup">Setup Account</string>
<string name="main_wrn_accsetup">There is no account set up on your device. In order to use this App, you need to create one.</string>
<string name="about_android">%1$s Android App</string> <string name="about_android">%1$s Android App</string>
<string name="about_version">version %1$s</string> <string name="about_version">version %1$s</string>
<string name="actionbar_sync">Refresh account</string> <string name="actionbar_sync">Refresh account</string>
@ -147,7 +139,6 @@
<string name="auth_trying_to_login">Trying to login&#8230;</string> <string name="auth_trying_to_login">Trying to login&#8230;</string>
<string name="auth_no_net_conn_title">No network connection</string> <string name="auth_no_net_conn_title">No network connection</string>
<string name="auth_connect_anyway">Connect anyway</string-->
<string name="auth_nossl_plain_ok_title">Secure connection unavailable.</string> <string name="auth_nossl_plain_ok_title">Secure connection unavailable.</string>
<string name="auth_connection_established">Connection established</string> <string name="auth_connection_established">Connection established</string>
<string name="auth_testing_connection">Testing connection&#8230;</string> <string name="auth_testing_connection">Testing connection&#8230;</string>
@ -201,7 +192,6 @@
<string name="oauth_check_onoff">Login with oAuth2.</string> <string name="oauth_check_onoff">Login with oAuth2.</string>
<string name="oauth_login_connection">Connecting to oAuth2 server…</string> <string name="oauth_login_connection">Connecting to oAuth2 server…</string>
<string name="ssl_validator_title">Warning</string -->
<string name="ssl_validator_header">The identity of the site could not be verified</string> <string name="ssl_validator_header">The identity of the site could not be verified</string>
<string name="ssl_validator_reason_cert_not_trusted">- The server certificate is not trusted</string> <string name="ssl_validator_reason_cert_not_trusted">- The server certificate is not trusted</string>
<string name="ssl_validator_reason_cert_expired">- The server certificate expired</string> <string name="ssl_validator_reason_cert_expired">- The server certificate expired</string>

View file

@ -1,158 +0,0 @@
/* ownCloud Android client application
* Copyright (C) 2011 Bartek Przybylski
*
* 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 com.actionbarsherlock.app.SherlockFragmentActivity;
import com.owncloud.android.ui.adapter.LandingScreenAdapter;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.Toast;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
/**
* This activity is used as a landing page when the user first opens this app.
*
* @author Lennart Rosam
*
*/
public class LandingActivity extends SherlockFragmentActivity implements
OnClickListener, OnItemClickListener {
public static final int DIALOG_SETUP_ACCOUNT = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Fill the grid view of the landing screen with icons
GridView landingScreenItems = (GridView) findViewById(R.id.homeScreenGrid);
landingScreenItems.setAdapter(new LandingScreenAdapter(this));
landingScreenItems.setOnItemClickListener(this);
// Check, if there are ownCloud accounts
if (!accountsAreSetup()) {
showDialog(DIALOG_SETUP_ACCOUNT);
} else {
// Start device tracking service
Intent locationServiceIntent = new Intent();
locationServiceIntent
.setAction("com.owncloud.android.location.LocationLauncher");
sendBroadcast(locationServiceIntent);
}
}
@Override
protected void onRestart() {
super.onRestart();
// Check, if there are ownCloud accounts
if (!accountsAreSetup()) {
showDialog(DIALOG_SETUP_ACCOUNT);
}
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
// Check, if there are ownCloud accounts
if (!accountsAreSetup()) {
showDialog(DIALOG_SETUP_ACCOUNT);
}
}
@Override
protected Dialog onCreateDialog(int id) {
Dialog dialog;
switch (id) {
case DIALOG_SETUP_ACCOUNT:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.main_tit_accsetup);
builder.setMessage(R.string.main_wrn_accsetup);
builder.setCancelable(false);
builder.setPositiveButton(R.string.common_ok, this);
builder.setNegativeButton(R.string.common_cancel, this);
dialog = builder.create();
break;
default:
dialog = null;
}
return dialog;
}
public void onClick(DialogInterface dialog, int which) {
// In any case - we won't need it anymore
dialog.dismiss();
switch (which) {
case DialogInterface.BUTTON_POSITIVE:
Intent intent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT);
intent.putExtra("authorities",
new String[] { MainApp.getAuthTokenType() });
startActivity(intent);
break;
case DialogInterface.BUTTON_NEGATIVE:
finish();
}
}
@Override
/**
* Start an activity based on the selection
* the user made
*/
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Intent intent;
intent = (Intent) parent.getAdapter().getItem(position);
if (intent != null) {
startActivity(intent);
} else {
// TODO: Implement all of this and make this text go away ;-)
Toast toast = Toast.makeText(this, "Not yet implemented!",
Toast.LENGTH_SHORT);
toast.show();
}
}
/**
* Checks, whether or not there are any ownCloud accounts setup.
*
* @return true, if there is at least one account.
*/
private boolean accountsAreSetup() {
AccountManager accMan = AccountManager.get(this);
Account[] accounts = accMan
.getAccountsByType(MainApp.getAccountType());
return accounts.length > 0;
}
}

View file

@ -1,112 +0,0 @@
/* ownCloud Android client application
* Copyright (C) 2011 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.adapter;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.activity.Preferences;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.owncloud.android.R;
/**
* Populates the landing screen icons.
*
* @author Lennart Rosam
*
*/
public class LandingScreenAdapter extends BaseAdapter {
private Context mContext;
private final Integer[] mLandingScreenIcons = { R.drawable.home,
R.drawable.music, R.drawable.contacts, R.drawable.calendar,
android.R.drawable.ic_menu_agenda, R.drawable.settings };
private final Integer[] mLandingScreenTexts = { R.string.main_files,
R.string.main_music, R.string.main_contacts,
R.string.main_calendar, R.string.main_bookmarks,
R.string.main_settings };
public LandingScreenAdapter(Context context) {
mContext = context;
}
@Override
public int getCount() {
return mLandingScreenIcons.length;
}
@Override
/**
* Returns the Intent associated with this object
* or null if the functionality is not yet implemented
*/
public Object getItem(int position) {
Intent intent = new Intent();
switch (position) {
case 0:
/*
* The FileDisplayActivity requires the ownCloud account as an
* parcableExtra. We will put in the one that is selected in the
* preferences
*/
intent.setClass(mContext, FileDisplayActivity.class);
intent.putExtra("ACCOUNT",
AccountUtils.getCurrentOwnCloudAccount(mContext));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
break;
case 5:
intent.setClass(mContext, Preferences.class);
break;
default:
intent = null;
}
return intent;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflator = LayoutInflater.from(mContext);
convertView = inflator.inflate(R.layout.landing_page_item, null);
ImageView icon = (ImageView) convertView
.findViewById(R.id.gridImage);
TextView iconText = (TextView) convertView
.findViewById(R.id.gridText);
icon.setImageResource(mLandingScreenIcons[position]);
iconText.setText(mLandingScreenTexts[position]);
}
return convertView;
}
}

View file

@ -1,58 +0,0 @@
/* ownCloud Android client application
* Copyright (C) 2011 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.fragment;
import com.actionbarsherlock.app.SherlockFragment;
import com.owncloud.android.ui.activity.LandingActivity;
import com.owncloud.android.ui.adapter.LandingScreenAdapter;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.owncloud.android.R;
/**
* Used on the Landing page to display what Components of the ownCloud there
* are. Like Files, Music, Contacts, etc.
*
* @author Lennart Rosam
*
*/
public class LandingPageFragment extends SherlockFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.landing_page_fragment, container);
return root;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ListView landingScreenItems = (ListView) getView().findViewById(
R.id.homeScreenList);
landingScreenItems.setAdapter(new LandingScreenAdapter(getActivity()));
landingScreenItems
.setOnItemClickListener((LandingActivity) getActivity());
}
}