summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2019-06-02 08:43:13 +0200
committerBjørn Mork <bjorn@mork.no>2019-06-02 08:43:13 +0200
commit3ee2d0f387d2d5602ec187a3bdd9cafaeb6b954f (patch)
treee8c52e6bda74726167c99db93257debebe8c4172
parent926d5e0c71bae1a550ce3ec593534a751ae43a03 (diff)
use best practice naming for item layouts
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--Defogger/Makefile2
-rw-r--r--Defogger/res/layout/item_net.xml29
-rw-r--r--Defogger/res/layout/item_scan.xml (renamed from Defogger/res/layout/scanitem.xml)0
-rw-r--r--Defogger/src/no/mork/android/defogger/MainActivity.java7
-rw-r--r--Defogger/src/no/mork/android/defogger/ScannerActivity.java2
5 files changed, 37 insertions, 3 deletions
diff --git a/Defogger/Makefile b/Defogger/Makefile
index c27b63e..ca41316 100644
--- a/Defogger/Makefile
+++ b/Defogger/Makefile
@@ -14,7 +14,7 @@ JAVAVER ?= 8
ANDROID_HOME ?= /usr/lib/android-sdk
SDKCLASSPATH ?= $(ANDROID_HOME)/platforms/android-$(APIVER)/android.jar
-RESOURCES=layout/activity_main.xml layout/activity_scanner.xml layout/scanitem.xml layout/netitem.xml values/strings.xml
+RESOURCES=layout/activity_main.xml layout/activity_scanner.xml layout/item_scan.xml layout/item_net.xml values/strings.xml
RES=$(addprefix res/,$(RESOURCES))
## Temp disabled while we have some non-building classess....
diff --git a/Defogger/res/layout/item_net.xml b/Defogger/res/layout/item_net.xml
new file mode 100644
index 0000000..f3f8eb8
--- /dev/null
+++ b/Defogger/res/layout/item_net.xml
@@ -0,0 +1,29 @@
+<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:id="@+id/ssid"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <TextView
+ android:id="@+id/channel"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <TextView
+ android:id="@+id/key_mgmt"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <TextView
+ android:id="@+id/proto"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <TextView
+ android:id="@+id/rssi"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ </TableRow>
+</TableLayout>
diff --git a/Defogger/res/layout/scanitem.xml b/Defogger/res/layout/item_scan.xml
index 3167c3a..3167c3a 100644
--- a/Defogger/res/layout/scanitem.xml
+++ b/Defogger/res/layout/item_scan.xml
diff --git a/Defogger/src/no/mork/android/defogger/MainActivity.java b/Defogger/src/no/mork/android/defogger/MainActivity.java
index 3808499..e9376ba 100644
--- a/Defogger/src/no/mork/android/defogger/MainActivity.java
+++ b/Defogger/src/no/mork/android/defogger/MainActivity.java
@@ -1,3 +1,8 @@
+/*
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (c) 2019 Bjørn Mork <bjorn@mork.no>
+ */
+
package no.mork.android.defogger;
import android.app.Activity;
@@ -395,7 +400,7 @@ public class MainActivity extends Activity {
runOnUiThread(new Runnable() {
@Override
public void run() {
- ArrayAdapter<String> itemsAdapter = new NetAdapter(ctx, R.layout.netitem, networks);
+ ArrayAdapter<String> itemsAdapter = new NetAdapter(ctx, R.layout.item_net, networks);
ListView listView = (ListView) findViewById(R.id.networks);
listView.setAdapter(itemsAdapter);
}
diff --git a/Defogger/src/no/mork/android/defogger/ScannerActivity.java b/Defogger/src/no/mork/android/defogger/ScannerActivity.java
index f645a6c..098b139 100644
--- a/Defogger/src/no/mork/android/defogger/ScannerActivity.java
+++ b/Defogger/src/no/mork/android/defogger/ScannerActivity.java
@@ -75,7 +75,7 @@ public class ScannerActivity extends Activity implements Runnable {
setContentView(R.layout.activity_scanner);
ListView listView = (ListView) findViewById(R.id.scanlist_view);
- scanlistAdapter = new ScanListAdapter(this, R.layout.scanitem, R.id.scanitem);
+ scanlistAdapter = new ScanListAdapter(this, R.layout.item_scan, R.id.scanitem);
listView.setAdapter(scanlistAdapter);
leScanCallback = new BtleScanCallback(scanlistAdapter);