summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppWidgetResizeFrame.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-09-25 11:50:16 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-09-25 11:50:16 -0700
commit9d4380856ff41ecb26c0d5aee1747b6060d2ef0e (patch)
tree59f1195b66f6adab842c52e86c3e83688b835a3b /src/com/android/launcher3/AppWidgetResizeFrame.java
parent1f832f85d59600fc4c212dec51a5112a6b7427d5 (diff)
parente78e3d734b577c1ab6dc0738a83600374908ea52 (diff)
downloadandroid_packages_apps_Trebuchet-9d4380856ff41ecb26c0d5aee1747b6060d2ef0e.tar.gz
android_packages_apps_Trebuchet-9d4380856ff41ecb26c0d5aee1747b6060d2ef0e.tar.bz2
android_packages_apps_Trebuchet-9d4380856ff41ecb26c0d5aee1747b6060d2ef0e.zip
resolved conflicts for e78e3d73 to ub-launcher3-master
Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
Diffstat (limited to 'src/com/android/launcher3/AppWidgetResizeFrame.java')
-rw-r--r--src/com/android/launcher3/AppWidgetResizeFrame.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 6818929f7..7bd5284fc 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -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);
}