Example usage for android.support.v4.graphics.drawable DrawableCompat setHotspot

List of usage examples for android.support.v4.graphics.drawable DrawableCompat setHotspot

Introduction

In this page you can find the example usage for android.support.v4.graphics.drawable DrawableCompat setHotspot.

Prototype

public static void setHotspot(Drawable drawable, float f, float f2) 

Source Link

Usage

From source file:android.support.graphics.drawable.VectorDrawableCommon.java

@Override
public void setHotspot(float x, float y) {
    // API >= 21 only.
    if (mDelegateDrawable != null) {
        DrawableCompat.setHotspot(mDelegateDrawable, x, y);
    }/*from   w  w  w. ja  va  2 s.  com*/
    return;
}

From source file:android.support.v7.graphics.drawable.DrawableWrapper.java

@Override
public void setHotspot(float x, float y) {
    DrawableCompat.setHotspot(mDrawable, x, y);
}

From source file:com.negusoft.greenmatter.drawable.CompoundDrawableWrapper.java

@Override
public void setHotspot(float x, float y) {
    for (Drawable d : mSecondaryDrawables)
        DrawableCompat.setHotspot(d, x, y);
    super.setHotspot(x, y);
}

From source file:android.support.v7.internal.widget.ListViewCompat.java

protected void positionSelectorLikeTouchCompat(int position, View sel, float x, float y) {
    positionSelectorLikeFocusCompat(position, sel);

    Drawable selector = getSelector();//from   ww  w  .ja va  2s  . c om
    if (selector != null && position != INVALID_POSITION) {
        DrawableCompat.setHotspot(selector, x, y);
    }
}

From source file:android.support.v7.internal.widget.ListViewCompat.java

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);
    }/*from w w w . j av a  2 s  . c  om*/

    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);
    }
}

From source file:com.github.shareme.gwsmaterialuikit.library.material.drawable.PaddingDrawable.java

@Override
public void setHotspot(float x, float y) {
    if (mDrawable != null)
        DrawableCompat.setHotspot(mDrawable, x, y);
}

From source file:com.shizhefei.view.largeimage.UpdateImageView.java

@Override
public void drawableHotspotChanged(float x, float y) {
    super.drawableHotspotChanged(x, y);
    if (mDrawable != null) {
        DrawableCompat.setHotspot(mDrawable, x, y);
    }/*w w w . ja va  2 s  .c o  m*/
}

From source file:com.gh4a.adapter.RootAdapter.java

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (holder instanceof FooterViewHolder) {
        if (mFooterListener != null) {
            mFooterListener.onScrolledToFooter();
        }//from   ww  w  .  j a v a  2s . co m
    } else if (!(holder instanceof HeaderViewHolder)) {
        onBindViewHolder((VH) holder, getItemFromAdapterPosition(position));
        if (position == mHighlightPosition) {
            final View v = holder.itemView;
            v.post(new Runnable() {
                @Override
                public void run() {
                    if (v.getBackground() != null) {
                        final int centerX = v.getWidth() / 2;
                        final int centerY = v.getHeight() / 2;
                        DrawableCompat.setHotspot(v.getBackground(), centerX, centerY);
                    }
                    v.setPressed(true);
                    v.setPressed(false);
                    mHighlightPosition = -1;
                }
            });
        }
    }
}

From source file:com.albedinsky.android.support.ui.graphics.drawable.DrawableWrapper.java

/**
 */
@Override
public void setHotspot(float x, float y) {
    DrawableCompat.setHotspot(mDrawable, x, y);
}

From source file:am.widget.basetabstrip.BaseTabStrip.java

@Override
protected void drawableStateChanged() {
    final float downMotionX = tabStripGestureDetector.getDownMotionX();
    final float downMotionY = tabStripGestureDetector.getDownMotionY();
    int position = pointToPosition(downMotionX, downMotionY);
    if (position >= 0 && position < mTabItemBackgrounds.size()) {
        Drawable tag = mTabItemBackgrounds.get(position);
        DrawableCompat.setHotspot(tag, getHotspotX(tag, position, downMotionX, downMotionY),
                getHotspotY(tag, position, downMotionX, downMotionY));
        if (tag.isStateful()) {
            tag.setState(getDrawableState());
        }/*from  ww w  . j  a v  a 2s . c om*/
    }
    super.drawableStateChanged();
}