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

Commit e4012c4a authored by Jason Monk's avatar Jason Monk Committed by android-build-merger
Browse files

Merge "Updates for QS DND tile" into oc-dev

am: 88b8dc52

Change-Id: I091681155cfc263598d9fd918873d7269d3eee32
parents 025927c7 88b8dc52
Loading
Loading
Loading
Loading
+132 −81
Original line number Diff line number Diff line
@@ -18,7 +18,14 @@
<com.android.systemui.volume.ZenModePanel xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/zen_mode_panel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_height="match_parent"
    android:clipChildren="false" >

    <LinearLayout
        android:id="@+id/edit_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?android:attr/colorPrimary"
        android:clipChildren="false"
        android:orientation="vertical">

@@ -117,5 +124,49 @@
            android:textDirection="locale"
            android:lineSpacingMultiplier="1.20029"
            android:textAppearance="@style/TextAppearance.QS.Warning" />
    </LinearLayout>

    <LinearLayout
        android:id="@android:id/empty"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:background="?android:attr/colorPrimary"
        android:gravity="center"
        android:orientation="vertical">

        <ImageView
            android:id="@android:id/icon"
            android:layout_width="56dp"
            android:layout_height="56dp"
            android:alpha="?android:attr/disabledAlpha"
            android:tint="?android:attr/colorForeground" />

        <TextView
            android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:textAppearance="@style/TextAppearance.QS.DetailEmpty"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/auto_rule"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?android:attr/colorPrimary"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginBottom="8dp"
        android:orientation="vertical">

        <TextView
            android:id="@android:id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="@style/TextAppearance.QS.DetailItemPrimary"/>

    </LinearLayout>

</com.android.systemui.volume.ZenModePanel>
+3 −3
Original line number Diff line number Diff line
@@ -1975,13 +1975,13 @@
    <string name="dnd_is_off">Do Not Disturb is off</string>

    <!-- Prompt for when Do not disturb is on from automatic rule in QS [CHAR LIMIT=NONE] -->
    <string name="qs_dnd_prompt_auto_rule">Do Not Disturb was turned on by an automatic rule (<xliff:g name="rule">%s</xliff:g>). Keep current settings?</string>
    <string name="qs_dnd_prompt_auto_rule">Do Not Disturb was turned on by an automatic rule (<xliff:g name="rule">%s</xliff:g>).</string>

    <!-- Prompt for when Do not disturb is on from app in QS [CHAR LIMIT=NONE] -->
    <string name="qs_dnd_prompt_app">Do Not Disturb was turned on by an app (<xliff:g name="app">%s</xliff:g>). Keep current settings?</string>
    <string name="qs_dnd_prompt_app">Do Not Disturb was turned on by an app (<xliff:g name="app">%s</xliff:g>).</string>

    <!-- Prompt for when Do not disturb is on from automatic rule or app in QS [CHAR LIMIT=NONE] -->
    <string name="qs_dnd_prompt_auto_rule_app">Do Not Disturb was turned on by an automatic rule or app. Keep current settings?</string>
    <string name="qs_dnd_prompt_auto_rule_app">Do Not Disturb was turned on by an automatic rule or app.</string>

    <!-- Description of Do Not Disturb option in QS that ends at the specified time[CHAR LIMIT=20] -->
    <string name="qs_dnd_until">Until <xliff:g name="time">%s</xliff:g></string>
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ public class SystemUIApplication extends Application implements SysUiServiceProv
     * the main process.
     * <p>This method must only be called from the main thread.</p>
     */

    public void startServicesIfNeeded() {
        startServicesIfNeeded(SERVICES);
    }
+6 −4
Original line number Diff line number Diff line
@@ -81,8 +81,8 @@ public class QSDetailItems extends FrameLayout {
        mItemList.setAdapter(mAdapter);
        mEmpty = findViewById(android.R.id.empty);
        mEmpty.setVisibility(GONE);
        mEmptyText = (TextView) mEmpty.findViewById(android.R.id.title);
        mEmptyIcon = (ImageView) mEmpty.findViewById(android.R.id.icon);
        mEmptyText = mEmpty.findViewById(android.R.id.title);
        mEmptyIcon = mEmpty.findViewById(android.R.id.icon);
    }

    @Override
@@ -104,8 +104,10 @@ public class QSDetailItems extends FrameLayout {
    }

    public void setEmptyState(int icon, int text) {
        mEmptyIcon.post(() -> {
            mEmptyIcon.setImageResource(icon);
            mEmptyText.setText(text);
        });
    }

    @Override
+6 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile {

    private String mTileSpec;
    private EnforcedAdmin mEnforcedAdmin;
    private boolean mShowingDetail;

    public abstract TState newTileState();

@@ -286,11 +287,16 @@ public abstract class QSTileImpl<TState extends State> implements QSTile {
    }

    private void handleShowDetail(boolean show) {
        mShowingDetail = show;
        for (int i = 0; i < mCallbacks.size(); i++) {
            mCallbacks.get(i).onShowDetail(show);
        }
    }

    protected boolean isShowingDetail() {
        return mShowingDetail;
    }

    private void handleToggleStateChanged(boolean state) {
        for (int i = 0; i < mCallbacks.size(); i++) {
            mCallbacks.get(i).onToggleStateChanged(state);
Loading