[Provider Model] Support 2+ lines instead of marque for Mobile data and Wi-Fi
- Also fix the Wi-Fi's margin - Fix the screen for large screen and tablet - Match parent's width for other devices Bug: 194970610 Test: manual Change-Id: I61c32c7454771583e252c5d23f5d41728472c41b
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
style="@style/Widget.SliceView.Panel"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginBottom="@dimen/internet_dialog_network_layout_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
@@ -57,7 +57,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginBottom="@dimen/internet_dialog_network_layout_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
@@ -101,8 +101,8 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginEnd="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginStart="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginEnd="@dimen/internet_dialog_network_layout_margin"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingEnd="22dp">
|
||||
|
||||
@@ -130,24 +130,24 @@
|
||||
<TextView
|
||||
android:id="@+id/mobile_title"
|
||||
android:textDirection="locale"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
<TextView
|
||||
android:id="@+id/mobile_summary"
|
||||
android:textDirection="locale"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorTertiary"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
@@ -179,8 +179,8 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginEnd="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginStart="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginEnd="@dimen/internet_dialog_network_layout_margin"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingEnd="22dp">
|
||||
|
||||
@@ -230,10 +230,10 @@
|
||||
android:visibility="gone"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginEnd="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginStart="@dimen/settingslib_switchbar_margin"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingEnd="22dp">
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:layout_marginEnd="@dimen/internet_dialog_network_layout_margin"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="24dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="24dp"
|
||||
@@ -248,12 +248,13 @@
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_weight="3"
|
||||
android:id="@+id/wifi_connected_list"
|
||||
android:orientation="vertical"
|
||||
android:clickable="false"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="72dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start|center_vertical">
|
||||
<TextView
|
||||
android:id="@+id/wifi_connected_title"
|
||||
@@ -261,9 +262,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
@@ -273,9 +273,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorTertiary"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
@@ -284,14 +283,14 @@
|
||||
<FrameLayout
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:clickable="false"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:id="@+id/wifi_settings_icon"
|
||||
android:src="@drawable/ic_settings_24dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_height="wrap_content"/>
|
||||
</FrameLayout>
|
||||
|
||||
@@ -324,7 +323,7 @@
|
||||
android:layout_height="24dp"
|
||||
android:clickable="false"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_marginStart="16dp">
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin">
|
||||
<ImageView
|
||||
android:id="@+id/arrow_forward"
|
||||
android:src="@drawable/ic_arrow_forward"
|
||||
@@ -338,7 +337,7 @@
|
||||
android:clickable="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp">
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin">
|
||||
<TextView
|
||||
android:text="@string/see_all_networks"
|
||||
android:textDirection="locale"
|
||||
|
||||
@@ -31,15 +31,14 @@
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingEnd="22dp">
|
||||
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="40dp">
|
||||
<FrameLayout
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:clickable="false"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_marginStart="16dp">
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin">
|
||||
<ImageView
|
||||
android:id="@+id/wifi_icon"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -48,52 +47,47 @@
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_weight="3"
|
||||
android:id="@+id/wifi_network_layout"
|
||||
android:orientation="vertical"
|
||||
android:clickable="false"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="72dp">
|
||||
android:layout_height="72dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start|center_vertical"
|
||||
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin">
|
||||
<TextView
|
||||
android:id="@+id/wifi_title"
|
||||
android:textDirection="locale"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_height="20dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
android:fontFamily="google-sans"
|
||||
android:layout_marginEnd="18dp"/>
|
||||
<TextView
|
||||
android:id="@+id/wifi_summary"
|
||||
android:textDirection="locale"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_height="20dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
android:fontFamily="google-sans"
|
||||
android:layout_marginEnd="18dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/settingslib_switchbar_padding_right"
|
||||
android:clickable="false"
|
||||
android:gravity="center">
|
||||
android:layout_gravity="end|center_vertical">
|
||||
<ImageView
|
||||
android:id="@+id/wifi_locked_icon"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"/>
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
@@ -103,4 +103,7 @@
|
||||
|
||||
<!-- When split shade is used, this panel should be aligned to the top -->
|
||||
<dimen name="qs_detail_margin_top">0dp</dimen>
|
||||
|
||||
<!-- Internet panel related dimensions -->
|
||||
<dimen name="internet_dialog_list_max_width">624dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -1601,15 +1601,16 @@
|
||||
<!-- Internet panel related dimensions -->
|
||||
<dimen name="internet_dialog_list_margin">12dp</dimen>
|
||||
<dimen name="internet_dialog_list_max_height">646dp</dimen>
|
||||
<dimen name="internet_dialog_list_max_width">412dp</dimen>
|
||||
<dimen name="internet_dialog_list_max_width">@dimen/match_parent</dimen>
|
||||
|
||||
<!-- Signal icon in internet dialog -->
|
||||
<dimen name="signal_strength_icon_size">24dp</dimen>
|
||||
|
||||
<!-- Internet dialog related dimensions -->
|
||||
<dimen name="internet_dialog_corner_radius">24dp</dimen>
|
||||
|
||||
<!-- Size of internet dialog -->
|
||||
<!-- End margin of network layout -->
|
||||
<dimen name="internet_dialog_network_layout_margin">16dp</dimen>
|
||||
<!-- Size of switch bar in internet dialog -->
|
||||
<dimen name="settingslib_switchbar_margin">16dp</dimen>
|
||||
<!-- Minimum width of switch -->
|
||||
<dimen name="settingslib_min_switch_width">52dp</dimen>
|
||||
|
||||
@@ -175,12 +175,9 @@ public class InternetAdapter extends RecyclerView.Adapter<InternetAdapter.Intern
|
||||
mWifiNetworkLayout.setVisibility(View.VISIBLE);
|
||||
mWifiTitleText.setText(title);
|
||||
if (TextUtils.isEmpty(summary)) {
|
||||
mWifiTitleText.setGravity(Gravity.CENTER);
|
||||
mWifiSummaryText.setVisibility(View.GONE);
|
||||
return;
|
||||
} else {
|
||||
mWifiTitleText.setGravity(Gravity.BOTTOM);
|
||||
mWifiSummaryText.setGravity(Gravity.TOP);
|
||||
mWifiSummaryText.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mWifiSummaryText.setText(summary);
|
||||
|
||||
@@ -104,6 +104,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
private TextView mInternetDialogSubTitle;
|
||||
private View mDivider;
|
||||
private ProgressBar mProgressBar;
|
||||
private LinearLayout mInternetDialogLayout;
|
||||
private LinearLayout mInternetListLayout;
|
||||
private LinearLayout mConnectedWifListLayout;
|
||||
private LinearLayout mConnectedWifList;
|
||||
@@ -125,7 +126,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
private Button mDoneButton;
|
||||
private Drawable mBackgroundOn;
|
||||
private int mListMaxHeight;
|
||||
private int mListMaxWidth;
|
||||
private int mLayoutWidth;
|
||||
private int mDefaultDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||
private boolean mCanConfigMobileData;
|
||||
|
||||
@@ -146,10 +147,10 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
|
||||
private final ViewTreeObserver.OnGlobalLayoutListener mInternetListLayoutListener = () -> {
|
||||
// Set max height for list
|
||||
if (mInternetListLayout.getHeight() > mListMaxHeight) {
|
||||
ViewGroup.LayoutParams params = mInternetListLayout.getLayoutParams();
|
||||
if (mInternetDialogLayout.getHeight() > mListMaxHeight) {
|
||||
ViewGroup.LayoutParams params = mInternetDialogLayout.getLayoutParams();
|
||||
params.height = mListMaxHeight;
|
||||
mInternetListLayout.setLayoutParams(params);
|
||||
mInternetDialogLayout.setLayoutParams(params);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -180,7 +181,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
};
|
||||
mListMaxHeight = context.getResources().getDimensionPixelSize(
|
||||
R.dimen.internet_dialog_list_max_height);
|
||||
mListMaxWidth = context.getResources().getDimensionPixelSize(
|
||||
mLayoutWidth = context.getResources().getDimensionPixelSize(
|
||||
R.dimen.internet_dialog_list_max_width);
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mAdapter = new InternetAdapter(mInternetDialogController);
|
||||
@@ -208,11 +209,14 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
layoutParams.setFitInsetsIgnoringVisibility(true);
|
||||
window.setAttributes(layoutParams);
|
||||
window.setContentView(mDialogView);
|
||||
window.setLayout(mListMaxWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
//Only fix the width for large screen or tablet.
|
||||
window.setLayout(mContext.getResources().getDimensionPixelSize(
|
||||
R.dimen.internet_dialog_list_max_width), ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
window.setWindowAnimations(R.style.Animation_InternetDialog);
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
window.addFlags(FLAG_LAYOUT_NO_LIMITS);
|
||||
|
||||
mInternetDialogLayout = mDialogView.requireViewById(R.id.internet_connectivity_dialog);
|
||||
mInternetDialogTitle = mDialogView.requireViewById(R.id.internet_dialog_title);
|
||||
mInternetDialogSubTitle = mDialogView.requireViewById(R.id.internet_dialog_subtitle);
|
||||
mDivider = mDialogView.requireViewById(R.id.divider);
|
||||
@@ -237,7 +241,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
mMobileDataToggle = mDialogView.requireViewById(R.id.mobile_toggle);
|
||||
mWiFiToggle = mDialogView.requireViewById(R.id.wifi_toggle);
|
||||
mBackgroundOn = mContext.getDrawable(R.drawable.settingslib_switch_bar_bg_on);
|
||||
mInternetListLayout.getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
mInternetDialogLayout.getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
mInternetListLayoutListener);
|
||||
mInternetDialogTitle.setText(getDialogTitleText());
|
||||
mInternetDialogTitle.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
|
||||
|
||||
Reference in New Issue
Block a user