// Path: phial-overlay/src/main/java/com/mindcoders/phial/ShareContext.java
// public interface ShareContext {
//     /**
//      * @return Android Context in which Phial works
//      */
//     Context getAndroidContext();
// 
//     /**
//      * Should be called if successfully shared
//      */
//     void onSuccess();
// 
//     /**
//      * Should be called in case of error during share.
//      *
//      * @param message that will be presented to user
//      */
//     void onFailed(String message);
// 
//     /**
//      * Should be called in case user cancel share
//      */
//     void onCancel();
// 
//     /**
//      * Presents custom view that will be shown to user
//      *
//      * @param view view to present
//      */
//     void presentView(View view);
// 
//     /**
//      * Shows or hides progress bar to user
//      *
//      * @param isVisible true will show progressbar false will hide
//      */
//     void setProgressBarVisibility(boolean isVisible);
// 
//     /**
//      * Creates view using provided layoutId. Created view will not be presented.
//      * Should {@link #presentView(View)} in order to show to user
//      *
//      * @param layoutId Android layout resource
//      * @return created view
//      */
//     View inflate(@LayoutRes int layoutId);
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/ShareDescription.java
// public class ShareDescription {
//     private final Drawable drawable;
//     private final CharSequence label;
// 
//     /**
//      * @param drawable icon that will be displayed with share option
//      * @param label    label for share option
//      */
//     public ShareDescription(Drawable drawable, CharSequence label) {
//         this.drawable = drawable;
//         this.label = label;
//     }
// 
//     /**
//      * @param context     android context that will be used to load icon and title
//      * @param drawableRes drawableId that will be displayed with share option
//      * @param label       labelId for share option
//      */
//     public ShareDescription(Context context, @DrawableRes int drawableRes, @StringRes int label) {
//         this(ContextCompat.getDrawable(context, drawableRes), context.getString(label));
//     }
// 
//     public Drawable getDrawable() {
//         return drawable;
//     }
// 
//     public CharSequence getLabel() {
//         return label;
//     }
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/Shareable.java
// public interface Shareable {
//     /**
//      * Is called when user selects provided share option.
//      * <p>
//      * At the end of share should notify Phial about result of sharing by calling one of
//      * {@link ShareContext#onSuccess()}
//      * {@link ShareContext#onFailed(String)}
//      * {@link ShareContext#onCancel()}
//      * <p>
//      * ShareContext can be used in order to show your custom view or progress when user selected your share option
//      * see {@link ShareContext}
//      *
//      * @param shareContext     used in order to communicate with Phial
//      * @param zippedAttachment file that should be shared
//      * @param message          message provided by user
//      */
//     void share(ShareContext shareContext, File zippedAttachment, String message);
// 
//     /**
//      * Sets icon and title for ShareOption
//      *
//      * @return ShareDescription with icon and title
//      */
//     ShareDescription getDescription();
// }


import android.content.Context;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.mindcoders.phial.ShareContext;
import com.mindcoders.phial.ShareDescription;
import com.mindcoders.phial.Shareable;
import java.io.File;
                    return true;
                }

                return false;
            }
        });

        shareContext.presentView(view);
    }

    private void internalShare(ShareContext shareContext, File attachment, String message) {
        shareContext.setProgressBarVisibility(true);
        final JiraShareManager.ResultCallback callback =
                ResultCalbackMainThreadWrapper.wrap(new ShareResult(shareContext));
        shareManager.share(attachment, message, callback);
    }

    private static class ShareResult implements JiraShareManager.ResultCallback {
        private final ShareContext context;

        private ShareResult(ShareContext context) {
            this.context = context;
        }

        @Override
        public void onSuccess(String issueName) {
            context.setProgressBarVisibility(false);
            final Context androidContext = context.getAndroidContext();
            Toast.makeText(
                    androidContext,
// Path: phial-overlay/src/main/java/com/mindcoders/phial/ShareContext.java
// public interface ShareContext {
//     /**
//      * @return Android Context in which Phial works
//      */
//     Context getAndroidContext();
// 
//     /**
//      * Should be called if successfully shared
//      */
//     void onSuccess();
// 
//     /**
//      * Should be called in case of error during share.
//      *
//      * @param message that will be presented to user
//      */
//     void onFailed(String message);
// 
//     /**
//      * Should be called in case user cancel share
//      */
//     void onCancel();
// 
//     /**
//      * Presents custom view that will be shown to user
//      *
//      * @param view view to present
//      */
//     void presentView(View view);
// 
//     /**
//      * Shows or hides progress bar to user
//      *
//      * @param isVisible true will show progressbar false will hide
//      */
//     void setProgressBarVisibility(boolean isVisible);
// 
//     /**
//      * Creates view using provided layoutId. Created view will not be presented.
//      * Should {@link #presentView(View)} in order to show to user
//      *
//      * @param layoutId Android layout resource
//      * @return created view
//      */
//     View inflate(@LayoutRes int layoutId);
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/ShareDescription.java
// public class ShareDescription {
//     private final Drawable drawable;
//     private final CharSequence label;
// 
//     /**
//      * @param drawable icon that will be displayed with share option
//      * @param label    label for share option
//      */
//     public ShareDescription(Drawable drawable, CharSequence label) {
//         this.drawable = drawable;
//         this.label = label;
//     }
// 
//     /**
//      * @param context     android context that will be used to load icon and title
//      * @param drawableRes drawableId that will be displayed with share option
//      * @param label       labelId for share option
//      */
//     public ShareDescription(Context context, @DrawableRes int drawableRes, @StringRes int label) {
//         this(ContextCompat.getDrawable(context, drawableRes), context.getString(label));
//     }
// 
//     public Drawable getDrawable() {
//         return drawable;
//     }
// 
//     public CharSequence getLabel() {
//         return label;
//     }
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/Shareable.java
// public interface Shareable {
//     /**
//      * Is called when user selects provided share option.
//      * <p>
//      * At the end of share should notify Phial about result of sharing by calling one of
//      * {@link ShareContext#onSuccess()}
//      * {@link ShareContext#onFailed(String)}
//      * {@link ShareContext#onCancel()}
//      * <p>
//      * ShareContext can be used in order to show your custom view or progress when user selected your share option
//      * see {@link ShareContext}
//      *
//      * @param shareContext     used in order to communicate with Phial
//      * @param zippedAttachment file that should be shared
//      * @param message          message provided by user
//      */
//     void share(ShareContext shareContext, File zippedAttachment, String message);
// 
//     /**
//      * Sets icon and title for ShareOption
//      *
//      * @return ShareDescription with icon and title
//      */
//     ShareDescription getDescription();
// }


// Path: phial-jira/src/main/java/com/mindcoders/phial/jira/JiraShareable.java
import android.content.Context;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.mindcoders.phial.ShareContext;
import com.mindcoders.phial.ShareDescription;
import com.mindcoders.phial.Shareable;
import java.io.File;

                    return true;
                }

                return false;
            }
        });

        shareContext.presentView(view);
    }

    private void internalShare(ShareContext shareContext, File attachment, String message) {
        shareContext.setProgressBarVisibility(true);
        final JiraShareManager.ResultCallback callback =
                ResultCalbackMainThreadWrapper.wrap(new ShareResult(shareContext));
        shareManager.share(attachment, message, callback);
    }

    private static class ShareResult implements JiraShareManager.ResultCallback {
        private final ShareContext context;

        private ShareResult(ShareContext context) {
            this.context = context;
        }

        @Override
        public void onSuccess(String issueName) {
            context.setProgressBarVisibility(false);
            final Context androidContext = context.getAndroidContext();
            Toast.makeText(
                    androidContext,
                    androidContext.getString(R.string.jira_issue_created, issueName),