mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Merge "Allow icons to take up full width in all cases where width > height." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
906e96a68e
@@ -43,6 +43,7 @@ import androidx.annotation.UiThread;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.InsettableFrameLayout;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.R;
|
||||
@@ -82,7 +83,6 @@ public class FloatingIconView extends FrameLayout implements
|
||||
private final Launcher mLauncher;
|
||||
private final boolean mIsRtl;
|
||||
|
||||
private boolean mIsVerticalBarLayout = false;
|
||||
private boolean mIsOpening;
|
||||
|
||||
private IconLoadResult mIconLoadResult;
|
||||
@@ -150,7 +150,7 @@ public class FloatingIconView extends FrameLayout implements
|
||||
float shapeProgressStart, float cornerRadius, boolean isOpening) {
|
||||
setAlpha(alpha);
|
||||
mClipIconView.update(rect, progress, shapeProgressStart, cornerRadius, fgIconAlpha,
|
||||
isOpening, this, mLauncher.getDeviceProfile(), mIsVerticalBarLayout);
|
||||
isOpening, this, mLauncher.getDeviceProfile());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -320,11 +320,11 @@ public class FloatingIconView extends FrameLayout implements
|
||||
@UiThread
|
||||
private void setIcon(@Nullable Drawable drawable, @Nullable Drawable badge,
|
||||
@Nullable Drawable btvIcon, int iconOffset) {
|
||||
final DeviceProfile dp = mLauncher.getDeviceProfile();
|
||||
final InsettableFrameLayout.LayoutParams lp =
|
||||
(InsettableFrameLayout.LayoutParams) getLayoutParams();
|
||||
mBadge = badge;
|
||||
mClipIconView.setIcon(drawable, iconOffset, lp, mIsOpening, mIsVerticalBarLayout,
|
||||
mLauncher.getDeviceProfile());
|
||||
mClipIconView.setIcon(drawable, iconOffset, lp, mIsOpening, dp);
|
||||
if (drawable instanceof AdaptiveIconDrawable) {
|
||||
final int originalHeight = lp.height;
|
||||
final int originalWidth = lp.width;
|
||||
@@ -332,7 +332,7 @@ public class FloatingIconView extends FrameLayout implements
|
||||
mFinalDrawableBounds.set(0, 0, originalWidth, originalHeight);
|
||||
|
||||
float aspectRatio = mLauncher.getDeviceProfile().aspectRatio;
|
||||
if (mIsVerticalBarLayout) {
|
||||
if (dp.isLandscape) {
|
||||
lp.width = (int) Math.max(lp.width, lp.height * aspectRatio);
|
||||
} else {
|
||||
lp.height = (int) Math.max(lp.height, lp.width * aspectRatio);
|
||||
@@ -565,7 +565,6 @@ public class FloatingIconView extends FrameLayout implements
|
||||
view.recycle();
|
||||
|
||||
// Init properties before getting the drawable.
|
||||
view.mIsVerticalBarLayout = launcher.getDeviceProfile().isVerticalBarLayout();
|
||||
view.mIsOpening = isOpening;
|
||||
view.mOriginalIcon = originalView;
|
||||
view.mPositionOut = positionOut;
|
||||
|
||||
Reference in New Issue
Block a user