Loading packages/SystemUI/src/com/android/systemui/qs/QSFooter.java +2 −3 Original line number Diff line number Diff line Loading @@ -65,10 +65,9 @@ public interface QSFooter { void setKeyguardShowing(boolean keyguardShowing); /** * Returns the {@link View} that should expand the quick settings when clicked. * Sets the {@link android.view.View.OnClickListener to be used on elements that expend QS. */ @Nullable View getExpandView(); void setExpandClickListener(View.OnClickListener onClickListener); default void disable(int state1, int state2, boolean animate) {} } packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java +23 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.qs; import static android.app.StatusBarManager.DISABLE2_QUICK_SETTINGS; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; import android.content.Context; import android.content.Intent; Loading @@ -27,6 +26,7 @@ import android.content.res.Configuration; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.os.Bundle; import android.os.UserManager; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; Loading @@ -34,6 +34,7 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; import android.view.View.OnClickListener; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; Loading Loading @@ -96,6 +97,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, private ImageView mMobileRoaming; private final int mColorForeground; private final CellSignalState mInfo = new CellSignalState(); private OnClickListener mExpandClickListener; public QSFooterImpl(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -140,6 +142,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, mActivityStarter = Dependency.get(ActivityStarter.class); addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updateAnimator(right - left)); setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } private void updateAnimator(int width) { Loading Loading @@ -204,6 +207,11 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, setExpansion(mExpansionAmount); } @Override public void setExpandClickListener(OnClickListener onClickListener) { mExpandClickListener = onClickListener; } @Override public void setExpanded(boolean expanded) { if (mExpanded == expanded) return; Loading Loading @@ -238,8 +246,20 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, } @Override public View getExpandView() { return findViewById(R.id.expand_indicator); public boolean performAccessibilityAction(int action, Bundle arguments) { if (action == AccessibilityNodeInfo.ACTION_EXPAND) { if (mExpandClickListener != null) { mExpandClickListener.onClick(null); return true; } } return super.performAccessibilityAction(action, arguments); } @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_EXPAND); } @Override Loading packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +1 −10 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks { @Override public void setHeaderClickable(boolean clickable) { if (DEBUG) Log.d(TAG, "setHeaderClickable " + clickable); View expandView = mFooter.getExpandView(); if (expandView != null) { expandView.setClickable(clickable); } } @Override Loading Loading @@ -369,11 +364,7 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks { @Override public void setExpandClickListener(OnClickListener onClickListener) { View expandView = mFooter.getExpandView(); if (expandView != null) { expandView.setOnClickListener(onClickListener); } mFooter.setExpandClickListener(onClickListener); } @Override Loading packages/SystemUI/src/com/android/systemui/qs/car/CarQSFooter.java +1 −3 Original line number Diff line number Diff line Loading @@ -114,11 +114,9 @@ public class CarQSFooter extends RelativeLayout implements QSFooter, } } @Nullable @Override public View getExpandView() { public void setExpandClickListener(OnClickListener onClickListener) { // No view that should expand/collapse the quick settings. return null; } @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +6 −8 Original line number Diff line number Diff line Loading @@ -1965,7 +1965,6 @@ public class NotificationPanelView extends PanelView implements @Override public void onClick(View v) { if (v.getId() == R.id.expand_indicator) { onQsExpansionStarted(); if (mQsExpanded) { flingSettings(0 /* vel */, false /* expand */, null, true /* isClick */); Loading @@ -1974,7 +1973,6 @@ public class NotificationPanelView extends PanelView implements flingSettings(0 /* vel */, true /* expand */, null, true /* isClick */); } } } @Override public void onAnimationToSideStarted(boolean rightPage, float translation, float vel) { Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QSFooter.java +2 −3 Original line number Diff line number Diff line Loading @@ -65,10 +65,9 @@ public interface QSFooter { void setKeyguardShowing(boolean keyguardShowing); /** * Returns the {@link View} that should expand the quick settings when clicked. * Sets the {@link android.view.View.OnClickListener to be used on elements that expend QS. */ @Nullable View getExpandView(); void setExpandClickListener(View.OnClickListener onClickListener); default void disable(int state1, int state2, boolean animate) {} }
packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java +23 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.qs; import static android.app.StatusBarManager.DISABLE2_QUICK_SETTINGS; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; import android.content.Context; import android.content.Intent; Loading @@ -27,6 +26,7 @@ import android.content.res.Configuration; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.os.Bundle; import android.os.UserManager; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; Loading @@ -34,6 +34,7 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; import android.view.View.OnClickListener; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; Loading Loading @@ -96,6 +97,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, private ImageView mMobileRoaming; private final int mColorForeground; private final CellSignalState mInfo = new CellSignalState(); private OnClickListener mExpandClickListener; public QSFooterImpl(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -140,6 +142,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, mActivityStarter = Dependency.get(ActivityStarter.class); addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updateAnimator(right - left)); setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } private void updateAnimator(int width) { Loading Loading @@ -204,6 +207,11 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, setExpansion(mExpansionAmount); } @Override public void setExpandClickListener(OnClickListener onClickListener) { mExpandClickListener = onClickListener; } @Override public void setExpanded(boolean expanded) { if (mExpanded == expanded) return; Loading Loading @@ -238,8 +246,20 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, } @Override public View getExpandView() { return findViewById(R.id.expand_indicator); public boolean performAccessibilityAction(int action, Bundle arguments) { if (action == AccessibilityNodeInfo.ACTION_EXPAND) { if (mExpandClickListener != null) { mExpandClickListener.onClick(null); return true; } } return super.performAccessibilityAction(action, arguments); } @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_EXPAND); } @Override Loading
packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +1 −10 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks { @Override public void setHeaderClickable(boolean clickable) { if (DEBUG) Log.d(TAG, "setHeaderClickable " + clickable); View expandView = mFooter.getExpandView(); if (expandView != null) { expandView.setClickable(clickable); } } @Override Loading Loading @@ -369,11 +364,7 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks { @Override public void setExpandClickListener(OnClickListener onClickListener) { View expandView = mFooter.getExpandView(); if (expandView != null) { expandView.setOnClickListener(onClickListener); } mFooter.setExpandClickListener(onClickListener); } @Override Loading
packages/SystemUI/src/com/android/systemui/qs/car/CarQSFooter.java +1 −3 Original line number Diff line number Diff line Loading @@ -114,11 +114,9 @@ public class CarQSFooter extends RelativeLayout implements QSFooter, } } @Nullable @Override public View getExpandView() { public void setExpandClickListener(OnClickListener onClickListener) { // No view that should expand/collapse the quick settings. return null; } @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +6 −8 Original line number Diff line number Diff line Loading @@ -1965,7 +1965,6 @@ public class NotificationPanelView extends PanelView implements @Override public void onClick(View v) { if (v.getId() == R.id.expand_indicator) { onQsExpansionStarted(); if (mQsExpanded) { flingSettings(0 /* vel */, false /* expand */, null, true /* isClick */); Loading @@ -1974,7 +1973,6 @@ public class NotificationPanelView extends PanelView implements flingSettings(0 /* vel */, true /* expand */, null, true /* isClick */); } } } @Override public void onAnimationToSideStarted(boolean rightPage, float translation, float vel) { Loading