public abstract class AbstractArithmetics extends java.lang.Object implements Arithmetics
TabSwitcher
's tabs.Arithmetics.Axis
Constructor and Description |
---|
AbstractArithmetics(TabSwitcher tabSwitcher)
Creates a new class, which provides methods, which allow to calculate the position, size and
rotation of a
TabSwitcher 's tabs. |
Modifier and Type | Method and Description |
---|---|
void |
animatePosition(Arithmetics.Axis axis,
android.view.ViewPropertyAnimator animator,
AbstractItem item,
float position)
Animates the position of an item on a specific axis.
|
float |
getScale(AbstractItem item)
Returns the scale of an item, depending on its margin.
|
float |
getTabContainerSize(Arithmetics.Axis axis)
Returns the size of the container, which contains the tab switcher's tabs, on a specific
axis.
|
protected TabSwitcher |
getTabSwitcher()
Returns the tab switcher, the arithmetics are calculated for.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
animatePosition, animateRotation, animateScale, getPivot, getPosition, getRotation, getScale, getSize, getTabContainerSize, getTabSwitcherPadding, getTouchPosition, setPivot, setPosition, setRotation, setScale
public AbstractArithmetics(@NonNull TabSwitcher tabSwitcher)
TabSwitcher
's tabs.tabSwitcher
- The tab switcher, the arithmetics should be calculated for, as an instance of the
class TabSwitcher
. The tab switcher may not be null@NonNull protected final TabSwitcher getTabSwitcher()
TabSwitcher
. The tab switcher may not be nullpublic final float getTabContainerSize(@NonNull Arithmetics.Axis axis)
Arithmetics
getTabContainerSize
in interface Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullFloat
valuepublic final void animatePosition(@NonNull Arithmetics.Axis axis, @NonNull android.view.ViewPropertyAnimator animator, @NonNull AbstractItem item, float position)
Arithmetics
animatePosition
in interface Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the position, as an instance of the
class ViewPropertyAnimator
. The animator may not be nullitem
- The item, whose position should be animated, as an instance of the class View
. The view may not be nullposition
- The position, which should be set by the animation, as a Float
valuepublic final float getScale(@NonNull AbstractItem item)
Arithmetics
getScale
in interface Arithmetics
item
- The item, whose scale should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
value