summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2019-06-04 22:17:03 +0200
committerBjørn Mork <bjorn@mork.no>2019-06-04 22:17:03 +0200
commitf17c59c8b3cd685e6da907c006b0bf12c899e258 (patch)
tree860eaec73398f358fa5b076849d1124f9b892bea
parent105aec2139467612b82a6c8c59c92a35d8718b8c (diff)
wip
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--Defogger/res/layout/activity_configurenetwork.xml4
-rw-r--r--Defogger/res/layout/activity_scanner.xml1
-rw-r--r--Defogger/res/layout/item_net.xml4
-rw-r--r--Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java3
-rw-r--r--Defogger/src/no/mork/android/defogger/Util.java15
5 files changed, 17 insertions, 10 deletions
diff --git a/Defogger/res/layout/activity_configurenetwork.xml b/Defogger/res/layout/activity_configurenetwork.xml
index 6158fff..c94d760 100644
--- a/Defogger/res/layout/activity_configurenetwork.xml
+++ b/Defogger/res/layout/activity_configurenetwork.xml
@@ -37,5 +37,7 @@
<ListView
android:id="@+id/networks"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ android:layout_height="wrap_content"
+ android:choiceMode="singleChoice"
+ android:listSelector="@color/list_view_selector"/>
</LinearLayout>
diff --git a/Defogger/res/layout/activity_scanner.xml b/Defogger/res/layout/activity_scanner.xml
index c1edca6..975bb61 100644
--- a/Defogger/res/layout/activity_scanner.xml
+++ b/Defogger/res/layout/activity_scanner.xml
@@ -26,5 +26,6 @@
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:choiceMode="singleChoice"
+ android:listSelector="@color/list_view_selector"
android:layout_below="@id/pincode" />
</RelativeLayout>
diff --git a/Defogger/res/layout/item_net.xml b/Defogger/res/layout/item_net.xml
index b399c43..4efb06c 100644
--- a/Defogger/res/layout/item_net.xml
+++ b/Defogger/res/layout/item_net.xml
@@ -5,5 +5,7 @@
<TextView
android:id="@+id/ssid"
android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content"
+ android:background="@color/list_view_selector"
+ android:textSize="20sp" />
</LinearLayout>
diff --git a/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java b/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java
index d1803c4..6892bd7 100644
--- a/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java
+++ b/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java
@@ -75,6 +75,7 @@ public class ConfigureNetworkActivity extends Activity {
ListView listView = (ListView) findViewById(R.id.networks);
listView.setAdapter(networklist);
+ setResult(RESULT_CANCELED); // default
}
public void returnConfigResult(String config) {
@@ -83,8 +84,6 @@ public class ConfigureNetworkActivity extends Activity {
if (config != null) {
intent.putExtra("netconf", config);
setResult(RESULT_OK, intent);
- } else {
- setResult(RESULT_CANCELED, intent);
}
finish();
}
diff --git a/Defogger/src/no/mork/android/defogger/Util.java b/Defogger/src/no/mork/android/defogger/Util.java
index 6bbfd99..9b122d8 100644
--- a/Defogger/src/no/mork/android/defogger/Util.java
+++ b/Defogger/src/no/mork/android/defogger/Util.java
@@ -22,12 +22,15 @@ public class Util {
{
Map<String,String> ret = new HashMap();
- if (kv != null)
- for (String s : kv.split(splitter)) {
- String[] foo = s.split("=");
- ret.put(foo[0], foo[1]);
- }
-
+ if (kv == null || kv.length() < 3)
+ return ret;
+
+ for (String s : kv.split(splitter)) {
+ if (s.length() < 3)
+ continue;
+ String[] foo = s.split("=");
+ ret.put(foo[0], foo[1]);
+ }
return ret;
}