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

Commit d75f4034 authored by Matt Pietal's avatar Matt Pietal
Browse files

Guest icon color

Use a standard guest icon color, as well as fix the guest icon sizing

Fixes: 218310678
Test: visual, open user switcher and observe guest user

Change-Id: Ieb539064e416736938a6fcbced6823dd971e3fd8
parent 874fd364
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
    </shape>
  </item>
  <!-- When an item is selected, this layer will show a ring around the icon -->
  <item>
  <item android:id="@+id/ring">
    <shape android:shape="oval">
       <stroke
           android:width="@dimen/user_switcher_icon_selected_width"
@@ -35,7 +35,7 @@
    </shape>
  </item>
  <!-- Where the user drawable/bitmap will be placed -->
  <item
  <item android:id="@+id/user_avatar"
      android:drawable="@drawable/user_avatar_bg"
      android:width="@dimen/bouncer_user_switcher_icon_size"
      android:height="@dimen/bouncer_user_switcher_icon_size"
+4 −13
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.content.IntentFilter
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.InsetDrawable
import android.graphics.drawable.LayerDrawable
import android.os.Bundle
import android.os.UserManager
@@ -149,8 +148,8 @@ class UserSwitcherActivity @Inject constructor(
        }

        private fun getDrawable(item: UserRecord): Drawable {
            var drawable = if (item.isCurrent && item.isGuest) {
                getDrawable(R.drawable.ic_avatar_guest_user)
            var drawable = if (item.isGuest) {
                getDrawable(R.drawable.ic_account_circle)
            } else {
                findUserIcon(item)
            }
@@ -168,7 +167,7 @@ class UserSwitcherActivity @Inject constructor(
            val ld = getDrawable(R.drawable.user_switcher_icon_large).mutate()
                as LayerDrawable
            if (item == userSwitcherController.getCurrentUserRecord()) {
                (ld.getDrawable(1) as GradientDrawable).apply {
                (ld.findDrawableByLayerId(R.id.ring) as GradientDrawable).apply {
                    val stroke = resources
                        .getDimensionPixelSize(R.dimen.user_switcher_icon_selected_width)
                    val color = Utils.getColorAttrDefaultColor(
@@ -180,15 +179,7 @@ class UserSwitcherActivity @Inject constructor(
                }
            }

            ld.addLayer(
                InsetDrawable(
                    drawable,
                    resources.getDimensionPixelSize(
                        R.dimen.user_switcher_icon_large_margin
                    )
                )
            )

            ld.setDrawableByLayerId(R.id.user_avatar, drawable)
            return ld
        }