Skip to content

6_callback(回调)

水牛 edited this page Nov 17, 2017 · 1 revision

mostly,you can use the MyDialogListener, when you use IosSingleChoose,BottomItemDialog,you can use MyItemDialogListener for item click callback.

MyDialogListener

	public abstract void onFirst();//md-sure button
    public abstract void onSecond();//md-cancel button
    public void onThird(){}//md-netural button

    public void onCancle(){}// when the dialog window cancle

    /**
     * callback for Input
     * @param input1
     * @param input2
     */
    public void onGetInput(CharSequence input1,CharSequence input2){

    }

/**
 * for inputdialog,when click btn1,send the text for validate
 * @param input1
 * @param input2
 * @param editText1
 * @param editText2
 * @return
 */
public boolean onInputValid(CharSequence input1, CharSequence input2, EditText editText1,EditText editText2){
    return true;
}

    /**
     * callback for MdSingleChoose
     * @param chosen
     * @param chosenTxt
     */
    public void onGetChoose(int chosen,CharSequence chosenTxt){

    }

    /**
     * callback for MdMultiChoose
     * @param states
     */
    public void onChoosen( List<Integer> selectedIndex, List<CharSequence> selectedStrs,boolean[] states){

    }

MyItemDialogListener

 /**
     * for IosSingleChoose,BottomItemDialog
     * @param text
     * @param position
     */
   public abstract void onItemClick(CharSequence text, int position);


    /**
     * for BottomItemDialog
     */
   public void onBottomBtnClick(){}