Added "Demo Mode" when phone data source is selected and highlighted it in warning colour - fixes #56.

This commit is contained in:
Graham Jones
2022-08-06 20:52:45 +01:00
parent 3fa884dcfb
commit e953887a4b
2 changed files with 12 additions and 6 deletions

View File

@@ -504,9 +504,15 @@ public class MainActivity extends AppCompatActivity {
if (mUtil.isServerRunning()) {
tv = (TextView) findViewById(R.id.serverStatusTv);
if (mConnection.mBound)
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + mConnection.mSdServer.mSdDataSourceName);
tv.setBackgroundColor(okColour);
tv.setTextColor(okTextColour);
if (mConnection.mSdServer.mSdDataSourceName.equals("Phone")) {
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + "Phone"+"\n"+"(Demo Mode)");
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
} else {
tv.setText(getString(R.string.ServerRunningOK) + getString(R.string.DataSource) + " = " + mConnection.mSdServer.mSdDataSourceName);
tv.setBackgroundColor(okColour);
tv.setTextColor(okTextColour);
}
tv = (TextView) findViewById(R.id.serverIpTv);
tv.setText(getString(R.string.AccessServerAt) + " http://"
+ mUtil.getLocalIpAddress()

View File

@@ -19,7 +19,7 @@
<TextView
android:id="@+id/serverStatusTv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center"
android:text="textView1" />
@@ -27,7 +27,7 @@
<TextView
android:id="@+id/serverIpTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:gravity="center"
android:text="textView2" />
@@ -81,7 +81,7 @@
<TextView
android:id="@+id/battTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:text="battTv" />
</LinearLayout>
</LinearLayout>