[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,28 +18,43 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingEnd="?android:attr/dialogPreferredPadding"
|
android:paddingEnd="?android:attr/dialogPreferredPadding"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall">
|
android:minHeight="?android:attr/listPreferredItemHeightSmall">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/network_request_title_text"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="24dp"
|
android:paddingStart="24dp">
|
||||||
android:paddingTop="18dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
style="@style/info_label"/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<TextView
|
||||||
android:id="@+id/network_request_title_progress"
|
android:id="@+id/network_request_title_text"
|
||||||
style="?android:attr/progressBarStyleSmallTitle"
|
android:layout_width="0dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:paddingTop="18dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_weight="1"
|
||||||
android:layout_marginStart="16dip"
|
android:textSize="20sp"
|
||||||
android:minWidth="32dp"
|
android:gravity="center_vertical"
|
||||||
android:text="@string/progress_scanning"/>
|
style="@style/info_label"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/network_request_title_progress"
|
||||||
|
style="?android:attr/progressBarStyleSmallTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
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>
|
</LinearLayout>
|
||||||
|
@@ -11701,7 +11701,12 @@
|
|||||||
<string name="see_less">See less</string>
|
<string name="see_less">See less</string>
|
||||||
|
|
||||||
<!-- Title for Network connection request Dialog [CHAR LIMIT=60] -->
|
<!-- 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] -->
|
<!-- 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>
|
<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] -->
|
<!-- 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.ScanResult;
|
||||||
import android.net.wifi.WifiConfiguration;
|
import android.net.wifi.WifiConfiguration;
|
||||||
import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
|
import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||||
|
|
||||||
import java.util.List;
|
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";
|
final static String EXTRA_APP_NAME = "com.android.settings.wifi.extra.APP_NAME";
|
||||||
|
|
||||||
NetworkRequestDialogActivity mActivity = null;
|
NetworkRequestDialogActivity mActivity = null;
|
||||||
|
private String mAppName = "";
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetricsCategory() {
|
public int getMetricsCategory() {
|
||||||
@@ -61,6 +55,11 @@ abstract public class NetworkRequestDialogBaseFragment extends InstrumentedDialo
|
|||||||
if (context instanceof NetworkRequestDialogActivity) {
|
if (context instanceof NetworkRequestDialogActivity) {
|
||||||
mActivity = (NetworkRequestDialogActivity) context;
|
mActivity = (NetworkRequestDialogActivity) context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Intent intent = getActivity().getIntent();
|
||||||
|
if (intent != null) {
|
||||||
|
mAppName = intent.getStringExtra(EXTRA_APP_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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(
|
protected void onUserSelectionCallbackRegistration(
|
||||||
NetworkRequestUserSelectionCallback userSelectionCallback) {
|
NetworkRequestUserSelectionCallback userSelectionCallback) {
|
||||||
}
|
}
|
||||||
|
@@ -86,6 +86,8 @@ public class NetworkRequestDialogFragment extends NetworkRequestDialogBaseFragme
|
|||||||
|
|
||||||
final TextView title = customTitle.findViewById(R.id.network_request_title_text);
|
final TextView title = customTitle.findViewById(R.id.network_request_title_text);
|
||||||
title.setText(getTitle());
|
title.setText(getTitle());
|
||||||
|
final TextView summary = customTitle.findViewById(R.id.network_request_summary_text);
|
||||||
|
summary.setText(getSummary());
|
||||||
|
|
||||||
final ProgressBar progressBar = customTitle.findViewById(
|
final ProgressBar progressBar = customTitle.findViewById(
|
||||||
R.id.network_request_title_progress);
|
R.id.network_request_title_progress);
|
||||||
|
@@ -7,7 +7,9 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
|
||||||
import com.android.settings.R;
|
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 View customTitle = inflater.inflate(R.layout.network_request_dialog_title, null);
|
||||||
final TextView title = customTitle.findViewById(R.id.network_request_title_text);
|
final TextView title = customTitle.findViewById(R.id.network_request_title_text);
|
||||||
title.setText(getTitle());
|
title.setText(getTitle());
|
||||||
|
final TextView summary = customTitle.findViewById(R.id.network_request_summary_text);
|
||||||
|
summary.setText(getSummary());
|
||||||
final ProgressBar progressBar = customTitle
|
final ProgressBar progressBar = customTitle
|
||||||
.findViewById(R.id.network_request_title_progress);
|
.findViewById(R.id.network_request_title_progress);
|
||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
|
Reference in New Issue
Block a user