summaryrefslogtreecommitdiff
path: root/src/se
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-01-30 23:35:42 -0700
committerSean Leonard <meanderingcode@aetherislands.net>2013-01-30 23:35:42 -0700
commitb6e47ac59c3e853b23d4392eec33bbeb2f068f17 (patch)
treeb8beb6cd90ac234df8a2f8016af7d9a6e95d7fab /src/se
parentfea68f17a1a69bc3710e1b1b743e0d0ded95234a (diff)
Add EIP Service item in Dashboard
Diffstat (limited to 'src/se')
-rw-r--r--src/se/leap/leapclient/Dashboard.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index cc215be9..5835acb8 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -47,6 +47,10 @@ public class Dashboard extends Activity {
providerNameTV = (TextView) findViewById(R.id.providerName);
providerNameTV.setText(provider.getName());
providerNameTV.setTextSize(28); // TODO maybe to some calculating, or a marquee?
+
+ // TODO Inflate layout fragments for provider's services
+ if ( provider.hasEIP() )
+ serviceItemEIP();
}
// FIXME!! We don't want you around here once we have something /real/ going on
@@ -96,6 +100,35 @@ public class Dashboard extends Activity {
fakes.commit();
}
+ private void serviceItemEIP() {
+ // FIXME Provider service (eip/openvpn)
+ View eipOverview = ((ViewStub) findViewById(R.id.eipOverviewStub)).inflate();
+
+ // Set our EIP type title
+ eipTypeTV = (TextView) findViewById(R.id.eipType);
+ eipTypeTV.setText(provider.getEIPType());
+
+ // TODO Bind our switch to run our EIP
+ // What happens when our VPN stops running? does it call the listener?
+ Switch eipSwitch = (Switch) findViewById(R.id.eipSwitch);
+ eipSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if ( isChecked ){
+ //TODO startVPN();
+ } else {
+ //TODO stopVPN();
+ }
+ }
+ });
+
+ //TODO write our info into the view fragment that will expand with details and a settings button
+ // TODO set eip overview subview
+ // TODO make eip type clickable, show subview
+ // TODO attach vpn status feedback to eip overview view
+ // TODO attach settings button to something
+ }
+
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.