blob: 6468f749ac840a6fa15d301463044eb8cab49017 [file] [log] [blame]
Winson Chung3d503fb2011-07-13 17:25:49 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Daniel Sandler325dc232013-06-05 22:57:57 -040017package com.android.launcher3;
Winson Chung3d503fb2011-07-13 17:25:49 -070018
Liran Binyamina833af32023-08-02 16:30:27 -040019import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
20import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_BUBBLE_ADJUSTMENT_ANIM;
21
22import android.animation.AnimatorSet;
23import android.animation.ObjectAnimator;
24import android.animation.ValueAnimator;
Winson Chung3d503fb2011-07-13 17:25:49 -070025import android.content.Context;
Tony Wickhamd6b40372015-09-23 18:37:57 -070026import android.graphics.Rect;
Winson Chung3d503fb2011-07-13 17:25:49 -070027import android.util.AttributeSet;
Sunny Goyal07b69292018-01-08 14:19:34 -080028import android.view.Gravity;
Sunny Goyalc373e1c2021-03-09 17:27:53 -080029import android.view.LayoutInflater;
Sunny Goyald1580972019-04-09 11:52:49 -070030import android.view.MotionEvent;
Tony Wickham39938cb2021-02-26 09:15:31 -080031import android.view.View;
Sunny Goyal4ffec482016-02-09 11:28:52 -080032import android.view.ViewDebug;
Sunny Goyal07b69292018-01-08 14:19:34 -080033import android.view.ViewGroup;
Winson Chung3d503fb2011-07-13 17:25:49 -070034import android.widget.FrameLayout;
35
Liran Binyamin69f49742024-03-04 09:39:53 -050036import androidx.annotation.IntDef;
mpodoliandfb48212024-09-13 17:43:11 -070037import androidx.annotation.Nullable;
Liran Binyamin69f49742024-03-04 09:39:53 -050038
Liran Binyamina833af32023-08-02 16:30:27 -040039import com.android.launcher3.util.HorizontalInsettableView;
mpodoliandfb48212024-09-13 17:43:11 -070040import com.android.launcher3.util.MultiPropertyFactory;
Liran Binyamin69f49742024-03-04 09:39:53 -050041import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
Liran Binyamina833af32023-08-02 16:30:27 -040042import com.android.launcher3.util.MultiTranslateDelegate;
Liran Binyamin69f49742024-03-04 09:39:53 -050043import com.android.launcher3.util.MultiValueAlpha;
Liran Binyamina833af32023-08-02 16:30:27 -040044import com.android.launcher3.views.ActivityContext;
45
Liran Binyamin69f49742024-03-04 09:39:53 -050046import java.io.PrintWriter;
47import java.lang.annotation.Retention;
48import java.lang.annotation.RetentionPolicy;
49
Hyunyoung Song95786e02020-09-15 00:34:10 -070050/**
51 * View class that represents the bottom row of the home screen.
52 */
53public class Hotseat extends CellLayout implements Insettable {
Winson Chung3d503fb2011-07-13 17:25:49 -070054
Liran Binyamin69f49742024-03-04 09:39:53 -050055 public static final int ALPHA_CHANNEL_TASKBAR_ALIGNMENT = 0;
56 public static final int ALPHA_CHANNEL_PREVIEW_RENDERER = 1;
57 public static final int ALPHA_CHANNEL_TASKBAR_STASH = 2;
58 public static final int ALPHA_CHANNEL_CHANNELS_COUNT = 3;
59
60 @Retention(RetentionPolicy.RUNTIME)
61 @IntDef({ALPHA_CHANNEL_TASKBAR_ALIGNMENT, ALPHA_CHANNEL_PREVIEW_RENDERER,
62 ALPHA_CHANNEL_TASKBAR_STASH})
63 public @interface HotseatQsbAlphaId {
64 }
65
mpodoliandfb48212024-09-13 17:43:11 -070066 public static final int ICONS_TRANSLATION_X_NAV_BAR_ALIGNMENT = 0;
67 public static final int ICONS_TRANSLATION_X_CHANNELS_COUNT = 1;
68
69 @Retention(RetentionPolicy.RUNTIME)
70 @IntDef({ICONS_TRANSLATION_X_NAV_BAR_ALIGNMENT})
71 public @interface IconsTranslationX {
72 }
73
Sunny Goyalc373e1c2021-03-09 17:27:53 -080074 // Ratio of empty space, qsb should take up to appear visually centered.
75 public static final float QSB_CENTER_FACTOR = .325f;
Liran Binyamina833af32023-08-02 16:30:27 -040076 private static final int BUBBLE_BAR_ADJUSTMENT_ANIMATION_DURATION_MS = 250;
Sunny Goyalc373e1c2021-03-09 17:27:53 -080077
Sunny Goyal4ffec482016-02-09 11:28:52 -080078 @ViewDebug.ExportedProperty(category = "launcher")
Sunny Goyal12069e62018-01-16 14:17:20 -080079 private boolean mHasVerticalHotseat;
Shikha Malhotraf78da1b2022-04-11 10:23:18 +000080 private Workspace<?> mWorkspace;
Adam Cohenb66675a2020-05-15 16:16:17 -070081 private boolean mSendTouchToWorkspace;
Liran Binyamin69f49742024-03-04 09:39:53 -050082 private final MultiValueAlpha mIconsAlphaChannels;
83 private final MultiValueAlpha mQsbAlphaChannels;
Winson Chung3d503fb2011-07-13 17:25:49 -070084
mpodoliandfb48212024-09-13 17:43:11 -070085 private @Nullable MultiProperty mQsbTranslationX;
86
87 private final MultiPropertyFactory mIconsTranslationXFactory;
88
Sunny Goyalc373e1c2021-03-09 17:27:53 -080089 private final View mQsb;
Tony Wickhamae72b462021-03-10 16:18:40 -080090
Winson Chung3d503fb2011-07-13 17:25:49 -070091 public Hotseat(Context context) {
92 this(context, null);
93 }
94
95 public Hotseat(Context context, AttributeSet attrs) {
96 this(context, attrs, 0);
97 }
98
99 public Hotseat(Context context, AttributeSet attrs, int defStyle) {
100 super(context, attrs, defStyle);
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800101 mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800102 addView(mQsb);
Liran Binyamin69f49742024-03-04 09:39:53 -0500103 mIconsAlphaChannels = new MultiValueAlpha(getShortcutsAndWidgets(),
104 ALPHA_CHANNEL_CHANNELS_COUNT);
mpodoliandfb48212024-09-13 17:43:11 -0700105 if (mQsb instanceof Reorderable qsbReorderable) {
106 mQsbTranslationX = qsbReorderable.getTranslateDelegate()
107 .getTranslationX(MultiTranslateDelegate.INDEX_NAV_BAR_ANIM);
108 }
109 mIconsTranslationXFactory = new MultiPropertyFactory<>(getShortcutsAndWidgets(),
110 VIEW_TRANSLATE_X, ICONS_TRANSLATION_X_CHANNELS_COUNT, Float::sum);
Liran Binyamin69f49742024-03-04 09:39:53 -0500111 mQsbAlphaChannels = new MultiValueAlpha(mQsb, ALPHA_CHANNEL_CHANNELS_COUNT);
Winson Chung3d503fb2011-07-13 17:25:49 -0700112 }
113
mpodoliandfb48212024-09-13 17:43:11 -0700114 /** Provides translation X for hotseat icons for the channel. */
115 public MultiProperty getIconsTranslationX(@IconsTranslationX int channelId) {
116 return mIconsTranslationXFactory.get(channelId);
117 }
118
119 /** Provides translation X for hotseat Qsb. */
120 @Nullable
121 public MultiProperty getQsbTranslationX() {
122 return mQsbTranslationX;
123 }
124
Samuel Fufaaed008d2019-12-19 10:57:40 -0800125 /**
126 * Returns orientation specific cell X given invariant order in the hotseat
127 */
128 public int getCellXFromOrder(int rank) {
Sunny Goyal4f3e9382015-06-05 00:13:25 -0700129 return mHasVerticalHotseat ? 0 : rank;
Winson Chung3d503fb2011-07-13 17:25:49 -0700130 }
Hyunyoung Song31178b82015-02-24 14:12:51 -0800131
Samuel Fufaaed008d2019-12-19 10:57:40 -0800132 /**
133 * Returns orientation specific cell Y given invariant order in the hotseat
134 */
135 public int getCellYFromOrder(int rank) {
Sunny Goyal876e4622018-11-02 13:50:40 -0700136 return mHasVerticalHotseat ? (getCountY() - (rank + 1)) : 0;
Winson Chung3d503fb2011-07-13 17:25:49 -0700137 }
138
Sihua Maa44f4ac2024-06-03 18:35:39 +0000139 boolean isHasVerticalHotseat() {
140 return mHasVerticalHotseat;
141 }
142
Sunny Goyalab770a12018-11-14 15:17:26 -0800143 public void resetLayout(boolean hasVerticalHotseat) {
Liran Binyamina833af32023-08-02 16:30:27 -0400144 ActivityContext activityContext = ActivityContext.lookupContext(getContext());
145 boolean bubbleBarEnabled = activityContext.isBubbleBarEnabled();
146 boolean hasBubbles = activityContext.hasBubbles();
Sunny Goyal876e4622018-11-02 13:50:40 -0700147 removeAllViewsInLayout();
Sunny Goyal11e96492018-03-23 17:06:00 -0700148 mHasVerticalHotseat = hasVerticalHotseat;
Sunny Goyal19ff7282021-04-22 10:12:54 -0700149 DeviceProfile dp = mActivity.getDeviceProfile();
Liran Binyamina833af32023-08-02 16:30:27 -0400150
151 if (bubbleBarEnabled) {
mpodolian51e2bb32024-10-08 14:15:49 -0700152 if (dp.shouldAdjustHotseatForBubbleBar(getContext(), hasBubbles)) {
153 getShortcutsAndWidgets().setTranslationProvider(
154 cellX -> dp.getHotseatAdjustedTranslation(getContext(), cellX));
Liran Binyamina833af32023-08-02 16:30:27 -0400155 if (mQsb instanceof HorizontalInsettableView) {
156 HorizontalInsettableView insettableQsb = (HorizontalInsettableView) mQsb;
157 final float insetFraction = (float) dp.iconSizePx / dp.hotseatQsbWidth;
158 // post this to the looper so that QSB has a chance to redraw itself, e.g.
159 // after device rotation
160 mQsb.post(() -> insettableQsb.setHorizontalInsets(insetFraction));
161 }
162 } else {
163 getShortcutsAndWidgets().setTranslationProvider(null);
164 if (mQsb instanceof HorizontalInsettableView) {
165 ((HorizontalInsettableView) mQsb).setHorizontalInsets(0);
166 }
167 }
168 }
169
Thales Lima8cd020b2022-03-15 20:15:14 +0000170 resetCellSize(dp);
Sunny Goyal11e96492018-03-23 17:06:00 -0700171 if (hasVerticalHotseat) {
Sunny Goyal19ff7282021-04-22 10:12:54 -0700172 setGridSize(1, dp.numShownHotseatIcons);
Sunny Goyal11e96492018-03-23 17:06:00 -0700173 } else {
Sunny Goyal19ff7282021-04-22 10:12:54 -0700174 setGridSize(dp.numShownHotseatIcons, 1);
Sunny Goyal11e96492018-03-23 17:06:00 -0700175 }
Winson Chung3d503fb2011-07-13 17:25:49 -0700176 }
Adam Cohene25af792013-06-06 23:08:25 -0700177
Liran Binyamina833af32023-08-02 16:30:27 -0400178 /**
179 * Adjust the hotseat icons for the bubble bar.
180 *
181 * <p>When the bubble bar becomes visible, if needed, this method animates the hotseat icons
182 * to reduce the spacing between them and make room for the bubble bar. The QSB width is
183 * animated as well to align with the hotseat icons.
184 *
185 * <p>When the bubble bar goes away, any adjustments that were previously made are reversed.
186 */
187 public void adjustForBubbleBar(boolean isBubbleBarVisible) {
188 DeviceProfile dp = mActivity.getDeviceProfile();
mpodolian5bf8bff2024-11-06 16:11:35 -0800189 float adjustedBorderSpace = dp.getHotseatAdjustedBorderSpaceForBubbleBar(getContext());
190 boolean adjustmentRequired = Float.compare(adjustedBorderSpace, 0f) != 0;
Liran Binyamina833af32023-08-02 16:30:27 -0400191
192 ShortcutAndWidgetContainer icons = getShortcutsAndWidgets();
Liran Binyamina833af32023-08-02 16:30:27 -0400193 // update the translation provider for future layout passes of hotseat icons.
mpodolian5bf8bff2024-11-06 16:11:35 -0800194 if (adjustmentRequired && isBubbleBarVisible) {
mpodolian51e2bb32024-10-08 14:15:49 -0700195 icons.setTranslationProvider(
196 cellX -> dp.getHotseatAdjustedTranslation(getContext(), cellX));
Liran Binyamina833af32023-08-02 16:30:27 -0400197 } else {
198 icons.setTranslationProvider(null);
199 }
mpodolian5bf8bff2024-11-06 16:11:35 -0800200 if (!adjustmentRequired) return;
Liran Binyamina833af32023-08-02 16:30:27 -0400201
mpodolian5bf8bff2024-11-06 16:11:35 -0800202 AnimatorSet animatorSet = new AnimatorSet();
Liran Binyamina833af32023-08-02 16:30:27 -0400203 for (int i = 0; i < icons.getChildCount(); i++) {
204 View child = icons.getChildAt(i);
mpodolian51e2bb32024-10-08 14:15:49 -0700205 float tx = isBubbleBarVisible ? dp.getHotseatAdjustedTranslation(getContext(), i) : 0;
Liran Binyamina833af32023-08-02 16:30:27 -0400206 if (child instanceof Reorderable) {
207 MultiTranslateDelegate mtd = ((Reorderable) child).getTranslateDelegate();
208 animatorSet.play(
209 mtd.getTranslationX(INDEX_BUBBLE_ADJUSTMENT_ANIM).animateToValue(tx));
210 } else {
211 animatorSet.play(ObjectAnimator.ofFloat(child, VIEW_TRANSLATE_X, tx));
212 }
213 }
Liran Binyamin2a47a4a2024-07-24 12:25:09 -0400214 if (mQsb instanceof HorizontalInsettableView horizontalInsettableQsb) {
215 final float currentInsetFraction = horizontalInsettableQsb.getHorizontalInsets();
216 final float targetInsetFraction =
217 isBubbleBarVisible ? (float) dp.iconSizePx / dp.hotseatQsbWidth : 0;
218 ValueAnimator qsbAnimator =
219 ValueAnimator.ofFloat(currentInsetFraction, targetInsetFraction);
Liran Binyamina833af32023-08-02 16:30:27 -0400220 qsbAnimator.addUpdateListener(animation -> {
Liran Binyamin2a47a4a2024-07-24 12:25:09 -0400221 float insetFraction = (float) animation.getAnimatedValue();
Liran Binyamina833af32023-08-02 16:30:27 -0400222 horizontalInsettableQsb.setHorizontalInsets(insetFraction);
223 });
224 animatorSet.play(qsbAnimator);
225 }
226 animatorSet.setDuration(BUBBLE_BAR_ADJUSTMENT_ANIMATION_DURATION_MS).start();
227 }
228
Adam Cohena5f4e482013-10-11 12:10:28 -0700229 @Override
Sunny Goyal07b69292018-01-08 14:19:34 -0800230 public void setInsets(Rect insets) {
231 FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
Sunny Goyalc4d32012020-04-03 17:10:11 -0700232 DeviceProfile grid = mActivity.getDeviceProfile();
Sunny Goyal12069e62018-01-16 14:17:20 -0800233
Sunny Goyal11e96492018-03-23 17:06:00 -0700234 if (grid.isVerticalBarLayout()) {
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800235 mQsb.setVisibility(View.GONE);
Sunny Goyal07b69292018-01-08 14:19:34 -0800236 lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
Sunny Goyal7e2e67f2018-01-26 13:40:08 -0800237 if (grid.isSeascape()) {
Sunny Goyal07b69292018-01-08 14:19:34 -0800238 lp.gravity = Gravity.LEFT;
Tony Wickham1eeffbe2018-06-12 15:01:15 -0700239 lp.width = grid.hotseatBarSizePx + insets.left;
Sunny Goyal07b69292018-01-08 14:19:34 -0800240 } else {
241 lp.gravity = Gravity.RIGHT;
Tony Wickham1eeffbe2018-06-12 15:01:15 -0700242 lp.width = grid.hotseatBarSizePx + insets.right;
Sunny Goyal07b69292018-01-08 14:19:34 -0800243 }
244 } else {
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800245 mQsb.setVisibility(View.VISIBLE);
Sunny Goyal07b69292018-01-08 14:19:34 -0800246 lp.gravity = Gravity.BOTTOM;
247 lp.width = ViewGroup.LayoutParams.MATCH_PARENT;
Thales Limab8c05952022-05-23 16:58:38 +0100248 lp.height = grid.hotseatBarSizePx;
Sunny Goyal07b69292018-01-08 14:19:34 -0800249 }
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800250
Sunny Goyal57b22792021-05-25 14:35:01 -0700251 Rect padding = grid.getHotseatLayoutPadding(getContext());
252 setPadding(padding.left, padding.top, padding.right, padding.bottom);
Sunny Goyal07b69292018-01-08 14:19:34 -0800253 setLayoutParams(lp);
254 InsettableFrameLayout.dispatchInsets(this, insets);
255 }
Sunny Goyald1580972019-04-09 11:52:49 -0700256
Shikha Malhotraf78da1b2022-04-11 10:23:18 +0000257 public void setWorkspace(Workspace<?> w) {
Adam Cohenb66675a2020-05-15 16:16:17 -0700258 mWorkspace = w;
Sebastian Franco2986e0b2024-01-25 10:23:39 -0800259 setCellLayoutContainer(w);
Adam Cohenb66675a2020-05-15 16:16:17 -0700260 }
261
262 @Override
263 public boolean onInterceptTouchEvent(MotionEvent ev) {
264 // We allow horizontal workspace scrolling from within the Hotseat. We do this by delegating
265 // touch intercept the Workspace, and if it intercepts, delegating touch to the Workspace
266 // for the remainder of the this input stream.
267 int yThreshold = getMeasuredHeight() - getPaddingBottom();
268 if (mWorkspace != null && ev.getY() <= yThreshold) {
269 mSendTouchToWorkspace = mWorkspace.onInterceptTouchEvent(ev);
270 return mSendTouchToWorkspace;
271 }
272 return false;
273 }
274
Sunny Goyald1580972019-04-09 11:52:49 -0700275 @Override
276 public boolean onTouchEvent(MotionEvent event) {
Adam Cohenb66675a2020-05-15 16:16:17 -0700277 // See comment in #onInterceptTouchEvent
278 if (mSendTouchToWorkspace) {
279 final int action = event.getAction();
280 switch (action & MotionEvent.ACTION_MASK) {
281 case MotionEvent.ACTION_UP:
282 case MotionEvent.ACTION_CANCEL:
283 mSendTouchToWorkspace = false;
284 }
285 return mWorkspace.onTouchEvent(event);
286 }
Alex Chau21698c52021-09-24 14:36:15 +0100287 // Always let touch follow through to Workspace.
288 return false;
Sunny Goyald1580972019-04-09 11:52:49 -0700289 }
Schneider Victor-tulias3cf264f2020-09-22 12:58:38 -0700290
291 @Override
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800292 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
293 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
294
Alex Chau206ede92022-08-01 17:46:12 +0100295 DeviceProfile dp = mActivity.getDeviceProfile();
296 mQsb.measure(MeasureSpec.makeMeasureSpec(dp.hotseatQsbWidth, MeasureSpec.EXACTLY),
297 MeasureSpec.makeMeasureSpec(dp.hotseatQsbHeight, MeasureSpec.EXACTLY));
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800298 }
299
300 @Override
301 protected void onLayout(boolean changed, int l, int t, int r, int b) {
302 super.onLayout(changed, l, t, r, b);
303
Alex Chau206ede92022-08-01 17:46:12 +0100304 int qsbMeasuredWidth = mQsb.getMeasuredWidth();
Thales Limaa1012902022-01-13 17:58:42 +0000305 int left;
Alex Chau206ede92022-08-01 17:46:12 +0100306 DeviceProfile dp = mActivity.getDeviceProfile();
307 if (dp.isQsbInline) {
308 int qsbSpace = dp.hotseatBorderSpace;
Thales Lima612230d2022-03-31 18:04:37 +0100309 left = Utilities.isRtl(getResources()) ? r - getPaddingRight() + qsbSpace
Alex Chau206ede92022-08-01 17:46:12 +0100310 : l + getPaddingLeft() - qsbMeasuredWidth - qsbSpace;
Thales Limaa1012902022-01-13 17:58:42 +0000311 } else {
Alex Chau206ede92022-08-01 17:46:12 +0100312 left = (r - l - qsbMeasuredWidth) / 2;
Thales Limaa1012902022-01-13 17:58:42 +0000313 }
Alex Chau206ede92022-08-01 17:46:12 +0100314 int right = left + qsbMeasuredWidth;
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800315
Alex Chau206ede92022-08-01 17:46:12 +0100316 int bottom = b - t - dp.getQsbOffsetY();
317 int top = bottom - dp.hotseatQsbHeight;
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800318 mQsb.layout(left, top, right, bottom);
319 }
320
Tony Wickham39938cb2021-02-26 09:15:31 -0800321 /**
Liran Binyamin69f49742024-03-04 09:39:53 -0500322 * Sets the alpha value of the specified alpha channel of just our ShortcutAndWidgetContainer.
Tony Wickham9ce3b252021-03-22 14:43:58 -0700323 */
Liran Binyamin69f49742024-03-04 09:39:53 -0500324 public void setIconsAlpha(float alpha, @HotseatQsbAlphaId int channelId) {
325 getIconsAlpha(channelId).setValue(alpha);
Tony Wickhamae72b462021-03-10 16:18:40 -0800326 }
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800327
Alex Chauc1d26442022-06-09 15:09:26 +0100328 /**
329 * Sets the alpha value of just our QSB.
330 */
Liran Binyamin69f49742024-03-04 09:39:53 -0500331 public void setQsbAlpha(float alpha, @HotseatQsbAlphaId int channelId) {
332 getQsbAlpha(channelId).setValue(alpha);
Alex Chauc1d26442022-06-09 15:09:26 +0100333 }
334
Liran Binyamin69f49742024-03-04 09:39:53 -0500335 /** Returns the alpha channel for ShortcutAndWidgetContainer */
336 public MultiProperty getIconsAlpha(@HotseatQsbAlphaId int channelId) {
337 return mIconsAlphaChannels.get(channelId);
338 }
339
340 /** Returns the alpha channel for Qsb */
341 public MultiProperty getQsbAlpha(@HotseatQsbAlphaId int channelId) {
342 return mQsbAlphaChannels.get(channelId);
Tracy Zhouae881972021-09-30 10:14:34 -0700343 }
344
Sunny Goyalc373e1c2021-03-09 17:27:53 -0800345 /**
346 * Returns the QSB inside hotseat
347 */
348 public View getQsb() {
349 return mQsb;
350 }
Tony Wickham9ce3b252021-03-22 14:43:58 -0700351
Liran Binyamin69f49742024-03-04 09:39:53 -0500352 /** Dumps the Hotseat internal state */
353 public void dump(String prefix, PrintWriter writer) {
354 writer.println(prefix + "Hotseat:");
355 mIconsAlphaChannels.dump(
356 prefix + "\t",
357 writer,
358 "mIconsAlphaChannels",
359 "ALPHA_CHANNEL_TASKBAR_ALIGNMENT",
360 "ALPHA_CHANNEL_PREVIEW_RENDERER",
361 "ALPHA_CHANNEL_TASKBAR_STASH");
362 mQsbAlphaChannels.dump(
363 prefix + "\t",
364 writer,
365 "mQsbAlphaChannels",
366 "ALPHA_CHANNEL_TASKBAR_ALIGNMENT",
367 "ALPHA_CHANNEL_PREVIEW_RENDERER",
368 "ALPHA_CHANNEL_TASKBAR_STASH"
369 );
370 }
371
Winson Chung3d503fb2011-07-13 17:25:49 -0700372}