Merge "[Provider Model] Correct Wi-Fi toggle title color in Dark Theme"

This commit is contained in:
TreeHugger Robot
2021-08-13 14:43:11 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -191,6 +191,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:id="@+id/wifi_toggle_title"
android:text="@string/turn_on_wifi"
android:textDirection="locale"
android:layout_width="wrap_content"

View File

@@ -111,6 +111,7 @@ public class InternetDialog extends SystemUIDialog implements
private LinearLayout mMobileNetworkLayout;
private LinearLayout mMobileNetworkList;
private LinearLayout mTurnWifiOnLayout;
private TextView mWifiToggleTitleText;
private LinearLayout mSeeAllLayout;
private RecyclerView mWifiRecyclerView;
private ImageView mConnectedWifiIcon;
@@ -215,6 +216,7 @@ public class InternetDialog extends SystemUIDialog implements
mMobileNetworkLayout = mDialogView.requireViewById(R.id.mobile_network_layout);
mMobileNetworkList = mDialogView.requireViewById(R.id.mobile_network_list);
mTurnWifiOnLayout = mDialogView.requireViewById(R.id.turn_on_wifi_layout);
mWifiToggleTitleText = mDialogView.requireViewById(R.id.wifi_toggle_title);
mConnectedWifListLayout = mDialogView.requireViewById(R.id.wifi_connected_layout);
mConnectedWifList = mDialogView.requireViewById(R.id.wifi_connected_list);
mConnectedWifiIcon = mDialogView.requireViewById(R.id.wifi_connected_icon);
@@ -368,6 +370,12 @@ public class InternetDialog extends SystemUIDialog implements
private void updateWifiToggle(boolean isWifiEnabled, boolean isDeviceLocked) {
mWiFiToggle.setChecked(isWifiEnabled);
if (isDeviceLocked && mInternetDialogController.isNightMode()) {
int titleColor = mConnectedWifiEntry != null ? mContext.getColor(
R.color.connected_network_primary_color) : Utils.getColorAttrDefaultColor(
mContext, android.R.attr.textColorPrimary);
mWifiToggleTitleText.setTextColor(titleColor);
}
mTurnWifiOnLayout.setBackground(
(isDeviceLocked && mConnectedWifiEntry != null) ? mBackgroundOn : null);
}