All apps should display below system UI components such as the
notification tray and power menu, so an overlay window is more
appropriate. As a result, all apps has a separate window activity
context, but some properties are delegated to the taskbar activity
context. Taskbar should also be stashed while all apps is open.
Change-Id: I593457708779d84a0ab8b949a966d247d0a2e1b7
Test: Manual
Bug: 216843189
Fix: 217383817
(cherry picked from commit 473b980bf9)
70 lines
2.5 KiB
Java
70 lines
2.5 KiB
Java
/*
|
|
* Copyright (C) 2022 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
package com.android.launcher3.taskbar;
|
|
|
|
import android.content.Context;
|
|
import android.view.ContextThemeWrapper;
|
|
import android.view.LayoutInflater;
|
|
|
|
import com.android.launcher3.DeviceProfile;
|
|
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
|
|
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
|
|
import com.android.launcher3.util.Themes;
|
|
import com.android.launcher3.views.ActivityContext;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
// TODO(b/218912746): Share more behavior to avoid all apps context depending directly on taskbar.
|
|
/** Base for common behavior between taskbar window contexts. */
|
|
public abstract class BaseTaskbarContext extends ContextThemeWrapper implements ActivityContext,
|
|
DeviceProfileListenable {
|
|
|
|
protected final LayoutInflater mLayoutInflater;
|
|
private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>();
|
|
|
|
protected DeviceProfile mDeviceProfile;
|
|
|
|
public BaseTaskbarContext(Context windowContext) {
|
|
super(windowContext, Themes.getActivityThemeRes(windowContext));
|
|
mLayoutInflater = LayoutInflater.from(this).cloneInContext(this);
|
|
}
|
|
|
|
@Override
|
|
public final LayoutInflater getLayoutInflater() {
|
|
return mLayoutInflater;
|
|
}
|
|
|
|
@Override
|
|
public final DeviceProfile getDeviceProfile() {
|
|
return mDeviceProfile;
|
|
}
|
|
|
|
@Override
|
|
public final List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() {
|
|
return mDPChangeListeners;
|
|
}
|
|
|
|
/** Updates the {@link DeviceProfile} instance to the latest representation of the screen. */
|
|
public abstract void updateDeviceProfile(DeviceProfile dp);
|
|
|
|
/** Callback invoked when a drag is initiated within this context. */
|
|
public abstract void onDragStart();
|
|
|
|
/** Callback invoked when a popup is shown or closed within this context. */
|
|
public abstract void onPopupVisibilityChanged(boolean isVisible);
|
|
}
|