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

Commit b1444e4d authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Use Theme.SystemUI.Dialog for the TileRequest dialog

Also, use textColorOnAccent for the text and icon in an active tile so
the dialog displays correctly in light mode.

Test: manual, dialog and QS
Fixes: 207668351
Change-Id: Iadb68373827d50b9f2eff5f8c1425c7ce5ef05a6
parent b08fc1d6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
        android:layout_marginBottom="16dp"
        android:textDirection="locale"
        android:textAlignment="viewStart"
        android:textAppearance="@style/TextAppearance.PrivacyDialog"
        android:lineHeight="20sp"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
    />
</LinearLayout>
+0 −10
Original line number Diff line number Diff line
@@ -654,16 +654,6 @@
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    </style>

    <!-- TileService request dialog -->
    <style name="TileRequestDialog" parent="Theme.SystemUI.QuickSettings.Dialog">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@drawable/qs_dialog_bg</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:windowCloseOnTouchOutside">true</item>
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    </style>

    <!-- USB Contaminant dialog -->
    <style name ="USBContaminant" />

+2 −20
Original line number Diff line number Diff line
@@ -18,11 +18,8 @@ package com.android.systemui.qs.external

import android.content.Context
import android.graphics.drawable.Icon
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.view.WindowInsets
import android.widget.TextView
import com.android.systemui.R
import com.android.systemui.plugins.qs.QSTile
@@ -38,25 +35,12 @@ import com.android.systemui.statusbar.phone.SystemUIDialog
 */
class TileRequestDialog(
    context: Context
) : SystemUIDialog(context, R.style.TileRequestDialog) {
) : SystemUIDialog(context) {

    companion object {
        internal val CONTENT_ID = R.id.content
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window?.apply {
            attributes.fitInsetsTypes = attributes.fitInsetsTypes or WindowInsets.Type.statusBars()
            attributes.receiveInsetsIgnoringZOrder = true
            setLayout(
                    context.resources
                            .getDimensionPixelSize(R.dimen.qs_tile_service_request_dialog_width),
                    WRAP_CONTENT
            )
        }
    }

    /**
     * Set the data of the tile to add, to show the user.
     */
@@ -76,9 +60,7 @@ class TileRequestDialog(
                            context.resources.getDimensionPixelSize(R.dimen.qs_quick_tile_size)
                    )
        }
        val spacing = context.resources.getDimensionPixelSize(
                R.dimen.qs_tile_service_request_content_space
        )
        val spacing = 0
        setView(ll, spacing, spacing, spacing, spacing / 2)
    }

+1 −1
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ public class QSIconViewImpl extends QSIconView {
                return Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary);
            case Tile.STATE_ACTIVE:
                return Utils.getColorAttrDefaultColor(context,
                        android.R.attr.textColorPrimaryInverse);
                        com.android.internal.R.attr.textColorOnAccent);
            default:
                Log.e("QSIconView", "Invalid state " + state);
                return 0;
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
    private val colorUnavailable = Utils.applyAlpha(UNAVAILABLE_ALPHA, colorInactive)

    private val colorLabelActive =
            Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse)
            Utils.getColorAttrDefaultColor(context, com.android.internal.R.attr.textColorOnAccent)
    private val colorLabelInactive =
            Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary)
    private val colorLabelUnavailable = Utils.applyAlpha(UNAVAILABLE_ALPHA, colorLabelInactive)
Loading