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