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

Commit acb26e3a authored by Alejandro Nijamkin's avatar Alejandro Nijamkin Committed by Ale Nijamkin
Browse files

Lockscreen quick affordance buttons are bigger now.

There was a bug where the lock screen buttons were too small. This CL
fixes that bug.

The reason they were to slow is because we added the selection border to
them, which required the addition of an inset that made the visible
area of the background that much smaller, even when the selection border
is not visible.

The approach taken in the CL is simple. Use the foreground for the
selection border. Note that it does remove the spacing between the
visible background and the border, but that's fine as the selection
border is only ever shown in a scaled-down preview of the lock screen.

Fix: 265974363
Test: manually verified the size and functionality on the lock screen
Test: manually verified the selection border is visible in wallpaper
picker

Change-Id: I3d1c82df8830a1c1125b01e95b73310dd8f67b07
parent a5e45d31
Loading
Loading
Loading
Loading
+9 −54
Original line number Diff line number Diff line
@@ -16,58 +16,13 @@
* limitations under the License.
*/
-->
<selector
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">

  <item android:state_selected="true">
    <layer-list>
      <item
          android:left="3dp"
          android:top="3dp"
          android:right="3dp"
          android:bottom="3dp">
        <!-- We make the shapes a rounded rectangle instead of an oval so that it can animate -->
        <!-- properly into an app/dialog. -->
        <shape android:shape="rectangle">
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:shape="rectangle">
  <solid android:color="?androidprv:attr/colorSurface"/>
  <size
      android:width="@dimen/keyguard_affordance_fixed_width"
      android:height="@dimen/keyguard_affordance_fixed_height"/>
  <corners android:radius="@dimen/keyguard_affordance_fixed_radius" />
</shape>
      </item>

      <item>
        <shape android:shape="rectangle">
          <stroke
              android:color="@color/control_primary_text"
              android:width="2dp"/>
          <size
              android:width="@dimen/keyguard_affordance_fixed_width"
              android:height="@dimen/keyguard_affordance_fixed_height"/>
          <corners android:radius="@dimen/keyguard_affordance_fixed_radius"/>
        </shape>
      </item>
    </layer-list>
  </item>

  <item>
    <layer-list>
      <item
          android:left="3dp"
          android:top="3dp"
          android:right="3dp"
          android:bottom="3dp">
        <shape android:shape="rectangle">
          <solid android:color="?androidprv:attr/colorSurface"/>
          <size
              android:width="@dimen/keyguard_affordance_fixed_width"
              android:height="@dimen/keyguard_affordance_fixed_height"/>
          <corners android:radius="@dimen/keyguard_affordance_fixed_radius"/>
        </shape>
      </item>
    </layer-list>
  </item>

</selector>
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright 2023, 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_selected="true">
    <shape android:shape="oval">
      <stroke
          android:color="@color/control_primary_text"
          android:width="2dp"/>
      <size
          android:width="@dimen/keyguard_affordance_fixed_width"
          android:height="@dimen/keyguard_affordance_fixed_height"/>
    </shape>
  </item>
</selector>
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@
        android:scaleType="center"
        android:tint="?android:attr/textColorPrimary"
        android:background="@drawable/keyguard_bottom_affordance_bg"
        android:foreground="@drawable/keyguard_bottom_affordance_selected_border"
        android:layout_marginStart="@dimen/keyguard_affordance_horizontal_offset"
        android:layout_marginBottom="@dimen/keyguard_affordance_vertical_offset"
        android:visibility="gone" />
@@ -79,6 +80,7 @@
        android:scaleType="center"
        android:tint="?android:attr/textColorPrimary"
        android:background="@drawable/keyguard_bottom_affordance_bg"
        android:foreground="@drawable/keyguard_bottom_affordance_selected_border"
        android:layout_marginEnd="@dimen/keyguard_affordance_horizontal_offset"
        android:layout_marginBottom="@dimen/keyguard_affordance_vertical_offset"
        android:visibility="gone" />