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

Commit 9a662089 authored by Roy Chou's avatar Roy Chou
Browse files

chore(magnification): enlarge magnification panel settings button tap area

Originally the settings button icon has margin outside of the ImageView. Tapping on the margin would be detected as tapping on underlying border view then trigger the bounce animation. Therefore, we change the outer margin to inner inset padding for the ImageView. So it will still look the same as before, and tapping on edge of the icon would become tapping on the padding, which will be detected as tapping on the button and trigger the panel as expected.

Bug: 279563444
Flag: NA
Test: manually
      atest WindowMagnificationControllerTest
Change-Id: If98eb2a12e4e714f703d56aa95aeda16333857cd
parent 420854c5
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (C) 2024 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.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/accessibility_window_magnification_drag_handle_background_change"
    android:insetBottom="@dimen/magnification_inner_border_margin"
    android:insetLeft="@dimen/magnification_inner_border_margin"
    android:insetRight="@dimen/magnification_inner_border_margin"
    android:insetTop="@dimen/magnification_inner_border_margin" />
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (C) 2024 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.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/accessibility_window_magnification_drag_handle_background"
    android:insetBottom="@dimen/magnification_inner_border_margin"
    android:insetLeft="@dimen/magnification_inner_border_margin"
    android:insetRight="@dimen/magnification_inner_border_margin"
    android:insetTop="@dimen/magnification_inner_border_margin" />
+1 −2
Original line number Diff line number Diff line
@@ -117,12 +117,11 @@
        android:id="@+id/drag_handle"
        android:layout_width="@dimen/magnification_drag_view_size"
        android:layout_height="@dimen/magnification_drag_view_size"
        android:layout_margin="@dimen/magnification_inner_border_margin"
        android:layout_gravity="right|bottom"
        android:padding="@dimen/magnifier_drag_handle_padding"
        android:scaleType="center"
        android:src="@drawable/ic_move_magnification"
        android:background="@drawable/accessibility_window_magnification_drag_handle_background"/>
        android:background="@drawable/accessibility_window_magnification_drag_handle_background_inset"/>

    <ImageView
        android:id="@+id/close_button"
+1 −1
Original line number Diff line number Diff line
@@ -1249,7 +1249,7 @@
    <dimen name="magnification_drag_corner_margin">8dp</dimen>
    <dimen name="magnification_frame_move_short">5dp</dimen>
    <dimen name="magnification_frame_move_long">25dp</dimen>
    <dimen name="magnification_drag_view_size">36dp</dimen>
    <dimen name="magnification_drag_view_size">70dp</dimen>
    <dimen name="magnification_controls_size">90dp</dimen>
    <dimen name="magnification_switch_button_size">56dp</dimen>
    <dimen name="magnification_switch_button_padding">6dp</dimen>
+2 −2
Original line number Diff line number Diff line
@@ -1449,8 +1449,8 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
        mSettingsPanelVisibility = settingsPanelIsShown;

        mDragView.setBackground(mContext.getResources().getDrawable(settingsPanelIsShown
                ? R.drawable.accessibility_window_magnification_drag_handle_background_change
                : R.drawable.accessibility_window_magnification_drag_handle_background));
                ? R.drawable.accessibility_window_magnification_drag_handle_background_change_inset
                : R.drawable.accessibility_window_magnification_drag_handle_background_inset));

        PorterDuffColorFilter filter = new PorterDuffColorFilter(
                mContext.getColor(settingsPanelIsShown