public interface

KnowledgeViewAddition

com.salesforce.android.knowledge.ui.KnowledgeViewAddition

Class Overview

Interface for a factory that adds additional views to KnowledgeUI.

An instance of this interface may be passed to viewAddition(KnowledgeViewAddition) to add an addition to the user interface during the Knowledge UI session by, e.g. displaying an overlay or floating action button on one or more parts of the Knowledge UI.

The views create by this addition may be hidden or shown for different scenes within Knowledge UI, as determined by the visibleFor(KnowledgeScene) method. The view must be properly initialized to its hidden or shown state in initView(View, boolean), after which time the getEnterAnimator(View) and getExitAnimator(View) methods will be called at the needed times to hide and show the view.

Summary

Public Methods
abstract View createView(ViewGroup root, Context context)
Create the view that will be overlaid over the Knowledge UI.
abstract Animator getEnterAnimator(View view)
Create an animator that can be used to show the view.
abstract Animator getExitAnimator(View view)
Create an animator that can be used to hide to view.
abstract void initView(View view, boolean visible)
Initialize the view returned from createView(ViewGroup, Context).
abstract boolean visibleFor(KnowledgeScene scene)
Return true if this addition should be made visible for the given KnowledgeScene.

Public Methods

public abstract View createView (ViewGroup root, Context context)

Create the view that will be overlaid over the Knowledge UI. The returned view will be added as a new content view on the Knowledge Activity.

Parameters
root A ViewGroup that may be used with android.view.LayoutInflater to inflate a layout file to construct the view. Note that the view should not be attached to this ViewGroup during inflation: use the inflate(int, ViewGroup, boolean) method overload with a false third argument.
context A convenience Context which may be used when constructing the View.
Returns
  • The created view.

public abstract Animator getEnterAnimator (View view)

Create an animator that can be used to show the view. The animator should not be started by this method.

Parameters
view The view to animate. This is the same view instance returned from createView(ViewGroup, Context).
Returns
  • An animator which will animate the view entering onto the screen.

public abstract Animator getExitAnimator (View view)

Create an animator that can be used to hide to view. The animator should not be started by this method.

Parameters
view The view to animate. This is the same view instance returned from createView(ViewGroup, Context).
Returns
  • An animator which will animate the view leaving the screen.

public abstract void initView (View view, boolean visible)

Initialize the view returned from createView(ViewGroup, Context). The visible parameter indicates whether the view should be initialized to a visible or a hidden state, as determined by the visibleFor(KnowledgeScene) method.

Parameters
view The view to initialize. This is the same view instance returned from createView(ViewGroup, Context).
visible If true the view should be initialized to a visible state, otherwise the view should be initialized to its hidden state.

public abstract boolean visibleFor (KnowledgeScene scene)

Return true if this addition should be made visible for the given KnowledgeScene.

Parameters
scene The scene being shown.
Returns
  • True if this addition should be shown.