public class NacCardHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements android.view.View.OnClickListener, android.view.View.OnLongClickListener, android.widget.CompoundButton.OnCheckedChangeListener, android.app.TimePickerDialog.OnTimeSetListener, NacDialog.OnDismissListener, NacDayOfWeek.OnWeekChangedListener, android.widget.SeekBar.OnSeekBarChangeListener, NacHeightAnimator.OnAnimateHeightListener
Modifier and Type | Class and Description |
---|---|
static interface |
NacCardHolder.OnCardCollapsedListener
Card collapsed listener.
|
static interface |
NacCardHolder.OnCardExpandedListener
Card expanded listener.
|
static interface |
NacCardHolder.OnDeleteClickedListener
Listener for when the delete button is clicked.
|
Constructor and Description |
---|
NacCardHolder(android.view.View root) |
Modifier and Type | Method and Description |
---|---|
void |
cancelBackgroundColor()
Reset the animator that changes the background color of the alarm card.
|
void |
cancelHighlight()
Cancel the animator that highlights the alarm card.
|
boolean |
checkCanDeleteAlarm() |
boolean |
checkCanModifyAlarm()
Check if the alarm can be modified, and if it cannot, display toasts to the
user indicating as such.
|
void |
collapse()
Collapse the alarm card.
|
void |
delete()
Delete the alarm card.
|
void |
doAudioSourceButtonClick()
Act as if the audio source button was clicked.
|
void |
doCardClick()
Act as if the alarm card was clicked.
|
void |
doCollapse()
Collapse the alarm card without any animations.
|
void |
doCollapseForce()
Force the alarm card to be fully collapsed, without any animations.
|
void |
doDayButtonClick(com.nfcalarmclock.util.NacCalendar.Day day)
Act as if the day button was clicked.
|
void |
doDeleteButtonClick()
Act as if the delete button was clicked.
|
void |
doDismissButtonClick()
Act as if the dismiss button was clicked.
|
void |
doExpand()
Expand the alarm card without any animations.
|
void |
doMediaButtonClick()
Act as if the media button was clicked.
|
void |
doNameClick()
Act as if the name was clicked.
|
void |
doNfcButtonClick()
Act as if the NFC button was clicked.
|
void |
doRepeatButtonClick()
Act as if the repeat button was clicked.
|
void |
doRepeatButtonLongClick()
Act as if the repeat button was long clicked.
|
void |
doSwitchCheckedChanged(boolean state)
Act as if the switch was changed.
|
void |
doTimeClick()
Act as if the time was clicked.
|
void |
doVibrateButtonClick()
Act as if the vibrate button was clicked.
|
void |
expand()
Expand the alarm card.
|
NacAlarm |
getAlarm() |
androidx.cardview.widget.CardView |
getCardView() |
android.content.Context |
getContext() |
android.widget.RelativeLayout |
getCopySwipeView() |
com.google.android.material.button.MaterialButton |
getDeleteButton() |
android.widget.RelativeLayout |
getDeleteSwipeView() |
com.google.android.material.button.MaterialButton |
getDismissButton() |
android.widget.LinearLayout |
getDismissParentView() |
android.widget.LinearLayout |
getExtraView() |
android.widget.TextView |
getMeridianView() |
com.google.android.material.button.MaterialButton |
getNameButton() |
com.google.android.material.button.MaterialButton |
getNfcButton() |
NacCardHolder.OnDeleteClickedListener |
getOnDeleteClickedListener() |
com.google.android.material.button.MaterialButton |
getRepeatButton() |
android.view.View |
getRoot() |
android.widget.TextView |
getSummaryDaysView() |
android.widget.TextView |
getSummaryNameView() |
androidx.appcompat.widget.SwitchCompat |
getSwitch() |
android.widget.LinearLayout |
getTimeParentView() |
android.widget.TextView |
getTimeView() |
void |
highlight()
Highlight the alarm card.
|
void |
init(NacAlarm alarm)
Initialize the alarm card.
|
void |
initColors()
Initialize the colors of the various views.
|
void |
initListeners(java.lang.Object listener)
Initialize the listeners of the various views.
|
void |
initViews()
Initialize the various views.
|
void |
interact()
Interact with an alarm.
|
boolean |
isAlarmInUse() |
boolean |
isCollapsed() |
boolean |
isExpanded() |
void |
onAnimateCollapse(NacHeightAnimator animator)
Called when the card is collapsing.
|
void |
onAnimateExpand(NacHeightAnimator animator)
Called when the card is expanding.
|
void |
onCheckedChanged(android.widget.CompoundButton button,
boolean state)
Save the repeat state of the alarm.
|
void |
onClick(android.view.View view) |
boolean |
onDismissDialog(NacDialog dialog)
Notify alarm listener that the alarm has been modified.
|
boolean |
onLongClick(android.view.View view) |
void |
onProgressChanged(android.widget.SeekBar seekBar,
int progress,
boolean fromUser) |
void |
onStartTrackingTouch(android.widget.SeekBar seekBar) |
void |
onStopTrackingTouch(android.widget.SeekBar seekBar) |
void |
onTimeSet(android.widget.TimePicker tp,
int hr,
int min) |
boolean |
onWeekChanged(NacDayButton button,
com.nfcalarmclock.util.NacCalendar.Day day)
Save which day was selected to be repeated, or deselected so that it is
not repeated.
|
void |
respondToDayButtonClick(NacDayButton button,
com.nfcalarmclock.util.NacCalendar.Day day)
Perform the day button state change.
|
void |
respondToRepeatButtonLongClick()
Perform the repeat button long click action.
|
void |
respondToSwitchCheckedChanged(android.widget.CompoundButton button,
boolean state)
Perform the switch state change.
|
void |
setDayOfWeek()
Set the day of week to its proper setting.
|
void |
setDayOfWeekRippleColor()
Set the ripple color for each day in the day of week view.
|
void |
setDismissButtonRippleColor()
Set the ripple color for the dismiss button.
|
void |
setDismissView()
Set the dismiss view to its proper setting.
|
void |
setDividerColor()
Set the divider color.
|
void |
setMediaButton()
Set the media button to its proper setting.
|
void |
setMediaButtonRippleColor()
Set the ripple color of the media button.
|
void |
setMeridianColor()
Set the meridian color.
|
void |
setMeridianView()
Set the meridian view to its proper setting.
|
void |
setOnCardCollapsedListener(NacCardHolder.OnCardCollapsedListener listener)
Set the listener for when the alarm card is collapsed.
|
void |
setOnCardExpandedListener(NacCardHolder.OnCardExpandedListener listener)
Set the listener for when the alarm card is expanded.
|
void |
setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener listener)
Set listener for when a menu item is clicked.
|
void |
setOnDeleteClickedListener(NacCardHolder.OnDeleteClickedListener listener)
Set listener to delete the card.
|
void |
setSummaryDaysColor()
Set the color of the summary days.
|
void |
setSummaryDaysView()
Set the summary days view to its proper setting.
|
void |
setSummaryNameColor()
Set the color of the summary name.
|
void |
setSummaryNameView()
Set the summary name view to its proper setting.
|
void |
setSwitchColor()
Set the color of the switch.
|
void |
setSwitchView()
Set the switch to its proper setting.
|
void |
setTimeColor()
Set the time color.
|
void |
setTimeView()
Set the time view to its proper setting.
|
void |
setVibrateButton()
Set the vibrate button to its proper setting.
|
void |
setVolumeImageView()
Set the volume image view.
|
void |
setVolumeSeekBar()
Set the volume seekbar.
|
void |
setVolumeSeekBarColor()
Set the volume seekbar color.
|
void |
showAudioSourceDialog()
Show the audio source dialog.
|
void |
startMediaActivity()
Start the media activity.
|
public void cancelBackgroundColor()
public void cancelHighlight()
public boolean checkCanDeleteAlarm()
Same, but for deleting an alarm.
public boolean checkCanModifyAlarm()
public void collapse()
public void delete()
public void doCardClick()
public void doCollapse()
public void doCollapseForce()
public void doDayButtonClick(com.nfcalarmclock.util.NacCalendar.Day day)
public void doDeleteButtonClick()
public void doDismissButtonClick()
public void doExpand()
public void doMediaButtonClick()
public void doNameClick()
public void doNfcButtonClick()
public void doRepeatButtonClick()
public void doRepeatButtonLongClick()
public void doSwitchCheckedChanged(boolean state)
public void doTimeClick()
public void doVibrateButtonClick()
public void doAudioSourceButtonClick()
public void expand()
public NacAlarm getAlarm()
public androidx.cardview.widget.CardView getCardView()
public android.content.Context getContext()
public android.widget.RelativeLayout getCopySwipeView()
public com.google.android.material.button.MaterialButton getDeleteButton()
public android.widget.RelativeLayout getDeleteSwipeView()
public com.google.android.material.button.MaterialButton getDismissButton()
public android.widget.LinearLayout getDismissParentView()
public android.widget.LinearLayout getExtraView()
public android.widget.TextView getMeridianView()
public com.google.android.material.button.MaterialButton getNameButton()
public com.google.android.material.button.MaterialButton getNfcButton()
public NacCardHolder.OnDeleteClickedListener getOnDeleteClickedListener()
public com.google.android.material.button.MaterialButton getRepeatButton()
public android.view.View getRoot()
public android.widget.TextView getSummaryDaysView()
public android.widget.TextView getSummaryNameView()
public androidx.appcompat.widget.SwitchCompat getSwitch()
public android.widget.LinearLayout getTimeParentView()
public android.widget.TextView getTimeView()
public void highlight()
public void init(NacAlarm alarm)
public void initColors()
public void initListeners(java.lang.Object listener)
public void initViews()
public void interact()
public boolean isAlarmInUse()
public boolean isCollapsed()
public boolean isExpanded()
public void onAnimateCollapse(NacHeightAnimator animator)
onAnimateCollapse
in interface NacHeightAnimator.OnAnimateHeightListener
public void onAnimateExpand(NacHeightAnimator animator)
onAnimateExpand
in interface NacHeightAnimator.OnAnimateHeightListener
public void onCheckedChanged(android.widget.CompoundButton button, boolean state)
onCheckedChanged
in interface android.widget.CompoundButton.OnCheckedChangeListener
public boolean onWeekChanged(NacDayButton button, com.nfcalarmclock.util.NacCalendar.Day day)
onWeekChanged
in interface NacDayOfWeek.OnWeekChangedListener
public void onClick(android.view.View view)
onClick
in interface android.view.View.OnClickListener
public boolean onDismissDialog(NacDialog dialog)
onDismissDialog
in interface NacDialog.OnDismissListener
public boolean onLongClick(android.view.View view)
onLongClick
in interface android.view.View.OnLongClickListener
public void onProgressChanged(android.widget.SeekBar seekBar, int progress, boolean fromUser)
onProgressChanged
in interface android.widget.SeekBar.OnSeekBarChangeListener
public void onStartTrackingTouch(android.widget.SeekBar seekBar)
onStartTrackingTouch
in interface android.widget.SeekBar.OnSeekBarChangeListener
public void onStopTrackingTouch(android.widget.SeekBar seekBar)
onStopTrackingTouch
in interface android.widget.SeekBar.OnSeekBarChangeListener
public void onTimeSet(android.widget.TimePicker tp, int hr, int min)
onTimeSet
in interface android.app.TimePickerDialog.OnTimeSetListener
public void respondToDayButtonClick(NacDayButton button, com.nfcalarmclock.util.NacCalendar.Day day)
public void respondToRepeatButtonLongClick()
public void respondToSwitchCheckedChanged(android.widget.CompoundButton button, boolean state)
public void setDayOfWeek()
public void setDayOfWeekRippleColor()
public void setDismissButtonRippleColor()
public void setDismissView()
public void setDividerColor()
public void setMediaButton()
public void setMediaButtonRippleColor()
public void setMeridianColor()
public void setMeridianView()
public void setOnCardCollapsedListener(NacCardHolder.OnCardCollapsedListener listener)
public void setOnCardExpandedListener(NacCardHolder.OnCardExpandedListener listener)
public void setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener listener)
public void setOnDeleteClickedListener(NacCardHolder.OnDeleteClickedListener listener)
listener
- The delete listener.public void setSummaryDaysColor()
public void setSummaryDaysView()
public void setSummaryNameColor()
public void setSummaryNameView()
public void setSwitchColor()
public void setSwitchView()
public void setTimeColor()
public void setTimeView()
public void setVibrateButton()
public void setVolumeImageView()
public void setVolumeSeekBar()
public void setVolumeSeekBarColor()
public void showAudioSourceDialog()
public void startMediaActivity()