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

Commit 4ab826ac authored by Arc Wang's avatar Arc Wang
Browse files

Set Wi-Fi DPP fragment icons.

1. set fragment icon for WifiDppChooseSavedWifiNetworkFragment
2. set fragment icon of success for WifiDppAddDeviceFragment

All Wi-Fi DPP fragment icons are VectorDrawable of instinct size
24dp draw on a 48dp canvas. Except for ic_devices_check_circle_green,
it's a LayerDrawable of different size. I dynamically change ImageView
layout width & height between these 2 different kind of drawable.

Bug: 122982132
Test: manual test
Change-Id: Idab8cd8b0798363e447da00dc6bc68a86498b8be
parent 9a87eab2
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2019 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.
-->
<layer-list
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:drawable="@drawable/ic_devices_other_opaque_black"
        android:width="@dimen/wifi_dpp_fragment_icon_width_height"
        android:height="@dimen/wifi_dpp_fragment_icon_width_height"
        android:gravity="center"/>

    <item
        android:drawable="@drawable/ic_check_circle_green"
        android:top="28dp"
        android:left="44dp"
        android:gravity="center"/>

</layer-list>
+10 −2
Original line number Diff line number Diff line
@@ -28,8 +28,16 @@

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_width="@dimen/wifi_dpp_fragment_icon_width_height"
        android:layout_height="@dimen/wifi_dpp_fragment_icon_width_height"
        android:scaleType="fitCenter"/>

    <!-- Special header icon only for ic_devices_check_circle_green -->
    <ImageView
        android:id="@+id/devices_check_circle_green_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_devices_check_circle_green"
        android:scaleType="fitCenter"/>

    <TextView
+3 −0
Original line number Diff line number Diff line
@@ -385,6 +385,9 @@
    <dimen name="qrcode_size">264dp</dimen>
    <dimen name="qrcode_preview_size">360dp</dimen>

    <!-- Wi-Fi DPP fragment icon size -->
    <dimen name="wifi_dpp_fragment_icon_width_height">48dp</dimen>

    <!-- Height for slice preference, which contains 6 items at most -->
    <dimen name="slice_preference_group_height">360dp</dimen>
</resources>
+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
        @Override
        public void onConfiguratorSuccess(int code) {
            // Update success UI.
            mHeaderIcon.setImageResource(R.drawable.ic_check_circle_green);
            setHeaderIconImageResource(R.drawable.ic_devices_check_circle_green);
            mTitle.setText(R.string.wifi_dpp_wifi_shared_with_device);
            mSummary.setVisibility(View.INVISIBLE);
            mWifiApPictureView.setImageResource(R.drawable.wifi_dpp_success);
@@ -110,7 +110,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mHeaderIcon.setImageResource(R.drawable.ic_devices_other_opaque_black);
        setHeaderIconImageResource(R.drawable.ic_devices_other_opaque_black);

        final WifiQrCode wifiQrCode = ((WifiDppConfiguratorActivity) getActivity())
                .getWifiDppQrCode();
+2 −0
Original line number Diff line number Diff line
@@ -82,6 +82,8 @@ public class WifiDppChooseSavedWifiNetworkFragment extends WifiDppQrCodeBaseFrag
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        setHeaderIconImageResource(R.drawable.ic_wifi_signal_4);

        mTitle.setText(R.string.wifi_dpp_choose_network);
        mSummary.setText(R.string.wifi_dpp_choose_network_to_connect_device);

Loading