Files
app_Settings/res/layout/preference_widget_gear_optional_background.xml
Adam Newman 7577624db7 Enable launching captive portal directly
Whenever a user has connected to a captive portal network, split the
ConnectedAccessPointPreference to allow directly signing into the
captive portal or modifying the network's settings. When in any other
network state, use the old behavior of a single tappable preference that
takes the user to settings.

Bug: 63929546
Bug: 68031656
Test: make RunSettingsRoboTests
Test: manual by connecting to Captive Portal and normal WiFi networks.

Change-Id: I444202a12138d90c94bda94945c121c8c0810536
2018-03-15 09:50:49 -07:00

49 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- Settings button with optional ripple background through toggling visiblity. -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/settings_button_no_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:scaleType="center"
android:src="@drawable/ic_settings"
android:contentDescription="@string/settings_button" />
<!-- Additional overdraw background to stop parent's material ripple -->
<FrameLayout
android:id="@+id/settings_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible"
android:background="?android:attr/colorBackground">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingStart="?android:attr/listPreferredItemPaddingEnd"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground"
android:scaleType="center"
android:src="@drawable/ic_settings"
android:contentDescription="@string/settings_button" />
</FrameLayout>
</FrameLayout>