Files
app_Settings/res/layout/wifi_add_app_networks.xml
govenliu 7b6b93b4f8 [Wi-Fi] Add one network request case for adding Wi-Fi for apps feature.
Handle adding one network case, add UI components and process saving/connecting flow.

Bug: 136472483
Test: Add unit test cases to test one network in list case and null list case, and also check if the SSID set correct or not.
Change-Id: I99f804a967575538c9dc3f1faabb2b507e92e558
2019-11-28 16:39:06 +08:00

153 lines
6.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
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
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:id="@+id/panel_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/settings_panel_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:clipToPadding="false"
android:paddingStart="12dp"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:minWidth="68dp"
android:orientation="horizontal"
android:clipToPadding="false"
android:paddingTop="4dp"
android:paddingBottom="4dp">
<androidx.preference.internal.PreferenceImageView
android:id="@+id/app_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
settings:maxWidth="48dp"
settings:maxHeight="48dp"/>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/app_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee"/>
<TextView
android:id="@+id/app_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/app_title"
android:layout_alignStart="@+id/app_title"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="10"/>
</RelativeLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider"/>
<LinearLayout
android:id="@+id/single_network"
android:layout_width="match_parent"
android:layout_height="144dp"
android:paddingTop="24dp"
android:paddingBottom="16dp"
android:orientation="vertical">
<ImageView
android:id="@+id/signal_strength"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"/>
<TextView
android:id="@+id/single_ssid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:singleLine="true"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee"/>
<TextView
android:id="@+id/single_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="2dp"
android:gravity="center"
android:accessibilityLiveRegion="polite"
android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>
<include layout="@layout/horizontal_divider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<Button
android:id="@+id/cancel"
style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginStart="12dp"
android:text="@string/cancel"/>
<Space
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"/>
<Button
android:id="@+id/save"
style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginEnd="12dp"
android:text="@string/save"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>