Put AllApps in bottom sheet for tablets

http://screen/7steQ7W8U2ga3Hs

Bug: 208599118
Test: manual
Change-Id: I36cbac3cb7cb214081e5a33a6e042ae83e745f23
This commit is contained in:
Alex Chau
2022-01-14 18:02:18 +00:00
parent 36e0fd91a0
commit 27b39b9668
9 changed files with 109 additions and 28 deletions

View File

@@ -30,12 +30,12 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.views.ActivityContext;
import com.android.systemui.plugins.AllAppsRow;
import com.android.systemui.plugins.AllAppsRow.OnHeightUpdatedListener;
import com.android.systemui.plugins.PluginListener;
@@ -118,7 +118,9 @@ public class FloatingHeaderView extends LinearLayout implements
mHeaderTopPadding = context.getResources()
.getDimensionPixelSize(R.dimen.all_apps_header_top_padding);
mHeaderProtectionSupported = context.getResources().getBoolean(
R.bool.config_header_protection_supported);
R.bool.config_header_protection_supported)
// TODO(b/208599118) Support header protection for bottom sheet.
&& !ActivityContext.lookupContext(context).getDeviceProfile().isTablet;
}
@Override
@@ -413,7 +415,7 @@ public class FloatingHeaderView extends LinearLayout implements
@Override
public void setInsets(Rect insets) {
DeviceProfile grid = BaseDraggingActivity.fromContext(getContext()).getDeviceProfile();
DeviceProfile grid = ActivityContext.lookupContext(getContext()).getDeviceProfile();
for (FloatingHeaderRow row : mAllRows) {
row.setInsets(insets, grid);
}