Separated data log manager into two screens (local and remote) to simplify interface

This commit is contained in:
Graham Jones
2022-02-09 07:36:20 +00:00
parent b53e646cb5
commit e7e8f79346
3 changed files with 74 additions and 16 deletions

View File

@@ -233,7 +233,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
private void updateUi() { private void updateUi() {
//Log.v(TAG,"updateUi()"); Log.i(TAG,"updateUi()");
boolean stopUpdating = true; boolean stopUpdating = true;
TextView tv; TextView tv;
Button btn; Button btn;
@@ -250,7 +250,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
} else { } else {
stopUpdating = false; stopUpdating = false;
} }
// Local Database ListView
if (mEventsList != null) { if (mEventsList != null) {
ListView lv = (ListView) findViewById(R.id.eventLogListView); ListView lv = (ListView) findViewById(R.id.eventLogListView);
ListAdapter adapter = new SimpleAdapter(LogManagerControlActivity.this, mEventsList, R.layout.log_entry_layout, ListAdapter adapter = new SimpleAdapter(LogManagerControlActivity.this, mEventsList, R.layout.log_entry_layout,
@@ -264,13 +264,16 @@ public class LogManagerControlActivity extends AppCompatActivity {
// Remote Database List View // Remote Database List View
if (mRemoteEventsList != null) { if (mRemoteEventsList != null) {
ListView lv = (ListView) findViewById(R.id.remoteEventsLv); ListView lv = (ListView) findViewById(R.id.remoteEventsLv);
ListAdapter adapter = new SimpleAdapter(LogManagerControlActivity.this, mRemoteEventsList, R.layout.log_entry_layout, ListAdapter adapter = new SimpleAdapter(LogManagerControlActivity.this, mRemoteEventsList, R.layout.log_entry_layout_remote,
new String[]{"dataTime", "type", "subType"}, new String[]{"dataTime", "type", "subType", "osdAlarmStateStr", "desc"},
new int[]{R.id.event_date, R.id.event_alarmState, R.id.event_uploaded}); new int[]{R.id.event_date_remote_tv, R.id.event_type_remote_tv, R.id.event_subtype_remote_tv,
R.id.event_alarmState_remote_tv, R.id.event_notes_remote_tv});
lv.setAdapter(adapter); lv.setAdapter(adapter);
Log.i(TAG,"adapter[0]="+adapter.getItem(0));
Log.i(TAG,"adapter[3]="+adapter.getItem(3));
} else { } else {
//mUtil.showToast("No Remote Events"); //mUtil.showToast("No Remote Events");
Log.d(TAG, "UpdateUi: No Remote Events"); Log.i(TAG, "UpdateUi: No Remote Events");
stopUpdating = false; stopUpdating = false;
} }

View File

@@ -106,7 +106,7 @@
<ListView <ListView
android:id="@+id/eventLogListView" android:id="@+id/eventLogListView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="150dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />
</LinearLayout> </LinearLayout>
@@ -123,12 +123,6 @@
android:text="@string/remote_database" android:text="@string/remote_database"
android:textAppearance="?android:attr/textAppearanceLarge" /> android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="@+id/remoteEventsLv"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_marginTop="10dp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -145,8 +139,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/authenticate" /> android:text="@string/authenticate" />
</LinearLayout>
<Button <Button
android:id="@+id/refresh_button" android:id="@+id/refresh_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -154,4 +146,14 @@
android:text="@string/refreshBtn" /> android:text="@string/refreshBtn" />
</LinearLayout> </LinearLayout>
<ListView
android:id="@+id/remoteEventsLv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/event_date_remote_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="date" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/event_type_remote_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" : " />
<TextView
android:id="@+id/event_subtype_remote_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---" />
</LinearLayout>
<TextView
android:id="@+id/event_alarmState_remote_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="alarm" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="date"
android:id="@+id/event_notes_remote_tv" />
<!-- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="dataJSON"
android:id="@+id/event_dataJSON" />
-->
</LinearLayout>