Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | |
| 17 | package com.android.systemui.recents; |
| 18 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 19 | import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; |
| 20 | import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; |
| 21 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 22 | import android.annotation.TargetApi; |
| 23 | import android.app.ActivityManager; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 24 | import android.content.Context; |
| 25 | import android.content.res.Configuration; |
Tony Wickham | 0239d5f | 2018-01-22 18:40:05 -0800 | [diff] [blame] | 26 | import android.content.res.Resources; |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 27 | import android.graphics.CornerPathEffect; |
| 28 | import android.graphics.Paint; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 29 | import android.graphics.PixelFormat; |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 30 | import android.graphics.drawable.ShapeDrawable; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 31 | import android.os.Build; |
Tony Wickham | 96f35e5 | 2018-02-16 15:36:09 -0800 | [diff] [blame] | 32 | import android.os.SystemProperties; |
| 33 | import android.os.UserManager; |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 34 | import android.text.TextUtils; |
| 35 | import android.util.Log; |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 36 | import android.util.TypedValue; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 37 | import android.view.Gravity; |
| 38 | import android.view.LayoutInflater; |
| 39 | import android.view.View; |
| 40 | import android.view.ViewGroup; |
| 41 | import android.view.WindowManager; |
| 42 | import android.view.animation.AccelerateInterpolator; |
| 43 | import android.view.animation.DecelerateInterpolator; |
Tony Wickham | 0239d5f | 2018-01-22 18:40:05 -0800 | [diff] [blame] | 44 | import android.widget.ImageView; |
| 45 | import android.widget.TextView; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 46 | |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 47 | import com.android.systemui.OverviewProxyService; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 48 | import com.android.systemui.Prefs; |
| 49 | import com.android.systemui.R; |
| 50 | import com.android.systemui.recents.misc.SysUiTaskStackChangeListener; |
| 51 | import com.android.systemui.shared.system.ActivityManagerWrapper; |
| 52 | |
Tony Wickham | 78f8eee | 2018-02-27 15:40:33 -0800 | [diff] [blame] | 53 | import java.util.Collections; |
| 54 | import java.util.HashSet; |
| 55 | import java.util.Set; |
| 56 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 57 | /** |
| 58 | * Shows onboarding for the new recents interaction in P (codenamed quickstep). |
| 59 | */ |
| 60 | @TargetApi(Build.VERSION_CODES.P) |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 61 | public class RecentsOnboarding { |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 62 | |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 63 | private static final String TAG = "RecentsOnboarding"; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 64 | private static final boolean RESET_PREFS_FOR_DEBUG = false; |
Tracy Zhou | beaa975 | 2018-04-09 10:37:44 -0700 | [diff] [blame] | 65 | private static final boolean ONBOARDING_ENABLED = false; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 66 | private static final long SHOW_DELAY_MS = 500; |
| 67 | private static final long SHOW_HIDE_DURATION_MS = 300; |
| 68 | // Don't show the onboarding until the user has launched this number of apps. |
Tony Wickham | 64f1cd5 | 2018-01-23 16:05:53 -0800 | [diff] [blame] | 69 | private static final int SHOW_ON_APP_LAUNCH = 2; |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 70 | // After explicitly dismissing, show again after launching this number of apps. |
| 71 | private static final int SHOW_ON_APP_LAUNCH_AFTER_DISMISS = 5; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 72 | |
| 73 | private final Context mContext; |
| 74 | private final WindowManager mWindowManager; |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 75 | private final OverviewProxyService mOverviewProxyService; |
Tony Wickham | 78f8eee | 2018-02-27 15:40:33 -0800 | [diff] [blame] | 76 | private Set<String> mBlacklistedPackages; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 77 | private final View mLayout; |
Tony Wickham | 0239d5f | 2018-01-22 18:40:05 -0800 | [diff] [blame] | 78 | private final TextView mTextView; |
| 79 | private final ImageView mDismissView; |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 80 | private final View mArrowView; |
| 81 | private final int mOnboardingToastColor; |
| 82 | private final int mOnboardingToastArrowRadius; |
| 83 | private int mNavBarHeight; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 84 | |
| 85 | private boolean mTaskListenerRegistered; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 86 | private boolean mLayoutAttachedToWindow; |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 87 | private int mLastTaskId; |
| 88 | private boolean mHasDismissed; |
| 89 | private int mNumAppsLaunchedSinceDismiss; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 90 | |
| 91 | private final SysUiTaskStackChangeListener mTaskListener = new SysUiTaskStackChangeListener() { |
| 92 | @Override |
| 93 | public void onTaskStackChanged() { |
| 94 | ActivityManager.RunningTaskInfo info = ActivityManagerWrapper.getInstance() |
| 95 | .getRunningTask(ACTIVITY_TYPE_UNDEFINED /* ignoreActivityType */); |
Winson Chung | 475f20f | 2018-03-19 15:04:56 -0700 | [diff] [blame] | 96 | if (info == null) { |
| 97 | return; |
| 98 | } |
Tony Wickham | 78f8eee | 2018-02-27 15:40:33 -0800 | [diff] [blame] | 99 | if (mBlacklistedPackages.contains(info.baseActivity.getPackageName())) { |
| 100 | hide(true); |
| 101 | return; |
| 102 | } |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 103 | if (info.id == mLastTaskId) { |
| 104 | // We only count launches that go to a new task. |
| 105 | return; |
| 106 | } |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 107 | int activityType = info.configuration.windowConfiguration.getActivityType(); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 108 | if (activityType == ACTIVITY_TYPE_STANDARD) { |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 109 | mLastTaskId = info.id; |
| 110 | int numAppsLaunched = mHasDismissed ? mNumAppsLaunchedSinceDismiss |
| 111 | : Prefs.getInt(mContext, Prefs.Key.NUM_APPS_LAUNCHED, 0); |
| 112 | int showOnAppLaunch = mHasDismissed ? SHOW_ON_APP_LAUNCH_AFTER_DISMISS |
| 113 | : SHOW_ON_APP_LAUNCH; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 114 | numAppsLaunched++; |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 115 | if (numAppsLaunched >= showOnAppLaunch) { |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 116 | show(); |
| 117 | } else { |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 118 | if (mHasDismissed) { |
| 119 | mNumAppsLaunchedSinceDismiss = numAppsLaunched; |
| 120 | } else { |
| 121 | Prefs.putInt(mContext, Prefs.Key.NUM_APPS_LAUNCHED, numAppsLaunched); |
| 122 | } |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 123 | } |
| 124 | } else { |
Winson Chung | 8ae17be | 2018-01-24 19:50:12 -0800 | [diff] [blame] | 125 | hide(false); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 126 | } |
| 127 | } |
| 128 | }; |
| 129 | |
| 130 | private final View.OnAttachStateChangeListener mOnAttachStateChangeListener |
| 131 | = new View.OnAttachStateChangeListener() { |
| 132 | @Override |
| 133 | public void onViewAttachedToWindow(View view) { |
| 134 | if (view == mLayout) { |
| 135 | mLayoutAttachedToWindow = true; |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 136 | mHasDismissed = false; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 137 | } |
| 138 | } |
| 139 | |
| 140 | @Override |
| 141 | public void onViewDetachedFromWindow(View view) { |
| 142 | if (view == mLayout) { |
| 143 | mLayoutAttachedToWindow = false; |
| 144 | } |
| 145 | } |
| 146 | }; |
| 147 | |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 148 | public RecentsOnboarding(Context context, OverviewProxyService overviewProxyService) { |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 149 | mContext = context; |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 150 | mOverviewProxyService = overviewProxyService; |
Tony Wickham | 0239d5f | 2018-01-22 18:40:05 -0800 | [diff] [blame] | 151 | final Resources res = context.getResources(); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 152 | mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); |
Tony Wickham | 78f8eee | 2018-02-27 15:40:33 -0800 | [diff] [blame] | 153 | mBlacklistedPackages = new HashSet<>(); |
| 154 | Collections.addAll(mBlacklistedPackages, res.getStringArray( |
| 155 | R.array.recents_onboarding_blacklisted_packages)); |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 156 | mLayout = LayoutInflater.from(mContext).inflate(R.layout.recents_onboarding, null); |
Winson Chung | 8ae17be | 2018-01-24 19:50:12 -0800 | [diff] [blame] | 157 | mTextView = mLayout.findViewById(R.id.onboarding_text); |
| 158 | mDismissView = mLayout.findViewById(R.id.dismiss); |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 159 | mArrowView = mLayout.findViewById(R.id.arrow); |
| 160 | |
| 161 | TypedValue typedValue = new TypedValue(); |
| 162 | context.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); |
| 163 | mOnboardingToastColor = res.getColor(typedValue.resourceId); |
| 164 | mOnboardingToastArrowRadius = res.getDimensionPixelSize( |
| 165 | R.dimen.recents_onboarding_toast_arrow_corner_radius); |
Tony Wickham | 0239d5f | 2018-01-22 18:40:05 -0800 | [diff] [blame] | 166 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 167 | mLayout.addOnAttachStateChangeListener(mOnAttachStateChangeListener); |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 168 | mDismissView.setOnClickListener(v -> { |
| 169 | hide(true); |
| 170 | mHasDismissed = true; |
| 171 | mNumAppsLaunchedSinceDismiss = 0; |
| 172 | }); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 173 | |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 174 | ViewGroup.LayoutParams arrowLp = mArrowView.getLayoutParams(); |
| 175 | ShapeDrawable arrowDrawable = new ShapeDrawable(TriangleShape.create( |
| 176 | arrowLp.width, arrowLp.height, false)); |
| 177 | Paint arrowPaint = arrowDrawable.getPaint(); |
| 178 | arrowPaint.setColor(mOnboardingToastColor); |
| 179 | // The corner path effect won't be reflected in the shadow, but shouldn't be noticeable. |
| 180 | arrowPaint.setPathEffect(new CornerPathEffect(mOnboardingToastArrowRadius)); |
| 181 | mArrowView.setBackground(arrowDrawable); |
| 182 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 183 | if (RESET_PREFS_FOR_DEBUG) { |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 184 | Prefs.putBoolean(mContext, Prefs.Key.HAS_SEEN_RECENTS_ONBOARDING, false); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 185 | Prefs.putInt(mContext, Prefs.Key.NUM_APPS_LAUNCHED, 0); |
| 186 | } |
| 187 | } |
| 188 | |
Winson Chung | 8ae17be | 2018-01-24 19:50:12 -0800 | [diff] [blame] | 189 | public void onConnectedToLauncher() { |
Tracy Zhou | beaa975 | 2018-04-09 10:37:44 -0700 | [diff] [blame] | 190 | if (!ONBOARDING_ENABLED) { |
| 191 | return; |
| 192 | } |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 193 | boolean alreadySeenRecentsOnboarding = Prefs.getBoolean(mContext, |
| 194 | Prefs.Key.HAS_SEEN_RECENTS_ONBOARDING, false); |
| 195 | if (!mTaskListenerRegistered && !alreadySeenRecentsOnboarding) { |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 196 | ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskListener); |
| 197 | mTaskListenerRegistered = true; |
| 198 | } |
| 199 | } |
| 200 | |
Matthew Ng | 2ea93b7 | 2018-03-14 19:43:18 +0000 | [diff] [blame] | 201 | public void onQuickStepStarted() { |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 202 | boolean alreadySeenRecentsOnboarding = Prefs.getBoolean(mContext, |
| 203 | Prefs.Key.HAS_SEEN_RECENTS_ONBOARDING, false); |
| 204 | if (!alreadySeenRecentsOnboarding) { |
| 205 | Prefs.putBoolean(mContext, Prefs.Key.HAS_SEEN_RECENTS_ONBOARDING, true); |
Winson Chung | 8ae17be | 2018-01-24 19:50:12 -0800 | [diff] [blame] | 206 | onDisconnectedFromLauncher(); |
| 207 | } |
| 208 | } |
| 209 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 210 | public void onDisconnectedFromLauncher() { |
| 211 | if (mTaskListenerRegistered) { |
| 212 | ActivityManagerWrapper.getInstance().unregisterTaskStackListener(mTaskListener); |
| 213 | mTaskListenerRegistered = false; |
| 214 | } |
Tony Wickham | 2f0d015 | 2018-03-01 15:45:04 -0800 | [diff] [blame] | 215 | mHasDismissed = false; |
| 216 | mNumAppsLaunchedSinceDismiss = 0; |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 217 | hide(false); |
| 218 | } |
| 219 | |
| 220 | public void onConfigurationChanged(Configuration newConfiguration) { |
| 221 | if (newConfiguration.orientation != Configuration.ORIENTATION_PORTRAIT) { |
| 222 | hide(false); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | public void show() { |
Tony Wickham | 96f35e5 | 2018-02-16 15:36:09 -0800 | [diff] [blame] | 227 | if (!shouldShow()) { |
| 228 | return; |
| 229 | } |
Tracy Zhou | 0ad2763 | 2018-04-11 20:40:53 -0700 | [diff] [blame] | 230 | mTextView.setText(R.string.recents_swipe_up_onboarding); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 231 | // Only show in portrait. |
| 232 | int orientation = mContext.getResources().getConfiguration().orientation; |
| 233 | if (!mLayoutAttachedToWindow && orientation == Configuration.ORIENTATION_PORTRAIT) { |
| 234 | mLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 235 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 236 | mWindowManager.addView(mLayout, getWindowLayoutParams()); |
| 237 | int layoutHeight = mLayout.getHeight(); |
| 238 | if (layoutHeight == 0) { |
| 239 | mLayout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| 240 | layoutHeight = mLayout.getMeasuredHeight(); |
| 241 | } |
| 242 | mLayout.setTranslationY(layoutHeight); |
| 243 | mLayout.setAlpha(0); |
| 244 | mLayout.animate() |
| 245 | .translationY(0) |
| 246 | .alpha(1f) |
| 247 | .withLayer() |
| 248 | .setStartDelay(SHOW_DELAY_MS) |
| 249 | .setDuration(SHOW_HIDE_DURATION_MS) |
| 250 | .setInterpolator(new DecelerateInterpolator()) |
| 251 | .start(); |
| 252 | } |
| 253 | } |
| 254 | |
Tony Wickham | 96f35e5 | 2018-02-16 15:36:09 -0800 | [diff] [blame] | 255 | /** |
Robb Glasser | e8f1d36 | 2018-02-20 13:28:53 -0800 | [diff] [blame] | 256 | * @return True unless setprop has been set to false, we're in demo mode, or running tests in |
| 257 | * automation. |
Tony Wickham | 96f35e5 | 2018-02-16 15:36:09 -0800 | [diff] [blame] | 258 | */ |
| 259 | private boolean shouldShow() { |
| 260 | return SystemProperties.getBoolean("persist.quickstep.onboarding.enabled", |
Robb Glasser | e8f1d36 | 2018-02-20 13:28:53 -0800 | [diff] [blame] | 261 | !(mContext.getSystemService(UserManager.class)).isDemoUser() && |
| 262 | !ActivityManager.isRunningInTestHarness()); |
Tony Wickham | 96f35e5 | 2018-02-16 15:36:09 -0800 | [diff] [blame] | 263 | } |
| 264 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 265 | public void hide(boolean animate) { |
| 266 | if (mLayoutAttachedToWindow) { |
| 267 | if (animate) { |
| 268 | mLayout.animate() |
| 269 | .translationY(mLayout.getHeight()) |
| 270 | .alpha(0f) |
| 271 | .withLayer() |
| 272 | .setDuration(SHOW_HIDE_DURATION_MS) |
| 273 | .setInterpolator(new AccelerateInterpolator()) |
| 274 | .withEndAction(() -> mWindowManager.removeView(mLayout)) |
| 275 | .start(); |
| 276 | } else { |
Tony Wickham | 96f35e5 | 2018-02-16 15:36:09 -0800 | [diff] [blame] | 277 | mLayout.animate().cancel(); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 278 | mWindowManager.removeView(mLayout); |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 283 | public void setNavBarHeight(int navBarHeight) { |
| 284 | mNavBarHeight = navBarHeight; |
Tony Wickham | 0239d5f | 2018-01-22 18:40:05 -0800 | [diff] [blame] | 285 | } |
| 286 | |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 287 | private WindowManager.LayoutParams getWindowLayoutParams() { |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 288 | int flags = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 289 | | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; |
| 290 | final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( |
| 291 | ViewGroup.LayoutParams.MATCH_PARENT, |
| 292 | ViewGroup.LayoutParams.WRAP_CONTENT, |
Tracy Zhou | 559d97c | 2018-04-07 23:54:46 -0700 | [diff] [blame] | 293 | 0, -mNavBarHeight / 2, |
| 294 | WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 295 | flags, |
| 296 | PixelFormat.TRANSLUCENT); |
| 297 | lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; |
Tony Wickham | 05c1f85 | 2018-02-06 12:32:54 -0800 | [diff] [blame] | 298 | lp.setTitle("RecentsOnboarding"); |
Tony Wickham | fb63fe8 | 2018-01-16 12:14:06 -0800 | [diff] [blame] | 299 | lp.gravity = Gravity.BOTTOM; |
| 300 | return lp; |
| 301 | } |
| 302 | } |