diff --git a/art/itoopie-512.svg b/art/itoopie-512.svg index fca9c38bd..27dba8c16 100644 --- a/art/itoopie-512.svg +++ b/art/itoopie-512.svg @@ -15,7 +15,6 @@ version="1.1" inkscape:version="0.48.4 r9939" sodipodi:docname="itoopie-512.svg" - inkscape:export-filename="/home/str4d/dev/i2p/android/i2p.android.base/res/drawable-xhdpi/ic_launcher_itoopie.png" inkscape:export-xdpi="16.875" inkscape:export-ydpi="16.875"> + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/drawable-hdpi/ic_stat_router_active.png b/res/drawable-hdpi/ic_stat_router_active.png new file mode 100644 index 000000000..496034692 Binary files /dev/null and b/res/drawable-hdpi/ic_stat_router_active.png differ diff --git a/res/drawable-hdpi/ic_stat_router_running.png b/res/drawable-hdpi/ic_stat_router_running.png new file mode 100644 index 000000000..d631b0c69 Binary files /dev/null and b/res/drawable-hdpi/ic_stat_router_running.png differ diff --git a/res/drawable-hdpi/ic_stat_router_shutting_down.png b/res/drawable-hdpi/ic_stat_router_shutting_down.png new file mode 100644 index 000000000..423a0b34f Binary files /dev/null and b/res/drawable-hdpi/ic_stat_router_shutting_down.png differ diff --git a/res/drawable-hdpi/ic_stat_router_starting.png b/res/drawable-hdpi/ic_stat_router_starting.png new file mode 100644 index 000000000..e28c96bf9 Binary files /dev/null and b/res/drawable-hdpi/ic_stat_router_starting.png differ diff --git a/res/drawable-hdpi/ic_stat_router_stopping.png b/res/drawable-hdpi/ic_stat_router_stopping.png new file mode 100644 index 000000000..1de043e37 Binary files /dev/null and b/res/drawable-hdpi/ic_stat_router_stopping.png differ diff --git a/res/drawable-hdpi/ic_stat_router_waiting_network.png b/res/drawable-hdpi/ic_stat_router_waiting_network.png new file mode 100644 index 000000000..a86bf8376 Binary files /dev/null and b/res/drawable-hdpi/ic_stat_router_waiting_network.png differ diff --git a/res/drawable-mdpi/ic_stat_router_active.png b/res/drawable-mdpi/ic_stat_router_active.png new file mode 100644 index 000000000..61c0c28f5 Binary files /dev/null and b/res/drawable-mdpi/ic_stat_router_active.png differ diff --git a/res/drawable-mdpi/ic_stat_router_running.png b/res/drawable-mdpi/ic_stat_router_running.png new file mode 100644 index 000000000..8559f1725 Binary files /dev/null and b/res/drawable-mdpi/ic_stat_router_running.png differ diff --git a/res/drawable-mdpi/ic_stat_router_shutting_down.png b/res/drawable-mdpi/ic_stat_router_shutting_down.png new file mode 100644 index 000000000..1738099b4 Binary files /dev/null and b/res/drawable-mdpi/ic_stat_router_shutting_down.png differ diff --git a/res/drawable-mdpi/ic_stat_router_starting.png b/res/drawable-mdpi/ic_stat_router_starting.png new file mode 100644 index 000000000..5494104c1 Binary files /dev/null and b/res/drawable-mdpi/ic_stat_router_starting.png differ diff --git a/res/drawable-mdpi/ic_stat_router_stopping.png b/res/drawable-mdpi/ic_stat_router_stopping.png new file mode 100644 index 000000000..85363b28b Binary files /dev/null and b/res/drawable-mdpi/ic_stat_router_stopping.png differ diff --git a/res/drawable-mdpi/ic_stat_router_waiting_network.png b/res/drawable-mdpi/ic_stat_router_waiting_network.png new file mode 100644 index 000000000..a7f866c0c Binary files /dev/null and b/res/drawable-mdpi/ic_stat_router_waiting_network.png differ diff --git a/res/drawable-xhdpi/ic_stat_router_active.png b/res/drawable-xhdpi/ic_stat_router_active.png new file mode 100644 index 000000000..ebfeb6984 Binary files /dev/null and b/res/drawable-xhdpi/ic_stat_router_active.png differ diff --git a/res/drawable-xhdpi/ic_stat_router_running.png b/res/drawable-xhdpi/ic_stat_router_running.png new file mode 100644 index 000000000..1cb448c6e Binary files /dev/null and b/res/drawable-xhdpi/ic_stat_router_running.png differ diff --git a/res/drawable-xhdpi/ic_stat_router_shutting_down.png b/res/drawable-xhdpi/ic_stat_router_shutting_down.png new file mode 100644 index 000000000..f3f256b17 Binary files /dev/null and b/res/drawable-xhdpi/ic_stat_router_shutting_down.png differ diff --git a/res/drawable-xhdpi/ic_stat_router_starting.png b/res/drawable-xhdpi/ic_stat_router_starting.png new file mode 100644 index 000000000..61181d220 Binary files /dev/null and b/res/drawable-xhdpi/ic_stat_router_starting.png differ diff --git a/res/drawable-xhdpi/ic_stat_router_stopping.png b/res/drawable-xhdpi/ic_stat_router_stopping.png new file mode 100644 index 000000000..f60a559e3 Binary files /dev/null and b/res/drawable-xhdpi/ic_stat_router_stopping.png differ diff --git a/res/drawable-xhdpi/ic_stat_router_waiting_network.png b/res/drawable-xhdpi/ic_stat_router_waiting_network.png new file mode 100644 index 000000000..87aa4c733 Binary files /dev/null and b/res/drawable-xhdpi/ic_stat_router_waiting_network.png differ diff --git a/res/drawable/ic_launcher_itoopie_120.png b/res/drawable/ic_launcher_itoopie_120.png deleted file mode 100644 index 00a964f48..000000000 Binary files a/res/drawable/ic_launcher_itoopie_120.png and /dev/null differ diff --git a/res/drawable/ic_launcher_itoopie_150.png b/res/drawable/ic_launcher_itoopie_150.png deleted file mode 100644 index 14e1fd63d..000000000 Binary files a/res/drawable/ic_launcher_itoopie_150.png and /dev/null differ diff --git a/res/drawable/ic_launcher_itoopie_180.png b/res/drawable/ic_launcher_itoopie_180.png deleted file mode 100644 index a1059e986..000000000 Binary files a/res/drawable/ic_launcher_itoopie_180.png and /dev/null differ diff --git a/res/drawable/ic_launcher_itoopie_300.png b/res/drawable/ic_launcher_itoopie_300.png deleted file mode 100644 index e7baee6dc..000000000 Binary files a/res/drawable/ic_launcher_itoopie_300.png and /dev/null differ diff --git a/res/drawable/ic_launcher_itoopie_330.png b/res/drawable/ic_launcher_itoopie_330.png deleted file mode 100644 index 8a09d4034..000000000 Binary files a/res/drawable/ic_launcher_itoopie_330.png and /dev/null differ diff --git a/src/net/i2p/android/router/service/RouterService.java b/src/net/i2p/android/router/service/RouterService.java index 0c99d79fe..de246ae5d 100644 --- a/src/net/i2p/android/router/service/RouterService.java +++ b/src/net/i2p/android/router/service/RouterService.java @@ -110,15 +110,15 @@ public class RouterService extends Service { _receiver = new I2PReceiver(this); if(Util.isConnected(this)) { if(restart) { - _statusBar.replace(StatusBar.ICON1, "I2P is restarting"); + _statusBar.replace(StatusBar.ICON_STARTING, "I2P is restarting"); } else { - _statusBar.replace(StatusBar.ICON1, "I2P is starting up"); + _statusBar.replace(StatusBar.ICON_STARTING, "I2P is starting up"); } setState(State.STARTING); _starterThread = new Thread(new Starter()); _starterThread.start(); } else { - _statusBar.replace(StatusBar.ICON6, "I2P is waiting for a network connection"); + _statusBar.replace(StatusBar.ICON_WAITING_NETWORK, "I2P is waiting for a network connection"); setState(State.WAITING); _handler.postDelayed(new Waiter(), 10 * 1000); } @@ -147,7 +147,7 @@ public class RouterService extends Service { if(_state != State.WAITING) { return; } - _statusBar.replace(StatusBar.ICON1, "Network connected, I2P is starting up"); + _statusBar.replace(StatusBar.ICON_STARTING, "Network connected, I2P is starting up"); setState(State.STARTING); _starterThread = new Thread(new Starter()); _starterThread.start(); @@ -319,7 +319,7 @@ public class RouterService extends Service { if((contexts == null) || (contexts.isEmpty())) { throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down."); } - _statusBar.replace(StatusBar.ICON2, "I2P is running"); + _statusBar.replace(StatusBar.ICON_RUNNING, "I2P is running"); _context = (RouterContext) contexts.get(0); _context.router().setKillVMOnEnd(false); Job loadJob = new LoadClientsJob(_context); @@ -379,9 +379,9 @@ public class RouterService extends Service { boolean haveTunnels = inCl > 0 && outCl > 0; if(haveTunnels != _hadTunnels) { if(haveTunnels) { - _statusBar.replace(StatusBar.ICON3, "Client tunnels are ready"); + _statusBar.replace(StatusBar.ICON_ACTIVE, "Client tunnels are ready"); } else { - _statusBar.replace(StatusBar.ICON2, "Client tunnels are down"); + _statusBar.replace(StatusBar.ICON_RUNNING, "Client tunnels are down"); } _hadTunnels = haveTunnels; } @@ -447,7 +447,7 @@ public class RouterService extends Service { _starterThread.interrupt(); } if(_state == State.STARTING || _state == State.RUNNING) { - _statusBar.replace(StatusBar.ICON4, "Stopping I2P"); + _statusBar.replace(StatusBar.ICON_STOPPING, "Stopping I2P"); Thread stopperThread = new Thread(new Stopper(State.MANUAL_STOPPING, State.MANUAL_STOPPED)); stopperThread.start(); } @@ -468,7 +468,7 @@ public class RouterService extends Service { _starterThread.interrupt(); } if(_state == State.STARTING || _state == State.RUNNING) { - _statusBar.replace(StatusBar.ICON4, "Stopping I2P"); + _statusBar.replace(StatusBar.ICON_STOPPING, "Stopping I2P"); Thread stopperThread = new Thread(new Stopper(State.MANUAL_QUITTING, State.MANUAL_QUITTED)); stopperThread.start(); } else if(_state == State.WAITING) { @@ -489,7 +489,7 @@ public class RouterService extends Service { _starterThread.interrupt(); } if(_state == State.STARTING || _state == State.RUNNING) { - _statusBar.replace(StatusBar.ICON4, "Network disconnected, stopping I2P"); + _statusBar.replace(StatusBar.ICON_STOPPING, "Network disconnected, stopping I2P"); // don't change state, let the shutdown hook do it Thread stopperThread = new Thread(new Stopper(State.NETWORK_STOPPING, State.NETWORK_STOPPING)); stopperThread.start(); @@ -509,7 +509,7 @@ public class RouterService extends Service { if(!canManualStart()) { return; } - _statusBar.replace(StatusBar.ICON1, "I2P is starting up"); + _statusBar.replace(StatusBar.ICON_STARTING, "I2P is starting up"); setState(State.STARTING); _starterThread = new Thread(new Starter()); _starterThread.start(); @@ -547,7 +547,7 @@ public class RouterService extends Service { } if(_state == State.STARTING || _state == State.RUNNING) { // should this be in a thread? - _statusBar.replace(StatusBar.ICON5, "I2P is shutting down"); + _statusBar.replace(StatusBar.ICON_SHUTTING_DOWN, "I2P is shutting down"); Thread stopperThread = new Thread(new Stopper(State.STOPPING, State.STOPPED)); stopperThread.start(); } @@ -602,7 +602,7 @@ public class RouterService extends Service { public void run() { Util.i(this + " shutdown hook" + " Current state is: " + _state); - _statusBar.replace(StatusBar.ICON5, "I2P is shutting down"); + _statusBar.replace(StatusBar.ICON_SHUTTING_DOWN, "I2P is shutting down"); I2PReceiver rcvr = _receiver; if(rcvr != null) { synchronized(rcvr) { diff --git a/src/net/i2p/android/router/service/StatusBar.java b/src/net/i2p/android/router/service/StatusBar.java index 27c24fe1b..f6191e7bf 100644 --- a/src/net/i2p/android/router/service/StatusBar.java +++ b/src/net/i2p/android/router/service/StatusBar.java @@ -17,12 +17,12 @@ class StatusBar { private static final int ID = 1337; - public static final int ICON1 = R.drawable.ic_launcher_itoopie_300; - public static final int ICON2 = R.drawable.ic_launcher_itoopie_330; - public static final int ICON3 = R.drawable.ic_launcher_itoopie; - public static final int ICON4 = R.drawable.ic_launcher_itoopie_120; - public static final int ICON5 = R.drawable.ic_launcher_itoopie_150; - public static final int ICON6 = R.drawable.ic_launcher_itoopie_180; + public static final int ICON_STARTING = R.drawable.ic_stat_router_starting; + public static final int ICON_RUNNING = R.drawable.ic_stat_router_running; + public static final int ICON_ACTIVE = R.drawable.ic_stat_router_active; + public static final int ICON_STOPPING = R.drawable.ic_stat_router_stopping; + public static final int ICON_SHUTTING_DOWN = R.drawable.ic_stat_router_shutting_down; + public static final int ICON_WAITING_NETWORK = R.drawable.ic_stat_router_waiting_network; StatusBar(Context cx) { ctx = cx; @@ -30,7 +30,7 @@ class StatusBar { mgr = (NotificationManager)ctx.getSystemService(ns); Thread.currentThread().setUncaughtExceptionHandler(new CrashHandler(mgr)); - int icon = ICON1; + int icon = ICON_STARTING; // won't be shown if replace() is called String text = "Starting I2P"; long now = System.currentTimeMillis();