Use colors from the Android color palette for the VPN status texts
authorTobias Brunner <tobias@strongswan.org>
Thu, 9 Aug 2012 13:01:19 +0000 (15:01 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Aug 2012 09:22:14 +0000 (11:22 +0200)
src/frontends/android/res/values/colors.xml [new file with mode: 0644]
src/frontends/android/src/org/strongswan/android/ui/VpnStateFragment.java

diff --git a/src/frontends/android/res/values/colors.xml b/src/frontends/android/res/values/colors.xml
new file mode 100644 (file)
index 0000000..be64d5d
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2012 Tobias Brunner
+    Hochschule fuer Technik Rapperswil
+
+    This program 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 2 of the License, or (at your
+    option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+
+    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.
+-->
+<resources>
+
+    <color
+        name="error_text">#D9192C</color>
+
+    <color
+        name="success_text">#99CC00</color>
+
+</resources>
index ac632fd..b86fd18 100644 (file)
@@ -33,7 +33,6 @@ import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.ServiceConnection;
-import android.graphics.Color;
 import android.os.Bundle;
 import android.os.IBinder;
 import android.view.LayoutInflater;
@@ -213,7 +212,7 @@ public class VpnStateFragment extends Fragment implements VpnStateListener
                                showProfile(true);
                                enableActionButton(true);
                                mStateView.setText(R.string.state_connected);
-                               mStateView.setTextColor(Color.GREEN);
+                               mStateView.setTextColor(getResources().getColor(R.color.success_text));
                                break;
                        case DISCONNECTING:
                                showProfile(true);
@@ -254,7 +253,7 @@ public class VpnStateFragment extends Fragment implements VpnStateListener
                showProfile(true);
                enableActionButton(false);
                mStateView.setText(R.string.state_error);
-               mStateView.setTextColor(Color.RED);
+               mStateView.setTextColor(getResources().getColor(R.color.error_text));
                switch (error)
                {
                        case AUTH_FAILED: