mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Using WidgetCell in the Pin Item confirmation prompt for a consistent UI
Also fixing some platform API changes in PinItemRequestCompat Bug: 33584624 Change-Id: I255829f0079f1a3967bf8d6a337da12c890eb7ec
This commit is contained in:
@@ -23,6 +23,7 @@ import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnLayoutChangeListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewPropertyAnimator;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -60,7 +61,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
|
||||
private static final float PREVIEW_SCALE = 0.8f;
|
||||
|
||||
private int mPresetPreviewSize;
|
||||
int cellSize;
|
||||
private int mCellSize;
|
||||
|
||||
private WidgetImageView mWidgetImage;
|
||||
private TextView mWidgetName;
|
||||
@@ -96,8 +97,8 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
|
||||
|
||||
private void setContainerWidth() {
|
||||
DeviceProfile profile = mActivity.getDeviceProfile();
|
||||
cellSize = (int) (profile.cellWidthPx * WIDTH_SCALE);
|
||||
mPresetPreviewSize = (int) (cellSize * PREVIEW_SCALE);
|
||||
mCellSize = (int) (profile.cellWidthPx * WIDTH_SCALE);
|
||||
mPresetPreviewSize = (int) (mCellSize * PREVIEW_SCALE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,6 +201,12 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayoutParams(ViewGroup.LayoutParams params) {
|
||||
params.width = params.height = mCellSize;
|
||||
super.setLayoutParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getAccessibilityClassName() {
|
||||
return WidgetCell.class.getName();
|
||||
|
||||
Reference in New Issue
Block a user