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

The following examples show how to use android.support.v4.graphics.drawable.DrawableCompat#setHotspotBounds() . 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: VectorDrawableCommon.java    From VectorChildFinder with Apache License 2.0 5 votes vote down vote up
@Override
public void setHotspotBounds(int left, int top, int right, int bottom) {
    if (mDelegateDrawable != null) {
        DrawableCompat.setHotspotBounds(mDelegateDrawable, left, top, right, bottom);
        return;
    }
}
 
Example 2
Source File: SeekBarCompat.java    From sealrtc-android with MIT License 5 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21 we want to use the
 * same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(
        Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(
                drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 3
Source File: ShadowUtils.java    From AndroidUtilCode with Apache License 2.0 4 votes vote down vote up
public void setHotspotBounds(int left, int top, int right, int bottom) {
    DrawableCompat.setHotspotBounds(this.mDrawable, left, top, right, bottom);
}
 
Example 4
Source File: PaddingDrawable.java    From MDPreference with Apache License 2.0 4 votes vote down vote up
@Override
public void setHotspotBounds(int left, int top, int right, int bottom) {
    if(mDrawable != null)
        DrawableCompat.setHotspotBounds(mDrawable, left, top, right, bottom);
}
 
Example 5
Source File: DrawableWrapper.java    From ticdesign with Apache License 2.0 4 votes vote down vote up
@Override
public void setHotspotBounds(int left, int top, int right, int bottom) {
    DrawableCompat.setHotspotBounds(mDrawable, left, top, right, bottom);
}
 
Example 6
Source File: SeekBarCompat.java    From PLDroidShortVideo with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 7
Source File: SeekBarCompat.java    From Musicoco with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 8
Source File: SeekBarCompat.java    From IdealMedia with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 9
Source File: SeekBarCompat.java    From FuAgoraDemoDroid with MIT License 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 10
Source File: SeekBarCompat.java    From SwipeBack with GNU General Public License v3.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 11
Source File: SeekBarCompat.java    From Sky31Radio with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 12
Source File: SeekBarCompat.java    From Panoramic-Screenshot with GNU General Public License v3.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 13
Source File: SeekBarCompat.java    From discreteSeekBar with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 14
Source File: SeekBarCompat.java    From UltimateAndroid with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}
 
Example 15
Source File: SeekBarCompat.java    From android-open-project-demo with Apache License 2.0 3 votes vote down vote up
/**
 * As our DiscreteSeekBar implementation uses a circular drawable on API < 21
 * we want to use the same method to set its bounds as the Ripple's hotspot bounds.
 *
 * @param drawable
 * @param left
 * @param top
 * @param right
 * @param bottom
 */
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //We don't want the full size rect, Lollipop ripple would be too big
        int size = (right - left) / 8;
        DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
    } else {
        drawable.setBounds(left, top, right, bottom);
    }
}