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

Commit 81a3a3e5 authored by Jiaming Cheng's avatar Jiaming Cheng
Browse files

[QSDetailedView] Polish the lock screen internet details view

- remove the background from the wifi toggle entry

Bug: 378514300
Flag: com.android.systemui.qs_tile_detailed_view
Test: Only change the colors. Existing unit tests still pass.
Change-Id: Ie18f25d8e71aee7f8cbdf43a178b6bd102697cca
parent a4ce82ea
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -130,7 +130,6 @@ constructor(
    private var alertDialog: AlertDialog? = null
    private var canChangeWifiState = false
    private var wifiNetworkHeight = 0
    private var backgroundOn: Drawable? = null
    private var entryBackgroundActive: Drawable? = null
    private var entryBackgroundInactive: Drawable? = null
    private var entryBackgroundStart: Drawable? = null
@@ -223,7 +222,6 @@ constructor(
        progressBar = contentView.requireViewById(R.id.wifi_searching_progress)

        // Background drawables
        backgroundOn = context.getDrawable(R.drawable.settingslib_switch_bar_bg_on)
        entryBackgroundActive = context.getDrawable(R.drawable.settingslib_entry_bg_on)
        entryBackgroundInactive = context.getDrawable(R.drawable.settingslib_entry_bg_off)
        entryBackgroundStart = context.getDrawable(R.drawable.settingslib_entry_bg_off_start)
@@ -714,16 +712,6 @@ constructor(
        if (wifiToggle.isChecked != internetContent.isWifiEnabled) {
            wifiToggle.isChecked = internetContent.isWifiEnabled
        }
        if (internetContent.isDeviceLocked) {
            wifiToggleTitleTextView.setTextAppearance(
                if ((connectedWifiEntry != null))
                    R.style.TextAppearance_TileDetailsEntryTitle_Active
                else R.style.TextAppearance_TileDetailsEntryTitle
            )
        }
        turnWifiOnLayout.background =
            if ((internetContent.isDeviceLocked && connectedWifiEntry != null)) backgroundOn
            else null

        if (!canChangeWifiState && wifiToggle.isEnabled) {
            wifiToggle.isEnabled = false
+2 −4
Original line number Diff line number Diff line
@@ -542,9 +542,8 @@ class InternetDetailsContentManagerTest : SysuiTestCase() {
        internetDetailsContentManager.internetContentData.observe(
            internetDetailsContentManager.lifecycleOwner!!
        ) {
            // Show WiFi Toggle without background
            // Show WiFi Toggle
            assertThat(wifiToggle!!.visibility).isEqualTo(View.VISIBLE)
            assertThat(wifiToggle!!.background).isNull()
            // Hide Wi-Fi networks and See all
            assertThat(connectedWifi!!.visibility).isEqualTo(View.GONE)
            assertThat(wifiList!!.visibility).isEqualTo(View.GONE)
@@ -564,9 +563,8 @@ class InternetDetailsContentManagerTest : SysuiTestCase() {
        internetDetailsContentManager.internetContentData.observe(
            internetDetailsContentManager.lifecycleOwner!!
        ) {
            // Show WiFi Toggle with highlight background
            // Show WiFi Toggle
            assertThat(wifiToggle!!.visibility).isEqualTo(View.VISIBLE)
            assertThat(wifiToggle!!.background).isNotNull()
            // Hide Wi-Fi networks and See all
            assertThat(connectedWifi!!.visibility).isEqualTo(View.GONE)
            assertThat(wifiList!!.visibility).isEqualTo(View.GONE)