com.samsung.android.sdk.look.airbutton
Class SlookAirButton
- java.lang.Object
-
- com.samsung.android.sdk.look.airbutton.SlookAirButton
-
public class SlookAirButton extends java.lang.Object
This class is SlookAirButton.
This class is needed for AirButton in SDK.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
SlookAirButton.ItemSelectListener
This is a listener to handle event regarding item selecting.
-
Field Summary
Fields Modifier and Type Field and Description static int
DIRECTION_AUTO
Auto direction of AirButton.static int
DIRECTION_LEFT
Left direction of AirButton.static int
DIRECTION_LOWER
Lower direction of AirButton.static int
DIRECTION_RIGHT
Right direction of AirButton.static int
DIRECTION_UPPER
Upper direction of AirButton.static int
GRAVITY_AUTO
Auto gravity of AirButton.static int
GRAVITY_BOTTOM
Bottom gravity of AirButton.static int
GRAVITY_HOVER_POINT
Gravity which base on the location of hover point of AirButton.static int
GRAVITY_LEFT
Left gravity of AirButton.static int
GRAVITY_RIGHT
Right gravity of AirButton.static int
GRAVITY_TOP
Top gravity of AirButton.static int
UI_TYPE_LIST
UI display type list.static int
UI_TYPE_MENU
UI display type menu.
-
Constructor Summary
Constructors Constructor and Description SlookAirButton(android.view.View parentView, SlookAirButtonAdapter adapter, int uiType)
This is constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
dismiss()
Dismiss the AirButton.int
getDirection()
Get direction of items.int
getGravity()
Get gravity.void
hide()
Hide the AirButton.boolean
isAutoControlEnabled()
Check the auto control enabled.boolean
isBounceEffectEnabled()
Check the BounceEffect is enable or not.boolean
isScrollEnabled()
Check the scrolling is enable or not.void
moveAnimationIcon(android.view.MotionEvent event)
Move animation icon with ACTION_HOVER_MOVE when auto control is disabled.void
setAutoControlEnabled(boolean enable)
Set auto control enable or disable of AirButton widget.void
setBounceEffectEnabled(boolean enable)
Set bounce effect.void
setDirection(int direction)
Set display direction of items.void
setGravity(int gravity)
Set gravity.void
setItemSelectListener(SlookAirButton.ItemSelectListener listener)
Set ItemSelectListener.void
setPosition(int x, int y)
Set position of AirButton.void
setScrollEnabled(boolean enable)
Set scrolling.void
show(android.view.MotionEvent event)
Show airbutton with BUTTON_SECONDARY when auto control is disabled.void
startAnimationIcon(android.view.MotionEvent event)
Starts animation icon with ACTION_HOVER_ENTER when auto control is disabled.void
stopAnimationIcon(android.view.MotionEvent event)
Stop animation icon with ACTION_HOVER_EXIT when auto control is disabled.
-
-
-
Field Detail
-
UI_TYPE_MENU
public static final int UI_TYPE_MENU
UI display type menu. It cannot scrollable and has (drawable) or (drawable and text). And display with horizontal direction. Using 32dp*32dp drawable is recommanded if not the drawable is scaled by scaleType = "centerInside" [NOTE] *Because of a concept change, 'Menu List"(UI_TYPE_MENU) AirButton is not supported for Note 4 and Note Edge. See sample APK. (3.AirButton > 1.Simple > Menu, 3.AirButton > 3.SurfaceView, 3.AirButton > 4.SurfaceView-Manual) *For Note 4 and Note Edge, opening the 'Menu List'(UI_TYPE_MENU) was changed from pressing the 'sidekey' to 'hovering' for improed usability.- See Also:
- Constant Field Values
-
UI_TYPE_LIST
public static final int UI_TYPE_LIST
UI display type list. User can scroll and flick. It displays vertical direction.- See Also:
- Constant Field Values
-
GRAVITY_AUTO
public static final int GRAVITY_AUTO
Auto gravity of AirButton. It will set display gravity automatically based on the position of hovered view.- See Also:
- Constant Field Values
-
GRAVITY_TOP
public static final int GRAVITY_TOP
Top gravity of AirButton. It will display TOP of hovered view.- See Also:
- Constant Field Values
-
GRAVITY_BOTTOM
public static final int GRAVITY_BOTTOM
Bottom gravity of AirButton. It will display BOTTOM of hovered view.- See Also:
- Constant Field Values
-
GRAVITY_LEFT
public static final int GRAVITY_LEFT
Left gravity of AirButton. It will display LEFT of hovered view.- See Also:
- Constant Field Values
-
GRAVITY_RIGHT
public static final int GRAVITY_RIGHT
Right gravity of AirButton. It will display RIGHT of hovered view.- See Also:
- Constant Field Values
-
GRAVITY_HOVER_POINT
public static final int GRAVITY_HOVER_POINT
Gravity which base on the location of hover point of AirButton. The base position will based on the hover point.- See Also:
- Constant Field Values
-
DIRECTION_AUTO
public static final int DIRECTION_AUTO
Auto direction of AirButton. It will set display direction automatically based on the position of hovered view.- See Also:
- Constant Field Values
-
DIRECTION_UPPER
public static final int DIRECTION_UPPER
Upper direction of AirButton. It will displays UPPER direction based on first item position.- See Also:
- Constant Field Values
-
DIRECTION_LOWER
public static final int DIRECTION_LOWER
Lower direction of AirButton. It will displays LOWER direction based on first item position.- See Also:
- Constant Field Values
-
DIRECTION_LEFT
public static final int DIRECTION_LEFT
Left direction of AirButton. It will displays LEFT direction based on first item position.- See Also:
- Constant Field Values
-
DIRECTION_RIGHT
public static final int DIRECTION_RIGHT
Right direction of AirButton. It will displays RIGHT direction based on first item position.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SlookAirButton
public SlookAirButton(android.view.View parentView, SlookAirButtonAdapter adapter, int uiType)
This is constructor.- Parameters:
parentView
- parentview is view which can be drawed airbutton.adapter
- adapter is medium between airbutton and data.uiType
- this integer means UItype.- Since:
- 1.0.0
-
-
Method Detail
-
setItemSelectListener
public void setItemSelectListener(SlookAirButton.ItemSelectListener listener)
Set ItemSelectListener. Add the Listener which can know item is selected or not.- Parameters:
listener
- ItemSelectedListener reference. This method is called by selecting item.- Since:
- 1.0.0
-
setGravity
public void setGravity(int gravity)
Set gravity. It is widget position based on the hovered view.- Parameters:
gravity
- It is set for widget position.- Since:
- 1.0.0
-
getGravity
public int getGravity()
Get gravity.- Returns:
- Current gravity.
- Since:
- 1.0.0
-
setDirection
public void setDirection(int direction)
Set display direction of items. It displays based on the position of first view.- Parameters:
direction
- Direction what you want to locate items. limitation:with UI_TYPE_MENU: Do not use this function. with UI_TYPE_LIST: you can use only DIRECTION_UPPER/LOWER/AUTO The direction is changed by policy if the gravity is wrong.- Since:
- 1.0.0
-
getDirection
public int getDirection()
Get direction of items.- Returns:
- Current direction.
- Since:
- 1.0.0
-
setPosition
public void setPosition(int x, int y)
Set position of AirButton. It is not absolute value. It based on hovered view.- Parameters:
x
- X position based on hovered view.y
- Y position based on hovered view.- Since:
- 1.0.0
-
setScrollEnabled
public void setScrollEnabled(boolean enable)
Set scrolling. If Button Type is UI_TYPE_MENU, Scroll is not worked. Basically it is "true" for List type AirButton.- Parameters:
enabled
- true : if you want to enable scrolling. false : if you want to disable scrolling.- Since:
- 1.0.0
-
isScrollEnabled
public boolean isScrollEnabled()
Check the scrolling is enable or not.- Returns:
- This AirButton has scrolling function or not. If scrolling of airbutton widget is enabled, return TRUE, otherwise false.
- Since:
- 1.0.0
-
setBounceEffectEnabled
public void setBounceEffectEnabled(boolean enable)
Set bounce effect. Basically it is "false" for all widget display types.- Parameters:
Enabled
- true : if you want to enable bounce effect. false : if you want to disable bounce effect.- Since:
- 1.0.0
-
isBounceEffectEnabled
public boolean isBounceEffectEnabled()
Check the BounceEffect is enable or not.- Returns:
- This AirButton has bounce effect or not. If BounceEffect widget is enabled, return TRUE, otherwise false
- Since:
- 1.0.0
-
hide
public void hide()
Hide the AirButton.- Since:
- 1.0.0
-
dismiss
public void dismiss()
Dismiss the AirButton. It will clear all variables.- Since:
- 1.0.0
-
setAutoControlEnabled
public void setAutoControlEnabled(boolean enable)
Set auto control enable or disable of AirButton widget. If you set as false, AirButton and animation icon will not be shown by hover event.- Parameters:
enable
- is true or false for setting AutoControl.- Since:
- 1.0.0
-
isAutoControlEnabled
public boolean isAutoControlEnabled()
Check the auto control enabled.- Returns:
- AirButton widget is enabled or not. If airbutton widget is enabled, return TRUE, otherwise false.
- Since:
- 1.0.0
-
startAnimationIcon
public void startAnimationIcon(android.view.MotionEvent event)
Starts animation icon with ACTION_HOVER_ENTER when auto control is disabled.- Parameters:
event
- is Touchevent when user touches the device screen.- Since:
- 1.0.0
- See Also:
setAutoControlEnabled
-
moveAnimationIcon
public void moveAnimationIcon(android.view.MotionEvent event)
Move animation icon with ACTION_HOVER_MOVE when auto control is disabled.- Parameters:
event
- is Touchevent when user touches the device screen.- Since:
- 1.0.0
- See Also:
setAutoControlEnabled
-
stopAnimationIcon
public void stopAnimationIcon(android.view.MotionEvent event)
Stop animation icon with ACTION_HOVER_EXIT when auto control is disabled.- Parameters:
event
- is Touchevent when user touches the device screen.- Since:
- 1.0.0
- See Also:
setAutoControlEnabled
-
show
public void show(android.view.MotionEvent event)
Show airbutton with BUTTON_SECONDARY when auto control is disabled.- Parameters:
event
- is Touchevent when user touches the device screen.- Since:
- 1.0.0
- See Also:
setAutoControlEnabled
-
-