From 3ef00eb6a1f77f9ba53c256eededc5afb15c866a Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Mon, 17 Oct 2016 09:47:36 -0400 Subject: [PATCH] now the notification view looks good and has useful information --- res/layout/notification.xml | 7 ++++++- src/org/galexander/sshd/SimpleSSHDService.java | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/res/layout/notification.xml b/res/layout/notification.xml index 4ec387c..2498f6b 100644 --- a/res/layout/notification.xml +++ b/res/layout/notification.xml @@ -3,10 +3,15 @@ android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> - + diff --git a/src/org/galexander/sshd/SimpleSSHDService.java b/src/org/galexander/sshd/SimpleSSHDService.java index f6fee53..8addad1 100644 --- a/src/org/galexander/sshd/SimpleSSHDService.java +++ b/src/org/galexander/sshd/SimpleSSHDService.java @@ -70,6 +70,12 @@ public class SimpleSSHDService extends Service { n.contentView = new RemoteViews(getPackageName(), R.layout.notification); + /* for some reason icon cannot be defined in xml: */ + n.contentView.setImageViewResource(R.id.n_icon, + R.drawable.icon); + n.contentView.setTextViewText(R.id.n_text, + "SimpleSSHD listening on "+SimpleSSHD.get_ip()+ + ":"+Prefs.get_port()); startForeground(1, n); }