java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.LinearLayout | |||
↳ | com.sap.cloud.mobile.fiori.formcell.DurationPickerFormCell |
DurationPickerFormCell is a control which contains a Key and Value along with a Duration picker Dialog. The user can click the key value view to display a popup dialog to pick the duration on the cell.
DurationPickerFormCell can be used to pick a duration. User of the cell can specify their own display format by setting
setDurationTextFormat(String)
.
Structure of the control :
setKey(CharSequence)
Duration
See also: setValue(Duration)
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DurationPickerFormCell(Context context) | |||||||||||
DurationPickerFormCell(Context context, AttributeSet attrs) | |||||||||||
DurationPickerFormCell(Context context, AttributeSet attrs, int defStyleAttr) | |||||||||||
DurationPickerFormCell(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()
Get the cell widget type from
FormCell.WidgetType
| ||||||||||
CellValueChangeListener<Duration> |
getCellValueChangeListener()
Get the CellChangeListener of the cell
| ||||||||||
CharSequence | getDialogTitle() | ||||||||||
CharSequence | getDisplayValue() | ||||||||||
CharSequence |
getError()
Get error set on the view
| ||||||||||
TextView | getErrorView() | ||||||||||
CharSequence |
getKey()
Get the key property of the cell
| ||||||||||
TextView | getKeyView() | ||||||||||
Duration |
getValue()
Get the value of the cell.
| ||||||||||
TextView | getValueView() | ||||||||||
boolean |
isEditable()
Get is the cell is editable.
| ||||||||||
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
| ||||||||||
boolean | onInterceptTouchEvent(MotionEvent ev) | ||||||||||
boolean | performClick() | ||||||||||
void |
set24HourView(boolean enable)
Set if the duration picker should be in 24 hour mode
| ||||||||||
void |
setCellValueChangeListener(CellValueChangeListener<Duration> listener)
Set the listener on the cell
| ||||||||||
void |
setClickable(boolean clickable)
Enable or disable clickable property on the view and all its children
| ||||||||||
void |
setDialogTitle(CharSequence dialogTitle)
Set the title on the dialog
| ||||||||||
void | setDisplayValue(CharSequence displayValue) | ||||||||||
void |
setDurationTextFormat(String durationTextFormat)
Sets the string used to format the selected time duration.
| ||||||||||
void |
setEditable(boolean isEditable)
Enable or disable the cell's editable property
| ||||||||||
void |
setEnabled(boolean enabled)
Enable or disable the view
| ||||||||||
void |
setError(CharSequence error)
Set the error on view
| ||||||||||
void |
setErrorEnabled(boolean errorEnabled)
Enable or disable error enabled
| ||||||||||
void |
setErrorTextAppearance(int resId)
Set the error text appearance
| ||||||||||
void |
setFocusable(boolean focusable)
Enable or disable focusable property on the view and all its children
| ||||||||||
void |
setHelperEnabled(boolean enabled)
Enable or disable helper field on the view
| ||||||||||
void |
setHour(int hour)
Set the minute on the DurationPickerFormCell
| ||||||||||
void |
setKey(CharSequence key)
Set the key on the cell
| ||||||||||
void | setKeyEnabled(boolean keyEnabled) | ||||||||||
void |
setKeyTextAppearance(int resId)
Set the key Text appearance
| ||||||||||
void |
setKeyTextColor(ColorStateList colorStateList)
Set the color of the value
| ||||||||||
void |
setLabelTextAppearanceUnFocused(int labelTextAppearanceUnFocused)
Set the label text appearance when the view is not focused
| ||||||||||
void |
setMaxLines(int lines)
Set max lines on value
| ||||||||||
void |
setMinLines(int minLines)
Set minimum number of lines on display value
| ||||||||||
void |
setMinute(int minute)
Set the minute on the DurationPickerFormCell
| ||||||||||
void |
setMinuteInterval(int minuteInterval)
Sets the interval in which the minute scale between 0 - 60 will be divided evenly.
| ||||||||||
void |
setOverrideKeyStyle(boolean overrideKeyStyle)
Override the Key styling manually.
| ||||||||||
void |
setOverrideStatusStyle(boolean overrideStatusStyle)
Override the status i.e.
| ||||||||||
void |
setShouldAttachOrientationListener(boolean shouldAttach)
Determines if an OrientationEventListener should be attached.
| ||||||||||
void |
setValue(Duration value)
Set the value on the cell
| ||||||||||
void |
setValue(int hour, int minute)
Set the value on the cell using given hour and minute
| ||||||||||
void |
setValueTextAppearance(int resId)
Set the text appearance of the value property
| ||||||||||
void |
setValueTextColor(ColorStateList color)
Set the color of the value
| ||||||||||
void |
setValueTextColor(int resId)
Set the color of the 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 | onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) | ||||||||||
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 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Add given view in the view
child | View |
---|---|
index | position at which the view has to be added |
params | ViewGroup.LayoutParams |
Get the cell widget type from FormCell.WidgetType
Get the CellChangeListener of the cell
Get the key property of the cell
Get the value of the cell.
Duration
Get is the cell is editable.
Is error enabled on the view
Set if the helper field is enabled on the view
Is the label field on the view is enabled
Set if the duration picker should be in 24 hour mode
enable | isEnabled |
---|
Set the listener on the cell
listener | value change listener of the control |
---|
Enable or disable clickable property on the view and all its children
clickable | boolean |
---|
Set the title on the dialog
dialogTitle | CharSequence |
---|
Sets the string used to format the selected time duration. Default text formatter is %d Hrs %d Min where %d is the number of hours and minutes.
durationTextFormat | CharSequence |
---|
Enable or disable the cell's editable property
isEditable | boolean |
---|
Enable or disable the view
enabled | boolean |
---|
Enable or disable focusable property on the view and all its children
focusable | boolean |
---|
Enable or disable helper field on the view
enabled | boolean |
---|
Set the minute on the DurationPickerFormCell
hour | int |
---|
Set the key on the cell
key | key of the cell as CharSequence |
---|
Set the key Text appearance
resId | int |
---|
Set the color of the value
colorStateList | ColorStateList |
---|
Set the label text appearance when the view is not focused
labelTextAppearanceUnFocused | Style resource |
---|
Set max lines on value
lines | int |
---|
Set minimum number of lines on display value
minLines | int |
---|
Set the minute on the DurationPickerFormCell
minute | int |
---|
Sets the interval in which the minute scale between 0 - 60 will be divided evenly. Default is 5. Minimum interval is 1 and maximum can be 30.
minuteInterval | int |
---|
Override the Key styling manually.
overrideKeyStyle | boolean |
---|
Override the status i.e. error and helper styling manually
overrideStatusStyle | boolean |
---|
Determines if an OrientationEventListener should be attached.
shouldAttach | Whether the FormCell should consider attaching an OrientationEventListener or not |
---|
Set the value on the cell
value | value of the property |
---|
Set the value on the cell using given hour and minute
hour | hour as int |
---|---|
minute | minute as int |
Set the text appearance of the value property
resId | int |
---|
Set the color of the value
color | ColorStateList |
---|
Set the color of the value
resId | Color resource as int |
---|
Calculate and set the margins for the cell's elements. Subclasses should override this method to suit their own needs.
Check if the array contains the given property
array | array of integer |
---|---|
value | int |
Drawable state changed
Get the helper text from the view
Get the label on the view
Each time you add a new view, error/helper view has to be adjusted to be the last view in the layout
Set the helper text on the view
helper | CharSequence |
---|
Set the helper text appearance
helperTextAppearance | style resource |
---|
Set the label on the view
key | CharSequence |
---|
Enable or disable the label field on the view
keyEnabled | boolean |
---|
Set the text appearance on the label. This changes the appearance when the view is focused and unfocused
textAppearance | style resource |
---|
Set the text appearance on the label when the view is not focused
textAppearance | Style resource |
---|
Set the text color of the label for error mode
color | ColorStateList |
---|
Set the color of label when the view is focused
color | ColorStateList |
---|
Set the color of label when the view is not focused
color | ColorStateList |
---|
Setup the error/helper field on the view
Setup the label view on the view
Should layout the given view
v | View |
---|