diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a060054..b3c3a4c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -44,6 +44,10 @@ along with Yaaic. If not, see .
android:label="@string/about_label"
android:theme="@android:style/Theme.Dialog">
+
+
diff --git a/res/menu/servers.xml b/res/menu/servers.xml
index daee60d..eb8f3a6 100644
--- a/res/menu/servers.xml
+++ b/res/menu/servers.xml
@@ -24,6 +24,10 @@ along with Yaaic. If not, see .
android:id="@+id/add"
android:title="@string/add_server_menu"
android:icon="@android:drawable/ic_menu_add" />
+
-
+
+ show_timestamp
+ false
+
+ show_icons
+ true
+
+ show_colors
+ true
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a283b42..a188e64 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7,6 +7,7 @@
(C) 2009-2010 Sebastian Kaspari
Add server
+ Settings
About
Add new server
@@ -34,4 +35,6 @@
Yaaic is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Yaaic 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.
+
+ Settings
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
new file mode 100644
index 0000000..ddc44af
--- /dev/null
+++ b/res/xml/preferences.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/org/yaaic/model/Message.java b/src/org/yaaic/model/Message.java
index 16229fa..e240d6f 100644
--- a/src/org/yaaic/model/Message.java
+++ b/src/org/yaaic/model/Message.java
@@ -108,15 +108,18 @@ public class Message {
*/
public SpannableString render(Context context)
{
+ Settings settings = new Settings(context);
+
if (canvas == null) {
- String prefix = hasIcon() ? " " : "";
+ String prefix = hasIcon() && settings.showIcons() ? " " : "";
canvas = new SpannableString(prefix + text);
- if (hasIcon()) {
+
+ if (hasIcon() && settings.showIcons()) {
Drawable drawable = context.getResources().getDrawable(icon);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
canvas.setSpan(new ImageSpan(drawable, ImageSpan.ALIGN_BOTTOM), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
- if (color != -1) {
+ if (color != -1 && settings.showTimestamp()) {
canvas.setSpan(new ForegroundColorSpan(color), 0, canvas.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
diff --git a/src/org/yaaic/view/AddServerActivity.java b/src/org/yaaic/view/AddServerActivity.java
index 56f5daa..181691a 100644
--- a/src/org/yaaic/view/AddServerActivity.java
+++ b/src/org/yaaic/view/AddServerActivity.java
@@ -44,6 +44,9 @@ public class AddServerActivity extends Activity implements OnClickListener
{
public static final String TAG = "Yaaic/AddServerActivity";
+ /**
+ * On create
+ */
@Override
public void onCreate(Bundle savedInstanceState)
{
diff --git a/src/org/yaaic/view/ServersActivity.java b/src/org/yaaic/view/ServersActivity.java
index 54dcf27..66879ba 100644
--- a/src/org/yaaic/view/ServersActivity.java
+++ b/src/org/yaaic/view/ServersActivity.java
@@ -207,6 +207,9 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
case R.id.about:
startActivity(new Intent(this, AboutActivity.class));
break;
+ case R.id.settings:
+ startActivity(new Intent(this, SettingsActivity.class));
+ break;
}
return true;
diff --git a/src/org/yaaic/view/SettingsActivity.java b/src/org/yaaic/view/SettingsActivity.java
new file mode 100644
index 0000000..f3151e9
--- /dev/null
+++ b/src/org/yaaic/view/SettingsActivity.java
@@ -0,0 +1,45 @@
+/*
+Yaaic - Yet Another Android IRC Client
+
+Copyright 2009-2010 Sebastian Kaspari
+
+This file is part of Yaaic.
+
+Yaaic is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Yaaic 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 Yaaic. If not, see .
+*/
+package org.yaaic.view;
+
+import org.yaaic.R;
+
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+
+/**
+ * Settings
+ *
+ * @author Sebastian Kaspari
+ */
+public class SettingsActivity extends PreferenceActivity
+{
+ /**
+ * On create
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.preferences);
+ }
+}