Separated data log manager into two screens (local and remote) to simplify interface
This commit is contained in:
@@ -233,7 +233,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
private void updateUi() {
|
||||
//Log.v(TAG,"updateUi()");
|
||||
Log.i(TAG,"updateUi()");
|
||||
boolean stopUpdating = true;
|
||||
TextView tv;
|
||||
Button btn;
|
||||
@@ -250,7 +250,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
} else {
|
||||
stopUpdating = false;
|
||||
}
|
||||
|
||||
// Local Database ListView
|
||||
if (mEventsList != null) {
|
||||
ListView lv = (ListView) findViewById(R.id.eventLogListView);
|
||||
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
|
||||
if (mRemoteEventsList != null) {
|
||||
ListView lv = (ListView) findViewById(R.id.remoteEventsLv);
|
||||
ListAdapter adapter = new SimpleAdapter(LogManagerControlActivity.this, mRemoteEventsList, R.layout.log_entry_layout,
|
||||
new String[]{"dataTime", "type", "subType"},
|
||||
new int[]{R.id.event_date, R.id.event_alarmState, R.id.event_uploaded});
|
||||
ListAdapter adapter = new SimpleAdapter(LogManagerControlActivity.this, mRemoteEventsList, R.layout.log_entry_layout_remote,
|
||||
new String[]{"dataTime", "type", "subType", "osdAlarmStateStr", "desc"},
|
||||
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);
|
||||
Log.i(TAG,"adapter[0]="+adapter.getItem(0));
|
||||
Log.i(TAG,"adapter[3]="+adapter.getItem(3));
|
||||
} else {
|
||||
//mUtil.showToast("No Remote Events");
|
||||
Log.d(TAG, "UpdateUi: No Remote Events");
|
||||
Log.i(TAG, "UpdateUi: No Remote Events");
|
||||
stopUpdating = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<ListView
|
||||
android:id="@+id/eventLogListView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -123,12 +123,6 @@
|
||||
android:text="@string/remote_database"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/remoteEventsLv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -145,13 +139,21 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/authenticate" />
|
||||
<Button
|
||||
android:id="@+id/refresh_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/refreshBtn" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/refresh_button"
|
||||
|
||||
<ListView
|
||||
android:id="@+id/remoteEventsLv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/refreshBtn" />
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
53
app/src/main/res/layout/log_entry_layout_remote.xml
Normal file
53
app/src/main/res/layout/log_entry_layout_remote.xml
Normal 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>
|
||||
Reference in New Issue
Block a user