public class PhoneArithmetics extends AbstractArithmetics
TabSwitcher's tabs, when using the smartphone layout.Arithmetics.Axis| Constructor and Description |
|---|
PhoneArithmetics(TabSwitcher tabSwitcher)
Creates a new class, which provides methods, which allow to calculate the position, size and
rotation of a
TabSwitcher's tabs, when using the smartphone layout. |
| Modifier and Type | Method and Description |
|---|---|
void |
animatePosition(Arithmetics.Axis axis,
android.view.ViewPropertyAnimator animator,
AbstractItem item,
float position,
boolean includePadding)
Animates the position of an item on a specific axis.
|
void |
animateRotation(Arithmetics.Axis axis,
android.view.ViewPropertyAnimator animator,
float angle)
Animates the rotation of an item on a specific axis.
|
void |
animateScale(Arithmetics.Axis axis,
android.view.ViewPropertyAnimator animator,
float scale)
Animates the scale of an item on a specific axis.
|
float |
getPivot(Arithmetics.Axis axis,
AbstractItem item,
AbstractDragTabsEventHandler.DragState dragState)
Returns the pivot of an item on a specific axis, depending on the current drag state.
|
float |
getPosition(Arithmetics.Axis axis,
AbstractItem item)
Returns the position of a specific item on a specific axis.
|
float |
getRotation(Arithmetics.Axis axis,
AbstractItem item)
Returns the rotation of an item on a specific axis.
|
float |
getScale(AbstractItem item,
boolean includePadding)
Returns the scale of an item, depending on its margin.
|
float |
getSize(Arithmetics.Axis axis,
AbstractItem item)
Returns the size of an item on a specific axis.
|
float |
getTabContainerSize(Arithmetics.Axis axis,
boolean includePadding)
Returns the size of the container, which contains the tab switcher's tabs, on a specific
axis.
|
int |
getTabSwitcherPadding(Arithmetics.Axis axis,
int gravity)
Returns the padding of the tab switcher on a specific axis and using a specific gravity.
|
float |
getTouchPosition(Arithmetics.Axis axis,
android.view.MotionEvent event)
Returns the position of a touch event on a specific axis.
|
void |
setPivot(Arithmetics.Axis axis,
AbstractItem item,
float pivot)
Sets the pivot of an item on a specific axis.
|
void |
setPosition(Arithmetics.Axis axis,
AbstractItem item,
float position)
Sets the position of an item on a specific axis.
|
void |
setRotation(Arithmetics.Axis axis,
AbstractItem item,
float angle)
Sets the rotation of an item on a specific axis.
|
void |
setScale(Arithmetics.Axis axis,
AbstractItem item,
float scale)
Sets the scale of an item on a specific axis.
|
animatePosition, getScale, getTabContainerSize, getTabSwitcherpublic PhoneArithmetics(TabSwitcher tabSwitcher)
TabSwitcher's tabs, when using the smartphone layout.tabSwitcher - The tab switcher, the arithmetics should be calculated for, as an instance of the
class TabSwitcher. The tab switcher may not be nullpublic final int getTabSwitcherPadding(Arithmetics.Axis axis, int gravity)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullgravity - The gravity as an Integer value. The gravity must be
Gravity.START or Gravity.ENDInteger valuepublic final float getTabContainerSize(Arithmetics.Axis axis, boolean includePadding)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullincludePadding - True, if the padding and the size of the toolbars should be included, false
otherwiseFloat valuepublic final float getTouchPosition(Arithmetics.Axis axis, android.view.MotionEvent event)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullevent - The touch event, whose position should be returned, as an instance of the class
MotionEvent. The motion event may not be nullFloat valuepublic final float getPosition(Arithmetics.Axis axis, AbstractItem item)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose position should be returned, as an instance of the class AbstractItem. The item may not be nullFloat valuepublic final void setPosition(Arithmetics.Axis axis, AbstractItem item, float position)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose position should be set, as an instance of the class AbstractItem. The item may not be nullposition - The position, which should be set, as a Float valuepublic final void animatePosition(Arithmetics.Axis axis, android.view.ViewPropertyAnimator animator, AbstractItem item, float position, boolean includePadding)
Arithmeticsaxis - 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 valueincludePadding - True, if the item's padding should be taken into account, false otherwisepublic final float getScale(AbstractItem item, boolean includePadding)
Arithmeticsitem - The item, whose scale should be returned, as an instance of the class AbstractItem. The item may not be nullincludePadding - True, if the item's padding should be taken into account as well, false otherwiseFloat valuepublic final void setScale(Arithmetics.Axis axis, AbstractItem item, float scale)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose scale should be set, as an instance of the class AbstractItem. The item may not be nullscale - The scale, which should be set, as a Float valuepublic final void animateScale(Arithmetics.Axis axis, android.view.ViewPropertyAnimator animator, float scale)
Arithmeticsaxis - 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 scale, as an instance of the class
ViewPropertyAnimator. The animator may not be nullscale - The scale, which should be set by the animation, as a Float valuepublic final float getSize(Arithmetics.Axis axis, AbstractItem item)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose size should be returned, as an instance of the class AbstractItem. The item may not be nullFloat valuepublic final float getPivot(Arithmetics.Axis axis, AbstractItem item, AbstractDragTabsEventHandler.DragState dragState)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose pivot should be returned, as an instance of the class AbstractItem. The item may not be nulldragState - The current drag state as a value of the enum AbstractDragTabsEventHandler.DragState. The drag state may
not be nullFloat valuepublic final void setPivot(Arithmetics.Axis axis, AbstractItem item, float pivot)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose pivot should be set, as an instance of the class View. The
item may not be nullpivot - The pivot, which should be set, as a Float valuepublic final float getRotation(Arithmetics.Axis axis, AbstractItem item)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose rotation should be returned, as an instance of the class AbstractItem. The item may not be nullFloat valuepublic final void setRotation(Arithmetics.Axis axis, AbstractItem item, float angle)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullitem - The item, whose rotation should be set, as an instance of the class AbstractItem. The item may not be nullangle - The rotation, which should be set, as a Float valuepublic final void animateRotation(Arithmetics.Axis axis, android.view.ViewPropertyAnimator animator, float angle)
Arithmeticsaxis - The axis as a value of the enum Arithmetics.Axis. The axis may not be nullanimator - The animator, should be used to animate the rotation, as an instance of the class
ViewPropertyAnimator. The animator may not be nullangle - The rotation, which should be set by the animation, as a Float value