Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45de39e0 authored by Weng Su's avatar Weng Su
Browse files

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

- Update title color when device is locked in Dark Theme

Bug: 196513308
Test: manual test
atest -c InternetDialogTest

Change-Id: I24e86a75d4a72c837191277ed5258b81cd5aee00
parent 99b0bd20
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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"
+8 −0
Original line number Diff line number Diff line
@@ -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);
    }