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

Commit 9319d0ce authored by Andras Kloczl's avatar Andras Kloczl
Browse files

Fix keyguard and qs user switcher disabled state

- Set grayscale for disabled user's image
- Set gray color for disabled icons
- Set reduced alpha for disabled users

Test: Manual test
Bug: 155896542
Change-Id: I35ffb6382685ff5ed4f53a14fdc77517c83da306
parent 8083336a
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
  ~ Copyright (C) 2016 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:color="?android:attr/textColorPrimary" />
    <item android:color="@android:color/transparent" />
</selector>
+1 −1
Original line number Diff line number Diff line
@@ -27,13 +27,13 @@
        android:gravity="end|center_vertical"
        android:clickable="true"
        android:background="@drawable/kg_user_switcher_rounded_bg"
        sysui:activatedTextAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher"
        sysui:regularTextAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher">
    <TextView android:id="@+id/user_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="25dp"
            android:layout_marginEnd="12dp"
            android:textAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher"
            />
    <com.android.systemui.statusbar.phone.UserAvatarView android:id="@+id/user_picture"
            android:layout_width="@dimen/kg_framed_avatar_size"
+0 −2
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@
            android:layout_width="@dimen/kg_framed_avatar_size"
            android:layout_height="@dimen/kg_framed_avatar_size"
            android:contentDescription="@null"
            android:backgroundTint="@color/qs_user_detail_avatar_tint"
            android:backgroundTintMode="src_atop"
            sysui:frameWidth="@dimen/keyguard_user_switcher_border_thickness"
            sysui:framePadding="2.5dp"
            sysui:badgeDiameter="18dp"
+1 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
        android:clipToPadding="false"
        android:focusable="true"
        android:background="@drawable/ripple_drawable"
        systemui:activatedTextAppearance="@style/TextAppearance.QS.UserSwitcher"
        systemui:regularTextAppearance="@style/TextAppearance.QS.UserSwitcher">

    <com.android.systemui.statusbar.phone.UserAvatarView
@@ -37,8 +38,6 @@
            android:layout_width="@dimen/qs_framed_avatar_size"
            android:layout_height="@dimen/qs_framed_avatar_size"
            android:layout_marginBottom="7dp"
            android:backgroundTint="@color/qs_user_detail_avatar_tint"
            android:backgroundTintMode="src_atop"
            systemui:frameWidth="6dp"
            systemui:badgeDiameter="18dp"
            systemui:badgeMargin="1dp"
+4 −7
Original line number Diff line number Diff line
@@ -95,14 +95,11 @@ public class UserDetailItemView extends LinearLayout {
        mAvatar.setDrawableWithBadge(picture, userId);
    }

    public void setAvatarEnabled(boolean enabled) {
        mAvatar.setEnabled(enabled);
    }

    public void setDisabledByAdmin(boolean disabled) {
        if (mRestrictedPadlock != null) {
            mRestrictedPadlock.setVisibility(disabled ? View.VISIBLE : View.GONE);
        mName.setEnabled(!disabled);
        mAvatar.setEnabled(!disabled);
        }
        setEnabled(!disabled);
    }

    public void setEnabled(boolean enabled) {
Loading