Loading src/com/android/launcher3/widget/WidgetCell.java +0 −21 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.launcher3.widget; import static android.view.View.MeasureSpec.getSize; import static android.view.View.MeasureSpec.makeMeasureSpec; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; Loading Loading @@ -119,8 +118,6 @@ public class WidgetCell extends LinearLayout { private TextView mWidgetName; private TextView mWidgetDims; private TextView mWidgetDescription; private Consumer<Bitmap> mCallback; private @Nullable Bitmap mCachedPreview; protected WidgetItem mItem; Loading Loading @@ -432,8 +429,6 @@ public class WidgetCell extends LinearLayout { */ private void ensurePreviewWithCallback(Consumer<Bitmap> callback, @Nullable Bitmap cachedPreview) { mCallback = callback; mCachedPreview = cachedPreview; if (mAppWidgetHostViewPreview != null) { int containerWidth = (int) (mTargetPreviewWidth * mPreviewContainerScale); int containerHeight = (int) (mTargetPreviewHeight * mPreviewContainerScale); Loading Loading @@ -474,7 +469,6 @@ public class WidgetCell extends LinearLayout { INDEX_WIDGET_CENTERING, -(params.width - (params.width * mPreviewContainerScale)) / 2.0f, -(params.height - (params.height * mPreviewContainerScale)) / 2.0f); mWidgetImageContainer.removeAllViews(); mWidgetImageContainer.addView(mAppWidgetHostViewPreview, /* index= */ 0); mWidgetImage.setVisibility(View.GONE); applyPreview(null); Loading Loading @@ -585,19 +579,4 @@ public class WidgetCell extends LinearLayout { (mTargetPreviewHeight - verticalPadding) * mPreviewContainerScale / appWidgetContentHeight); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int padding = getPaddingLeft() + getPaddingRight(); int allowedWidth = getSize(widthMeasureSpec) - padding; // Here we prevent having clipped widgets when they're too large as the preview width is // larger than the max allowed width. We then re-do the preview with the new preview width if (allowedWidth > 0 && mCachedPreview == null && allowedWidth < mTargetPreviewWidth) { mTargetPreviewWidth = allowedWidth; ensurePreviewWithCallback(mCallback, null); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } Loading
src/com/android/launcher3/widget/WidgetCell.java +0 −21 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.launcher3.widget; import static android.view.View.MeasureSpec.getSize; import static android.view.View.MeasureSpec.makeMeasureSpec; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; Loading Loading @@ -119,8 +118,6 @@ public class WidgetCell extends LinearLayout { private TextView mWidgetName; private TextView mWidgetDims; private TextView mWidgetDescription; private Consumer<Bitmap> mCallback; private @Nullable Bitmap mCachedPreview; protected WidgetItem mItem; Loading Loading @@ -432,8 +429,6 @@ public class WidgetCell extends LinearLayout { */ private void ensurePreviewWithCallback(Consumer<Bitmap> callback, @Nullable Bitmap cachedPreview) { mCallback = callback; mCachedPreview = cachedPreview; if (mAppWidgetHostViewPreview != null) { int containerWidth = (int) (mTargetPreviewWidth * mPreviewContainerScale); int containerHeight = (int) (mTargetPreviewHeight * mPreviewContainerScale); Loading Loading @@ -474,7 +469,6 @@ public class WidgetCell extends LinearLayout { INDEX_WIDGET_CENTERING, -(params.width - (params.width * mPreviewContainerScale)) / 2.0f, -(params.height - (params.height * mPreviewContainerScale)) / 2.0f); mWidgetImageContainer.removeAllViews(); mWidgetImageContainer.addView(mAppWidgetHostViewPreview, /* index= */ 0); mWidgetImage.setVisibility(View.GONE); applyPreview(null); Loading Loading @@ -585,19 +579,4 @@ public class WidgetCell extends LinearLayout { (mTargetPreviewHeight - verticalPadding) * mPreviewContainerScale / appWidgetContentHeight); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int padding = getPaddingLeft() + getPaddingRight(); int allowedWidth = getSize(widthMeasureSpec) - padding; // Here we prevent having clipped widgets when they're too large as the preview width is // larger than the max allowed width. We then re-do the preview with the new preview width if (allowedWidth > 0 && mCachedPreview == null && allowedWidth < mTargetPreviewWidth) { mTargetPreviewWidth = allowedWidth; ensurePreviewWithCallback(mCallback, null); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } }