Loading core/java/android/view/View.java +24 −16 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ import static java.lang.Math.max; import com.android.internal.R; import com.android.internal.util.Predicate; import com.android.internal.view.menu.MenuBuilder; import com.google.android.collect.Lists; import com.google.android.collect.Maps; Loading Loading @@ -4794,14 +4795,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param v previous or the next focus holder, or null if none */ private void manageFocusHotspot(boolean focused, View v) { if (mBackground == null) { return; } final Rect r = new Rect(); if (!focused && v != null) { v.getBoundsOnScreen(r); final int[] location = new int[2]; final int[] location = mAttachInfo.mTmpLocation; getLocationOnScreen(location); r.offset(-location[0], -location[1]); } else { Loading @@ -4810,8 +4807,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback, final float x = r.exactCenterX(); final float y = r.exactCenterY(); setDrawableHotspot(x, y); } /** * Sets the hotspot position for this View's drawables. * * @param x hotspot x coordinate * @param y hotspot y coordinate * @hide */ protected void setDrawableHotspot(float x, float y) { if (mBackground != null) { mBackground.setHotspot(x, y); } } /** * Request that a rectangle of this view be visible on the screen, Loading Loading @@ -6767,7 +6777,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void setPressed(boolean pressed, float x, float y) { if (pressed) { setHotspot(x, y); setDrawableHotspot(x, y); } setPressed(pressed); Loading Loading @@ -9106,8 +9116,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout()); } else { // Not inside a scrolling container, so show the feedback right away setHotspot(x, y); setPressed(true); setPressed(true, x, y); checkForLongClick(0); } break; Loading @@ -9119,7 +9128,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, break; case MotionEvent.ACTION_MOVE: setHotspot(x, y); setDrawableHotspot(x, y); // Be lenient about moving outside of buttons if (!pointInView(x, y, mTouchSlop)) { Loading @@ -9141,12 +9150,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return false; } private void setHotspot(float x, float y) { if (mBackground != null) { mBackground.setHotspot(x, y); } } /** * @hide */ Loading Loading @@ -19761,6 +19764,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ final int[] mInvalidateChildLocation = new int[2]; /** * Global to the view hierarchy used as a temporary for dealng with * computing absolute on-screen location. */ final int[] mTmpLocation = new int[2]; /** * Global to the view hierarchy used as a temporary for dealing with core/java/android/widget/AbsSeekBar.java +16 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,22 @@ public abstract class AbsSeekBar extends ProgressBar { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); final Drawable progressDrawable = getProgressDrawable(); if (progressDrawable != null) { progressDrawable.setHotspot(x, y); } final Drawable thumb = mThumb; if (thumb != null) { thumb.setHotspot(x, y); } } @Override public void invalidateDrawable(Drawable dr) { super.invalidateDrawable(dr); Loading core/java/android/widget/CheckedTextView.java +10 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,16 @@ public class CheckedTextView extends TextView implements Checkable { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); if (mCheckMarkDrawable != null) { mCheckMarkDrawable.setHotspot(x, y); } } @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); Loading core/java/android/widget/CompoundButton.java +10 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,16 @@ public abstract class CompoundButton extends Button implements Checkable { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); if (mButtonDrawable != null) { mButtonDrawable.setHotspot(x, y); } } @Override protected boolean verifyDrawable(Drawable who) { return super.verifyDrawable(who) || who == mButtonDrawable; Loading core/java/android/widget/FrameLayout.java +10 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,16 @@ public class FrameLayout extends ViewGroup { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); if (mForeground != null) { mForeground.setHotspot(x, y); } } /** * Returns a set of layout parameters with a width of * {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}, Loading Loading
core/java/android/view/View.java +24 −16 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ import static java.lang.Math.max; import com.android.internal.R; import com.android.internal.util.Predicate; import com.android.internal.view.menu.MenuBuilder; import com.google.android.collect.Lists; import com.google.android.collect.Maps; Loading Loading @@ -4794,14 +4795,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param v previous or the next focus holder, or null if none */ private void manageFocusHotspot(boolean focused, View v) { if (mBackground == null) { return; } final Rect r = new Rect(); if (!focused && v != null) { v.getBoundsOnScreen(r); final int[] location = new int[2]; final int[] location = mAttachInfo.mTmpLocation; getLocationOnScreen(location); r.offset(-location[0], -location[1]); } else { Loading @@ -4810,8 +4807,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback, final float x = r.exactCenterX(); final float y = r.exactCenterY(); setDrawableHotspot(x, y); } /** * Sets the hotspot position for this View's drawables. * * @param x hotspot x coordinate * @param y hotspot y coordinate * @hide */ protected void setDrawableHotspot(float x, float y) { if (mBackground != null) { mBackground.setHotspot(x, y); } } /** * Request that a rectangle of this view be visible on the screen, Loading Loading @@ -6767,7 +6777,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void setPressed(boolean pressed, float x, float y) { if (pressed) { setHotspot(x, y); setDrawableHotspot(x, y); } setPressed(pressed); Loading Loading @@ -9106,8 +9116,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout()); } else { // Not inside a scrolling container, so show the feedback right away setHotspot(x, y); setPressed(true); setPressed(true, x, y); checkForLongClick(0); } break; Loading @@ -9119,7 +9128,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, break; case MotionEvent.ACTION_MOVE: setHotspot(x, y); setDrawableHotspot(x, y); // Be lenient about moving outside of buttons if (!pointInView(x, y, mTouchSlop)) { Loading @@ -9141,12 +9150,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return false; } private void setHotspot(float x, float y) { if (mBackground != null) { mBackground.setHotspot(x, y); } } /** * @hide */ Loading Loading @@ -19761,6 +19764,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ final int[] mInvalidateChildLocation = new int[2]; /** * Global to the view hierarchy used as a temporary for dealng with * computing absolute on-screen location. */ final int[] mTmpLocation = new int[2]; /** * Global to the view hierarchy used as a temporary for dealing with
core/java/android/widget/AbsSeekBar.java +16 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,22 @@ public abstract class AbsSeekBar extends ProgressBar { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); final Drawable progressDrawable = getProgressDrawable(); if (progressDrawable != null) { progressDrawable.setHotspot(x, y); } final Drawable thumb = mThumb; if (thumb != null) { thumb.setHotspot(x, y); } } @Override public void invalidateDrawable(Drawable dr) { super.invalidateDrawable(dr); Loading
core/java/android/widget/CheckedTextView.java +10 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,16 @@ public class CheckedTextView extends TextView implements Checkable { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); if (mCheckMarkDrawable != null) { mCheckMarkDrawable.setHotspot(x, y); } } @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); Loading
core/java/android/widget/CompoundButton.java +10 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,16 @@ public abstract class CompoundButton extends Button implements Checkable { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); if (mButtonDrawable != null) { mButtonDrawable.setHotspot(x, y); } } @Override protected boolean verifyDrawable(Drawable who) { return super.verifyDrawable(who) || who == mButtonDrawable; Loading
core/java/android/widget/FrameLayout.java +10 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,16 @@ public class FrameLayout extends ViewGroup { } } /** @hide */ @Override protected void setDrawableHotspot(float x, float y) { super.setDrawableHotspot(x, y); if (mForeground != null) { mForeground.setHotspot(x, y); } } /** * Returns a set of layout parameters with a width of * {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}, Loading