use of com.android.launcher3.InsettableFrameLayout.LayoutParams in project android_packages_apps_Launcher3 by ArrowOS.
the class FloatingSurfaceView method updateIconLocation.
private void updateIconLocation() {
if (mContract == null) {
return;
}
View icon = mLauncher.getFirstMatchForAppClose(-1, mContract.componentName.getPackageName(), mContract.user);
boolean iconChanged = mIcon != icon;
if (iconChanged) {
setCurrentIconVisible(true);
mIcon = icon;
setCurrentIconVisible(false);
}
if (icon != null && icon.isAttachedToWindow()) {
getLocationBoundsForView(mLauncher, icon, false, mTmpPosition, mIconBounds);
if (!mTmpPosition.equals(mIconPosition)) {
mIconPosition.set(mTmpPosition);
sendIconInfo();
LayoutParams lp = (LayoutParams) mSurfaceView.getLayoutParams();
lp.width = Math.round(mIconPosition.width());
lp.height = Math.round(mIconPosition.height());
lp.leftMargin = Math.round(mIconPosition.left);
lp.topMargin = Math.round(mIconPosition.top);
}
}
if (mIcon != null && iconChanged && !mIconBounds.isEmpty()) {
// Record the icon display
setCurrentIconVisible(true);
Canvas c = mPicture.beginRecording(mIconBounds.width(), mIconBounds.height());
c.translate(-mIconBounds.left, -mIconBounds.top);
mIcon.draw(c);
mPicture.endRecording();
setCurrentIconVisible(false);
drawOnSurface();
}
}
use of com.android.launcher3.InsettableFrameLayout.LayoutParams in project android_packages_apps_Launcher3 by ArrowOS.
the class DigitalWellBeingToast method setupAndAddBanner.
private void setupAndAddBanner() {
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mBanner.getLayoutParams();
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
layoutParams.bottomMargin = ((ViewGroup.MarginLayoutParams) mTaskView.getThumbnail().getLayoutParams()).bottomMargin;
PagedOrientationHandler orientationHandler = mTaskView.getPagedOrientationHandler();
Pair<Float, Float> translations = orientationHandler.setDwbLayoutParamsAndGetTranslations(mTaskView.getMeasuredWidth(), mTaskView.getMeasuredHeight(), mStagedSplitBounds, deviceProfile, mTaskView.getThumbnails(), mTask.key.id, mBanner);
mSplitOffsetTranslationX = translations.first;
mSplitOffsetTranslationY = translations.second;
updateTranslationY();
updateTranslationX();
mTaskView.addView(mBanner);
}
use of com.android.launcher3.InsettableFrameLayout.LayoutParams in project android_packages_apps_Launcher3 by ArrowOS.
the class Folder method getHeightFromBottom.
/**
* Returns the height of the current folder's bottom edge from the bottom of the screen.
*/
private int getHeightFromBottom() {
BaseDragLayer.LayoutParams layoutParams = (BaseDragLayer.LayoutParams) getLayoutParams();
int folderBottomPx = layoutParams.y + layoutParams.height;
int windowBottomPx = mActivityContext.getDeviceProfile().heightPx;
return windowBottomPx - folderBottomPx;
}
use of com.android.launcher3.InsettableFrameLayout.LayoutParams in project android_packages_apps_Launcher3 by ArrowOS.
the class TaskView method setOrientationState.
public void setOrientationState(RecentsOrientedState orientationState) {
PagedOrientationHandler orientationHandler = orientationState.getOrientationHandler();
boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
LayoutParams snapshotParams = (LayoutParams) mSnapshotView.getLayoutParams();
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
boolean isGridTask = isGridTask();
int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
int taskMargin = isGridTask ? deviceProfile.overviewTaskMarginGridPx : deviceProfile.overviewTaskMarginPx;
int taskIconMargin = snapshotParams.topMargin - taskIconHeight - taskMargin;
LayoutParams iconParams = (LayoutParams) mIconView.getLayoutParams();
orientationHandler.setIconAndSnapshotParams(mIconView, taskIconMargin, taskIconHeight, snapshotParams, isRtl);
mSnapshotView.setLayoutParams(snapshotParams);
iconParams.width = iconParams.height = taskIconHeight;
mIconView.setLayoutParams(iconParams);
mIconView.setRotation(orientationHandler.getDegreesRotated());
int iconDrawableSize = isGridTask ? deviceProfile.overviewTaskIconDrawableSizeGridPx : deviceProfile.overviewTaskIconDrawableSizePx;
mIconView.setDrawableSize(iconDrawableSize, iconDrawableSize);
snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
mSnapshotView.setLayoutParams(snapshotParams);
mSnapshotView.getTaskOverlay().updateOrientationState(orientationState);
}
use of com.android.launcher3.InsettableFrameLayout.LayoutParams in project android_packages_apps_Launcher3 by ArrowOS.
the class CellLayout method copySolutionToTempState.
private void copySolutionToTempState(ItemConfiguration solution, View dragView) {
mTmpOccupied.clear();
int childCount = mShortcutsAndWidgets.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = mShortcutsAndWidgets.getChildAt(i);
if (child == dragView)
continue;
LayoutParams lp = (LayoutParams) child.getLayoutParams();
CellAndSpan c = solution.map.get(child);
if (c != null) {
lp.tmpCellX = c.cellX;
lp.tmpCellY = c.cellY;
lp.cellHSpan = c.spanX;
lp.cellVSpan = c.spanY;
mTmpOccupied.markCells(c, true);
}
}
mTmpOccupied.markCells(solution, true);
}
Aggregations