use of android.support.constraint.solver.widgets.ConstraintWidgetContainer in project android by JetBrains.
the class WidgetDecorator method updateShowAnchorsPolicy.
/**
* Update the show anchors policy. Used for selected widgets.
*/
private void updateShowAnchorsPolicy() {
mDisplayAnchorsPolicy.clear();
mDisplayAnchorsPolicy.add(WidgetDraw.ANCHORS_DISPLAY.ALL);
mDisplayAnchorsPolicy.add(WidgetDraw.ANCHORS_DISPLAY.SELECTED);
if (mWidget.getParent() instanceof ConstraintWidgetContainer) {
ConstraintWidgetContainer container = (ConstraintWidgetContainer) mWidget.getParent();
if (container.handlesInternalConstraints()) {
mDisplayAnchorsPolicy.clear();
mDisplayAnchorsPolicy.add(WidgetDraw.ANCHORS_DISPLAY.NONE);
}
} else {
// if the parent is NOT a ConstraintWidgetContainer, don't show the anchors
mDisplayAnchorsPolicy.clear();
mDisplayAnchorsPolicy.add(WidgetDraw.ANCHORS_DISPLAY.NONE);
}
if (!mShowResizeHandles) {
mDisplayAnchorsPolicy.clear();
mDisplayAnchorsPolicy.add(WidgetDraw.ANCHORS_DISPLAY.CONNECTED);
}
}
Aggregations