// Path: matisse/src/main/java/com/zhihu/matisse/internal/ui/widget/IncapableDialog.java
// public class IncapableDialog extends DialogFragment {
// 
//     public static final String EXTRA_TITLE = "extra_title";
//     public static final String EXTRA_MESSAGE = "extra_message";
// 
//     public static IncapableDialog newInstance(String title, String message) {
//         IncapableDialog dialog = new IncapableDialog();
//         Bundle args = new Bundle();
//         args.putString(EXTRA_TITLE, title);
//         args.putString(EXTRA_MESSAGE, message);
//         dialog.setArguments(args);
//         return dialog;
//     }
// 
//     @NonNull
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         String title = getArguments().getString(EXTRA_TITLE);
//         String message = getArguments().getString(EXTRA_MESSAGE);
// 
//         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
//         if (!TextUtils.isEmpty(title)) {
//             builder.setTitle(title);
//         }
//         if (!TextUtils.isEmpty(message)) {
//             builder.setMessage(message);
//         }
//         builder.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
//             @Override
//             public void onClick(DialogInterface dialog, int which) {
//                 dialog.dismiss();
//             }
//         });
// 
//         return builder.create();
//     }
// }


import android.content.Context;
import androidx.annotation.IntDef;
import androidx.fragment.app.FragmentActivity;
import android.widget.Toast;
import com.zhihu.matisse.internal.ui.widget.IncapableDialog;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.SOURCE;

    public IncapableCause(String message) {
        mMessage = message;
    }

    public IncapableCause(String title, String message) {
        mTitle = title;
        mMessage = message;
    }

    public IncapableCause(@Form int form, String message) {
        mForm = form;
        mMessage = message;
    }

    public IncapableCause(@Form int form, String title, String message) {
        mForm = form;
        mTitle = title;
        mMessage = message;
    }

    public static void handleCause(Context context, IncapableCause cause) {
        if (cause == null)
            return;

        switch (cause.mForm) {
            case NONE:
                // do nothing.
                break;
            case DIALOG:
// Path: matisse/src/main/java/com/zhihu/matisse/internal/ui/widget/IncapableDialog.java
// public class IncapableDialog extends DialogFragment {
// 
//     public static final String EXTRA_TITLE = "extra_title";
//     public static final String EXTRA_MESSAGE = "extra_message";
// 
//     public static IncapableDialog newInstance(String title, String message) {
//         IncapableDialog dialog = new IncapableDialog();
//         Bundle args = new Bundle();
//         args.putString(EXTRA_TITLE, title);
//         args.putString(EXTRA_MESSAGE, message);
//         dialog.setArguments(args);
//         return dialog;
//     }
// 
//     @NonNull
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         String title = getArguments().getString(EXTRA_TITLE);
//         String message = getArguments().getString(EXTRA_MESSAGE);
// 
//         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
//         if (!TextUtils.isEmpty(title)) {
//             builder.setTitle(title);
//         }
//         if (!TextUtils.isEmpty(message)) {
//             builder.setMessage(message);
//         }
//         builder.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
//             @Override
//             public void onClick(DialogInterface dialog, int which) {
//                 dialog.dismiss();
//             }
//         });
// 
//         return builder.create();
//     }
// }


// Path: matisse/src/main/java/com/zhihu/matisse/internal/entity/IncapableCause.java
import android.content.Context;
import androidx.annotation.IntDef;
import androidx.fragment.app.FragmentActivity;
import android.widget.Toast;
import com.zhihu.matisse.internal.ui.widget.IncapableDialog;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.SOURCE;


    public IncapableCause(String message) {
        mMessage = message;
    }

    public IncapableCause(String title, String message) {
        mTitle = title;
        mMessage = message;
    }

    public IncapableCause(@Form int form, String message) {
        mForm = form;
        mMessage = message;
    }

    public IncapableCause(@Form int form, String title, String message) {
        mForm = form;
        mTitle = title;
        mMessage = message;
    }

    public static void handleCause(Context context, IncapableCause cause) {
        if (cause == null)
            return;

        switch (cause.mForm) {
            case NONE:
                // do nothing.
                break;
            case DIALOG:
                IncapableDialog incapableDialog = IncapableDialog.newInstance(cause.mTitle, cause.mMessage);