summaryrefslogtreecommitdiff
path: root/service/ServiceWifiResources
diff options
context:
space:
mode:
author Quang Anh Luong <qal@google.com> 2024-10-24 15:03:50 +0900
committer Quang Luong <qal@google.com> 2024-11-14 00:07:20 +0000
commitf3effc2ee0df1465647c00277c81ddd3b9e6ad02 (patch)
treeca9dd1f4232be2944f6617554f3da6d301fcab6f /service/ServiceWifiResources
parent791976156514c58385d7dc352cedfad55ea1de7e (diff)
Update P2P dialog
Update P2P dialog strings to be more user friendly and show the peer device name in the dialog message instead of a separate line. Flag: com.android.wifi.flags.p2p_dialog2 Bug: 349253691 Test: Manual verification via shell cmd that P2P dialog styles are correct Change-Id: Iaa719420deed4472be4b4b8060ec987a9cd9092f
Diffstat (limited to 'service/ServiceWifiResources')
-rw-r--r--service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_display_pin.xml25
-rw-r--r--service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_enter_pin.xml25
-rw-r--r--service/ServiceWifiResources/res/values-night/styles.xml14
-rw-r--r--service/ServiceWifiResources/res/values/overlayable.xml31
-rw-r--r--service/ServiceWifiResources/res/values/strings.xml42
-rw-r--r--service/ServiceWifiResources/res/values/styles.xml34
6 files changed, 164 insertions, 7 deletions
diff --git a/service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_display_pin.xml b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_display_pin.xml
new file mode 100644
index 0000000000..020f987d8d
--- /dev/null
+++ b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_display_pin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 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"
+ style="@style/wifi_p2p_dialog2_display_pin_section">
+ <TextView
+ android:text="@string/wifi_p2p_dialog2_display_pin_label"
+ style="@style/wifi_p2p_dialog2_display_pin_label"/>
+
+ <TextView android:id="@+id/wifi_p2p_dialog2_display_pin"
+ style="@style/wifi_p2p_dialog2_display_pin" />
+</LinearLayout>
diff --git a/service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_enter_pin.xml b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_enter_pin.xml
new file mode 100644
index 0000000000..32da7b78a1
--- /dev/null
+++ b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog2_enter_pin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 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"
+ style="@style/wifi_p2p_dialog2_enter_pin_section">
+ <TextView
+ android:text="@string/wifi_p2p_dialog2_enter_pin_label"
+ style="@style/wifi_p2p_dialog2_enter_pin_label"/>
+
+ <EditText android:id="@+id/wifi_p2p_dialog2_enter_pin"
+ style="@style/wifi_p2p_dialog2_enter_pin" />
+</LinearLayout>
diff --git a/service/ServiceWifiResources/res/values-night/styles.xml b/service/ServiceWifiResources/res/values-night/styles.xml
index 9279ee3780..a97049517e 100644
--- a/service/ServiceWifiResources/res/values-night/styles.xml
+++ b/service/ServiceWifiResources/res/values-night/styles.xml
@@ -23,4 +23,18 @@
<item name="android:inputType">number</item>
<item name="android:textColor">@android:color/primary_text_dark</item>
</style>
+
+ <style name="wifi_p2p_dialog2" parent="@android:style/Theme.DeviceDefault.Dialog.Alert" />
+ <style name="wifi_p2p_dialog2_pin_label">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textColor">@android:color/secondary_text_dark</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+ <style name="wifi_p2p_dialog2_pin">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textSize">18sp</item>
+ <item name="android:textColor">@android:color/primary_text_dark</item>
+ </style>
</resources>
diff --git a/service/ServiceWifiResources/res/values/overlayable.xml b/service/ServiceWifiResources/res/values/overlayable.xml
index 7409ad1414..a64f330b05 100644
--- a/service/ServiceWifiResources/res/values/overlayable.xml
+++ b/service/ServiceWifiResources/res/values/overlayable.xml
@@ -390,13 +390,19 @@
<item type="string" name="accept" />
<item type="string" name="decline" />
<item type="string" name="ok" />
- <item type="string" name="wifi_p2p_invitation_sent_title" />
- <item type="string" name="wifi_p2p_invitation_to_connect_title" />
- <item type="string" name="wifi_p2p_invitation_seconds_remaining" />
- <item type="string" name="wifi_p2p_from_message" />
- <item type="string" name="wifi_p2p_to_message" />
- <item type="string" name="wifi_p2p_enter_pin_message" />
- <item type="string" name="wifi_p2p_show_pin_message" />
+ <item type="string" name="wifi_p2p_dialog2_sent_title" />
+ <item type="string" name="wifi_p2p_dialog2_sent_title_display_pin" />
+ <item type="string" name="wifi_p2p_dialog2_sent_message" />
+ <item type="string" name="wifi_p2p_dialog2_sent_message_display_pin" />
+ <item type="string" name="wifi_p2p_dialog2_sent_positive_button" />
+ <item type="string" name="wifi_p2p_dialog2_received_title" />
+ <item type="string" name="wifi_p2p_dialog2_received_message" />
+ <item type="string" name="wifi_p2p_dialog2_received_message_enter_pin" />
+ <item type="string" name="wifi_p2p_dialog2_received_message_display_pin" />
+ <item type="string" name="wifi_p2p_dialog2_received_positive_button" />
+ <item type="string" name="wifi_p2p_dialog2_received_negative_button" />
+ <item type="string" name="wifi_p2p_dialog2_enter_pin_label" />
+ <item type="string" name="wifi_p2p_dialog2_display_pin_label" />
<item type="string" name="wifi_p2p_frequency_conflict_message" />
<item type="string" name="dlg_ok" />
<item type="string" name="wifi_cannot_connect_with_randomized_mac_title" />
@@ -505,6 +511,17 @@
<item type="style" name="wifi_p2p_dialog_row_content" />
<item type="style" name="wifi_p2p_dialog_enter_pin_message" />
<item type="style" name="wifi_p2p_dialog_pin_input" />
+
+ <item type="style" name="wifi_p2p_dialog2" />
+ <item type="style" name="wifi_p2p_dialog2_pin_section" />
+ <item type="style" name="wifi_p2p_dialog2_pin_label" />
+ <item type="style" name="wifi_p2p_dialog2_pin" />
+ <item type="style" name="wifi_p2p_dialog2_enter_pin_section" />
+ <item type="style" name="wifi_p2p_dialog2_enter_pin_label" />
+ <item type="style" name="wifi_p2p_dialog2_enter_pin" />
+ <item type="style" name="wifi_p2p_dialog2_display_pin_section" />
+ <item type="style" name="wifi_p2p_dialog2_display_pin_label" />
+ <item type="style" name="wifi_p2p_dialog2_display_pin" />
<!-- Params from styles.xml that can be overlayed -->
<!-- Params from drawable/ that can be overlayed -->
diff --git a/service/ServiceWifiResources/res/values/strings.xml b/service/ServiceWifiResources/res/values/strings.xml
index 26624b023e..3660d752b8 100644
--- a/service/ServiceWifiResources/res/values/strings.xml
+++ b/service/ServiceWifiResources/res/values/strings.xml
@@ -100,6 +100,7 @@
<string name="wifi_p2p_invitation_sent_title">Invitation sent</string>
<string name="wifi_p2p_invitation_to_connect_title">Invitation to connect</string>
+ <!-- Start of strings for legacy P2P Dialog -->
<!-- The message of the P2P Invitation Received dialog indicating the seconds left to accept before auto rejection [CHAR_LIMIT=NONE] [ICU SYNTAX] -->
<string name="wifi_p2p_invitation_seconds_remaining">
{0, plural,
@@ -111,6 +112,47 @@
<string name="wifi_p2p_to_message">To: </string>
<string name="wifi_p2p_enter_pin_message">Type the required PIN: </string>
<string name="wifi_p2p_show_pin_message">PIN: </string>
+ <!-- End of strings for legacy P2P Dialog -->
+
+ <!-- Start of strings for P2P Dialog 2 -->
+ <string name="wifi_p2p_dialog2_sent_title">Device connection</string>
+ <string name="wifi_p2p_dialog2_sent_title_display_pin">Device connection</string>
+ <string name="wifi_p2p_dialog2_sent_message">Invitation sent to <xliff:g id="device_name">%1$s</xliff:g>.</string>
+ <string name="wifi_p2p_dialog2_sent_message_display_pin">Enter this PIN on <xliff:g id="device_name">%1$s</xliff:g> to connect.</string>
+ <string name="wifi_p2p_dialog2_sent_positive_button">OK</string>
+
+ <string name="wifi_p2p_dialog2_received_title">Device connection</string>
+ <string name="wifi_p2p_dialog2_received_title_enter_pin">Device connection</string>
+ <string name="wifi_p2p_dialog2_received_title_display_pin">Device connection</string>
+ <string name="wifi_p2p_dialog2_received_message"><xliff:g id="device_name">%1$s</xliff:g> wants to connect to your device.</string>
+ <string name="wifi_p2p_dialog2_received_message_enter_pin">Enter the PIN shown on <xliff:g id="device_name">%1$s</xliff:g> to connect.</string>
+ <string name="wifi_p2p_dialog2_received_message_display_pin"><xliff:g id="device_name">%1$s</xliff:g> wants to connect to your device with the following PIN.</string>
+
+ <string name="wifi_p2p_dialog2_received_message_countdown">
+ {countdown, plural,
+ =1 {{device} wants to connect to your device. Accept in {countdown} second.}
+ other {{device} wants to connect to your device. Accept in {countdown} seconds.}
+ }
+ </string>
+ <string name="wifi_p2p_dialog2_received_message_enter_pin_countdown">
+ {countdown, plural,
+ =1 {Enter the PIN shown on {device} within {countdown} second to connect.}
+ other {Enter the PIN shown on {device} within {countdown} seconds to connect.}
+ }
+ </string>
+ <string name="wifi_p2p_dialog2_received_message_display_pin_countdown">
+ {countdown, plural,
+ =1 {{device} wants to connect to your device with the following PIN. Accept in {countdown} second.}
+ other {{device} wants to connect to your device with the following PIN. Accept in {countdown} seconds.}
+ }
+ </string>
+
+ <string name="wifi_p2p_dialog2_received_positive_button">Connect</string>
+ <string name="wifi_p2p_dialog2_received_negative_button">Cancel</string>
+
+ <string name="wifi_p2p_dialog2_enter_pin_label">PIN</string>
+ <string name="wifi_p2p_dialog2_display_pin_label">PIN</string>
+ <!-- End of strings for P2P Dialog 2 -->
<string name="wifi_p2p_frequency_conflict_message">Your device will temporarily disconnect from Wi-Fi while it\'s connected to <xliff:g id="device_name">%1$s</xliff:g></string>
<!-- Dialog ok button-->
diff --git a/service/ServiceWifiResources/res/values/styles.xml b/service/ServiceWifiResources/res/values/styles.xml
index 714d10fe0f..e86aee8417 100644
--- a/service/ServiceWifiResources/res/values/styles.xml
+++ b/service/ServiceWifiResources/res/values/styles.xml
@@ -63,4 +63,38 @@
<item name="android:inputType">number</item>
<item name="android:textColor">@android:color/primary_text_light</item>
</style>
+
+ <style name="wifi_p2p_dialog2" parent="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" />
+
+ <style name="wifi_p2p_dialog2_pin_section">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:orientation">vertical</item>
+ <item name="android:paddingLeft">24dp</item>
+ <item name="android:paddingRight">24dp</item>
+ </style>
+ <style name="wifi_p2p_dialog2_pin_label" >
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textColor">@android:color/secondary_text_light</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+ <style name="wifi_p2p_dialog2_pin">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textColor">@android:color/primary_text_light</item>
+ <item name="android:textSize">18sp</item>
+ </style>
+
+ <style name="wifi_p2p_dialog2_enter_pin_section" parent="@style/wifi_p2p_dialog2_pin_section" />
+ <style name="wifi_p2p_dialog2_enter_pin_label" parent="@style/wifi_p2p_dialog2_pin_label" />
+ <style name="wifi_p2p_dialog2_enter_pin" parent="@style/wifi_p2p_dialog2_pin">
+ <item name="android:singleLine">true</item>
+ <item name="android:maxLength">8</item>
+ <item name="android:inputType">number</item>
+ </style>
+
+ <style name="wifi_p2p_dialog2_display_pin_section" parent="@style/wifi_p2p_dialog2_pin_section" />
+ <style name="wifi_p2p_dialog2_display_pin_label" parent="@style/wifi_p2p_dialog2_pin_label" />
+ <style name="wifi_p2p_dialog2_display_pin" parent="@style/wifi_p2p_dialog2_pin" />
</resources>