- set view click listener on the entire widget view instead of only listening to the switch button event. - move the preference layout end padding into the widget frame, so that clicking on the empty space at the end will send the click event to the widget frame instead of the preference view. Change-Id: I98025f723465f3941cebbbd03b812209c0240590 Fix: 35872094 Test: make RunSettingsRoboTests
43 lines
1.5 KiB
XML
43 lines
1.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Copyright (C) 2017 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.
|
|
-->
|
|
|
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="match_parent">
|
|
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="match_parent"
|
|
android:gravity="start|center_vertical"
|
|
android:orientation="horizontal"
|
|
android:paddingEnd="20dp"
|
|
android:paddingTop="16dp"
|
|
android:paddingBottom="16dp">
|
|
<View
|
|
android:layout_width="1dp"
|
|
android:layout_height="match_parent"
|
|
android:background="?android:attr/dividerVertical"/>
|
|
</LinearLayout>
|
|
|
|
<Switch android:id="@+id/switchWidget"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="match_parent"
|
|
android:gravity="center_vertical"
|
|
android:clickable="false"/>
|
|
|
|
</LinearLayout>
|