Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file |
| 5 | * except in compliance with the License. You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software distributed under the |
| 10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 11 | * KIND, either express or implied. See the License for the specific language governing |
| 12 | * permissions and limitations under the License. |
| 13 | */ |
| 14 | |
| 15 | package com.android.systemui.qs; |
| 16 | |
| 17 | import android.animation.Animator; |
| 18 | import android.animation.AnimatorListenerAdapter; |
| 19 | import android.annotation.Nullable; |
| 20 | import android.app.Fragment; |
| 21 | import android.content.res.Configuration; |
| 22 | import android.graphics.Rect; |
| 23 | import android.os.Bundle; |
Jason Monk | 64b214e | 2017-03-27 13:40:59 -0400 | [diff] [blame] | 24 | import android.support.annotation.VisibleForTesting; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 25 | import android.util.Log; |
Jason Monk | 9a376bc | 2017-05-10 09:52:10 -0400 | [diff] [blame^] | 26 | import android.view.ContextThemeWrapper; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 27 | import android.view.LayoutInflater; |
| 28 | import android.view.View; |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 29 | import android.view.View.OnClickListener; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 30 | import android.view.ViewGroup; |
| 31 | import android.view.ViewTreeObserver; |
| 32 | import android.widget.FrameLayout.LayoutParams; |
| 33 | |
| 34 | import com.android.systemui.Interpolators; |
| 35 | import com.android.systemui.R; |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 36 | import com.android.systemui.R.id; |
Jason Monk | 9a376bc | 2017-05-10 09:52:10 -0400 | [diff] [blame^] | 37 | import com.android.systemui.R.style; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 38 | import com.android.systemui.plugins.qs.QS; |
| 39 | import com.android.systemui.qs.customize.QSCustomizer; |
| 40 | import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 41 | import com.android.systemui.statusbar.stack.StackStateAnimator; |
| 42 | |
| 43 | public class QSFragment extends Fragment implements QS { |
| 44 | private static final String TAG = "QS"; |
| 45 | private static final boolean DEBUG = false; |
Jason Monk | 64b214e | 2017-03-27 13:40:59 -0400 | [diff] [blame] | 46 | private static final String EXTRA_EXPANDED = "expanded"; |
| 47 | private static final String EXTRA_LISTENING = "listening"; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 48 | |
| 49 | private final Rect mQsBounds = new Rect(); |
| 50 | private boolean mQsExpanded; |
| 51 | private boolean mHeaderAnimating; |
| 52 | private boolean mKeyguardShowing; |
| 53 | private boolean mStackScrollerOverscrolling; |
| 54 | |
| 55 | private long mDelay; |
| 56 | |
| 57 | private QSAnimator mQSAnimator; |
| 58 | private HeightListener mPanelView; |
| 59 | protected QuickStatusBarHeader mHeader; |
| 60 | private QSCustomizer mQSCustomizer; |
| 61 | protected QSPanel mQSPanel; |
| 62 | private QSDetail mQSDetail; |
| 63 | private boolean mListening; |
| 64 | private QSContainerImpl mContainer; |
| 65 | private int mLayoutDirection; |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 66 | private QSFooter mFooter; |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 67 | private int mGutterHeight; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 68 | |
| 69 | @Override |
| 70 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, |
| 71 | Bundle savedInstanceState) { |
Jason Monk | 9a376bc | 2017-05-10 09:52:10 -0400 | [diff] [blame^] | 72 | inflater =inflater.cloneInContext(new ContextThemeWrapper(getContext(), R.style.qs_theme)); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 73 | return inflater.inflate(R.layout.qs_panel, container, false); |
| 74 | } |
| 75 | |
| 76 | @Override |
| 77 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 78 | super.onViewCreated(view, savedInstanceState); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 79 | mQSPanel = view.findViewById(R.id.quick_settings_panel); |
| 80 | mQSDetail = view.findViewById(R.id.qs_detail); |
| 81 | mHeader = view.findViewById(R.id.header); |
| 82 | mFooter = view.findViewById(R.id.qs_footer); |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 83 | mContainer = view.findViewById(id.quick_settings_container); |
| 84 | mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 85 | |
| 86 | mQSDetail.setQsPanel(mQSPanel, mHeader); |
Anthony Chen | 3cb3ad9 | 2016-12-01 10:58:47 -0800 | [diff] [blame] | 87 | |
| 88 | // If the quick settings row is not shown, then there is no need for the animation from |
| 89 | // the row to the full QS panel. |
| 90 | if (getResources().getBoolean(R.bool.config_showQuickSettingsRow)) { |
| 91 | mQSAnimator = new QSAnimator(this, |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 92 | mHeader.findViewById(R.id.quick_qs_panel), mQSPanel); |
Anthony Chen | 3cb3ad9 | 2016-12-01 10:58:47 -0800 | [diff] [blame] | 93 | } |
| 94 | |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 95 | mQSCustomizer = view.findViewById(R.id.qs_customize); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 96 | mQSCustomizer.setQs(this); |
Jason Monk | 64b214e | 2017-03-27 13:40:59 -0400 | [diff] [blame] | 97 | if (savedInstanceState != null) { |
| 98 | setExpanded(savedInstanceState.getBoolean(EXTRA_EXPANDED)); |
| 99 | setListening(savedInstanceState.getBoolean(EXTRA_LISTENING)); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | @Override |
| 104 | public void onDestroy() { |
| 105 | super.onDestroy(); |
| 106 | if (mListening) { |
| 107 | setListening(false); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | @Override |
| 112 | public void onSaveInstanceState(Bundle outState) { |
| 113 | super.onSaveInstanceState(outState); |
| 114 | outState.putBoolean(EXTRA_EXPANDED, mQsExpanded); |
| 115 | outState.putBoolean(EXTRA_LISTENING, mListening); |
| 116 | } |
| 117 | |
| 118 | @VisibleForTesting |
| 119 | boolean isListening() { |
| 120 | return mListening; |
| 121 | } |
| 122 | |
| 123 | @VisibleForTesting |
| 124 | boolean isExpanded() { |
| 125 | return mQsExpanded; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 126 | } |
| 127 | |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 128 | @Override |
| 129 | public View getHeader() { |
| 130 | return mHeader; |
| 131 | } |
| 132 | |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 133 | public void setPanelView(HeightListener panelView) { |
| 134 | mPanelView = panelView; |
| 135 | } |
| 136 | |
| 137 | @Override |
| 138 | public void onConfigurationChanged(Configuration newConfig) { |
| 139 | super.onConfigurationChanged(newConfig); |
| 140 | if (newConfig.getLayoutDirection() != mLayoutDirection) { |
| 141 | mLayoutDirection = newConfig.getLayoutDirection(); |
Anthony Chen | 3cb3ad9 | 2016-12-01 10:58:47 -0800 | [diff] [blame] | 142 | |
| 143 | if (mQSAnimator != null) { |
| 144 | mQSAnimator.onRtlChanged(); |
| 145 | } |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 146 | } |
| 147 | } |
| 148 | |
| 149 | @Override |
| 150 | public void setContainer(ViewGroup container) { |
| 151 | if (container instanceof NotificationsQuickSettingsContainer) { |
| 152 | mQSCustomizer.setContainer((NotificationsQuickSettingsContainer) container); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | public boolean isCustomizing() { |
| 157 | return mQSCustomizer.isCustomizing(); |
| 158 | } |
| 159 | |
| 160 | public void setHost(QSTileHost qsh) { |
| 161 | mQSPanel.setHost(qsh, mQSCustomizer); |
| 162 | mHeader.setQSPanel(mQSPanel); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 163 | mFooter.setQSPanel(mQSPanel); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 164 | mQSDetail.setHost(qsh); |
Anthony Chen | 3cb3ad9 | 2016-12-01 10:58:47 -0800 | [diff] [blame] | 165 | |
| 166 | if (mQSAnimator != null) { |
| 167 | mQSAnimator.setHost(qsh); |
| 168 | } |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | private void updateQsState() { |
| 172 | final boolean expandVisually = mQsExpanded || mStackScrollerOverscrolling |
| 173 | || mHeaderAnimating; |
| 174 | mQSPanel.setExpanded(mQsExpanded); |
| 175 | mQSDetail.setExpanded(mQsExpanded); |
| 176 | mHeader.setVisibility((mQsExpanded || !mKeyguardShowing || mHeaderAnimating) |
| 177 | ? View.VISIBLE |
| 178 | : View.INVISIBLE); |
| 179 | mHeader.setExpanded((mKeyguardShowing && !mHeaderAnimating) |
| 180 | || (mQsExpanded && !mStackScrollerOverscrolling)); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 181 | mFooter.setVisibility((mQsExpanded || !mKeyguardShowing || mHeaderAnimating) |
| 182 | ? View.VISIBLE |
| 183 | : View.INVISIBLE); |
| 184 | mFooter.setExpanded((mKeyguardShowing && !mHeaderAnimating) |
| 185 | || (mQsExpanded && !mStackScrollerOverscrolling)); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 186 | mQSPanel.setVisibility(expandVisually ? View.VISIBLE : View.INVISIBLE); |
| 187 | } |
| 188 | |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 189 | public QSPanel getQsPanel() { |
| 190 | return mQSPanel; |
| 191 | } |
| 192 | |
| 193 | public QSCustomizer getCustomizer() { |
| 194 | return mQSCustomizer; |
| 195 | } |
| 196 | |
| 197 | public boolean isShowingDetail() { |
| 198 | return mQSPanel.isShowingCustomize() || mQSDetail.isShowingDetail(); |
| 199 | } |
| 200 | |
| 201 | public void setHeaderClickable(boolean clickable) { |
| 202 | if (DEBUG) Log.d(TAG, "setHeaderClickable " + clickable); |
Jason Monk | 1fdde2d | 2017-03-08 09:39:21 -0500 | [diff] [blame] | 203 | mFooter.getExpandView().setClickable(clickable); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | public void setExpanded(boolean expanded) { |
| 207 | if (DEBUG) Log.d(TAG, "setExpanded " + expanded); |
| 208 | mQsExpanded = expanded; |
| 209 | mQSPanel.setListening(mListening && mQsExpanded); |
| 210 | updateQsState(); |
| 211 | } |
| 212 | |
| 213 | public void setKeyguardShowing(boolean keyguardShowing) { |
| 214 | if (DEBUG) Log.d(TAG, "setKeyguardShowing " + keyguardShowing); |
| 215 | mKeyguardShowing = keyguardShowing; |
Anthony Chen | 3cb3ad9 | 2016-12-01 10:58:47 -0800 | [diff] [blame] | 216 | |
| 217 | if (mQSAnimator != null) { |
| 218 | mQSAnimator.setOnKeyguard(keyguardShowing); |
| 219 | } |
| 220 | |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 221 | updateQsState(); |
| 222 | } |
| 223 | |
| 224 | public void setOverscrolling(boolean stackScrollerOverscrolling) { |
| 225 | if (DEBUG) Log.d(TAG, "setOverscrolling " + stackScrollerOverscrolling); |
| 226 | mStackScrollerOverscrolling = stackScrollerOverscrolling; |
| 227 | updateQsState(); |
| 228 | } |
| 229 | |
| 230 | public void setListening(boolean listening) { |
| 231 | if (DEBUG) Log.d(TAG, "setListening " + listening); |
| 232 | mListening = listening; |
| 233 | mHeader.setListening(listening); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 234 | mFooter.setListening(listening); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 235 | mQSPanel.setListening(mListening && mQsExpanded); |
| 236 | } |
| 237 | |
| 238 | public void setHeaderListening(boolean listening) { |
| 239 | mHeader.setListening(listening); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 240 | mFooter.setListening(listening); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | public void setQsExpansion(float expansion, float headerTranslation) { |
| 244 | if (DEBUG) Log.d(TAG, "setQSExpansion " + expansion + " " + headerTranslation); |
| 245 | mContainer.setExpansion(expansion); |
| 246 | final float translationScaleY = expansion - 1; |
| 247 | if (!mHeaderAnimating) { |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 248 | int height = mHeader.getHeight() + mGutterHeight; |
| 249 | getView().setTranslationY(mKeyguardShowing ? (translationScaleY * height) |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 250 | : headerTranslation); |
| 251 | } |
| 252 | mHeader.setExpansion(mKeyguardShowing ? 1 : expansion); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 253 | mFooter.setExpansion(mKeyguardShowing ? 1 : expansion); |
| 254 | int heightDiff = mQSPanel.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom(); |
| 255 | mQSPanel.setTranslationY(translationScaleY * heightDiff); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 256 | mQSDetail.setFullyExpanded(expansion == 1); |
Anthony Chen | 3cb3ad9 | 2016-12-01 10:58:47 -0800 | [diff] [blame] | 257 | |
| 258 | if (mQSAnimator != null) { |
| 259 | mQSAnimator.setPosition(expansion); |
| 260 | } |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 261 | |
| 262 | // Set bounds on the QS panel so it doesn't run over the header. |
Jason Monk | ce4be85 | 2017-03-27 17:09:30 -0400 | [diff] [blame] | 263 | mQsBounds.top = (int) (mQSPanel.getHeight() * (1 - expansion)); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 264 | mQsBounds.right = mQSPanel.getWidth(); |
| 265 | mQsBounds.bottom = mQSPanel.getHeight(); |
| 266 | mQSPanel.setClipBounds(mQsBounds); |
| 267 | } |
| 268 | |
| 269 | public void animateHeaderSlidingIn(long delay) { |
| 270 | if (DEBUG) Log.d(TAG, "animateHeaderSlidingIn"); |
| 271 | // If the QS is already expanded we don't need to slide in the header as it's already |
| 272 | // visible. |
| 273 | if (!mQsExpanded) { |
| 274 | mHeaderAnimating = true; |
| 275 | mDelay = delay; |
| 276 | getView().getViewTreeObserver().addOnPreDrawListener(mStartHeaderSlidingIn); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | public void animateHeaderSlidingOut() { |
| 281 | if (DEBUG) Log.d(TAG, "animateHeaderSlidingOut"); |
| 282 | mHeaderAnimating = true; |
| 283 | getView().animate().y(-mHeader.getHeight()) |
| 284 | .setStartDelay(0) |
| 285 | .setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD) |
| 286 | .setInterpolator(Interpolators.FAST_OUT_SLOW_IN) |
| 287 | .setListener(new AnimatorListenerAdapter() { |
| 288 | @Override |
| 289 | public void onAnimationEnd(Animator animation) { |
| 290 | getView().animate().setListener(null); |
| 291 | mHeaderAnimating = false; |
| 292 | updateQsState(); |
| 293 | } |
| 294 | }) |
| 295 | .start(); |
| 296 | } |
| 297 | |
| 298 | @Override |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 299 | public void setExpandClickListener(OnClickListener onClickListener) { |
| 300 | mFooter.getExpandView().setOnClickListener(onClickListener); |
| 301 | } |
| 302 | |
| 303 | @Override |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 304 | public void closeDetail() { |
| 305 | mQSPanel.closeDetail(); |
| 306 | } |
| 307 | |
| 308 | public void notifyCustomizeChanged() { |
| 309 | // The customize state changed, so our height changed. |
| 310 | mContainer.updateBottom(); |
| 311 | mQSPanel.setVisibility(!mQSCustomizer.isCustomizing() ? View.VISIBLE : View.INVISIBLE); |
| 312 | mHeader.setVisibility(!mQSCustomizer.isCustomizing() ? View.VISIBLE : View.INVISIBLE); |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 313 | mFooter.setVisibility(!mQSCustomizer.isCustomizing() ? View.VISIBLE : View.INVISIBLE); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 314 | // Let the panel know the position changed and it needs to update where notifications |
| 315 | // and whatnot are. |
| 316 | mPanelView.onQsHeightChanged(); |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * The height this view wants to be. This is different from {@link #getMeasuredHeight} such that |
| 321 | * during closing the detail panel, this already returns the smaller height. |
| 322 | */ |
| 323 | public int getDesiredHeight() { |
| 324 | if (mQSCustomizer.isCustomizing()) { |
| 325 | return getView().getHeight(); |
| 326 | } |
| 327 | if (mQSDetail.isClosingDetail()) { |
Jason Monk | e5b770e | 2017-03-03 21:49:29 -0500 | [diff] [blame] | 328 | LayoutParams layoutParams = (LayoutParams) mQSPanel.getLayoutParams(); |
| 329 | int panelHeight = layoutParams.topMargin + layoutParams.bottomMargin + |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 330 | + mQSPanel.getMeasuredHeight(); |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 331 | return panelHeight + getView().getPaddingBottom() + mGutterHeight; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 332 | } else { |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 333 | return getView().getMeasuredHeight() + mGutterHeight; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 334 | } |
| 335 | } |
| 336 | |
| 337 | @Override |
| 338 | public void setHeightOverride(int desiredHeight) { |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 339 | mContainer.setHeightOverride(desiredHeight - mGutterHeight); |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 340 | } |
| 341 | |
| 342 | public int getQsMinExpansionHeight() { |
Jason Monk | b4cc7b1 | 2017-05-09 13:50:47 -0400 | [diff] [blame] | 343 | return mHeader.getHeight() + mGutterHeight; |
Jason Monk | 0ceef21 | 2016-11-02 14:05:23 -0400 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | @Override |
| 347 | public void hideImmediately() { |
| 348 | getView().animate().cancel(); |
| 349 | getView().setY(-mHeader.getHeight()); |
| 350 | } |
| 351 | |
| 352 | private final ViewTreeObserver.OnPreDrawListener mStartHeaderSlidingIn |
| 353 | = new ViewTreeObserver.OnPreDrawListener() { |
| 354 | @Override |
| 355 | public boolean onPreDraw() { |
| 356 | getView().getViewTreeObserver().removeOnPreDrawListener(this); |
| 357 | getView().animate() |
| 358 | .translationY(0f) |
| 359 | .setStartDelay(mDelay) |
| 360 | .setDuration(StackStateAnimator.ANIMATION_DURATION_GO_TO_FULL_SHADE) |
| 361 | .setInterpolator(Interpolators.FAST_OUT_SLOW_IN) |
| 362 | .setListener(mAnimateHeaderSlidingInListener) |
| 363 | .start(); |
| 364 | getView().setY(-mHeader.getHeight()); |
| 365 | return true; |
| 366 | } |
| 367 | }; |
| 368 | |
| 369 | private final Animator.AnimatorListener mAnimateHeaderSlidingInListener |
| 370 | = new AnimatorListenerAdapter() { |
| 371 | @Override |
| 372 | public void onAnimationEnd(Animator animation) { |
| 373 | mHeaderAnimating = false; |
| 374 | updateQsState(); |
| 375 | } |
| 376 | }; |
| 377 | } |