@Test public void getIconSize_returns_correct_size() { assertEquals(10, PhialButton.getIconSize(10, -1)); assertEquals(10, PhialButton.getIconSize(10, 20)); }
@VisibleForTesting static int getIconSize(int maxSize, int intrinsicSize) { if (intrinsicSize == -1 || intrinsicSize > maxSize) { return maxSize; } return intrinsicSize; }
PhialButton extends View { @VisibleForTesting static int getIconSize(int maxSize, int intrinsicSize) { if (intrinsicSize == -1 || intrinsicSize > maxSize) { return maxSize; } return intrinsicSize; } }
PhialButton extends View { @VisibleForTesting static int getIconSize(int maxSize, int intrinsicSize) { if (intrinsicSize == -1 || intrinsicSize > maxSize) { return maxSize; } return intrinsicSize; } PhialButton(Context context);  PhialButton(Context context, @Nullable AttributeSet attrs);  PhialButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr); }
PhialButton extends View { @VisibleForTesting static int getIconSize(int maxSize, int intrinsicSize) { if (intrinsicSize == -1 || intrinsicSize > maxSize) { return maxSize; } return intrinsicSize; } PhialButton(Context context);  PhialButton(Context context, @Nullable AttributeSet attrs);  PhialButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr); void setIcon(Drawable drawable); void setIcon(Bitmap bitmap); Drawable getIcon(); void setIcon(@DrawableRes int iconId); void setSuggestedSize(int size); void setShadowSize(int size); @ColorInt int getBackgroundColor(); @ColorInt int getIconColor(); int getShadowColor(); int getShadowSize(); int getSuggestedSize(); }
PhialButton extends View { @VisibleForTesting static int getIconSize(int maxSize, int intrinsicSize) { if (intrinsicSize == -1 || intrinsicSize > maxSize) { return maxSize; } return intrinsicSize; } PhialButton(Context context);  PhialButton(Context context, @Nullable AttributeSet attrs);  PhialButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr); void setIcon(Drawable drawable); void setIcon(Bitmap bitmap); Drawable getIcon(); void setIcon(@DrawableRes int iconId); void setSuggestedSize(int size); void setShadowSize(int size); @ColorInt int getBackgroundColor(); @ColorInt int getIconColor(); int getShadowColor(); int getShadowSize(); int getSuggestedSize();  }