mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Add icon to desktop tile in overview
Copied over icon from caption desktop button in WMShell. Temporary icon for now. Refactored some logic in TaskView to better support for custom orientation handling in subclasses. Subclasses can override setting orientation for icon or thumbnail. Bug: 267326722 Test: manual, enable desktop windowing proto 2 and go to overview Change-Id: Id66d48fa52a418a07b954a384b2c3ea22f091b1f
This commit is contained in:
@@ -996,6 +996,11 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
}
|
||||
|
||||
public void setOrientationState(RecentsOrientedState orientationState) {
|
||||
setIconOrientation(orientationState);
|
||||
setThumbnailOrientation(orientationState);
|
||||
}
|
||||
|
||||
protected void setIconOrientation(RecentsOrientedState orientationState) {
|
||||
PagedOrientationHandler orientationHandler = orientationState.getOrientationHandler();
|
||||
boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
|
||||
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
|
||||
@@ -1016,6 +1021,11 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
int iconDrawableSize = isGridTask ? deviceProfile.overviewTaskIconDrawableSizeGridPx
|
||||
: deviceProfile.overviewTaskIconDrawableSizePx;
|
||||
mIconView.setDrawableSize(iconDrawableSize, iconDrawableSize);
|
||||
}
|
||||
|
||||
protected void setThumbnailOrientation(RecentsOrientedState orientationState) {
|
||||
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
|
||||
int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
|
||||
|
||||
LayoutParams snapshotParams = (LayoutParams) mSnapshotView.getLayoutParams();
|
||||
snapshotParams.topMargin = thumbnailTopMargin;
|
||||
|
||||
Reference in New Issue
Block a user