1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-26 10:52:16 -05:00

Code cleanup (Formatting)

This commit is contained in:
Sebastian Kaspari 2011-01-25 21:02:27 +01:00
parent 4edaa4436d
commit 0fb2338f9c
72 changed files with 833 additions and 775 deletions

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic; package org.yaaic;
import java.util.ArrayList; import java.util.ArrayList;
@ -36,10 +36,10 @@ import android.content.Context;
*/ */
public class Yaaic public class Yaaic
{ {
public static Yaaic instance; public static Yaaic instance;
private HashMap<Integer, Server> servers; private HashMap<Integer, Server> servers;
private boolean serversLoaded = false; private boolean serversLoaded = false;
/** /**
* Private constructor, you may want to use static getInstance() * Private constructor, you may want to use static getInstance()
@ -61,7 +61,7 @@ public class Yaaic
servers = db.getServers(); servers = db.getServers();
db.close(); db.close();
//context.sendBroadcast(new Intent(Broadcast.SERVER_UPDATE)); // context.sendBroadcast(new Intent(Broadcast.SERVER_UPDATE));
serversLoaded = true; serversLoaded = true;
} }
} }

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import org.yaaic.R; import org.yaaic.R;

View File

@ -13,14 +13,14 @@ import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
public class AddAliasActivity extends Activity implements OnClickListener, OnItemClickListener, TextWatcher public class AddAliasActivity extends Activity implements OnClickListener, OnItemClickListener, TextWatcher
{ {
@ -65,65 +65,71 @@ public class AddAliasActivity extends Activity implements OnClickListener, OnIte
/** /**
* On Click * On Click
*/ */
public void onClick(View v) @Override
{ public void onClick(View v)
switch (v.getId()) { {
case R.id.add: switch (v.getId()) {
String alias = aliasInput.getText().toString().trim(); case R.id.add:
aliases.add(alias); String alias = aliasInput.getText().toString().trim();
adapter.add(alias); aliases.add(alias);
aliasInput.setText(""); adapter.add(alias);
okButton.setEnabled(true); aliasInput.setText("");
break; okButton.setEnabled(true);
case R.id.cancel: break;
setResult(RESULT_CANCELED); case R.id.cancel:
finish(); setResult(RESULT_CANCELED);
break; finish();
case R.id.ok: break;
// Get list and return as result case R.id.ok:
Intent intent = new Intent(); // Get list and return as result
intent.putExtra(Extra.ALIASES, aliases); Intent intent = new Intent();
setResult(RESULT_OK, intent); intent.putExtra(Extra.ALIASES, aliases);
finish(); setResult(RESULT_OK, intent);
break; finish();
} break;
} }
}
/** /**
* On item clicked * On item clicked
*/ */
public void onItemClick(AdapterView<?> list, View item, int position, long id) @Override
{ public void onItemClick(AdapterView<?> list, View item, int position, long id)
final String alias = adapter.getItem(position); {
final String alias = adapter.getItem(position);
String[] items = { getResources().getString(R.string.action_remove) }; String[] items = { getResources().getString(R.string.action_remove) };
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(alias); builder.setTitle(alias);
builder.setItems(items, new DialogInterface.OnClickListener() { builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) { @Override
switch (item) { public void onClick(DialogInterface dialog, int item) {
case 0: // Remove switch (item) {
adapter.remove(alias); case 0: // Remove
aliases.remove(alias); adapter.remove(alias);
okButton.setEnabled(true); aliases.remove(alias);
break; okButton.setEnabled(true);
} break;
} }
}); }
AlertDialog alert = builder.create(); });
alert.show(); AlertDialog alert = builder.create();
} alert.show();
}
public void afterTextChanged(Editable s) { @Override
// Do nothing. public void afterTextChanged(Editable s) {
} // Do nothing.
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) { @Override
// Do nothing. public void beforeTextChanged(CharSequence s, int start, int count, int after) {
} // Do nothing.
}
public void onTextChanged(CharSequence s, int start, int before, int count) { @Override
addButton.setEnabled(aliasInput.getText().length() > 0); public void onTextChanged(CharSequence s, int start, int before, int count) {
} addButton.setEnabled(aliasInput.getText().length() > 0);
}
} }

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import java.util.ArrayList; import java.util.ArrayList;
@ -31,14 +31,14 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
/** /**
* Adding auto join channels to a server * Adding auto join channels to a server
@ -88,6 +88,7 @@ public class AddChannelActivity extends Activity implements OnClickListener, OnI
/** /**
* On Click * On Click
*/ */
@Override
public void onClick(View v) public void onClick(View v)
{ {
switch (v.getId()) { switch (v.getId()) {
@ -115,6 +116,7 @@ public class AddChannelActivity extends Activity implements OnClickListener, OnI
/** /**
* On item clicked * On item clicked
*/ */
@Override
public void onItemClick(AdapterView<?> list, View item, int position, long id) public void onItemClick(AdapterView<?> list, View item, int position, long id)
{ {
final String channel = adapter.getItem(position); final String channel = adapter.getItem(position);
@ -124,6 +126,7 @@ public class AddChannelActivity extends Activity implements OnClickListener, OnI
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(channel); builder.setTitle(channel);
builder.setItems(items, new DialogInterface.OnClickListener() { builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) { public void onClick(DialogInterface dialog, int item) {
switch (item) { switch (item) {
case 0: // Remove case 0: // Remove

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import java.util.ArrayList; import java.util.ArrayList;
@ -31,14 +31,14 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
/** /**
* Adding commands (to execute after connect) to a server * Adding commands (to execute after connect) to a server
@ -89,6 +89,7 @@ public class AddCommandsActivity extends Activity implements OnClickListener, On
/** /**
* On Click * On Click
*/ */
@Override
public void onClick(View v) public void onClick(View v)
{ {
switch (v.getId()) { switch (v.getId()) {
@ -121,6 +122,7 @@ public class AddCommandsActivity extends Activity implements OnClickListener, On
/** /**
* On item clicked * On item clicked
*/ */
@Override
public void onItemClick(AdapterView<?> list, View item, int position, long id) public void onItemClick(AdapterView<?> list, View item, int position, long id)
{ {
final String command = adapter.getItem(position); final String command = adapter.getItem(position);
@ -130,6 +132,7 @@ public class AddCommandsActivity extends Activity implements OnClickListener, On
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(command); builder.setTitle(command);
builder.setItems(items, new DialogInterface.OnClickListener() { builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) { public void onClick(DialogInterface dialog, int item) {
switch (item) { switch (item) {
case 0: // Remove case 0: // Remove

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import org.yaaic.R; import org.yaaic.R;
@ -54,6 +54,7 @@ public class JoinActivity extends Activity implements OnClickListener
/** /**
* On click * On click
*/ */
@Override
public void onClick(View v) public void onClick(View v)
{ {
Intent intent = new Intent(); Intent intent = new Intent();

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,11 +17,25 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import java.util.ArrayList; import java.util.ArrayList;
import org.yaaic.R;
import org.yaaic.Yaaic;
import org.yaaic.adapter.ServerListAdapter;
import org.yaaic.db.Database;
import org.yaaic.irc.IRCBinder;
import org.yaaic.irc.IRCService;
import org.yaaic.layout.NonScalingBackgroundDrawable;
import org.yaaic.listener.ServerListener;
import org.yaaic.model.Broadcast;
import org.yaaic.model.Extra;
import org.yaaic.model.Server;
import org.yaaic.model.Status;
import org.yaaic.receiver.ServerReceiver;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.ListActivity; import android.app.ListActivity;
import android.content.ComponentName; import android.content.ComponentName;
@ -36,23 +50,9 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast; import android.widget.Toast;
import android.widget.AdapterView.OnItemLongClickListener;
import org.yaaic.R;
import org.yaaic.Yaaic;
import org.yaaic.adapter.ServerListAdapter;
import org.yaaic.db.Database;
import org.yaaic.irc.IRCBinder;
import org.yaaic.irc.IRCService;
import org.yaaic.layout.NonScalingBackgroundDrawable;
import org.yaaic.listener.ServerListener;
import org.yaaic.model.Broadcast;
import org.yaaic.model.Extra;
import org.yaaic.model.Server;
import org.yaaic.model.Status;
import org.yaaic.receiver.ServerReceiver;
/** /**
* List of servers * List of servers
@ -121,6 +121,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
/** /**
* Service connected to Activity * Service connected to Activity
*/ */
@Override
public void onServiceConnected(ComponentName name, IBinder service) public void onServiceConnected(ComponentName name, IBinder service)
{ {
binder = (IRCBinder) service; binder = (IRCBinder) service;
@ -129,6 +130,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
/** /**
* Service disconnected from Activity * Service disconnected from Activity
*/ */
@Override
public void onServiceDisconnected(ComponentName name) public void onServiceDisconnected(ComponentName name)
{ {
binder = null; binder = null;
@ -161,6 +163,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
/** /**
* On long click * On long click
*/ */
@Override
public boolean onItemLongClick(AdapterView<?> l, View v, int position, long id) public boolean onItemLongClick(AdapterView<?> l, View v, int position, long id)
{ {
final Server server = adapter.getItem(position); final Server server = adapter.getItem(position);
@ -180,6 +183,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(server.getTitle()); builder.setTitle(server.getTitle());
builder.setItems(items, new DialogInterface.OnClickListener() { builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) { public void onClick(DialogInterface dialog, int item) {
switch (item) { switch (item) {
case 0: // Connect case 0: // Connect
@ -231,6 +235,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
/** /**
* Options Menu (Menu Button pressed) * Options Menu (Menu Button pressed)
*/ */
@Override
public boolean onCreateOptionsMenu(Menu menu) public boolean onCreateOptionsMenu(Menu menu)
{ {
super.onCreateOptionsMenu(menu); super.onCreateOptionsMenu(menu);
@ -304,6 +309,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
/** /**
* On server status update * On server status update
*/ */
@Override
public void onStatusUpdate() public void onStatusUpdate()
{ {
adapter.loadServers(); adapter.loadServers();

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import org.yaaic.R; import org.yaaic.R;
@ -27,9 +27,9 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.WindowManager.LayoutParams; import android.view.WindowManager.LayoutParams;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
@ -73,6 +73,7 @@ public class UserActivity extends Activity implements OnClickListener
/** /**
* On button click * On button click
*/ */
@Override
public void onClick(View v) public void onClick(View v)
{ {
Intent intent = new Intent(); Intent intent = new Intent();

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.activity; package org.yaaic.activity;
import java.util.Arrays; import java.util.Arrays;
@ -64,6 +64,7 @@ public class UsersActivity extends ListActivity implements OnItemClickListener
/** /**
* On user selected * On user selected
*/ */
@Override
public void onItemClick(AdapterView<?> list, View item, int position, long id) public void onItemClick(AdapterView<?> list, View item, int position, long id)
{ {
Intent intent = new Intent(); Intent intent = new Intent();

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.adapter; package org.yaaic.adapter;
import java.util.LinkedList; import java.util.LinkedList;
@ -63,6 +63,7 @@ public class DeckAdapter extends BaseAdapter
/** /**
* Get number of item * Get number of item
*/ */
@Override
public int getCount() public int getCount()
{ {
return conversations.size(); return conversations.size();
@ -71,6 +72,7 @@ public class DeckAdapter extends BaseAdapter
/** /**
* Get item at position * Get item at position
*/ */
@Override
public Conversation getItem(int position) public Conversation getItem(int position)
{ {
if (position >= 0 && position < conversations.size()) { if (position >= 0 && position < conversations.size()) {
@ -82,6 +84,7 @@ public class DeckAdapter extends BaseAdapter
/** /**
* Get id of item at position * Get id of item at position
*/ */
@Override
public long getItemId(int position) public long getItemId(int position)
{ {
return position; return position;
@ -180,6 +183,7 @@ public class DeckAdapter extends BaseAdapter
/** /**
* Get view at given position * Get view at given position
*/ */
@Override
public View getView(int position, View convertView, ViewGroup parent) public View getView(int position, View convertView, ViewGroup parent)
{ {
Conversation conversation = getItem(position); Conversation conversation = getItem(position);

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.adapter; package org.yaaic.adapter;
import java.util.LinkedList; import java.util.LinkedList;
@ -38,8 +38,8 @@ import android.widget.TextView;
*/ */
public class MessageListAdapter extends BaseAdapter public class MessageListAdapter extends BaseAdapter
{ {
private LinkedList<TextView> messages; private final LinkedList<TextView> messages;
private Context context; private final Context context;
/** /**
* Create a new MessageAdapter * Create a new MessageAdapter
@ -117,6 +117,7 @@ public class MessageListAdapter extends BaseAdapter
* *
* @return * @return
*/ */
@Override
public int getCount() public int getCount()
{ {
return messages.size(); return messages.size();
@ -128,6 +129,7 @@ public class MessageListAdapter extends BaseAdapter
* @param position * @param position
* @return * @return
*/ */
@Override
public TextView getItem(int position) public TextView getItem(int position)
{ {
return messages.get(position); return messages.get(position);
@ -139,6 +141,7 @@ public class MessageListAdapter extends BaseAdapter
* @param position * @param position
* @return * @return
*/ */
@Override
public long getItemId(int position) public long getItemId(int position)
{ {
return position; return position;
@ -152,6 +155,7 @@ public class MessageListAdapter extends BaseAdapter
* @param parent * @param parent
* @return * @return
*/ */
@Override
public View getView(int position, View convertView, ViewGroup parent) public View getView(int position, View convertView, ViewGroup parent)
{ {
return getItem(position); return getItem(position);

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.adapter; package org.yaaic.adapter;
import java.util.ArrayList; import java.util.ArrayList;
@ -65,6 +65,7 @@ public class ServerListAdapter extends BaseAdapter
/** /**
* Get number of items * Get number of items
*/ */
@Override
public int getCount() public int getCount()
{ {
int size = servers.size(); int size = servers.size();
@ -82,6 +83,7 @@ public class ServerListAdapter extends BaseAdapter
* *
* @param position * @param position
*/ */
@Override
public Server getItem(int position) public Server getItem(int position)
{ {
if (servers.size() == 0) { if (servers.size() == 0) {
@ -96,6 +98,7 @@ public class ServerListAdapter extends BaseAdapter
* *
* @param position * @param position
*/ */
@Override
public long getItemId(int position) public long getItemId(int position)
{ {
if (servers.size() == 0) { if (servers.size() == 0) {
@ -112,6 +115,7 @@ public class ServerListAdapter extends BaseAdapter
* @param convertView * @param convertView
* @param parent * @param parent
*/ */
@Override
public View getView(int position, View convertView, ViewGroup parent) public View getView(int position, View convertView, ViewGroup parent)
{ {
Server server = getItem(position); Server server = getItem(position);

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command; package org.yaaic.command;
import org.yaaic.exception.CommandException; import org.yaaic.exception.CommandException;

View File

@ -17,13 +17,11 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command; package org.yaaic.command;
import java.util.HashMap; import java.util.HashMap;
import android.content.Intent;
import org.yaaic.command.handler.AMsgHandler; import org.yaaic.command.handler.AMsgHandler;
import org.yaaic.command.handler.AwayHandler; import org.yaaic.command.handler.AwayHandler;
import org.yaaic.command.handler.CloseHandler; import org.yaaic.command.handler.CloseHandler;
@ -55,6 +53,8 @@ import org.yaaic.model.Conversation;
import org.yaaic.model.Message; import org.yaaic.model.Message;
import org.yaaic.model.Server; import org.yaaic.model.Server;
import android.content.Intent;
/** /**
* Parser for commands * Parser for commands
* *
@ -62,8 +62,8 @@ import org.yaaic.model.Server;
*/ */
public class CommandParser public class CommandParser
{ {
private HashMap<String, BaseHandler> commands; private final HashMap<String, BaseHandler> commands;
private HashMap<String, String> aliases; private final HashMap<String, String> aliases;
private static CommandParser instance; private static CommandParser instance;
/** /**

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import java.util.Collection; import java.util.Collection;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import java.io.File; import java.io.File;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import java.util.HashMap; import java.util.HashMap;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.jibble.pircbot.User; import org.jibble.pircbot.User;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.command.handler; package org.yaaic.command.handler;
import org.yaaic.R; import org.yaaic.R;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.db; package org.yaaic.db;
import android.provider.BaseColumns; import android.provider.BaseColumns;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.db; package org.yaaic.db;
import android.provider.BaseColumns; import android.provider.BaseColumns;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.db; package org.yaaic.db;
import java.util.ArrayList; import java.util.ArrayList;
@ -61,32 +61,32 @@ public class Database extends SQLiteOpenHelper
public void onCreate(SQLiteDatabase db) public void onCreate(SQLiteDatabase db)
{ {
db.execSQL("CREATE TABLE " + ServerConstants.TABLE_NAME + " ( " db.execSQL("CREATE TABLE " + ServerConstants.TABLE_NAME + " ( "
+ ServerConstants._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + ServerConstants._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ ServerConstants.TITLE + " TEXT NOT NULL, " + ServerConstants.TITLE + " TEXT NOT NULL, "
+ ServerConstants.HOST + " TEXT NOT NULL, " + ServerConstants.HOST + " TEXT NOT NULL, "
+ ServerConstants.PORT + " INTEGER, " + ServerConstants.PORT + " INTEGER, "
+ ServerConstants.PASSWORD + " TEXT, " + ServerConstants.PASSWORD + " TEXT, "
+ ServerConstants.AUTOCONNECT + " BOOLEAN, " // XXX: Does SQLLite support boolean? + ServerConstants.AUTOCONNECT + " BOOLEAN, " // XXX: Does SQLLite support boolean?
+ ServerConstants.USE_SSL + " BOOLEAN, " + ServerConstants.USE_SSL + " BOOLEAN, "
+ ServerConstants.CHARSET + " TEXT, " + ServerConstants.CHARSET + " TEXT, "
+ ServerConstants.IDENTITY + " INTEGER" + ServerConstants.IDENTITY + " INTEGER"
+ ");" + ");"
); );
db.execSQL("CREATE TABLE " + ChannelConstants.TABLE_NAME + " (" db.execSQL("CREATE TABLE " + ChannelConstants.TABLE_NAME + " ("
+ ChannelConstants._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + ChannelConstants._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ ChannelConstants.NAME + " TEXT NOT NULL, " + ChannelConstants.NAME + " TEXT NOT NULL, "
+ ChannelConstants.PASSWORD + " TEXT, " + ChannelConstants.PASSWORD + " TEXT, "
+ ChannelConstants.SERVER + " INTEGER" + ChannelConstants.SERVER + " INTEGER"
+ ");" + ");"
); );
db.execSQL("CREATE TABLE " + IdentityConstants.TABLE_NAME +" (" db.execSQL("CREATE TABLE " + IdentityConstants.TABLE_NAME +" ("
+ IdentityConstants._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + IdentityConstants._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ IdentityConstants.NICKNAME + " TEXT NOT NULL," + IdentityConstants.NICKNAME + " TEXT NOT NULL,"
+ IdentityConstants.IDENT + " TEXT NOT NULL," + IdentityConstants.IDENT + " TEXT NOT NULL,"
+ IdentityConstants.REALNAME + " TEXT NOT NULL" + IdentityConstants.REALNAME + " TEXT NOT NULL"
+ ");" + ");"
); );
db.execSQL("CREATE TABLE " + CommandConstants.TABLE_NAME + " (" db.execSQL("CREATE TABLE " + CommandConstants.TABLE_NAME + " ("

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.db; package org.yaaic.db;
import android.provider.BaseColumns; import android.provider.BaseColumns;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.db; package org.yaaic.db;
import android.provider.BaseColumns; import android.provider.BaseColumns;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.exception; package org.yaaic.exception;
/** /**

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.exception; package org.yaaic.exception;
/** /**

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.irc; package org.yaaic.irc;
import org.yaaic.model.Server; import org.yaaic.model.Server;
@ -31,7 +31,7 @@ import android.os.Binder;
*/ */
public class IRCBinder extends Binder public class IRCBinder extends Binder
{ {
private IRCService service; private final IRCService service;
/** /**
* Create a new binder for given service * Create a new binder for given service

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.layout; package org.yaaic.layout;
import android.content.Context; import android.content.Context;
@ -31,9 +31,10 @@ import android.view.View;
* *
* @author Sebastian Kaspari <sebastian@yaaic.org> * @author Sebastian Kaspari <sebastian@yaaic.org>
*/ */
public class NonScalingBackgroundDrawable extends Drawable { public class NonScalingBackgroundDrawable extends Drawable
private View view; {
private Drawable drawable; private final View view;
private final Drawable drawable;
/** /**
* Create a new non scaling background drawable * Create a new non scaling background drawable
@ -44,13 +45,14 @@ public class NonScalingBackgroundDrawable extends Drawable {
*/ */
public NonScalingBackgroundDrawable(Context context, View view, int resource) public NonScalingBackgroundDrawable(Context context, View view, int resource)
{ {
this.view = view; this.view = view;
this.drawable = context.getResources().getDrawable(resource); this.drawable = context.getResources().getDrawable(resource);
} }
/** /**
* Draw the background drawable * Draw the background drawable
*/ */
@Override
public void draw(Canvas canvas) public void draw(Canvas canvas)
{ {
int left = (view.getWidth() / 2) - (drawable.getIntrinsicWidth() / 2); int left = (view.getWidth() / 2) - (drawable.getIntrinsicWidth() / 2);
@ -66,14 +68,16 @@ public class NonScalingBackgroundDrawable extends Drawable {
/** /**
* Get the opacity * Get the opacity
*/ */
@Override
public int getOpacity() public int getOpacity()
{ {
return drawable.getOpacity(); return drawable.getOpacity();
} }
/** /**
* Set the alpha * Set the alpha
*/ */
@Override
public void setAlpha(int alpha) public void setAlpha(int alpha)
{ {
drawable.setAlpha(alpha); drawable.setAlpha(alpha);
@ -82,6 +86,7 @@ public class NonScalingBackgroundDrawable extends Drawable {
/** /**
* Set the color filter * Set the color filter
*/ */
@Override
public void setColorFilter(ColorFilter cf) public void setColorFilter(ColorFilter cf)
{ {
drawable.setColorFilter(cf); drawable.setColorFilter(cf);

View File

@ -17,20 +17,20 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.listener; package org.yaaic.listener;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.ViewSwitcher;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TableLayout.LayoutParams;
import org.yaaic.adapter.DeckAdapter; import org.yaaic.adapter.DeckAdapter;
import org.yaaic.model.Conversation; import org.yaaic.model.Conversation;
import org.yaaic.view.MessageListView; import org.yaaic.view.MessageListView;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TableLayout.LayoutParams;
import android.widget.ViewSwitcher;
/** /**
* Listener for clicks on conversations * Listener for clicks on conversations
* *
@ -38,8 +38,8 @@ import org.yaaic.view.MessageListView;
*/ */
public class ConversationClickListener implements OnItemClickListener public class ConversationClickListener implements OnItemClickListener
{ {
private DeckAdapter adapter; private final DeckAdapter adapter;
private ViewSwitcher switcher; private final ViewSwitcher switcher;
/** /**
* Create a new ConversationClickListener * Create a new ConversationClickListener
@ -56,6 +56,7 @@ public class ConversationClickListener implements OnItemClickListener
/** /**
* On conversation item clicked * On conversation item clicked
*/ */
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) public void onItemClick(AdapterView<?> adapterView, View view, int position, long id)
{ {
Conversation conversation = adapter.getItem(position); Conversation conversation = adapter.getItem(position);

View File

@ -17,9 +17,14 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.listener; package org.yaaic.listener;
/**
* Listener for conversations
*
* @author Sebastian Kaspari <sebastian@yaaic.org>
*/
public interface ConversationListener public interface ConversationListener
{ {
public void onConversationMessage(String target); public void onConversationMessage(String target);

View File

@ -17,18 +17,18 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.listener; package org.yaaic.listener;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
import org.yaaic.model.Conversation; import org.yaaic.model.Conversation;
import org.yaaic.model.Server; import org.yaaic.model.Server;
import org.yaaic.view.ConversationSwitcher; import org.yaaic.view.ConversationSwitcher;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.TextView;
/** /**
* Listener for conversation selections * Listener for conversation selections
* *
@ -36,9 +36,9 @@ import org.yaaic.view.ConversationSwitcher;
*/ */
public class ConversationSelectedListener implements OnItemSelectedListener public class ConversationSelectedListener implements OnItemSelectedListener
{ {
private Server server; private final Server server;
private TextView titleView; private final TextView titleView;
private ConversationSwitcher switcher; private final ConversationSwitcher switcher;
/** /**
* Create a new ConversationSelectedListener * Create a new ConversationSelectedListener
@ -56,6 +56,7 @@ public class ConversationSelectedListener implements OnItemSelectedListener
/** /**
* On conversation selected/focused * On conversation selected/focused
*/ */
@Override
public void onItemSelected(AdapterView<?> deck, View view, int position, long id) public void onItemSelected(AdapterView<?> deck, View view, int position, long id)
{ {
Conversation conversation = (Conversation) deck.getItemAtPosition(position); Conversation conversation = (Conversation) deck.getItemAtPosition(position);
@ -84,6 +85,7 @@ public class ConversationSelectedListener implements OnItemSelectedListener
/** /**
* On no conversation selected/focused * On no conversation selected/focused
*/ */
@Override
public void onNothingSelected(AdapterView<?> deck) public void onNothingSelected(AdapterView<?> deck)
{ {
titleView.setText(server.getTitle()); titleView.setText(server.getTitle());

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.listener; package org.yaaic.listener;
import org.yaaic.activity.MessageActivity; import org.yaaic.activity.MessageActivity;
@ -62,6 +62,7 @@ public class MessageClickListener implements OnItemClickListener
/** /**
* On message item clicked * On message item clicked
*/ */
@Override
public void onItemClick(AdapterView<?> group, View view, int position, long id) public void onItemClick(AdapterView<?> group, View view, int position, long id)
{ {
MessageListAdapter adapter = (MessageListAdapter) group.getAdapter(); MessageListAdapter adapter = (MessageListAdapter) group.getAdapter();

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.listener; package org.yaaic.listener;
public interface ServerListener public interface ServerListener

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.listener; package org.yaaic.listener;
import org.yaaic.activity.ConversationActivity; import org.yaaic.activity.ConversationActivity;
@ -35,7 +35,7 @@ import android.view.View.OnClickListener;
*/ */
public class SpeechClickListener implements OnClickListener public class SpeechClickListener implements OnClickListener
{ {
private Activity activity; private final Activity activity;
/** /**
* Create a new listener for speech button * Create a new listener for speech button
@ -51,6 +51,7 @@ public class SpeechClickListener implements OnClickListener
/** /**
* On Click on speech button * On Click on speech button
*/ */
@Override
public void onClick(View v) public void onClick(View v)
{ {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
import android.content.Intent; import android.content.Intent;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
/** /**

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
import java.util.LinkedList; import java.util.LinkedList;
@ -44,9 +44,9 @@ public abstract class Conversation
public static final int HISTORY_SIZE = 30; public static final int HISTORY_SIZE = 30;
private LinkedList<Message> buffer; private final LinkedList<Message> buffer;
private LinkedList<Message> history; private final LinkedList<Message> history;
private String name; private final String name;
private MessageListAdapter adapter; private MessageListAdapter adapter;
private int status = 1; private int status = 1;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
/** /**
@ -27,12 +27,12 @@ package org.yaaic.model;
*/ */
public class Extra public class Extra
{ {
public static final String SERVER = "server"; public static final String SERVER = "server";
public static final String CONVERSATION = "conversation"; public static final String CONVERSATION = "conversation";
public static final String USERS = "users"; public static final String USERS = "users";
public static final String ALIASES = "aliases"; public static final String ALIASES = "aliases";
public static final String CHANNELS = "channels"; public static final String CHANNELS = "channels";
public static final String COMMANDS = "commands"; public static final String COMMANDS = "commands";
public static final String MESSAGE = "message"; public static final String MESSAGE = "message";
public static final String USER = "user"; public static final String USER = "user";

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
import java.util.ArrayList; import java.util.ArrayList;
@ -33,7 +33,7 @@ import java.util.List;
public class Identity public class Identity
{ {
private String nickname; private String nickname;
private List<String> aliases = new ArrayList<String>(); private final List<String> aliases = new ArrayList<String>();
private String ident; private String ident;
private String realname; private String realname;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
import java.util.Date; import java.util.Date;
@ -37,38 +37,38 @@ import android.widget.TextView;
* @author Sebastian Kaspari <sebastian@yaaic.org> * @author Sebastian Kaspari <sebastian@yaaic.org>
*/ */
public class Message { public class Message {
public static final int COLOR_GREEN = 0xFF458509; public static final int COLOR_GREEN = 0xFF458509;
public static final int COLOR_RED = 0xFFcc0000; public static final int COLOR_RED = 0xFFcc0000;
public static final int COLOR_BLUE = 0xFF729fcf; public static final int COLOR_BLUE = 0xFF729fcf;
public static final int COLOR_YELLOW = 0xFFbe9b01; public static final int COLOR_YELLOW = 0xFFbe9b01;
public static final int COLOR_GREY = 0xFFaaaaaa; public static final int COLOR_GREY = 0xFFaaaaaa;
public static final int COLOR_DEFAULT = 0xFFeeeeee; public static final int COLOR_DEFAULT = 0xFFeeeeee;
public static final int[] colors = { public static final int[] colors = {
0xFFffffff, //White 0xFFffffff, // White
0xFFffff00, //Yellow 0xFFffff00, // Yellow
0xFFff00ff, //Fuchsia 0xFFff00ff, // Fuchsia
0xFFff0000, //Red 0xFFff0000, // Red
0xFFc0c0c0, //Silver 0xFFc0c0c0, // Silver
0xFF808080, //Gray 0xFF808080, // Gray
0xFF808000, //Olive 0xFF808000, // Olive
0xFF800080, //Purple 0xFF800080, // Purple
0xFF800000, //Maroon 0xFF800000, // Maroon
0xFF00ffff, //Agua 0xFF00ffff, // Agua
0xFF00ff00, //Lime 0xFF00ff00, // Lime
0xFF008080, //Teal 0xFF008080, // Teal
0xFF008000, //Green 0xFF008000, // Green
0xFF0000FF, //Blue 0xFF0000FF, // Blue
0xFF000080, //Navy 0xFF000080, // Navy
0xFF000000, //Black 0xFF000000, // Black
}; };
private int icon = -1; private int icon = -1;
private String text; private final String text;
private String sender; private final String sender;
private SpannableString canvas; private SpannableString canvas;
private int color = -1; private int color = -1;
private long timestamp; private final long timestamp;
/** /**
* Create a new message without an icon * Create a new message without an icon
@ -135,7 +135,9 @@ public class Message {
private int getSenderColor() private int getSenderColor()
{ {
/* It might be worth to use some hash table here */ /* It might be worth to use some hash table here */
if (sender == null) return COLOR_DEFAULT; if (sender == null) {
return COLOR_DEFAULT;
}
int color = 0; int color = 0;
for(int i = 0; i < sender.length(); i++){ for(int i = 0; i < sender.length(); i++){
color += sender.charAt(i); color += sender.charAt(i);

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
/** /**
@ -40,6 +40,7 @@ public class Query extends Conversation
/** /**
* Get the type of this conversation * Get the type of this conversation
*/ */
@Override
public int getType() public int getType()
{ {
return Conversation.TYPE_QUERY; return Conversation.TYPE_QUERY;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
import java.util.LinkedList; import java.util.LinkedList;
@ -31,7 +31,7 @@ public class Scrollback
{ {
public static final int MAX_HISTORY = 10; public static final int MAX_HISTORY = 10;
private LinkedList<String> messages; private final LinkedList<String> messages;
private int pointer; private int pointer;
/** /**

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
import java.util.ArrayList; import java.util.ArrayList;
@ -42,7 +42,7 @@ public class Server
private boolean useSSL = false; private boolean useSSL = false;
private Identity identity; private Identity identity;
private LinkedHashMap<String, Conversation> conversations = new LinkedHashMap<String, Conversation>(); private final LinkedHashMap<String, Conversation> conversations = new LinkedHashMap<String, Conversation>();
private ArrayList<String> autoJoinChannels; private ArrayList<String> autoJoinChannels;
private ArrayList<String> connectCommands; private ArrayList<String> connectCommands;

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
/** /**

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.model; package org.yaaic.model;
/** /**
@ -25,7 +25,8 @@ package org.yaaic.model;
* *
* @author Sebastian Kaspari <sebastian@yaaic.org> * @author Sebastian Kaspari <sebastian@yaaic.org>
*/ */
public class Status { public class Status
{
public static final int DISCONNECTED = 0; public static final int DISCONNECTED = 0;
public static final int CONNECTING = 1; public static final int CONNECTING = 1;
public static final int CONNECTED = 2; public static final int CONNECTED = 2;

View File

@ -17,17 +17,17 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.receiver; package org.yaaic.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import org.yaaic.listener.ConversationListener; import org.yaaic.listener.ConversationListener;
import org.yaaic.model.Broadcast; import org.yaaic.model.Broadcast;
import org.yaaic.model.Extra; import org.yaaic.model.Extra;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/** /**
* A channel receiver for receiving channel updates * A channel receiver for receiving channel updates
* *
@ -35,8 +35,8 @@ import org.yaaic.model.Extra;
*/ */
public class ConversationReceiver extends BroadcastReceiver public class ConversationReceiver extends BroadcastReceiver
{ {
private ConversationListener listener; private final ConversationListener listener;
private int serverId; private final int serverId;
/** /**
* Create a new channel receiver * Create a new channel receiver

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.receiver; package org.yaaic.receiver;
import org.yaaic.listener.ServerListener; import org.yaaic.listener.ServerListener;
@ -33,7 +33,7 @@ import android.content.Intent;
*/ */
public class ServerReceiver extends BroadcastReceiver public class ServerReceiver extends BroadcastReceiver
{ {
private ServerListener listener; private final ServerListener listener;
/** /**
* Create a new server receiver * Create a new server receiver

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.ssl; package org.yaaic.ssl;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
@ -37,6 +37,7 @@ public class NaiveTrustManager implements X509TrustManager
* *
* @throws CertificateException if not trusted * @throws CertificateException if not trusted
*/ */
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException
{ {
// No Exception == Trust // No Exception == Trust
@ -47,6 +48,7 @@ public class NaiveTrustManager implements X509TrustManager
* *
* @throws CertificateException if not trusted * @throws CertificateException if not trusted
*/ */
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException
{ {
// No Exception == Trust // No Exception == Trust
@ -55,6 +57,7 @@ public class NaiveTrustManager implements X509TrustManager
/** /**
* Get accepted issuers * Get accepted issuers
*/ */
@Override
public X509Certificate[] getAcceptedIssuers() public X509Certificate[] getAcceptedIssuers()
{ {
return new X509Certificate[0]; return new X509Certificate[0];

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.view; package org.yaaic.view;
import java.util.Collection; import java.util.Collection;
@ -39,7 +39,7 @@ import android.view.View;
public class ConversationSwitcher extends View public class ConversationSwitcher extends View
{ {
private Server server; private Server server;
private Paint paint; private final Paint paint;
/** /**
* Create a new ConversationSwitcher * Create a new ConversationSwitcher
@ -70,6 +70,7 @@ public class ConversationSwitcher extends View
* @param widthMeasureSpec * @param widthMeasureSpec
* @param heightMeasureSpec * @param heightMeasureSpec
*/ */
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{ {
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), 16); setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), 16);
@ -78,6 +79,7 @@ public class ConversationSwitcher extends View
/** /**
* On draw * On draw
*/ */
@Override
protected void onDraw(Canvas canvas) protected void onDraw(Canvas canvas)
{ {
super.onDraw(canvas); super.onDraw(canvas);

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>. along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.yaaic.view; package org.yaaic.view;
import org.yaaic.adapter.MessageListAdapter; import org.yaaic.adapter.MessageListAdapter;
@ -38,7 +38,7 @@ import android.widget.ListView;
public class MessageListView extends ListView public class MessageListView extends ListView
{ {
private boolean delegate = true; private boolean delegate = true;
private View parent; private final View parent;
private int parentWidth; private int parentWidth;
private int parentHeight; private int parentHeight;
@ -109,6 +109,7 @@ public class MessageListView extends ListView
* *
* @return The MessageListAdapter * @return The MessageListAdapter
*/ */
@Override
public MessageListAdapter getAdapter() public MessageListAdapter getAdapter()
{ {
return (MessageListAdapter) super.getAdapter(); return (MessageListAdapter) super.getAdapter();