use of com.android.launcher3.DeviceProfile in project android_packages_apps_Trebuchet by LineageOS.
the class WorkspacePageIndicator method setInsets.
@Override
public void setInsets(Rect insets) {
DeviceProfile grid = mLauncher.getDeviceProfile();
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
if (grid.isVerticalBarLayout()) {
Rect padding = grid.workspacePadding;
lp.leftMargin = padding.left + grid.workspaceCellPaddingXPx;
lp.rightMargin = padding.right + grid.workspaceCellPaddingXPx;
lp.bottomMargin = padding.bottom;
} else {
lp.leftMargin = lp.rightMargin = 0;
lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
lp.bottomMargin = grid.hotseatBarSizePx + insets.bottom;
}
setLayoutParams(lp);
}
use of com.android.launcher3.DeviceProfile in project android_packages_apps_Trebuchet by LineageOS.
the class PortraitStatesTouchController method getHotseatTop.
public static int getHotseatTop(Launcher launcher) {
DeviceProfile dp = launcher.getDeviceProfile();
int hotseatHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
return launcher.getDragLayer().getHeight() - hotseatHeight;
}
use of com.android.launcher3.DeviceProfile in project android_packages_apps_Trebuchet by LineageOS.
the class PreviewBackground method setup.
public void setup(Context context, ActivityContext activity, View invalidateDelegate, int availableSpaceX, int topPadding) {
mInvalidateDelegate = invalidateDelegate;
TypedArray ta = context.getTheme().obtainStyledAttributes(R.styleable.FolderIconPreview);
mDotColor = ta.getColor(R.styleable.FolderIconPreview_folderDotColor, 0);
mStrokeColor = ta.getColor(R.styleable.FolderIconPreview_folderIconBorderColor, 0);
mBgColor = ta.getColor(R.styleable.FolderIconPreview_folderFillColor, 0);
ta.recycle();
DeviceProfile grid = activity.getDeviceProfile();
previewSize = grid.folderIconSizePx;
basePreviewOffsetX = (availableSpaceX - previewSize) / 2;
basePreviewOffsetY = topPadding + grid.folderIconOffsetYPx;
// Stroke width is 1dp
mStrokeWidth = context.getResources().getDisplayMetrics().density;
float radius = getScaledRadius();
float shadowRadius = radius + mStrokeWidth;
int shadowColor = Color.argb(SHADOW_OPACITY, 0, 0, 0);
mShadowShader = new RadialGradient(0, 0, 1, new int[] { shadowColor, Color.TRANSPARENT }, new float[] { radius / shadowRadius, 1 }, Shader.TileMode.CLAMP);
invalidate();
}
use of com.android.launcher3.DeviceProfile in project Neo-Launcher by NeoApplications.
the class AllAppsQsbLayout method getScrollRangeDelta.
@Override
public float getScrollRangeDelta(Rect insets) {
DeviceProfile wallpaperDeviceProfile = mLauncher.getWallpaperDeviceProfile();
int i = (wallpaperDeviceProfile.hotseatBarSizePx - wallpaperDeviceProfile.hotseatCellHeightPx) - getLayoutParams().height;
int bottom = insets.bottom;
return ((getLayoutParams().height + Math.max(-mVerticalOffset, insets.top - mTopAdjusting)) + mVerticalOffset) + (bottom + (i - bottom) * 0.45f);
}
use of com.android.launcher3.DeviceProfile in project Neo-Launcher by NeoApplications.
the class DateWidgetView method onMeasure.
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Launcher launcher = OmegaUtilsKt.getLauncherOrNull(getContext());
int marginEnd;
if (launcher != null) {
DeviceProfile deviceProfile = Launcher.getLauncher(getContext()).getDeviceProfile();
int size = MeasureSpec.getSize(widthMeasureSpec) / deviceProfile.inv.numColumns;
marginEnd = (size - deviceProfile.iconSizePx) / 2;
mWidth = (deviceProfile.inv.numColumns - Math.max(1, (int) Math.ceil((double) (getResources().getDimension(R.dimen.qsb_min_width_with_mic) / ((float) size))))) * size;
mText = "";
update();
} else {
marginEnd = getResources().getDimensionPixelSize(R.dimen.smartspace_preview_widget_margin);
}
setMarginEnd(mDateText1, marginEnd);
setMarginEnd(mDateText2, marginEnd);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
Aggregations