java.lang.Object | ||
↳ | android.view.View | |
↳ | com.htc.painting.penmenu15.PenMenu |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | PENSET_ALL | The supported pen set on Pen Menu: All. | |||||||||
int | PENSET_SIMPLE | The supported pen set on Pen Menu: Only simple pen (the default stroke type supported by Android) and eraser pen are supported. | |||||||||
int | STROKE_INVISIBLE | Constants for IPaintingView stroke visibility. | |||||||||
int | STROKE_VISIBLE | Constants for IPaintingView stroke visibility. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
plse use
onRestoreInstanceState(Bundle)
| |||||||||||
This method is deprecated.
plse use
onSaveInstanceState()
| |||||||||||
Called to switch the show/hide state of the PenMenu alternately.
| |||||||||||
Force to hide the strokes (lower the opacity to the predefined value) on painting view when the value of forceHide is set to true
or restore the original state of strokes when the value of forceHide is set to false.
| |||||||||||
Receive the key event passed by applications.
| |||||||||||
Hide PenMenu.
| |||||||||||
Called to let PenMenu do the cleanup, including the registered receiver and allocated resources
| |||||||||||
Callback for invoke on Activity#onOptionsMenuClosed or whatever hide the PenMenu
by previous
onMenuOpened() call. | |||||||||||
Callback for invoke on Activity#onMenuOpened or whatever would overlay with PenMenu
to hide the PenMenu.
| |||||||||||
Called to let PenMenu retrieve the previous saved state and settings.
| |||||||||||
Called to let PenMenu have chance to save current show/hide state and settings before being killed
so that the state and settings can be restored later.
| |||||||||||
Restore current pen settings and history pens settings if any.
| |||||||||||
Save current pen settings and history pens settings if any.
| |||||||||||
When the applications implement their own painting view and integrate with Pen Menu with different behaviors,
they can disable action buttons by calling this function.
| |||||||||||
Called to enable/disable the Eraser mode.
| |||||||||||
Used for registering one listener to Pen Menu.
| |||||||||||
Associate HtcPaintingView with PenMenu.
| |||||||||||
When applications implement their own painting view and integrate with HTC Pen Menu with limited pen set,
call this function to grey out the predefined pens enabled on the device.
| |||||||||||
Show PenMenu.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
The supported pen set on Pen Menu: All. It will enable all pens that can be used in HtcPaintingView
The supported pen set on Pen Menu: Only simple pen (the default stroke type supported by Android) and eraser pen are supported.
Constants for IPaintingView stroke visibility. The ID of stroke visibility: STROKE_INVISIBLE. Set stroke to lower opacity value.
Constants for IPaintingView stroke visibility. The ID of stroke visibility: STROKE_VISIBLE. Set stroke to original opacity value.
Called to switch the show/hide state of the PenMenu alternately.
Force to hide the strokes (lower the opacity to the predefined value) on painting view when the value of forceHide is set to true or restore the original state of strokes when the value of forceHide is set to false. This function is provided for integrated APPs when users want to interact with the contents behind the painting view. For example, users may press the lower hardware button of Pen to enable Text Selection function. The integrated APPs can call this function to hide on-screen strokes. It will provide a clear view to let users do Text Selection.
forceHide | true to hide the strokes, false to restore the original state of strokes. |
---|
Receive the key event passed by applications. If the Hardware Pen Button is pressed, PenMenu will then switch the show/hide state alternately.
keyCode | the key code. |
---|---|
event | the key event. |
Hide PenMenu. Client app can control whether to play animation by playAnimation parameter. And the turnOffStickyState parameter can control whether the sticky state should be forced to turn off. The sticky state is for controlling the behavior to restore PenMenu's previous show/hide state when it is hidden. If this flag is turned off, the PenMenu couldn't show itself.
playAnimation | true to play hiding animation, false to hide directly without animation. |
---|---|
turnOffStickyState | true to turn off stick state, false to keep sticky state unchanged. |
Called to let PenMenu do the cleanup, including the registered receiver and allocated resources
Callback for invoke on Activity#onOptionsMenuClosed or whatever hide the PenMenu
by previous onMenuOpened()
call. Client app should always call this method on
its Activity#onOptionsMenuClosed.
Note. The method should be called in pair with onMenuOpened()
Callback for invoke on Activity#onMenuOpened or whatever would overlay with PenMenu
to hide the PenMenu. Client app should always call this method on its Activity#onMenuOpened.
Note. The method should be called in pair with onMenuClosed()
Called to let PenMenu retrieve the previous saved state and settings. PenMenu will restore its state and settings after device orientation is changed.
bundle | Bundle in which to place your saved state. |
---|
Called to let PenMenu have chance to save current show/hide state and settings before being killed so that the state and settings can be restored later. PenMenu will keep its state and setting while device orientation is changed.
bundle | Bundle in which to place your saved state. |
---|
Restore current pen settings and history pens settings if any. This function is designed for the feature of global pens settings (share the same preferences between all pen integrated APPs). When the setting, using the same pen settings among all pen integrated APPs, is set to true. The integrated APPs is responsible to call this function before activities are back to foreground. Once this is called, PenMune module will then restore pen settings by using the global preferences. If the setting is set to false, called this function will restore pen settings by using the local preferences. The pen integrated activities should call this method at their Activity#onResume() method.
Save current pen settings and history pens settings if any. This function is designed for the feature of global pens settings (share the same preferences between all pen integrated APPs). When the setting, using the same pen settings among all pen integrated APPs, is set to true. The integrated APPs is responsible to call this function before activities switch to background. Once this is called, PenMune module will then save current pen preferences for the next foreground pen-integrated activity. If the setting is set to false, called this function will save pen settings in the local preference. The pen integrated activities should call this method at their Activity#onPause() method.
When the applications implement their own painting view and integrate with Pen Menu with different behaviors, they can disable action buttons by calling this function. For example, when the customized painting view doesn't support Clear All function, call this function to grey out Clear All button. Simply, pass the identification of action button and its new state.
actionId | the identification of action button to set. |
---|---|
active | the state of this button. True means to enable and False to grey out this button. |
Called to enable/disable the Eraser mode. When pressing the upper buttons on the H/W Pen and the its corresponding function is configured to Eraser, applications can call this function to enable Eraser mode and the size of Eraser mode will be the same as the current size of Eraser Pen. Once the button is released, call this function with false parameter to disable Eraser mode and restore pen to previous setting.
isEraserMode | true to enable eraser mode. false to disable eraser mode. |
---|
Used for registering one listener to Pen Menu. Once registered, when the action buttons on Pen Menu are tapped by pen, the application will receive notification. The current action buttons are listed below.
listener | The OnActionPerformListener object to register |
---|
Associate HtcPaintingView with PenMenu. Once the association is created, any user actions made on PenMenu will apply to Painting Engine, including Pen settings (stroke, size and color) and actions (redo, undo, clear all and set ink opacity)
paintingView | the painting view to be associated with PenMenu. |
---|
When applications implement their own painting view and integrate with HTC Pen Menu with limited pen set, call this function to grey out the predefined pens enabled on the device. Currently, only following pen set are supported for Pen Menu.
PENSET_ALL
PENSET_SIMPLE
penSetType | the pen set to be set. |
---|
Show PenMenu. Client app can control whether to play animation by playAnimation parameter. And the turnOnStickyState parameter can control whether the sticky state should be forced to turn on. The sticky state is for controlling the behavior to restore PenMenu's previous state when it is hidden. If this flag is turned off, the method has no effect.
playAnimation | playAnimation true to play showing animation, false to show directly without animation. |
---|---|
turnOnStickyState | true to turn on stick state, false to keep sticky state unchanged. |