optimized examples
This commit is contained in:
@@ -190,12 +190,14 @@ public class ControlFragment extends Fragment implements View.OnClickListener {
|
|||||||
|
|
||||||
private void onEmitterConnected() {
|
private void onEmitterConnected() {
|
||||||
mParent.runOnUiThread(() -> {
|
mParent.runOnUiThread(() -> {
|
||||||
|
Log.d(TAG, "onEmitterConnected, set the status and button color in UI");
|
||||||
mBtnConnect.setImageDrawable(AppCompatResources.getDrawable(mParent, R.mipmap.button_unlink));
|
mBtnConnect.setImageDrawable(AppCompatResources.getDrawable(mParent, R.mipmap.button_unlink));
|
||||||
mVWConnectStatus.setBackgroundColor(Color.parseColor("#3FAFFF"));
|
mVWConnectStatus.setBackgroundColor(Color.parseColor("#3FAFFF"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private void onEmitterDisconnected() {
|
private void onEmitterDisconnected() {
|
||||||
mParent.runOnUiThread(() -> {
|
mParent.runOnUiThread(() -> {
|
||||||
|
Log.d(TAG, "onEmitterConnected, set the status and button color in UI");
|
||||||
ToastUtils.showToast(mParent, mParent.getString(R.string.connect_disconnected), Toast.LENGTH_SHORT);
|
ToastUtils.showToast(mParent, mParent.getString(R.string.connect_disconnected), Toast.LENGTH_SHORT);
|
||||||
mBtnConnect.setImageDrawable(AppCompatResources.getDrawable(mParent, R.mipmap.button_link));
|
mBtnConnect.setImageDrawable(AppCompatResources.getDrawable(mParent, R.mipmap.button_link));
|
||||||
mVWConnectStatus.setBackgroundColor(Color.parseColor("#FF7F7F"));
|
mVWConnectStatus.setBackgroundColor(Color.parseColor("#FF7F7F"));
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ void printWiFiStatus() {
|
|||||||
if (currentMillis - lastStatusCheck >= ALIVE_DEBUG_INTERVAL) {
|
if (currentMillis - lastStatusCheck >= ALIVE_DEBUG_INTERVAL) {
|
||||||
const IPAddress ip = WiFi.localIP();
|
const IPAddress ip = WiFi.localIP();
|
||||||
if (0 == strcmp(ip.toString().c_str(), "0.0.0.0")) {
|
if (0 == strcmp(ip.toString().c_str(), "0.0.0.0")) {
|
||||||
lastStatusCheck = currentMillis;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
serialPrint(LOG_INFO, "Wi-Fi SSID: %s", WiFi.SSID());
|
serialPrint(LOG_INFO, "Wi-Fi SSID: %s", WiFi.SSID());
|
||||||
|
|||||||
Reference in New Issue
Block a user