FileDocCategorySizeDatePackage
RepeatPreference.javaAPI DocAndroid 1.5 API2724Wed May 06 22:42:42 BST 2009com.android.alarmclock

RepeatPreference

public class RepeatPreference extends android.preference.ListPreference

Fields Summary
private Alarms.DaysOfWeek
mDaysOfWeek
private OnRepeatChangedObserver
mOnRepeatChangedObserver
Constructors Summary
public RepeatPreference(android.content.Context context, android.util.AttributeSet attrs)


       
                
          

               
           
    

         
        super(context, attrs);
    
Methods Summary
protected voidonDialogClosed(boolean positiveResult)

        if (positiveResult) {
            mOnRepeatChangedObserver.onRepeatChanged(mDaysOfWeek);
        } else {
            /* no change -- reset to initial state */
            mDaysOfWeek.set(mOnRepeatChangedObserver.getDaysOfWeek());
        }
    
protected voidonPrepareDialogBuilder(android.app.AlertDialog.Builder builder)

        CharSequence[] entries = getEntries();
        CharSequence[] entryValues = getEntryValues();

        if (entries == null || entryValues == null) {
            throw new IllegalStateException(
                    "RepeatPreference requires an entries array and an entryValues array.");
        }

        mDaysOfWeek.set(mOnRepeatChangedObserver.getDaysOfWeek());

        builder.setMultiChoiceItems(
                entries, mDaysOfWeek.getBooleanArray(),
                new DialogInterface.OnMultiChoiceClickListener() {
                    public void onClick(DialogInterface dialog, int which, boolean isChecked) {
                        mDaysOfWeek.set(which, isChecked);
                    }
                });
    
voidsetOnRepeatChangedObserver(com.android.alarmclock.RepeatPreference$OnRepeatChangedObserver onRepeatChangedObserver)

        mOnRepeatChangedObserver = onRepeatChangedObserver;