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

Commit 0c5573a0 authored by Hugo Benichi's avatar Hugo Benichi Committed by Android (Google) Code Review
Browse files

Merge "Wifi details page: sign-in uses primary color" into oc-dev

parents dacdcb9b 484140ba
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
<?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.
-->

<!--
  Defines a panel with two buttons and a spacer in between.
  The right button uses the Material.Button.Colored style.
-->

<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
        android:paddingTop="4dip"
        android:orientation="horizontal">
        <Button
            android:id="@+id/forget_button"
            android:layout_width="120dip"
            android:layout_weight="0.4"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"/>
        <!-- Spacer -->
        <View
            android:id="@+id/buttons_spacer_left"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:visibility="invisible"
            android:layout_weight="0.2" />
        <Button
            style="@android:style/Widget.Material.Button.Colored"
            android:id="@+id/signin_button"
            android:layout_width="120dip"
            android:text="@string/cancel"
            android:layout_weight="0.4"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"/>
</LinearLayout>
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
        <!-- Buttons -->
        <com.android.settings.applications.LayoutPreference
            android:key="buttons"
            android:layout="@layout/two_buttons_panel"
            android:layout="@layout/wifi_network_details_two_buttons_panel"
            android:selectable="false" />

        <com.android.settings.wifi.WifiDetailPreference
+2 −2
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ public class WifiDetailPreferenceController extends PreferenceController impleme
        mConnectionDetailPref = screen.findPreference(KEY_CONNECTION_DETAIL_PREF);

        mButtonsPref = (LayoutPreference) screen.findPreference(KEY_BUTTONS_PREF);
        mSignInButton = (Button) mButtonsPref.findViewById(R.id.right_button);
        mSignInButton = (Button) mButtonsPref.findViewById(R.id.signin_button);
        mSignInButton.setText(R.string.support_sign_in_button_text);
        mSignInButton.setOnClickListener(
            view -> mConnectivityManagerWrapper.startCaptivePortalApp(mNetwork));
@@ -245,7 +245,7 @@ public class WifiDetailPreferenceController extends PreferenceController impleme
                (PreferenceCategory) screen.findPreference(KEY_IPV6_ADDRESS_CATEGORY);

        mSecurityPref.setDetailText(mAccessPoint.getSecurityString(false /* concise */));
        mForgetButton = (Button) mButtonsPref.findViewById(R.id.left_button);
        mForgetButton = (Button) mButtonsPref.findViewById(R.id.forget_button);
        mForgetButton.setText(R.string.forget);
        mForgetButton.setOnClickListener(view -> forgetNetwork());
        updateInfo();
+2 −2
Original line number Diff line number Diff line
@@ -195,9 +195,9 @@ public class WifiDetailPreferenceControllerTest {
                .thenReturn(mockConnectionDetailPref);
        when(mockScreen.findPreference(WifiDetailPreferenceController.KEY_BUTTONS_PREF))
                .thenReturn(mockButtonsPref);
        when(mockButtonsPref.findViewById(R.id.left_button))
        when(mockButtonsPref.findViewById(R.id.forget_button))
                .thenReturn(mockForgetButton);
        when(mockButtonsPref.findViewById(R.id.right_button))
        when(mockButtonsPref.findViewById(R.id.signin_button))
                .thenReturn(mockSignInButton);
        when(mockScreen.findPreference(WifiDetailPreferenceController.KEY_SIGNAL_STRENGTH_PREF))
                .thenReturn(mockSignalStrengthPref);