Java Code Examples for androidx.core.graphics.drawable.DrawableCompat#setHotspot()

The following examples show how to use androidx.core.graphics.drawable.DrawableCompat#setHotspot() . 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: ListViewCompat.java    From material with Apache License 2.0 6 votes vote down vote up
protected void positionSelectorLikeFocusCompat(int position, View sel) {
    // If we're changing position, update the visibility since the selector
    // is technically being detached from the previous selection.
    final Drawable selector = getSelector();
    final boolean manageState = selector != null && position != INVALID_POSITION;
    if (manageState) {
        selector.setVisible(false, false);
    }
    positionSelectorCompat(position, sel);
    if (manageState) {
        final Rect bounds = mSelectorRect;
        final float x = bounds.exactCenterX();
        final float y = bounds.exactCenterY();
        selector.setVisible(getVisibility() == VISIBLE, false);
        DrawableCompat.setHotspot(selector, x, y);
    }
}
 
Example 2
Source File: RangeProgressBar.java    From RangeSeekBar with MIT License 5 votes vote down vote up
@Override
public void drawableHotspotChanged(float x, float y) {
    super.drawableHotspotChanged(x, y);

    if (mProgressDrawable != null) {
        logger.verbose("setHotspot(%.2f, %.2f)", x, y);
        DrawableCompat.setHotspot(mProgressDrawable, x, y);
    }
}
 
Example 3
Source File: RangeSeekBar.java    From RangeSeekBar with MIT License 5 votes vote down vote up
@Override
public void drawableHotspotChanged(float x, float y) {
    super.drawableHotspotChanged(x, y);

    if (mThumbStart != null) {
        logger.verbose("setHotspot(mThumbStart, %.2f, %.2f)", x, y);
        DrawableCompat.setHotspot(mThumbStart, x, y);
    }

    if (mThumbEnd != null) {
        logger.verbose("setHotspot(mThumbEnd, %.2f, %.2f)", x, y);
        DrawableCompat.setHotspot(mThumbEnd, x, y);
    }
}
 
Example 4
Source File: LayerDrawable.java    From Carbon with Apache License 2.0 5 votes vote down vote up
@Override
public void setHotspot(float x, float y) {
    final ChildDrawable[] array = mLayerState.mChildren;
    final int N = mLayerState.mNum;
    for (int i = 0; i < N; i++) {
        final Drawable dr = array[i].mDrawable;
        if (dr != null) {
            DrawableCompat.setHotspot(dr, x, y);
        }
    }
}
 
Example 5
Source File: ListViewCompat.java    From material with Apache License 2.0 5 votes vote down vote up
protected void positionSelectorLikeTouchCompat(int position, View sel, float x, float y) {
    positionSelectorLikeFocusCompat(position, sel);
    Drawable selector = getSelector();
    if (selector != null && position != INVALID_POSITION) {
        DrawableCompat.setHotspot(selector, x, y);
    }
}
 
Example 6
Source File: DrawableWrapper.java    From MHViewer with Apache License 2.0 4 votes vote down vote up
public void setHotspot(float x, float y) {
  DrawableCompat.setHotspot(this.mDrawable, x, y);
}
 
Example 7
Source File: ComparableDrawableWrapper.java    From litho with Apache License 2.0 4 votes vote down vote up
@Override
public void setHotspot(float x, float y) {
  DrawableCompat.setHotspot(mDrawable, x, y);
}
 
Example 8
Source File: DrawableWrapper.java    From MaterialPreference with Apache License 2.0 4 votes vote down vote up
@Override
public void setHotspot(float x, float y) {
    DrawableCompat.setHotspot(mDrawable, x, y);
}
 
Example 9
Source File: DrawableContainerCompat.java    From MaterialProgressBar with Apache License 2.0 4 votes vote down vote up
@Override
public void setHotspot(float x, float y) {
    if (mCurrDrawable != null) {
        DrawableCompat.setHotspot(mCurrDrawable, x, y);
    }
}
 
Example 10
Source File: PaddingDrawable.java    From material with Apache License 2.0 4 votes vote down vote up
@Override
public void setHotspot(float x, float y) {
    if(mDrawable != null)
        DrawableCompat.setHotspot(mDrawable, x, y);
}
 
Example 11
Source File: DrawableWrapper.java    From EhViewer with Apache License 2.0 4 votes vote down vote up
public void setHotspot(float x, float y) {
  DrawableCompat.setHotspot(this.mDrawable, x, y);
}