Merge "Move QS Edit into QSContainer" into nyc-dev
am: c8bc4713d0
* commit 'c8bc4713d08cb8edba87d80e902c0fdbe73bfea1':
Move QS Edit into QSContainer
This commit is contained in:
@@ -14,10 +14,12 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!-- Height is 0 because it will be managed by the QSContainer manually -->
|
||||||
<com.android.systemui.qs.customize.QSCustomizer
|
<com.android.systemui.qs.customize.QSCustomizer
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@drawable/qs_customizer_background"
|
android:background="@drawable/qs_customizer_background"
|
||||||
android:gravity="center_horizontal">
|
android:gravity="center_horizontal">
|
||||||
|
|||||||
@@ -34,4 +34,7 @@
|
|||||||
|
|
||||||
<include android:id="@+id/qs_detail" layout="@layout/qs_detail" />
|
<include android:id="@+id/qs_detail" layout="@layout/qs_detail" />
|
||||||
|
|
||||||
|
<include android:id="@+id/qs_customize" layout="@layout/qs_customize_panel"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
</com.android.systemui.qs.QSContainer>
|
</com.android.systemui.qs.QSContainer>
|
||||||
|
|||||||
@@ -43,8 +43,10 @@
|
|||||||
android:id="@+id/qs_density_container"
|
android:id="@+id/qs_density_container"
|
||||||
android:layout="@layout/qs_panel"
|
android:layout="@layout/qs_panel"
|
||||||
android:layout_width="@dimen/notification_panel_width"
|
android:layout_width="@dimen/notification_panel_width"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="@integer/notification_panel_layout_gravity" />
|
android:layout_gravity="@integer/notification_panel_layout_gravity"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:clipChildren="false" />
|
||||||
|
|
||||||
<com.android.systemui.statusbar.stack.NotificationStackScrollLayout
|
<com.android.systemui.statusbar.stack.NotificationStackScrollLayout
|
||||||
android:id="@+id/notification_stack_scroller"
|
android:id="@+id/notification_stack_scroller"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.qs;
|
|||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Point;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -26,7 +27,9 @@ import android.view.ViewTreeObserver;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import com.android.systemui.Interpolators;
|
import com.android.systemui.Interpolators;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.qs.customize.QSCustomizer;
|
||||||
import com.android.systemui.statusbar.phone.BaseStatusBarHeader;
|
import com.android.systemui.statusbar.phone.BaseStatusBarHeader;
|
||||||
|
import com.android.systemui.statusbar.phone.NotificationPanelView;
|
||||||
import com.android.systemui.statusbar.phone.QSTileHost;
|
import com.android.systemui.statusbar.phone.QSTileHost;
|
||||||
import com.android.systemui.statusbar.stack.StackStateAnimator;
|
import com.android.systemui.statusbar.stack.StackStateAnimator;
|
||||||
|
|
||||||
@@ -39,6 +42,8 @@ public class QSContainer extends FrameLayout {
|
|||||||
private static final String TAG = "QSContainer";
|
private static final String TAG = "QSContainer";
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
|
private final Point mSizePoint = new Point();
|
||||||
|
|
||||||
private int mHeightOverride = -1;
|
private int mHeightOverride = -1;
|
||||||
private QSPanel mQSPanel;
|
private QSPanel mQSPanel;
|
||||||
private QSDetail mQSDetail;
|
private QSDetail mQSDetail;
|
||||||
@@ -51,6 +56,8 @@ public class QSContainer extends FrameLayout {
|
|||||||
|
|
||||||
private long mDelay;
|
private long mDelay;
|
||||||
private QSAnimator mQSAnimator;
|
private QSAnimator mQSAnimator;
|
||||||
|
private QSCustomizer mQSCustomizer;
|
||||||
|
private NotificationPanelView mPanelView;
|
||||||
|
|
||||||
public QSContainer(Context context, AttributeSet attrs) {
|
public QSContainer(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -65,21 +72,33 @@ public class QSContainer extends FrameLayout {
|
|||||||
mHeader = (BaseStatusBarHeader) findViewById(R.id.header);
|
mHeader = (BaseStatusBarHeader) findViewById(R.id.header);
|
||||||
mQSAnimator = new QSAnimator(this, (QuickQSPanel) mHeader.findViewById(R.id.quick_qs_panel),
|
mQSAnimator = new QSAnimator(this, (QuickQSPanel) mHeader.findViewById(R.id.quick_qs_panel),
|
||||||
mQSPanel);
|
mQSPanel);
|
||||||
|
mQSCustomizer = (QSCustomizer) findViewById(R.id.qs_customize);
|
||||||
|
mQSCustomizer.setQsContainer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHost(QSTileHost qsh) {
|
public void setHost(QSTileHost qsh) {
|
||||||
mQSPanel.setHost(qsh);
|
mQSPanel.setHost(qsh, mQSCustomizer);
|
||||||
mHeader.setQSPanel(mQSPanel);
|
mHeader.setQSPanel(mQSPanel);
|
||||||
mQSDetail.setHost(qsh);
|
mQSDetail.setHost(qsh);
|
||||||
mQSAnimator.setHost(qsh);
|
mQSAnimator.setHost(qsh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPanelView(NotificationPanelView panelView) {
|
||||||
|
mPanelView = panelView;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
// Since we control our own bottom, be whatever size we want.
|
// Since we control our own bottom, be whatever size we want.
|
||||||
// Otherwise the QSPanel ends up with 0 height when the window is only the
|
// Otherwise the QSPanel ends up with 0 height when the window is only the
|
||||||
// size of the status bar.
|
// size of the status bar.
|
||||||
super.onMeasure(widthMeasureSpec, MeasureSpec.UNSPECIFIED);
|
super.onMeasure(widthMeasureSpec, MeasureSpec.UNSPECIFIED);
|
||||||
|
|
||||||
|
// QSCustomizer is always be the height of the screen, but do this after
|
||||||
|
// other measuring to avoid changing the height of the QSContainer.
|
||||||
|
getDisplay().getRealSize(mSizePoint);
|
||||||
|
mQSCustomizer.measure(widthMeasureSpec,
|
||||||
|
MeasureSpec.makeMeasureSpec(mSizePoint.y, MeasureSpec.EXACTLY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,6 +107,10 @@ public class QSContainer extends FrameLayout {
|
|||||||
updateBottom();
|
updateBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCustomizing() {
|
||||||
|
return mQSCustomizer.isCustomizing();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides the height of this view (post-layout), so that the content is clipped to that
|
* Overrides the height of this view (post-layout), so that the content is clipped to that
|
||||||
* height and the background is set to that height.
|
* height and the background is set to that height.
|
||||||
@@ -104,6 +127,9 @@ public class QSContainer extends FrameLayout {
|
|||||||
* during closing the detail panel, this already returns the smaller height.
|
* during closing the detail panel, this already returns the smaller height.
|
||||||
*/
|
*/
|
||||||
public int getDesiredHeight() {
|
public int getDesiredHeight() {
|
||||||
|
if (isCustomizing()) {
|
||||||
|
return getHeight();
|
||||||
|
}
|
||||||
if (mQSDetail.isClosingDetail()) {
|
if (mQSDetail.isClosingDetail()) {
|
||||||
return mQSPanel.getGridHeight() + mHeader.getCollapsedHeight() + getPaddingBottom();
|
return mQSPanel.getGridHeight() + mHeader.getCollapsedHeight() + getPaddingBottom();
|
||||||
} else {
|
} else {
|
||||||
@@ -111,9 +137,18 @@ public class QSContainer extends FrameLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void notifyCustomizeChanged() {
|
||||||
|
// The customize state changed, so our height changed.
|
||||||
|
updateBottom();
|
||||||
|
// Let the panel know the position changed and it needs to update where notifications
|
||||||
|
// and whatnot are.
|
||||||
|
mPanelView.onQsHeightChanged();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateBottom() {
|
private void updateBottom() {
|
||||||
int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
|
int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
|
||||||
int height = (int) (mQsExpansion * (heightOverride - mHeader.getCollapsedHeight()))
|
int height = mQSCustomizer.isCustomizing() ? mQSCustomizer.getHeight()
|
||||||
|
: (int) (mQsExpansion * (heightOverride - mHeader.getCollapsedHeight()))
|
||||||
+ mHeader.getCollapsedHeight();
|
+ mHeader.getCollapsedHeight();
|
||||||
setBottom(getTop() + height);
|
setBottom(getTop() + height);
|
||||||
mQSDetail.setBottom(getTop() + height);
|
mQSDetail.setBottom(getTop() + height);
|
||||||
@@ -138,6 +173,10 @@ public class QSContainer extends FrameLayout {
|
|||||||
return mQSPanel;
|
return mQSPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QSCustomizer getCustomizer() {
|
||||||
|
return mQSCustomizer;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isShowingDetail() {
|
public boolean isShowingDetail() {
|
||||||
return mQSPanel.isShowingCustomize() || mQSDetail.isShowingDetail();
|
return mQSPanel.isShowingCustomize() || mQSDetail.isShowingDetail();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,12 +155,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
|
|||||||
return mHost.createTile(subPanel);
|
return mHost.createTile(subPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createCustomizePanel() {
|
|
||||||
mCustomizePanel = (QSCustomizer) LayoutInflater.from(mContext)
|
|
||||||
.inflate(R.layout.qs_customize_panel, null);
|
|
||||||
mCustomizePanel.setHost(mHost);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBrightnessMirror(BrightnessMirrorController c) {
|
public void setBrightnessMirror(BrightnessMirrorController c) {
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
ToggleSlider brightnessSlider = (ToggleSlider) findViewById(R.id.brightness_slider);
|
ToggleSlider brightnessSlider = (ToggleSlider) findViewById(R.id.brightness_slider);
|
||||||
@@ -173,12 +167,15 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
|
|||||||
mCallback = callback;
|
mCallback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHost(QSTileHost host) {
|
public void setHost(QSTileHost host, QSCustomizer customizer) {
|
||||||
mHost = host;
|
mHost = host;
|
||||||
mHost.addCallback(this);
|
mHost.addCallback(this);
|
||||||
setTiles(mHost.getTiles());
|
setTiles(mHost.getTiles());
|
||||||
mFooter.setHost(host);
|
mFooter.setHost(host);
|
||||||
createCustomizePanel();
|
mCustomizePanel = customizer;
|
||||||
|
if (mCustomizePanel != null) {
|
||||||
|
mCustomizePanel.setHost(mHost);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public QSTileHost getHost() {
|
public QSTileHost getHost() {
|
||||||
|
|||||||
@@ -67,11 +67,6 @@ public class QuickQSPanel extends QSPanel {
|
|||||||
TunerService.get(mContext).removeTunable(mNumTiles);
|
TunerService.get(mContext).removeTunable(mNumTiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void createCustomizePanel() {
|
|
||||||
// No customizing from the header.
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQSPanelAndHeader(QSPanel fullPanel, View header) {
|
public void setQSPanelAndHeader(QSPanel fullPanel, View header) {
|
||||||
mFullPanel = fullPanel;
|
mFullPanel = fullPanel;
|
||||||
mHeader = header;
|
mHeader = header;
|
||||||
|
|||||||
@@ -32,8 +32,10 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
import android.widget.Toolbar.OnMenuItemClickListener;
|
import android.widget.Toolbar.OnMenuItemClickListener;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.qs.QSContainer;
|
||||||
import com.android.systemui.qs.QSDetailClipper;
|
import com.android.systemui.qs.QSDetailClipper;
|
||||||
import com.android.systemui.qs.QSTile;
|
import com.android.systemui.qs.QSTile;
|
||||||
|
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
|
||||||
import com.android.systemui.statusbar.phone.PhoneStatusBar;
|
import com.android.systemui.statusbar.phone.PhoneStatusBar;
|
||||||
import com.android.systemui.statusbar.phone.QSTileHost;
|
import com.android.systemui.statusbar.phone.QSTileHost;
|
||||||
|
|
||||||
@@ -59,6 +61,9 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
|
|||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private TileAdapter mTileAdapter;
|
private TileAdapter mTileAdapter;
|
||||||
private Toolbar mToolbar;
|
private Toolbar mToolbar;
|
||||||
|
private boolean mCustomizing;
|
||||||
|
private NotificationsQuickSettingsContainer mNotifQsContainer;
|
||||||
|
private QSContainer mQsContainer;
|
||||||
|
|
||||||
public QSCustomizer(Context context, AttributeSet attrs) {
|
public QSCustomizer(Context context, AttributeSet attrs) {
|
||||||
super(new ContextThemeWrapper(context, android.R.style.Theme_Material), attrs);
|
super(new ContextThemeWrapper(context, android.R.style.Theme_Material), attrs);
|
||||||
@@ -70,6 +75,14 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
|
|||||||
mPhoneStatusBar = host.getPhoneStatusBar();
|
mPhoneStatusBar = host.getPhoneStatusBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setContainer(NotificationsQuickSettingsContainer notificationsQsContainer) {
|
||||||
|
mNotifQsContainer = notificationsQsContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQsContainer(QSContainer qsContainer) {
|
||||||
|
mQsContainer = qsContainer;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
@@ -105,23 +118,31 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
|
|||||||
public void show(int x, int y) {
|
public void show(int x, int y) {
|
||||||
if (!isShown) {
|
if (!isShown) {
|
||||||
isShown = true;
|
isShown = true;
|
||||||
mPhoneStatusBar.getStatusBarWindow().addView(this);
|
|
||||||
setTileSpecs();
|
setTileSpecs();
|
||||||
mClipper.animateCircularClip(x, y, true, null);
|
setVisibility(View.VISIBLE);
|
||||||
|
mClipper.animateCircularClip(x, y, true, mExpandAnimationListener);
|
||||||
new TileQueryHelper(mContext, mHost).setListener(mTileAdapter);
|
new TileQueryHelper(mContext, mHost).setListener(mTileAdapter);
|
||||||
|
mNotifQsContainer.setCustomizerAnimating(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hide(int x, int y) {
|
public void hide(int x, int y) {
|
||||||
if (isShown) {
|
if (isShown) {
|
||||||
isShown = false;
|
isShown = false;
|
||||||
|
setCustomizing(false);
|
||||||
save();
|
save();
|
||||||
mClipper.animateCircularClip(x, y, false, mCollapseAnimationListener);
|
mClipper.animateCircularClip(x, y, false, mCollapseAnimationListener);
|
||||||
|
mNotifQsContainer.setCustomizerAnimating(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setCustomizing(boolean customizing) {
|
||||||
|
mCustomizing = customizing;
|
||||||
|
mQsContainer.notifyCustomizeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isCustomizing() {
|
public boolean isCustomizing() {
|
||||||
return isShown;
|
return mCustomizing;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -155,19 +176,34 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
|
|||||||
mTileAdapter.saveSpecs(mHost);
|
mTileAdapter.saveSpecs(mHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final AnimatorListener mExpandAnimationListener = new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
setCustomizing(true);
|
||||||
|
mNotifQsContainer.setCustomizerAnimating(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
mNotifQsContainer.setCustomizerAnimating(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private final AnimatorListener mCollapseAnimationListener = new AnimatorListenerAdapter() {
|
private final AnimatorListener mCollapseAnimationListener = new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
if (!isShown) {
|
if (!isShown) {
|
||||||
mPhoneStatusBar.getStatusBarWindow().removeView(QSCustomizer.this);
|
setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
mNotifQsContainer.setCustomizerAnimating(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationCancel(Animator animation) {
|
public void onAnimationCancel(Animator animation) {
|
||||||
if (!isShown) {
|
if (!isShown) {
|
||||||
mPhoneStatusBar.getStatusBarWindow().removeView(QSCustomizer.this);
|
setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
mNotifQsContainer.setCustomizerAnimating(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ import com.android.systemui.statusbar.stack.StackStateAnimator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class NotificationPanelView extends PanelView implements
|
public class NotificationPanelView extends PanelView implements
|
||||||
ExpandableView.OnHeightChangedListener, ObservableScrollView.Listener,
|
ExpandableView.OnHeightChangedListener,
|
||||||
View.OnClickListener, NotificationStackScrollLayout.OnOverscrollTopChangedListener,
|
View.OnClickListener, NotificationStackScrollLayout.OnOverscrollTopChangedListener,
|
||||||
KeyguardAffordanceHelper.Callback, NotificationStackScrollLayout.OnEmptySpaceClickListener,
|
KeyguardAffordanceHelper.Callback, NotificationStackScrollLayout.OnEmptySpaceClickListener,
|
||||||
HeadsUpManager.OnHeadsUpChangedListener {
|
HeadsUpManager.OnHeadsUpChangedListener {
|
||||||
@@ -222,6 +222,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
@Override
|
@Override
|
||||||
public void onInflated(View v) {
|
public void onInflated(View v) {
|
||||||
mQsContainer = (QSContainer) v.findViewById(R.id.quick_settings_container);
|
mQsContainer = (QSContainer) v.findViewById(R.id.quick_settings_container);
|
||||||
|
mQsContainer.setPanelView(NotificationPanelView.this);
|
||||||
mQsContainer.getHeader().setOnClickListener(NotificationPanelView.this);
|
mQsContainer.getHeader().setOnClickListener(NotificationPanelView.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -247,7 +248,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
final int height = bottom - top;
|
final int height = bottom - top;
|
||||||
final int oldHeight = oldBottom - oldTop;
|
final int oldHeight = oldBottom - oldTop;
|
||||||
if (height != oldHeight) {
|
if (height != oldHeight) {
|
||||||
onScrollChanged();
|
onQsHeightChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -547,7 +548,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||||
if (mBlockTouches) {
|
if (mBlockTouches || mQsContainer.isCustomizing()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
initDownStates(event);
|
initDownStates(event);
|
||||||
@@ -707,7 +708,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
if (mBlockTouches) {
|
if (mBlockTouches || mQsContainer.isCustomizing()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
initDownStates(event);
|
initDownStates(event);
|
||||||
@@ -905,18 +906,6 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
return (int) (mQsFalsingThreshold * factor);
|
return (int) (mQsFalsingThreshold * factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOverscrolled(float lastTouchX, float lastTouchY, int amount) {
|
|
||||||
if (mIntercepting && shouldQuickSettingsIntercept(lastTouchX, lastTouchY,
|
|
||||||
-1 /* yDiff: Not relevant here */)) {
|
|
||||||
mQsTracking = true;
|
|
||||||
onQsExpansionStarted(amount);
|
|
||||||
mInitialHeightOnTouch = mQsExpansionHeight;
|
|
||||||
mInitialTouchY = mLastTouchY;
|
|
||||||
mInitialTouchX = mLastTouchX;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOverscrollTopChanged(float amount, boolean isRubberbanded) {
|
public void onOverscrollTopChanged(float amount, boolean isRubberbanded) {
|
||||||
cancelQsAnimation();
|
cancelQsAnimation();
|
||||||
@@ -1719,9 +1708,10 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
public void onReset(ExpandableView view) {
|
public void onReset(ExpandableView view) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onQsHeightChanged() {
|
||||||
public void onScrollChanged() {
|
mQsMaxExpansionHeight = mQsContainer.getDesiredHeight();
|
||||||
if (mQsExpanded) {
|
if (mQsExpanded) {
|
||||||
|
mQsExpansionHeight = mQsMaxExpansionHeight;
|
||||||
requestScrollerTopPaddingUpdate(false /* animate */);
|
requestScrollerTopPaddingUpdate(false /* animate */);
|
||||||
requestPanelHeightUpdate();
|
requestPanelHeightUpdate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,21 +24,24 @@ import android.view.View;
|
|||||||
import android.view.ViewStub;
|
import android.view.ViewStub;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
import com.android.systemui.DensityContainer;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.qs.QSContainer;
|
||||||
|
import com.android.systemui.qs.customize.QSCustomizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The container with notification stack scroller and quick settings inside.
|
* The container with notification stack scroller and quick settings inside.
|
||||||
*/
|
*/
|
||||||
public class NotificationsQuickSettingsContainer extends FrameLayout
|
public class NotificationsQuickSettingsContainer extends FrameLayout
|
||||||
implements ViewStub.OnInflateListener {
|
implements ViewStub.OnInflateListener, DensityContainer.InflateListener {
|
||||||
|
|
||||||
private View mQsContainer;
|
private DensityContainer mQsContainer;
|
||||||
private View mUserSwitcher;
|
private View mUserSwitcher;
|
||||||
private View mStackScroller;
|
private View mStackScroller;
|
||||||
private View mKeyguardStatusBar;
|
private View mKeyguardStatusBar;
|
||||||
private boolean mInflated;
|
private boolean mInflated;
|
||||||
private boolean mQsExpanded;
|
private boolean mQsExpanded;
|
||||||
|
private boolean mCustomizerAnimating;
|
||||||
|
|
||||||
public NotificationsQuickSettingsContainer(Context context, AttributeSet attrs) {
|
public NotificationsQuickSettingsContainer(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -47,7 +50,8 @@ public class NotificationsQuickSettingsContainer extends FrameLayout
|
|||||||
@Override
|
@Override
|
||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
mQsContainer = findViewById(R.id.qs_density_container);
|
mQsContainer = (DensityContainer) findViewById(R.id.qs_density_container);
|
||||||
|
mQsContainer.addInflateListener(this);
|
||||||
mStackScroller = findViewById(R.id.notification_stack_scroller);
|
mStackScroller = findViewById(R.id.notification_stack_scroller);
|
||||||
mKeyguardStatusBar = findViewById(R.id.keyguard_header);
|
mKeyguardStatusBar = findViewById(R.id.keyguard_header);
|
||||||
ViewStub userSwitcher = (ViewStub) findViewById(R.id.keyguard_user_switcher);
|
ViewStub userSwitcher = (ViewStub) findViewById(R.id.keyguard_user_switcher);
|
||||||
@@ -80,8 +84,9 @@ public class NotificationsQuickSettingsContainer extends FrameLayout
|
|||||||
boolean userSwitcherVisible = mInflated && mUserSwitcher.getVisibility() == View.VISIBLE;
|
boolean userSwitcherVisible = mInflated && mUserSwitcher.getVisibility() == View.VISIBLE;
|
||||||
boolean statusBarVisible = mKeyguardStatusBar.getVisibility() == View.VISIBLE;
|
boolean statusBarVisible = mKeyguardStatusBar.getVisibility() == View.VISIBLE;
|
||||||
|
|
||||||
View stackQsTop = mQsExpanded ? mStackScroller : mQsContainer;
|
final boolean qsBottom = mQsExpanded && !mCustomizerAnimating;
|
||||||
View stackQsBottom = !mQsExpanded ? mStackScroller : mQsContainer;
|
View stackQsTop = qsBottom ? mStackScroller : mQsContainer;
|
||||||
|
View stackQsBottom = !qsBottom ? mStackScroller : mQsContainer;
|
||||||
// Invert the order of the scroll view and user switcher such that the notifications receive
|
// Invert the order of the scroll view and user switcher such that the notifications receive
|
||||||
// touches first but the panel gets drawn above.
|
// touches first but the panel gets drawn above.
|
||||||
if (child == mQsContainer) {
|
if (child == mQsContainer) {
|
||||||
@@ -117,10 +122,23 @@ public class NotificationsQuickSettingsContainer extends FrameLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInflated(View v) {
|
||||||
|
QSCustomizer customizer = ((QSContainer) v).getCustomizer();
|
||||||
|
customizer.setContainer(this);
|
||||||
|
}
|
||||||
|
|
||||||
public void setQsExpanded(boolean expanded) {
|
public void setQsExpanded(boolean expanded) {
|
||||||
if (mQsExpanded != expanded) {
|
if (mQsExpanded != expanded) {
|
||||||
mQsExpanded = expanded;
|
mQsExpanded = expanded;
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCustomizerAnimating(boolean isAnimating) {
|
||||||
|
if (mCustomizerAnimating != isAnimating) {
|
||||||
|
mCustomizerAnimating = isAnimating;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
mHost = host;
|
mHost = host;
|
||||||
host.setHeaderView(this);
|
host.setHeaderView(this);
|
||||||
mHeaderQsPanel.setQSPanelAndHeader(mQsPanel, this);
|
mHeaderQsPanel.setQSPanelAndHeader(mQsPanel, this);
|
||||||
mHeaderQsPanel.setHost(host);
|
mHeaderQsPanel.setHost(host, null /* No customization in header */);
|
||||||
setUserInfoController(host.getUserInfoController());
|
setUserInfoController(host.getUserInfoController());
|
||||||
setBatteryController(host.getBatteryController());
|
setBatteryController(host.getBatteryController());
|
||||||
setNextAlarmController(host.getNextAlarmController());
|
setNextAlarmController(host.getNextAlarmController());
|
||||||
|
|||||||
Reference in New Issue
Block a user