Java Code Examples for android.support.v4.graphics.drawable.DrawableCompat#setAutoMirrored()

The following examples show how to use android.support.v4.graphics.drawable.DrawableCompat#setAutoMirrored() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LayerDrawable.java    From RippleDrawable with MIT License 6 votes vote down vote up
/**
 * Add a new layer to this drawable. The new layer is identified by an id.
 *
 * @param layer      The drawable to add as a layer.
 * @param themeAttrs Theme attributes extracted from the layer.
 * @param id         The id of the new layer.
 * @param left       The left padding of the new layer.
 * @param top        The top padding of the new layer.
 * @param right      The right padding of the new layer.
 * @param bottom     The bottom padding of the new layer.
 */
ChildDrawable addLayer(Drawable layer, TypedValue[] themeAttrs, int id, int left, int top, int right, int bottom) {
    final ChildDrawable childDrawable = new ChildDrawable();
    childDrawable.mId = id;
    childDrawable.mThemeAttrs = themeAttrs;
    childDrawable.mDrawable = layer;
    DrawableCompat.setAutoMirrored(childDrawable.mDrawable, isAutoMirrored());
    childDrawable.mInsetL = left;
    childDrawable.mInsetT = top;
    childDrawable.mInsetR = right;
    childDrawable.mInsetB = bottom;

    addLayer(childDrawable);

    mLayerState.mChildrenChangingConfigurations |= layer.getChangingConfigurations();
    layer.setCallback(this);

    return childDrawable;
}
 
Example 2
Source File: VectorDrawableCompat.java    From VectorChildFinder with Apache License 2.0 5 votes vote down vote up
@Override
public void setAutoMirrored(boolean mirrored) {
    if (mDelegateDrawable != null) {
        DrawableCompat.setAutoMirrored(mDelegateDrawable, mirrored);
        return;
    }
    mVectorState.mAutoMirrored = mirrored;
}
 
Example 3
Source File: ActionBarDrawerToggle.java    From guideshow with MIT License 5 votes vote down vote up
private SlideDrawable(Drawable wrapped) {
    super();

    if (DrawableCompat.isAutoMirrored(wrapped)) {
        DrawableCompat.setAutoMirrored(this, true);
    }

    addLevel(0, 0, wrapped);
}
 
Example 4
Source File: LayerDrawable.java    From RippleDrawable with MIT License 5 votes vote down vote up
@Override
public void setAutoMirrored(boolean mirrored) {
    mLayerState.mAutoMirrored = mirrored;

    final ChildDrawable[] array = mLayerState.mChildren;
    final int N = mLayerState.mNum;
    for (int i = 0; i < N; i++) {
        DrawableCompat.setAutoMirrored(array[i].mDrawable, mirrored);
    }
}
 
Example 5
Source File: ShadowUtils.java    From AndroidUtilCode with Apache License 2.0 4 votes vote down vote up
public void setAutoMirrored(boolean mirrored) {
    DrawableCompat.setAutoMirrored(this.mDrawable, mirrored);
}
 
Example 6
Source File: PaddingDrawable.java    From MDPreference with Apache License 2.0 4 votes vote down vote up
@Override
public void setAutoMirrored(boolean mirrored) {
    if(mDrawable != null)
        DrawableCompat.setAutoMirrored(mDrawable, mirrored);
}
 
Example 7
Source File: DrawableWrapper.java    From ticdesign with Apache License 2.0 4 votes vote down vote up
@Override
public void setAutoMirrored(boolean mirrored) {
    DrawableCompat.setAutoMirrored(mDrawable, mirrored);
}