Fixed issue with crash when switching between new and original UI

This commit is contained in:
Graham Jones
2024-01-27 22:49:27 +00:00
parent c89d02e397
commit 02eeca28a3
4 changed files with 138 additions and 136 deletions

View File

@@ -185,20 +185,6 @@ public class FragmentCommon extends FragmentOsdBaseClass {
tv.setTextColor(Color.GRAY);
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
}
}
} else {
tv = (TextView) mRootView.findViewById(R.id.serverStatusTv);
tv.setText(R.string.ServerStopped);
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
/** FIXME - check this is not needed for this fragment
tv = (TextView) mRootView.findViewById(R.id.serverIpTv);
tv.setText("--");
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
*/
}
tv = (TextView) mRootView.findViewById(R.id.dataSourceInfoTv);
tv.setBackgroundColor(okColour);
@@ -215,6 +201,22 @@ public class FragmentCommon extends FragmentOsdBaseClass {
tv.setText(getString(R.string.DataSource) + " = " + mConnection.mSdServer.mSdDataSourceName);
}
}
} else {
tv = (TextView) mRootView.findViewById(R.id.serverStatusTv);
tv.setText(R.string.ServerStopped);
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
/** FIXME - check this is not needed for this fragment
tv = (TextView) mRootView.findViewById(R.id.serverIpTv);
tv.setText("--");
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
*/
}
// deal with latch alarms button
Button acceptAlarmButton = (Button) mRootView.findViewById(R.id.acceptAlarmButton);

View File

@@ -46,7 +46,7 @@ public class FragmentOsdAlg extends FragmentOsdBaseClass {
//Log.d(TAG,"updateUi()");
TextView tv;
if (mConnection.mBound) {
/////////////////////////////////////////////////////
// Set ProgressBars to show margin to alarm.
long powerPc;
@@ -183,6 +183,6 @@ public class FragmentOsdAlg extends FragmentOsdBaseClass {
mChart.invalidate();
}
}
}

View File

@@ -74,14 +74,14 @@ public class FragmentSystem extends FragmentOsdBaseClass {
if (mConnection.mBound) {
if (mConnection.mSdServer.mSdDataSourceName.equals("Phone")) {
if (mConnection.mSdServer.mLogNDA)
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + "Phone" + "\n" + "(Demo Mode)" + "\nNDA Logging");
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + "Phone" + " " + "(Demo Mode)" + "\nNDA Logging");
else
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + "Phone" + "\n" + "(Demo Mode)");
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + "Phone" + " " + "(Demo Mode)");
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
} else {
if (mConnection.mSdServer.mLogNDA)
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + mConnection.mSdServer.mSdDataSourceName + "\nNDA Logging");
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + mConnection.mSdServer.mSdDataSourceName + ": NDA Logging");
else
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + mConnection.mSdServer.mSdDataSourceName);
tv.setBackgroundColor(okColour);