mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 10:18:20 +00:00
resolved conflicts for e78e3d73 to ub-launcher3-master
Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
This commit is contained in:
@@ -17,6 +17,8 @@ import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
|
||||
|
||||
public class AppWidgetResizeFrame extends FrameLayout {
|
||||
private static final int SNAP_DURATION = 150;
|
||||
private static final float DIMMED_HANDLE_ALPHA = 0f;
|
||||
@@ -46,6 +48,8 @@ public class AppWidgetResizeFrame extends FrameLayout {
|
||||
private final int[] mLastDirectionVector = new int[2];
|
||||
private final int[] mTmpPt = new int[2];
|
||||
|
||||
private final DragViewStateAnnouncer mStateAnnouncer;
|
||||
|
||||
private boolean mLeftBorderActive;
|
||||
private boolean mRightBorderActive;
|
||||
private boolean mTopBorderActive;
|
||||
@@ -84,6 +88,8 @@ public class AppWidgetResizeFrame extends FrameLayout {
|
||||
mMinHSpan = info.minSpanX;
|
||||
mMinVSpan = info.minSpanY;
|
||||
|
||||
mStateAnnouncer = DragViewStateAnnouncer.createFor(this);
|
||||
|
||||
setBackgroundResource(R.drawable.widget_resize_shadow);
|
||||
setForeground(getResources().getDrawable(R.drawable.widget_resize_frame));
|
||||
setPadding(0, 0, 0, 0);
|
||||
@@ -326,12 +332,18 @@ public class AppWidgetResizeFrame extends FrameLayout {
|
||||
|
||||
if (mCellLayout.createAreaForResize(cellX, cellY, spanX, spanY, mWidgetView,
|
||||
mDirectionVector, onDismiss)) {
|
||||
if (mStateAnnouncer != null && (lp.cellHSpan != spanX || lp.cellVSpan != spanY) ) {
|
||||
mStateAnnouncer.announce(
|
||||
mLauncher.getString(R.string.widget_resized, spanX, spanY));
|
||||
}
|
||||
|
||||
lp.tmpCellX = cellX;
|
||||
lp.tmpCellY = cellY;
|
||||
lp.cellHSpan = spanX;
|
||||
lp.cellVSpan = spanY;
|
||||
mRunningVInc += vSpanDelta;
|
||||
mRunningHInc += hSpanDelta;
|
||||
|
||||
if (!onDismiss) {
|
||||
updateWidgetSizeRanges(mWidgetView, mLauncher, spanX, spanY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user