[Provider Model] Fix the toggle's size and dialog's width
Bug: 196019329 Test: manuak Change-Id: Ifb79e402540b4aef58f829312e836b4f11114a5d
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:top="@dimen/settingslib_switch_thumb_margin"
|
||||
android:left="@dimen/settingslib_switch_thumb_margin"
|
||||
android:right="@dimen/settingslib_switch_thumb_margin"
|
||||
android:bottom="@dimen/settingslib_switch_thumb_margin">
|
||||
<shape android:shape="oval">
|
||||
<size
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:top="@dimen/settingslib_switch_thumb_margin"
|
||||
android:left="@dimen/settingslib_switch_thumb_margin"
|
||||
android:right="@dimen/settingslib_switch_thumb_margin"
|
||||
android:bottom="@dimen/settingslib_switch_thumb_margin">
|
||||
<shape android:shape="oval">
|
||||
<size
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
android:shape="rectangle"
|
||||
android:width="@dimen/settingslib_switch_track_width"
|
||||
android:height="@dimen/settingslib_switch_track_height">
|
||||
<padding android:left="@dimen/settingslib_switch_thumb_margin"
|
||||
android:right="@dimen/settingslib_switch_thumb_margin"/>
|
||||
<solid android:color="@color/settingslib_track_off_color"/>
|
||||
<corners android:radius="@dimen/settingslib_switch_track_radius"/>
|
||||
</shape>
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
android:shape="rectangle"
|
||||
android:width="@dimen/settingslib_switch_track_width"
|
||||
android:height="@dimen/settingslib_switch_track_height">
|
||||
<padding android:left="@dimen/settingslib_switch_thumb_margin"
|
||||
android:right="@dimen/settingslib_switch_thumb_margin"/>
|
||||
<solid android:color="@color/settingslib_track_on_color"/>
|
||||
<corners android:radius="@dimen/settingslib_switch_track_radius"/>
|
||||
</shape>
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:id="@+id/internet_connectivity_dialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/internet_dialog_list_max_width"
|
||||
android:layout_height="@dimen/internet_dialog_list_max_height"
|
||||
android:background="@drawable/internet_dialog_rounded_top_corner_background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.SliceView.Panel"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
@@ -54,21 +54,28 @@
|
||||
android:textSize="14sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="?androidprv:attr/colorSurfaceVariant"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/wifi_searching_progress"
|
||||
android:indeterminate="true"
|
||||
android:layout_width="340dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="gone"
|
||||
style="@style/TrimmedHorizontalProgressBar"/>
|
||||
android:layout_marginBottom="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="?androidprv:attr/colorSurfaceVariant"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/wifi_searching_progress"
|
||||
android:indeterminate="true"
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="gone"
|
||||
style="@style/TrimmedHorizontalProgressBar"/>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
@@ -96,7 +103,6 @@
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginEnd="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginStart="@dimen/settingslib_switchbar_margin"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingEnd="22dp">
|
||||
|
||||
@@ -148,14 +154,15 @@
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="48dp"
|
||||
android:layout_width="@dimen/settingslib_switch_track_width"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="end|center_vertical">
|
||||
<Switch
|
||||
android:id="@+id/mobile_toggle"
|
||||
android:switchMinWidth="@dimen/settingslib_switch_track_width"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/settingslib_switch_track_width"
|
||||
android:layout_height="@dimen/settingslib_switch_track_height"
|
||||
android:track="@drawable/settingslib_track_selector"
|
||||
android:thumb="@drawable/settingslib_thumb_selector"
|
||||
android:theme="@style/MainSwitch.Settingslib"/>
|
||||
@@ -195,15 +202,16 @@
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="48dp"
|
||||
android:layout_width="@dimen/settingslib_switch_track_width"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
<Switch
|
||||
android:id="@+id/wifi_toggle"
|
||||
android:switchMinWidth="@dimen/settingslib_switch_track_width"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/settingslib_switch_track_width"
|
||||
android:layout_height="@dimen/settingslib_switch_track_height"
|
||||
android:track="@drawable/settingslib_track_selector"
|
||||
android:thumb="@drawable/settingslib_thumb_selector"
|
||||
android:theme="@style/MainSwitch.Settingslib"/>
|
||||
@@ -343,31 +351,23 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:id="@+id/space"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginBottom="40dp">
|
||||
<Button
|
||||
style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored"
|
||||
android:id="@+id/done"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="67dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:background="@drawable/internet_dialog_footer_background"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/inline_done_button"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="google-sans"/>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1598,7 +1598,8 @@
|
||||
|
||||
<!-- Internet panel related dimensions -->
|
||||
<dimen name="internet_dialog_list_margin">12dp</dimen>
|
||||
<dimen name="internet_dialog_list_max_height">614dp</dimen>
|
||||
<dimen name="internet_dialog_list_max_height">646dp</dimen>
|
||||
<dimen name="internet_dialog_list_max_width">412dp</dimen>
|
||||
|
||||
<!-- Signal icon in internet dialog -->
|
||||
<dimen name="signal_strength_icon_size">24dp</dimen>
|
||||
@@ -1609,23 +1610,23 @@
|
||||
<!-- Size of internet dialog -->
|
||||
<dimen name="settingslib_switchbar_margin">16dp</dimen>
|
||||
<!-- Minimum width of switch -->
|
||||
<dimen name="settingslib_min_switch_width">48dp</dimen>
|
||||
<dimen name="settingslib_min_switch_width">52dp</dimen>
|
||||
<!-- Size of layout margin left -->
|
||||
<dimen name="settingslib_switchbar_padding_left">20dp</dimen>
|
||||
<!-- Size of layout margin right -->
|
||||
<dimen name="settingslib_switchbar_padding_right">20dp</dimen>
|
||||
<!-- Radius of switch bar -->
|
||||
<dimen name="settingslib_switch_bar_radius">24dp</dimen>
|
||||
<dimen name="settingslib_switch_bar_radius">35dp</dimen>
|
||||
<!-- Margin of switch thumb -->
|
||||
<dimen name="settingslib_switch_thumb_margin">4dp</dimen>
|
||||
<!-- Size of switch thumb -->
|
||||
<dimen name="settingslib_switch_thumb_size">16dp</dimen>
|
||||
<dimen name="settingslib_switch_thumb_size">20dp</dimen>
|
||||
<!-- Width of switch track -->
|
||||
<dimen name="settingslib_switch_track_width">48dp</dimen>
|
||||
<dimen name="settingslib_switch_track_width">52dp</dimen>
|
||||
<!-- Height of switch track -->
|
||||
<dimen name="settingslib_switch_track_height">24dp</dimen>
|
||||
<dimen name="settingslib_switch_track_height">28dp</dimen>
|
||||
<!-- Radius of switch track -->
|
||||
<dimen name="settingslib_switch_track_radius">31dp</dimen>
|
||||
<dimen name="settingslib_switch_track_radius">35dp</dimen>
|
||||
|
||||
<!-- Height percentage of the parent container occupied by the communal view -->
|
||||
<item name="communal_source_height_percentage" format="float" type="dimen">0.80</item>
|
||||
|
||||
@@ -112,7 +112,6 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
private LinearLayout mMobileNetworkList;
|
||||
private LinearLayout mTurnWifiOnLayout;
|
||||
private LinearLayout mSeeAllLayout;
|
||||
private Space mSpace;
|
||||
private RecyclerView mWifiRecyclerView;
|
||||
private ImageView mConnectedWifiIcon;
|
||||
private ImageView mWifiSettingsIcon;
|
||||
@@ -126,6 +125,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
private Button mDoneButton;
|
||||
private Drawable mBackgroundOn;
|
||||
private int mListMaxHeight;
|
||||
private int mListMaxWidth;
|
||||
private int mDefaultDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||
private boolean mCanConfigMobileData;
|
||||
|
||||
@@ -174,6 +174,8 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
};
|
||||
mListMaxHeight = context.getResources().getDimensionPixelSize(
|
||||
R.dimen.internet_dialog_list_max_height);
|
||||
mListMaxWidth = context.getResources().getDimensionPixelSize(
|
||||
R.dimen.internet_dialog_list_max_width);
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mAdapter = new InternetAdapter(mInternetDialogController);
|
||||
if (!aboveStatusBar) {
|
||||
@@ -200,7 +202,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
layoutParams.setFitInsetsIgnoringVisibility(true);
|
||||
window.setAttributes(layoutParams);
|
||||
window.setContentView(mDialogView);
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
window.setLayout(mListMaxWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
window.setWindowAnimations(R.style.Animation_InternetDialog);
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
window.addFlags(FLAG_LAYOUT_NO_LIMITS);
|
||||
@@ -221,7 +223,6 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
mWifiSettingsIcon = mDialogView.requireViewById(R.id.wifi_settings_icon);
|
||||
mWifiRecyclerView = mDialogView.requireViewById(R.id.wifi_list_layout);
|
||||
mSeeAllLayout = mDialogView.requireViewById(R.id.see_all_layout);
|
||||
mSpace = mDialogView.requireViewById(R.id.space);
|
||||
mDoneButton = mDialogView.requireViewById(R.id.done);
|
||||
mSignalIcon = mDialogView.requireViewById(R.id.signal_icon);
|
||||
mMobileTitleText = mDialogView.requireViewById(R.id.mobile_title);
|
||||
@@ -302,7 +303,6 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
mSeeAllLayout.setVisibility(wifiListVisibility);
|
||||
mSpace.setVisibility(wifiListVisibility == View.VISIBLE ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private void setOnClickListener() {
|
||||
@@ -328,7 +328,6 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
(buttonView, isChecked) -> {
|
||||
buttonView.setChecked(isChecked);
|
||||
mWifiManager.setWifiEnabled(isChecked);
|
||||
mSpace.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
||||
});
|
||||
mDoneButton.setOnClickListener(v -> dismiss());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user