Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 1 | /* |
| 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 Sandler | 325dc23 | 2013-06-05 22:57:57 -0400 | [diff] [blame] | 17 | package com.android.launcher3; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 18 | |
Liran Binyamin | a833af3 | 2023-08-02 16:30:27 -0400 | [diff] [blame^] | 19 | import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; |
| 20 | import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_BUBBLE_ADJUSTMENT_ANIM; |
| 21 | |
| 22 | import android.animation.AnimatorSet; |
| 23 | import android.animation.ObjectAnimator; |
| 24 | import android.animation.ValueAnimator; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 25 | import android.content.Context; |
Tony Wickham | d6b4037 | 2015-09-23 18:37:57 -0700 | [diff] [blame] | 26 | import android.graphics.Rect; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 27 | import android.util.AttributeSet; |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 28 | import android.view.Gravity; |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 29 | import android.view.LayoutInflater; |
Sunny Goyal | d158097 | 2019-04-09 11:52:49 -0700 | [diff] [blame] | 30 | import android.view.MotionEvent; |
Tony Wickham | 39938cb | 2021-02-26 09:15:31 -0800 | [diff] [blame] | 31 | import android.view.View; |
Sunny Goyal | 4ffec48 | 2016-02-09 11:28:52 -0800 | [diff] [blame] | 32 | import android.view.ViewDebug; |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 33 | import android.view.ViewGroup; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 34 | import android.widget.FrameLayout; |
| 35 | |
Liran Binyamin | a833af3 | 2023-08-02 16:30:27 -0400 | [diff] [blame^] | 36 | import com.android.launcher3.util.HorizontalInsettableView; |
| 37 | import com.android.launcher3.util.MultiTranslateDelegate; |
| 38 | import com.android.launcher3.views.ActivityContext; |
| 39 | |
Hyunyoung Song | 95786e0 | 2020-09-15 00:34:10 -0700 | [diff] [blame] | 40 | /** |
| 41 | * View class that represents the bottom row of the home screen. |
| 42 | */ |
| 43 | public class Hotseat extends CellLayout implements Insettable { |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 44 | |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 45 | // Ratio of empty space, qsb should take up to appear visually centered. |
| 46 | public static final float QSB_CENTER_FACTOR = .325f; |
Liran Binyamin | a833af3 | 2023-08-02 16:30:27 -0400 | [diff] [blame^] | 47 | private static final int BUBBLE_BAR_ADJUSTMENT_ANIMATION_DURATION_MS = 250; |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 48 | |
Sunny Goyal | 4ffec48 | 2016-02-09 11:28:52 -0800 | [diff] [blame] | 49 | @ViewDebug.ExportedProperty(category = "launcher") |
Sunny Goyal | 12069e6 | 2018-01-16 14:17:20 -0800 | [diff] [blame] | 50 | private boolean mHasVerticalHotseat; |
Shikha Malhotra | f78da1b | 2022-04-11 10:23:18 +0000 | [diff] [blame] | 51 | private Workspace<?> mWorkspace; |
Adam Cohen | b66675a | 2020-05-15 16:16:17 -0700 | [diff] [blame] | 52 | private boolean mSendTouchToWorkspace; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 53 | |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 54 | private final View mQsb; |
Tony Wickham | ae72b46 | 2021-03-10 16:18:40 -0800 | [diff] [blame] | 55 | |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 56 | public Hotseat(Context context) { |
| 57 | this(context, null); |
| 58 | } |
| 59 | |
| 60 | public Hotseat(Context context, AttributeSet attrs) { |
| 61 | this(context, attrs, 0); |
| 62 | } |
| 63 | |
| 64 | public Hotseat(Context context, AttributeSet attrs, int defStyle) { |
| 65 | super(context, attrs, defStyle); |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 66 | |
| 67 | mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false); |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 68 | addView(mQsb); |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Samuel Fufa | aed008d | 2019-12-19 10:57:40 -0800 | [diff] [blame] | 71 | /** |
| 72 | * Returns orientation specific cell X given invariant order in the hotseat |
| 73 | */ |
| 74 | public int getCellXFromOrder(int rank) { |
Sunny Goyal | 4f3e938 | 2015-06-05 00:13:25 -0700 | [diff] [blame] | 75 | return mHasVerticalHotseat ? 0 : rank; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 76 | } |
Hyunyoung Song | 31178b8 | 2015-02-24 14:12:51 -0800 | [diff] [blame] | 77 | |
Samuel Fufa | aed008d | 2019-12-19 10:57:40 -0800 | [diff] [blame] | 78 | /** |
| 79 | * Returns orientation specific cell Y given invariant order in the hotseat |
| 80 | */ |
| 81 | public int getCellYFromOrder(int rank) { |
Sunny Goyal | 876e462 | 2018-11-02 13:50:40 -0700 | [diff] [blame] | 82 | return mHasVerticalHotseat ? (getCountY() - (rank + 1)) : 0; |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Sunny Goyal | ab770a1 | 2018-11-14 15:17:26 -0800 | [diff] [blame] | 85 | public void resetLayout(boolean hasVerticalHotseat) { |
Liran Binyamin | a833af3 | 2023-08-02 16:30:27 -0400 | [diff] [blame^] | 86 | ActivityContext activityContext = ActivityContext.lookupContext(getContext()); |
| 87 | boolean bubbleBarEnabled = activityContext.isBubbleBarEnabled(); |
| 88 | boolean hasBubbles = activityContext.hasBubbles(); |
Sunny Goyal | 876e462 | 2018-11-02 13:50:40 -0700 | [diff] [blame] | 89 | removeAllViewsInLayout(); |
Sunny Goyal | 11e9649 | 2018-03-23 17:06:00 -0700 | [diff] [blame] | 90 | mHasVerticalHotseat = hasVerticalHotseat; |
Sunny Goyal | 19ff728 | 2021-04-22 10:12:54 -0700 | [diff] [blame] | 91 | DeviceProfile dp = mActivity.getDeviceProfile(); |
Liran Binyamin | a833af3 | 2023-08-02 16:30:27 -0400 | [diff] [blame^] | 92 | |
| 93 | if (bubbleBarEnabled) { |
| 94 | float adjustedBorderSpace = dp.getHotseatAdjustedBorderSpaceForBubbleBar(getContext()); |
| 95 | if (hasBubbles && Float.compare(adjustedBorderSpace, 0f) != 0) { |
| 96 | getShortcutsAndWidgets().setTranslationProvider(child -> { |
| 97 | int index = getShortcutsAndWidgets().indexOfChild(child); |
| 98 | float borderSpaceDelta = adjustedBorderSpace - dp.hotseatBorderSpace; |
| 99 | return dp.iconSizePx + index * borderSpaceDelta; |
| 100 | }); |
| 101 | if (mQsb instanceof HorizontalInsettableView) { |
| 102 | HorizontalInsettableView insettableQsb = (HorizontalInsettableView) mQsb; |
| 103 | final float insetFraction = (float) dp.iconSizePx / dp.hotseatQsbWidth; |
| 104 | // post this to the looper so that QSB has a chance to redraw itself, e.g. |
| 105 | // after device rotation |
| 106 | mQsb.post(() -> insettableQsb.setHorizontalInsets(insetFraction)); |
| 107 | } |
| 108 | } else { |
| 109 | getShortcutsAndWidgets().setTranslationProvider(null); |
| 110 | if (mQsb instanceof HorizontalInsettableView) { |
| 111 | ((HorizontalInsettableView) mQsb).setHorizontalInsets(0); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
Thales Lima | 8cd020b | 2022-03-15 20:15:14 +0000 | [diff] [blame] | 116 | resetCellSize(dp); |
Sunny Goyal | 11e9649 | 2018-03-23 17:06:00 -0700 | [diff] [blame] | 117 | if (hasVerticalHotseat) { |
Sunny Goyal | 19ff728 | 2021-04-22 10:12:54 -0700 | [diff] [blame] | 118 | setGridSize(1, dp.numShownHotseatIcons); |
Sunny Goyal | 11e9649 | 2018-03-23 17:06:00 -0700 | [diff] [blame] | 119 | } else { |
Sunny Goyal | 19ff728 | 2021-04-22 10:12:54 -0700 | [diff] [blame] | 120 | setGridSize(dp.numShownHotseatIcons, 1); |
Sunny Goyal | 11e9649 | 2018-03-23 17:06:00 -0700 | [diff] [blame] | 121 | } |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 122 | } |
Adam Cohen | e25af79 | 2013-06-06 23:08:25 -0700 | [diff] [blame] | 123 | |
Liran Binyamin | a833af3 | 2023-08-02 16:30:27 -0400 | [diff] [blame^] | 124 | /** |
| 125 | * Adjust the hotseat icons for the bubble bar. |
| 126 | * |
| 127 | * <p>When the bubble bar becomes visible, if needed, this method animates the hotseat icons |
| 128 | * to reduce the spacing between them and make room for the bubble bar. The QSB width is |
| 129 | * animated as well to align with the hotseat icons. |
| 130 | * |
| 131 | * <p>When the bubble bar goes away, any adjustments that were previously made are reversed. |
| 132 | */ |
| 133 | public void adjustForBubbleBar(boolean isBubbleBarVisible) { |
| 134 | DeviceProfile dp = mActivity.getDeviceProfile(); |
| 135 | float adjustedBorderSpace = dp.getHotseatAdjustedBorderSpaceForBubbleBar(getContext()); |
| 136 | if (Float.compare(adjustedBorderSpace, 0f) == 0) { |
| 137 | return; |
| 138 | } |
| 139 | |
| 140 | ShortcutAndWidgetContainer icons = getShortcutsAndWidgets(); |
| 141 | AnimatorSet animatorSet = new AnimatorSet(); |
| 142 | float borderSpaceDelta = adjustedBorderSpace - dp.hotseatBorderSpace; |
| 143 | |
| 144 | // update the translation provider for future layout passes of hotseat icons. |
| 145 | if (isBubbleBarVisible) { |
| 146 | icons.setTranslationProvider(child -> { |
| 147 | int index = icons.indexOfChild(child); |
| 148 | return dp.iconSizePx + index * borderSpaceDelta; |
| 149 | }); |
| 150 | } else { |
| 151 | icons.setTranslationProvider(null); |
| 152 | } |
| 153 | |
| 154 | for (int i = 0; i < icons.getChildCount(); i++) { |
| 155 | View child = icons.getChildAt(i); |
| 156 | float tx = isBubbleBarVisible ? dp.iconSizePx + i * borderSpaceDelta : 0; |
| 157 | if (child instanceof Reorderable) { |
| 158 | MultiTranslateDelegate mtd = ((Reorderable) child).getTranslateDelegate(); |
| 159 | animatorSet.play( |
| 160 | mtd.getTranslationX(INDEX_BUBBLE_ADJUSTMENT_ANIM).animateToValue(tx)); |
| 161 | } else { |
| 162 | animatorSet.play(ObjectAnimator.ofFloat(child, VIEW_TRANSLATE_X, tx)); |
| 163 | } |
| 164 | } |
| 165 | if (mQsb instanceof HorizontalInsettableView) { |
| 166 | HorizontalInsettableView horizontalInsettableQsb = (HorizontalInsettableView) mQsb; |
| 167 | ValueAnimator qsbAnimator = ValueAnimator.ofFloat(0f, 1f); |
| 168 | qsbAnimator.addUpdateListener(animation -> { |
| 169 | float fraction = qsbAnimator.getAnimatedFraction(); |
| 170 | float insetFraction = isBubbleBarVisible |
| 171 | ? (float) dp.iconSizePx * fraction / dp.hotseatQsbWidth |
| 172 | : (float) dp.iconSizePx * (1 - fraction) / dp.hotseatQsbWidth; |
| 173 | horizontalInsettableQsb.setHorizontalInsets(insetFraction); |
| 174 | }); |
| 175 | animatorSet.play(qsbAnimator); |
| 176 | } |
| 177 | animatorSet.setDuration(BUBBLE_BAR_ADJUSTMENT_ANIMATION_DURATION_MS).start(); |
| 178 | } |
| 179 | |
Adam Cohen | a5f4e48 | 2013-10-11 12:10:28 -0700 | [diff] [blame] | 180 | @Override |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 181 | public void setInsets(Rect insets) { |
| 182 | FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams(); |
Sunny Goyal | c4d3201 | 2020-04-03 17:10:11 -0700 | [diff] [blame] | 183 | DeviceProfile grid = mActivity.getDeviceProfile(); |
Sunny Goyal | 12069e6 | 2018-01-16 14:17:20 -0800 | [diff] [blame] | 184 | |
Sunny Goyal | 11e9649 | 2018-03-23 17:06:00 -0700 | [diff] [blame] | 185 | if (grid.isVerticalBarLayout()) { |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 186 | mQsb.setVisibility(View.GONE); |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 187 | lp.height = ViewGroup.LayoutParams.MATCH_PARENT; |
Sunny Goyal | 7e2e67f | 2018-01-26 13:40:08 -0800 | [diff] [blame] | 188 | if (grid.isSeascape()) { |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 189 | lp.gravity = Gravity.LEFT; |
Tony Wickham | 1eeffbe | 2018-06-12 15:01:15 -0700 | [diff] [blame] | 190 | lp.width = grid.hotseatBarSizePx + insets.left; |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 191 | } else { |
| 192 | lp.gravity = Gravity.RIGHT; |
Tony Wickham | 1eeffbe | 2018-06-12 15:01:15 -0700 | [diff] [blame] | 193 | lp.width = grid.hotseatBarSizePx + insets.right; |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 194 | } |
| 195 | } else { |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 196 | mQsb.setVisibility(View.VISIBLE); |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 197 | lp.gravity = Gravity.BOTTOM; |
| 198 | lp.width = ViewGroup.LayoutParams.MATCH_PARENT; |
Thales Lima | b8c0595 | 2022-05-23 16:58:38 +0100 | [diff] [blame] | 199 | lp.height = grid.hotseatBarSizePx; |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 200 | } |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 201 | |
Sunny Goyal | 57b2279 | 2021-05-25 14:35:01 -0700 | [diff] [blame] | 202 | Rect padding = grid.getHotseatLayoutPadding(getContext()); |
| 203 | setPadding(padding.left, padding.top, padding.right, padding.bottom); |
Sunny Goyal | 07b6929 | 2018-01-08 14:19:34 -0800 | [diff] [blame] | 204 | setLayoutParams(lp); |
| 205 | InsettableFrameLayout.dispatchInsets(this, insets); |
| 206 | } |
Sunny Goyal | d158097 | 2019-04-09 11:52:49 -0700 | [diff] [blame] | 207 | |
Shikha Malhotra | f78da1b | 2022-04-11 10:23:18 +0000 | [diff] [blame] | 208 | public void setWorkspace(Workspace<?> w) { |
Adam Cohen | b66675a | 2020-05-15 16:16:17 -0700 | [diff] [blame] | 209 | mWorkspace = w; |
| 210 | } |
| 211 | |
| 212 | @Override |
| 213 | public boolean onInterceptTouchEvent(MotionEvent ev) { |
| 214 | // We allow horizontal workspace scrolling from within the Hotseat. We do this by delegating |
| 215 | // touch intercept the Workspace, and if it intercepts, delegating touch to the Workspace |
| 216 | // for the remainder of the this input stream. |
| 217 | int yThreshold = getMeasuredHeight() - getPaddingBottom(); |
| 218 | if (mWorkspace != null && ev.getY() <= yThreshold) { |
| 219 | mSendTouchToWorkspace = mWorkspace.onInterceptTouchEvent(ev); |
| 220 | return mSendTouchToWorkspace; |
| 221 | } |
| 222 | return false; |
| 223 | } |
| 224 | |
Sunny Goyal | d158097 | 2019-04-09 11:52:49 -0700 | [diff] [blame] | 225 | @Override |
| 226 | public boolean onTouchEvent(MotionEvent event) { |
Adam Cohen | b66675a | 2020-05-15 16:16:17 -0700 | [diff] [blame] | 227 | // See comment in #onInterceptTouchEvent |
| 228 | if (mSendTouchToWorkspace) { |
| 229 | final int action = event.getAction(); |
| 230 | switch (action & MotionEvent.ACTION_MASK) { |
| 231 | case MotionEvent.ACTION_UP: |
| 232 | case MotionEvent.ACTION_CANCEL: |
| 233 | mSendTouchToWorkspace = false; |
| 234 | } |
| 235 | return mWorkspace.onTouchEvent(event); |
| 236 | } |
Alex Chau | 21698c5 | 2021-09-24 14:36:15 +0100 | [diff] [blame] | 237 | // Always let touch follow through to Workspace. |
| 238 | return false; |
Sunny Goyal | d158097 | 2019-04-09 11:52:49 -0700 | [diff] [blame] | 239 | } |
Schneider Victor-tulias | 3cf264f | 2020-09-22 12:58:38 -0700 | [diff] [blame] | 240 | |
| 241 | @Override |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 242 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { |
| 243 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); |
| 244 | |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 245 | DeviceProfile dp = mActivity.getDeviceProfile(); |
| 246 | mQsb.measure(MeasureSpec.makeMeasureSpec(dp.hotseatQsbWidth, MeasureSpec.EXACTLY), |
| 247 | MeasureSpec.makeMeasureSpec(dp.hotseatQsbHeight, MeasureSpec.EXACTLY)); |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | @Override |
| 251 | protected void onLayout(boolean changed, int l, int t, int r, int b) { |
| 252 | super.onLayout(changed, l, t, r, b); |
| 253 | |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 254 | int qsbMeasuredWidth = mQsb.getMeasuredWidth(); |
Thales Lima | a101290 | 2022-01-13 17:58:42 +0000 | [diff] [blame] | 255 | int left; |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 256 | DeviceProfile dp = mActivity.getDeviceProfile(); |
| 257 | if (dp.isQsbInline) { |
| 258 | int qsbSpace = dp.hotseatBorderSpace; |
Thales Lima | 612230d | 2022-03-31 18:04:37 +0100 | [diff] [blame] | 259 | left = Utilities.isRtl(getResources()) ? r - getPaddingRight() + qsbSpace |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 260 | : l + getPaddingLeft() - qsbMeasuredWidth - qsbSpace; |
Thales Lima | a101290 | 2022-01-13 17:58:42 +0000 | [diff] [blame] | 261 | } else { |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 262 | left = (r - l - qsbMeasuredWidth) / 2; |
Thales Lima | a101290 | 2022-01-13 17:58:42 +0000 | [diff] [blame] | 263 | } |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 264 | int right = left + qsbMeasuredWidth; |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 265 | |
Alex Chau | 206ede9 | 2022-08-01 17:46:12 +0100 | [diff] [blame] | 266 | int bottom = b - t - dp.getQsbOffsetY(); |
| 267 | int top = bottom - dp.hotseatQsbHeight; |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 268 | mQsb.layout(left, top, right, bottom); |
| 269 | } |
| 270 | |
Tony Wickham | 39938cb | 2021-02-26 09:15:31 -0800 | [diff] [blame] | 271 | /** |
Tony Wickham | 9ce3b25 | 2021-03-22 14:43:58 -0700 | [diff] [blame] | 272 | * Sets the alpha value of just our ShortcutAndWidgetContainer. |
| 273 | */ |
| 274 | public void setIconsAlpha(float alpha) { |
| 275 | getShortcutsAndWidgets().setAlpha(alpha); |
Tony Wickham | ae72b46 | 2021-03-10 16:18:40 -0800 | [diff] [blame] | 276 | } |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 277 | |
Alex Chau | c1d2644 | 2022-06-09 15:09:26 +0100 | [diff] [blame] | 278 | /** |
| 279 | * Sets the alpha value of just our QSB. |
| 280 | */ |
| 281 | public void setQsbAlpha(float alpha) { |
| 282 | mQsb.setAlpha(alpha); |
| 283 | } |
| 284 | |
Tracy Zhou | ae88197 | 2021-09-30 10:14:34 -0700 | [diff] [blame] | 285 | public float getIconsAlpha() { |
| 286 | return getShortcutsAndWidgets().getAlpha(); |
| 287 | } |
| 288 | |
Sunny Goyal | c373e1c | 2021-03-09 17:27:53 -0800 | [diff] [blame] | 289 | /** |
| 290 | * Returns the QSB inside hotseat |
| 291 | */ |
| 292 | public View getQsb() { |
| 293 | return mQsb; |
| 294 | } |
Tony Wickham | 9ce3b25 | 2021-03-22 14:43:58 -0700 | [diff] [blame] | 295 | |
Winson Chung | 3d503fb | 2011-07-13 17:25:49 -0700 | [diff] [blame] | 296 | } |