[Wi-Fi] Modify NetworkRequestDialog title & summary
Design change for UX improvement. Bug: 155348488 Test: manual visual Change-Id: I07d441f6fda8017cc9f4561ef64d57ff8db86f0f
This commit is contained in:
@@ -18,18 +18,23 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="?android:attr/dialogPreferredPadding"
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:minHeight="?android:attr/listPreferredItemHeightSmall">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_request_title_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="18dp"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18sp"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center_vertical"
|
||||
style="@style/info_label"/>
|
||||
|
||||
@@ -38,8 +43,18 @@
|
||||
style="?android:attr/progressBarStyleSmallTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingTop="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="16dip"
|
||||
android:minWidth="32dp"
|
||||
android:text="@string/progress_scanning"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_request_summary_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="18dp"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
|
@@ -11701,7 +11701,12 @@
|
||||
<string name="see_less">See less</string>
|
||||
|
||||
<!-- Title for Network connection request Dialog [CHAR LIMIT=60] -->
|
||||
<string name="network_connection_request_dialog_title">Device to use with <xliff:g id="appName" example="ThirdPartyAppName">%1$s</xliff:g></string>
|
||||
<string name="network_connection_request_dialog_title">Connect to device</string>
|
||||
<!-- Summary for Network connection request Dialog [CHAR LIMIT=NONE] -->
|
||||
<string name="network_connection_request_dialog_summary">
|
||||
<xliff:g id="appName" example="ThirdPartyAppName">%1$s</xliff:g>
|
||||
app wants to use a temporary Wi\u2011Fi network to connect to your device
|
||||
</string>
|
||||
<!-- Message for Network connection timeout Dialog [CHAR LIMIT=NONE] -->
|
||||
<string name="network_connection_timeout_dialog_message">No devices found. Make sure devices are turned on and available to connect.</string>
|
||||
<!-- OK button for Network connection timeout Dialog [CHAR LIMIT=30] -->
|
||||
|
@@ -23,10 +23,13 @@ import android.content.Intent;
|
||||
import android.net.wifi.ScanResult;
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -39,16 +42,7 @@ abstract public class NetworkRequestDialogBaseFragment extends InstrumentedDialo
|
||||
final static String EXTRA_APP_NAME = "com.android.settings.wifi.extra.APP_NAME";
|
||||
|
||||
NetworkRequestDialogActivity mActivity = null;
|
||||
|
||||
protected String getTitle() {
|
||||
final Intent intent = getActivity().getIntent();
|
||||
String appName = "";
|
||||
if (intent != null) {
|
||||
appName = intent.getStringExtra(EXTRA_APP_NAME);
|
||||
}
|
||||
|
||||
return getString(R.string.network_connection_request_dialog_title, appName);
|
||||
}
|
||||
private String mAppName = "";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
@@ -61,6 +55,11 @@ abstract public class NetworkRequestDialogBaseFragment extends InstrumentedDialo
|
||||
if (context instanceof NetworkRequestDialogActivity) {
|
||||
mActivity = (NetworkRequestDialogActivity) context;
|
||||
}
|
||||
|
||||
final Intent intent = getActivity().getIntent();
|
||||
if (intent != null) {
|
||||
mAppName = intent.getStringExtra(EXTRA_APP_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,6 +77,14 @@ abstract public class NetworkRequestDialogBaseFragment extends InstrumentedDialo
|
||||
}
|
||||
}
|
||||
|
||||
protected String getTitle() {
|
||||
return getString(R.string.network_connection_request_dialog_title);
|
||||
}
|
||||
|
||||
protected String getSummary() {
|
||||
return getString(R.string.network_connection_request_dialog_summary, mAppName);
|
||||
}
|
||||
|
||||
protected void onUserSelectionCallbackRegistration(
|
||||
NetworkRequestUserSelectionCallback userSelectionCallback) {
|
||||
}
|
||||
|
@@ -86,6 +86,8 @@ public class NetworkRequestDialogFragment extends NetworkRequestDialogBaseFragme
|
||||
|
||||
final TextView title = customTitle.findViewById(R.id.network_request_title_text);
|
||||
title.setText(getTitle());
|
||||
final TextView summary = customTitle.findViewById(R.id.network_request_summary_text);
|
||||
summary.setText(getSummary());
|
||||
|
||||
final ProgressBar progressBar = customTitle.findViewById(
|
||||
R.id.network_request_title_progress);
|
||||
|
@@ -7,7 +7,9 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
/**
|
||||
@@ -33,6 +35,8 @@ public class NetworkRequestSingleSsidDialogFragment extends
|
||||
final View customTitle = inflater.inflate(R.layout.network_request_dialog_title, null);
|
||||
final TextView title = customTitle.findViewById(R.id.network_request_title_text);
|
||||
title.setText(getTitle());
|
||||
final TextView summary = customTitle.findViewById(R.id.network_request_summary_text);
|
||||
summary.setText(getSummary());
|
||||
final ProgressBar progressBar = customTitle
|
||||
.findViewById(R.id.network_request_title_progress);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
|
Reference in New Issue
Block a user