Merge "Set DividerView accessibility embedded matrix to surface position" into rvc-dev am: 4acfd1f0f2
Change-Id: Idbcf9a5094e5214b5300a53ed8684f47407e124d
This commit is contained in:
@@ -28,12 +28,14 @@ import android.animation.ValueAnimator;
|
|||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
import android.graphics.Region.Op;
|
import android.graphics.Region.Op;
|
||||||
import android.hardware.display.DisplayManager;
|
import android.hardware.display.DisplayManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.RemoteException;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
@@ -164,6 +166,9 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
int mDividerPositionX;
|
int mDividerPositionX;
|
||||||
int mDividerPositionY;
|
int mDividerPositionY;
|
||||||
|
|
||||||
|
private final Matrix mTmpMatrix = new Matrix();
|
||||||
|
private final float[] mTmpValues = new float[9];
|
||||||
|
|
||||||
// The view is removed or in the process of been removed from the system.
|
// The view is removed or in the process of been removed from the system.
|
||||||
private boolean mRemoved;
|
private boolean mRemoved;
|
||||||
|
|
||||||
@@ -249,6 +254,22 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private Runnable mUpdateEmbeddedMatrix = () -> {
|
||||||
|
if (getViewRootImpl() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isHorizontalDivision()) {
|
||||||
|
mTmpMatrix.setTranslate(0, mDividerPositionY - mDividerInsets);
|
||||||
|
} else {
|
||||||
|
mTmpMatrix.setTranslate(mDividerPositionX - mDividerInsets, 0);
|
||||||
|
}
|
||||||
|
mTmpMatrix.getValues(mTmpValues);
|
||||||
|
try {
|
||||||
|
getViewRootImpl().getAccessibilityEmbeddedConnection().setScreenMatrix(mTmpValues);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public DividerView(Context context) {
|
public DividerView(Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
}
|
}
|
||||||
@@ -1084,6 +1105,10 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
t.setPosition(dividerCtrl, mDividerPositionX - mDividerInsets, 0);
|
t.setPosition(dividerCtrl, mDividerPositionX - mDividerInsets, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (getViewRootImpl() != null) {
|
||||||
|
mHandler.removeCallbacks(mUpdateEmbeddedMatrix);
|
||||||
|
mHandler.post(mUpdateEmbeddedMatrix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setResizeDimLayer(Transaction t, boolean primary, float alpha) {
|
void setResizeDimLayer(Transaction t, boolean primary, float alpha) {
|
||||||
|
|||||||
Reference in New Issue
Block a user