Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ce4a9e0 authored by Zoey Chen's avatar Zoey Chen Committed by Automerger Merge Worker
Browse files

Merge "[Provider Model] 1. Add the vertical separation in front of the mobile...

Merge "[Provider Model] 1. Add the vertical separation in front of the mobile toggle 2. Increase the margin of the done btn" into sc-v2-dev am: a93b661b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16183028

Change-Id: I046905eef94139f616e23829a41abf5b2ec432a6
parents bea0c7d5 a93b661b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -156,6 +156,14 @@
                            style="@style/InternetDialog.NetworkSummary"/>
                    </LinearLayout>

                    <View
                        android:id="@+id/mobile_toggle_divider"
                        android:layout_width="1dp"
                        android:layout_height="28dp"
                        android:layout_marginEnd="16dp"
                        android:layout_gravity="center_vertical"
                        android:background="?android:attr/textColorSecondary"/>

                    <FrameLayout
                        android:layout_width="@dimen/settingslib_switch_track_width"
                        android:layout_height="48dp"
@@ -367,8 +375,9 @@
                android:id="@+id/done_layout"
                android:layout_width="67dp"
                android:layout_height="48dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginBottom="40dp"
                android:layout_marginBottom="34dp"
                android:layout_gravity="end|center_vertical"
                android:clickable="true"
                android:focusable="true">
+6 −2
Original line number Diff line number Diff line
@@ -53,13 +53,17 @@
    <style name="TextAppearance.InternetDialog.Active">
        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
        <item name="android:textSize">16sp</item>
        <item name="android:textColor">@color/connected_network_primary_color</item>
        <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
        <item name="android:textDirection">locale</item>
    </style>

    <style name="TextAppearance.InternetDialog.Secondary.Active">
        <item name="android:textSize">14sp</item>
        <item name="android:textColor">@color/connected_network_secondary_color</item>
        <item name="android:textColor">?android:attr/textColorSecondaryInverse</item>
    </style>

    <style name="InternetDialog.Divider.Active">
        <item name="android:background">?android:attr/textColorSecondaryInverse</item>
    </style>

</resources>
+6 −0
Original line number Diff line number Diff line
@@ -947,4 +947,10 @@

    <style name="TextAppearance.InternetDialog.Secondary.Active"/>

    <style name="InternetDialog.Divider">
        <item name="android:background">?android:attr/textColorSecondary</item>
    </style>

    <style name="InternetDialog.Divider.Active"/>

</resources>
+11 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import androidx.recyclerview.widget.RecyclerView;

import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.Utils;
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.accessibility.floatingmenu.AnnotationLinkSpan;
@@ -120,6 +121,7 @@ public class InternetDialog extends SystemUIDialog implements
    private TextView mMobileTitleText;
    private TextView mMobileSummaryText;
    private Switch mMobileDataToggle;
    private View mMobileToggleDivider;
    private Switch mWiFiToggle;
    private FrameLayout mDoneLayout;
    private Drawable mBackgroundOn;
@@ -207,6 +209,7 @@ public class InternetDialog extends SystemUIDialog implements
        mSignalIcon = mDialogView.requireViewById(R.id.signal_icon);
        mMobileTitleText = mDialogView.requireViewById(R.id.mobile_title);
        mMobileSummaryText = mDialogView.requireViewById(R.id.mobile_summary);
        mMobileToggleDivider = mDialogView.requireViewById(R.id.mobile_toggle_divider);
        mMobileDataToggle = mDialogView.requireViewById(R.id.mobile_toggle);
        mWiFiToggle = mDialogView.requireViewById(R.id.wifi_toggle);
        mBackgroundOn = mContext.getDrawable(R.drawable.settingslib_switch_bar_bg_on);
@@ -378,6 +381,14 @@ public class InternetDialog extends SystemUIDialog implements
            mMobileNetworkLayout.setBackground(
                    isCarrierNetworkConnected ? mBackgroundOn : mBackgroundOff);

            TypedArray array = mContext.obtainStyledAttributes(
                    R.style.InternetDialog_Divider_Active, new int[]{android.R.attr.background});
            int dividerColor = Utils.getColorAttrDefaultColor(mContext,
                    android.R.attr.textColorSecondary);
            mMobileToggleDivider.setBackgroundColor(isCarrierNetworkConnected
                    ? array.getColor(0, dividerColor) : dividerColor);
            array.recycle();

            mMobileDataToggle.setVisibility(mCanConfigMobileData ? View.VISIBLE : View.INVISIBLE);
        }
    }