Skip to content

Commit

Permalink
Remove updateConnectionStatus and fix text color as white
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-grace committed May 3, 2024
1 parent 1b8ff3c commit 9447826
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1027,26 +1027,6 @@ private Drawable getDrawableResource(int resID) {
return ContextCompat.getDrawable(this, resID);
}

/**
* Updates connection status UI according to current connection status.
*/
private void updateConnectionStatus() {
ConnectedDevice connectedDevice = BluetoothUtils.getPairedMicrobit(this);

if(!connectedDevice.mStatus) {
// Device is not connected
deviceConnectionStatusTextView.setBackgroundResource(R.drawable.grey_text_view);
deviceConnectionStatusTextView.setTextColor(Color.WHITE);
deviceConnectionStatusTextView.setContentDescription("Micro:bit not connected " + connectedDevice.mName + "is " + getStatusString(connectedDevice.mStatus));

} else {
// Device is connected
deviceConnectionStatusTextView.setBackgroundResource(R.drawable.white_btn_devices_status_connected);
deviceConnectionStatusTextView.setTextColor(Color.BLACK);
deviceConnectionStatusTextView.setContentDescription("Currently connected Micro:bit " + connectedDevice.mName + "is " + getStatusString(connectedDevice.mStatus));
}
}

/**
* Converts status state from boolean to its String representation.
*
Expand All @@ -1066,11 +1046,9 @@ private void updatePairedDeviceCard() {
ConnectedDevice connectedDevice = BluetoothUtils.getPairedMicrobit(this);
if(connectedDevice.mName == null) {
// No device is Paired
deviceConnectionStatusTextView.setBackgroundResource(R.drawable.grey_text_view);
deviceConnectionStatusTextView.setText("-");
} else {
deviceConnectionStatusTextView.setText(connectedDevice.mName);
updateConnectionStatus();
}
logi("updatePairedDeviceCard End");
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/pairing_device_state.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
android:id="@+id/connected_device_status"
style="@style/pairing_device_state_text_view_style"
android:background="@drawable/grey_text_view"
android:textColor="@color/white_color"
android:contentDescription="@null" />
</LinearLayout>

0 comments on commit 9447826

Please sign in to comment.