public class

SliderFormCell

extends LinearLayout
implements FormCell<T> InlineValidation SupportsKey
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.sap.cloud.mobile.fiori.formcell.SliderFormCell

Class Overview

Customized Seekbar control which contains TextView and a Seekbar. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys between the specified minimum and maximum value

Structure of the control :

  • TextView : showing the text to be displayed for label of the control See also : setKey(CharSequence)
  • TextView : showing the value string of the control See also: setDisplayValue(CharSequence)
  • TextView :Showing the minimum value of the seekbar See Also :setMinimumValue(int)
  • TextView: Showing the maximum value of the seekbar See Also :setMaximumValue(int)
  • SeekBar: Seekbar with the current progress See Also: setValue(Integer)
  • Summary

    XML Attributes
    Attribute Name Related Method Description
    android:clickable setClickable(boolean)  
    android:focusable setFocusable(boolean)  
    com.sap.cloud.mobile.fiori:errorEnabled isErrorEnabled() Whether the layout is laid out as if an error will be displayed. 
    com.sap.cloud.mobile.fiori:helperEnabled isHelperEnabled()  
    com.sap.cloud.mobile.fiori:helperText setHelperText(CharSequence)  
    com.sap.cloud.mobile.fiori:helperTextTextAppearance setHelperTextAppearance(int)  
    com.sap.cloud.mobile.fiori:key  
    com.sap.cloud.mobile.fiori:label setLabel(CharSequence)  
    com.sap.cloud.mobile.fiori:labelEnabled isLabelEnabled()  
    com.sap.cloud.mobile.fiori:labelTextAppearance setLabelTextAppearanceFocused(int)  
    com.sap.cloud.mobile.fiori:labelTextAppearanceFocused setLabelTextAppearanceFocused(int)  
    com.sap.cloud.mobile.fiori:labelTextAppearanceUnFocused setLabelTextAppearanceFocused(int)  
    com.sap.cloud.mobile.fiori:maximumValue  
    com.sap.cloud.mobile.fiori:minimumValue  
    com.sap.cloud.mobile.fiori:value  
    [Expand]
    Inherited Constants
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    Fields
    protected CharSequence mErrorMessage
    protected int mErrorTextAppearance
    protected CharSequence mHelperText
    protected int mHelperTextAppearance
    protected int mHorizontalMargin
    protected boolean mIsInError
    protected boolean mIsTablet
    protected int mLabelTextAppearance
    protected int mLabelTextAppearanceUnFocused
    protected TextView mLabelTextView
    protected boolean mShouldAttachOrientationListener
    protected TextView mStatusView
    [Expand]
    Inherited Fields
    From class android.view.View
    Public Constructors
    SliderFormCell(Context context)
    SliderFormCell(Context context, AttributeSet attrs)
    SliderFormCell(Context context, AttributeSet attrs, int defStyleAttr)
    SliderFormCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
    Public Methods
    void addView(View child, int index, ViewGroup.LayoutParams params)
    Add given view in the view
    int getCellType()
    Return the type of the filter control being used.
    CellValueChangeListener<Integer> getCellValueChangeListener()
    Return the value change handler of the control
    CharSequence getDisplayValue()
    TextView getDisplayValueView()
    TextView getEndLabelView()
    CharSequence getError()
    Get the error
    TextView getErrorView()
    CharSequence getKey()
    Return the label of the property of control
    TextView getKeyView()
    int getMaximumValue()
    int getMinimumValue()
    SeekBar getSeekbar()
    TextView getStartLabelView()
    Integer getValue()
    Return the value of the property of the control
    boolean isEditable()
    Returns if the control is enabled or not to modify values.
    boolean isErrorEnabled()
    Is error enabled on the view
    boolean isHelperEnabled()
    Set if the helper field is enabled on the view
    boolean isLabelEnabled()
    Is the label field on the view is enabled
    void setCellValueChangeListener(CellValueChangeListener<Integer> listener)
    void setClickable(boolean clickable)
    Enable or disable clickable property on the view and all its children
    void setDisplayValue(CharSequence displayValue)
    void setDisplayValueEnabled(boolean isEnabled)
    void setDisplayValueTextAppearance(int resId)
    void setEditable(boolean isEditable)
    Set if the control is enabled or not to modify value of the control.
    void setEnabled(boolean enabled)
    Enable or disable the view
    void setEndLabelBackground(int res)
    void setEndLabelBackground(Drawable res)
    void setEndLabelEditControl(boolean enabled)
    void setEndLabelEms(int ems)
    void setEndLabelEnabled(boolean isEnabled)
    void setEndLabelGravity(int endLabelGravity)
    void setEndLabelIcon(int icon)
    void setEndLabelText(CharSequence endLabelText)
    void setEndLabelTextAppearance(int resId)
    void setError(CharSequence error)
    Set the error on the view.
    void setErrorEnabled(boolean errorEnabled)
    Enable error text on view
    void setErrorTextAppearance(int resId)
    Set the text appearance on the error
    void setFocusable(boolean focusable)
    Enable or disable focusable property on the view and all its children
    void setHelperEnabled(boolean enabled)
    Enable or disable the helper field on the view
    void setKey(CharSequence keyName)
    Set the label for property of the control
    void setKeyTextAppearance(int resId)
    void setLabelTextAppearanceUnFocused(int labelTextAppearanceUnFocused)
    Set the label text appearance when the view is not focused
    void setMaximumValue(int maximumValue)
    void setMinimumValue(int minimumValue)
    Set the minimum value of the Seekbar
    void setOverrideKeyStyle(boolean overrideKeyStyle)
    Override the Key styling manually.
    void setOverrideStatusStyle(boolean overrideStatusStyle)
    Override the status i.e.
    void setProgressBackgroundTintList(ColorStateList colorStateList)
    void setProgressTintList(ColorStateList colorStateList)
    void setShouldAttachOrientationListener(boolean shouldAttach)
    Determines if an OrientationEventListener should be attached.
    void setStartLabelEms(int ems)
    void setStartLabelEnabled(boolean isEnabled)
    void setStartLabelIcon(int icon)
    void setStartLabelSingleLine(boolean singleLine)
    void setStartLabelText(CharSequence startLabelText)
    void setStartLabelTextAppearance(int resId)
    void setThumbTintList(ColorStateList colorStateList)
    void setTickMark(Drawable tickMark)
    Set the tick mark on the slider formcell
    void setValue(Integer value)
    Protected Methods
    void adjustMargins()
    Calculate and set the margins for the cell's elements.
    static boolean arrayContains(int[] array, int value)
    Check if the array contains the given property
    void drawableStateChanged()
    Drawable state changed
    TextView generateTextView()
    Generate the text view
    ViewGroup.LayoutParams getDefaultLayoutParams()
    CharSequence getHelperText()
    Get the helper text from the view
    CharSequence getLabel()
    Get the label on the view
    void onRestoreInstanceState(Parcelable state)
    Parcelable onSaveInstanceState()
    void replaceStatusView()
    Each time you add a new view, error/helper view has to be adjusted to be the last view in the layout
    void setHelperText(CharSequence helper)
    Set the helper text on the view
    void setHelperTextAppearance(int helperTextAppearance)
    Set the helper text appearance
    void setKeyEnabled(boolean labelEnabled)
    void setLabel(CharSequence key)
    Set the label on the view
    void setLabelEnabled(boolean keyEnabled)
    Enable or disable the label field on the view
    void setLabelTextAppearance(int textAppearance)
    Set the text appearance on the label.
    void setLabelTextAppearanceFocused(int textAppearance)
    Set the text appearance on the label when the view is not focused
    void setLabelTextColorError(ColorStateList color)
    Set the text color of the label for error mode
    void setLabelTextColorFocused(ColorStateList color)
    Set the color of label when the view is focused
    void setLabelTextColorUnFocused(ColorStateList color)
    Set the color of label when the view is not focused
    boolean setupErrorHelperView()
    Setup the error/helper field on the view
    boolean setupLabelView()
    Setup the label view on the view
    boolean shouldLayout(View v)
    Should layout the given view
    [Expand]
    Inherited Methods
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    From class java.lang.Object
    From interface android.graphics.drawable.Drawable.Callback
    From interface android.view.KeyEvent.Callback
    From interface android.view.ViewManager
    From interface android.view.ViewParent
    From interface android.view.accessibility.AccessibilityEventSource
    From interface com.sap.cloud.mobile.fiori.formcell.FormCell
    From interface com.sap.cloud.mobile.fiori.formcell.InlineValidation
    From interface com.sap.cloud.mobile.fiori.formcell.SupportsKey

    XML Attributes

    android:clickable

    Related Methods

    android:focusable

    Related Methods

    com.sap.cloud.mobile.fiori:errorEnabled

    Whether the layout is laid out as if an error will be displayed.

    May be a boolean value, such as "true" or "false".

    Related Methods

    com.sap.cloud.mobile.fiori:helperEnabled

    Related Methods

    com.sap.cloud.mobile.fiori:helperText

    Related Methods

    com.sap.cloud.mobile.fiori:helperTextTextAppearance

    com.sap.cloud.mobile.fiori:key

    Related Methods

    com.sap.cloud.mobile.fiori:label

    Related Methods

    com.sap.cloud.mobile.fiori:labelEnabled

    Related Methods

    com.sap.cloud.mobile.fiori:labelTextAppearance

    com.sap.cloud.mobile.fiori:labelTextAppearanceFocused

    com.sap.cloud.mobile.fiori:labelTextAppearanceUnFocused

    com.sap.cloud.mobile.fiori:maximumValue

    Related Methods

    com.sap.cloud.mobile.fiori:minimumValue

    Related Methods

    com.sap.cloud.mobile.fiori:value

    Related Methods

    Fields

    protected CharSequence mErrorMessage

    protected int mErrorTextAppearance

    protected CharSequence mHelperText

    protected int mHelperTextAppearance

    protected int mHorizontalMargin

    protected boolean mIsInError

    protected boolean mIsTablet

    protected int mLabelTextAppearance

    protected int mLabelTextAppearanceUnFocused

    protected TextView mLabelTextView

    protected boolean mShouldAttachOrientationListener

    protected TextView mStatusView

    Public Constructors

    public SliderFormCell (Context context)

    public SliderFormCell (Context context, AttributeSet attrs)

    public SliderFormCell (Context context, AttributeSet attrs, int defStyleAttr)

    public SliderFormCell (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

    Public Methods

    public void addView (View child, int index, ViewGroup.LayoutParams params)

    Add given view in the view

    Parameters
    child View
    index position at which the view has to be added
    params ViewGroup.LayoutParams

    public int getCellType ()

    Return the type of the filter control being used.

    Returns
    • WidgetType type of the control

    public CellValueChangeListener<Integer> getCellValueChangeListener ()

    Return the value change handler of the control

    Returns
    • OnCellChangeListener - value change listener of the control

    public CharSequence getDisplayValue ()

    public TextView getDisplayValueView ()

    public TextView getEndLabelView ()

    public CharSequence getError ()

    Get the error

    Returns
    • CharSequence

    public TextView getErrorView ()

    public CharSequence getKey ()

    Return the label of the property of control

    Returns
    • CharSequence keyName

    public TextView getKeyView ()

    public int getMaximumValue ()

    public int getMinimumValue ()

    public SeekBar getSeekbar ()

    public TextView getStartLabelView ()

    public Integer getValue ()

    Return the value of the property of the control

    Returns
    • T - value of the property

    public boolean isEditable ()

    Returns if the control is enabled or not to modify values.

    Returns
    • Boolean user is allowed to modify the value of the control

    public boolean isErrorEnabled ()

    Is error enabled on the view

    Returns
    • boolean

    public boolean isHelperEnabled ()

    Set if the helper field is enabled on the view

    Returns
    • boolean

    public boolean isLabelEnabled ()

    Is the label field on the view is enabled

    Returns
    • boolean

    public void setCellValueChangeListener (CellValueChangeListener<Integer> listener)

    public void setClickable (boolean clickable)

    Enable or disable clickable property on the view and all its children

    Related XML Attributes
    Parameters
    clickable boolean

    public void setDisplayValue (CharSequence displayValue)

    public void setDisplayValueEnabled (boolean isEnabled)

    public void setDisplayValueTextAppearance (int resId)

    public void setEditable (boolean isEditable)

    Set if the control is enabled or not to modify value of the control. In readOnly mode, however, the text labels and text values will be selectable. By default, the control will be editable( user can modify value of the control)

    Parameters
    isEditable Boolean

    public void setEnabled (boolean enabled)

    Enable or disable the view

    Parameters
    enabled boolean

    public void setEndLabelBackground (int res)

    public void setEndLabelBackground (Drawable res)

    public void setEndLabelEditControl (boolean enabled)

    public void setEndLabelEms (int ems)

    public void setEndLabelEnabled (boolean isEnabled)

    public void setEndLabelGravity (int endLabelGravity)

    public void setEndLabelIcon (int icon)

    public void setEndLabelText (CharSequence endLabelText)

    public void setEndLabelTextAppearance (int resId)

    public void setError (CharSequence error)

    Set the error on the view. If the view is not error enabled then this API does not take any effect.

    Parameters
    error CharSequence

    public void setErrorEnabled (boolean errorEnabled)

    Enable error text on view

    Parameters
    errorEnabled boolean

    public void setErrorTextAppearance (int resId)

    Set the text appearance on the error

    Parameters
    resId style resource

    public void setFocusable (boolean focusable)

    Enable or disable focusable property on the view and all its children

    Related XML Attributes
    Parameters
    focusable boolean

    public void setHelperEnabled (boolean enabled)

    Enable or disable the helper field on the view

    Parameters
    enabled boolean

    public void setKey (CharSequence keyName)

    Set the label for property of the control

    Parameters
    keyName label of the property

    public void setKeyTextAppearance (int resId)

    public void setLabelTextAppearanceUnFocused (int labelTextAppearanceUnFocused)

    Set the label text appearance when the view is not focused

    Parameters
    labelTextAppearanceUnFocused Style resource

    public void setMaximumValue (int maximumValue)

    public void setMinimumValue (int minimumValue)

    Set the minimum value of the Seekbar

    Parameters
    minimumValue minimum value of the Seekbar

    public void setOverrideKeyStyle (boolean overrideKeyStyle)

    Override the Key styling manually.

    Parameters
    overrideKeyStyle boolean

    public void setOverrideStatusStyle (boolean overrideStatusStyle)

    Override the status i.e. error and helper styling manually

    Parameters
    overrideStatusStyle boolean

    public void setProgressBackgroundTintList (ColorStateList colorStateList)

    public void setProgressTintList (ColorStateList colorStateList)

    public void setShouldAttachOrientationListener (boolean shouldAttach)

    Determines if an OrientationEventListener should be attached.

    Parameters
    shouldAttach Whether the FormCell should consider attaching an OrientationEventListener or not

    public void setStartLabelEms (int ems)

    public void setStartLabelEnabled (boolean isEnabled)

    public void setStartLabelIcon (int icon)

    public void setStartLabelSingleLine (boolean singleLine)

    public void setStartLabelText (CharSequence startLabelText)

    public void setStartLabelTextAppearance (int resId)

    public void setThumbTintList (ColorStateList colorStateList)

    public void setTickMark (Drawable tickMark)

    Set the tick mark on the slider formcell

    Parameters
    tickMark Drawable

    public void setValue (Integer value)

    Protected Methods

    protected void adjustMargins ()

    Calculate and set the margins for the cell's elements. Subclasses should override this method to suit their own needs.

    protected static boolean arrayContains (int[] array, int value)

    Check if the array contains the given property

    Parameters
    array array of integer
    value int
    Returns
    • boolean

    protected void drawableStateChanged ()

    Drawable state changed

    protected TextView generateTextView ()

    Generate the text view

    Returns
    • TextView

    protected ViewGroup.LayoutParams getDefaultLayoutParams ()

    protected CharSequence getHelperText ()

    Get the helper text from the view

    Related XML Attributes
    Returns
    • CharSequence

    protected CharSequence getLabel ()

    Get the label on the view

    Related XML Attributes
    Returns
    • CharSequence

    protected void onRestoreInstanceState (Parcelable state)

    protected Parcelable onSaveInstanceState ()

    protected void replaceStatusView ()

    Each time you add a new view, error/helper view has to be adjusted to be the last view in the layout

    protected void setHelperText (CharSequence helper)

    Set the helper text on the view

    Related XML Attributes
    Parameters
    helper CharSequence
    See Also

    protected void setHelperTextAppearance (int helperTextAppearance)

    Set the helper text appearance

    Parameters
    helperTextAppearance style resource

    protected void setKeyEnabled (boolean labelEnabled)

    protected void setLabel (CharSequence key)

    Set the label on the view

    Related XML Attributes
    Parameters
    key CharSequence
    See Also

    protected void setLabelEnabled (boolean keyEnabled)

    Enable or disable the label field on the view

    Parameters
    keyEnabled boolean

    protected void setLabelTextAppearance (int textAppearance)

    Set the text appearance on the label. This changes the appearance when the view is focused and unfocused

    Parameters
    textAppearance style resource

    protected void setLabelTextAppearanceFocused (int textAppearance)

    Set the text appearance on the label when the view is not focused

    Parameters
    textAppearance Style resource

    protected void setLabelTextColorError (ColorStateList color)

    Set the text color of the label for error mode

    Parameters
    color ColorStateList

    protected void setLabelTextColorFocused (ColorStateList color)

    Set the color of label when the view is focused

    Parameters
    color ColorStateList

    protected void setLabelTextColorUnFocused (ColorStateList color)

    Set the color of label when the view is not focused

    Parameters
    color ColorStateList

    protected boolean setupErrorHelperView ()

    Setup the error/helper field on the view

    Returns
    • boolean true: new view is created false:existing view is used

    protected boolean setupLabelView ()

    Setup the label view on the view

    Returns
    • boolean true: new view is created false:existing view is used

    protected boolean shouldLayout (View v)

    Should layout the given view

    Parameters
    v View
    Returns
    • boolean