// Path: advancedtoolbar/src/main/java/com/hkm/advancedtoolbar/Util/ErrorMessage.java
// public class ErrorMessage extends DialogFragment {
//     private static Runnable onclickrun;
// 
//     public static void alert(final String message, FragmentManager manager) {
//         ErrorMessage.message(message).show(manager, "errorMessageOnce");
//     }
// 
//     public static void alert(final String message, FragmentManager manager, Runnable onclickrun) {
//         ErrorMessage.onclickrun = onclickrun;
//         ErrorMessage.message(message).show(manager, "errorMessageOnce");
//     }
// 
//     public static Bundle getMessageBundle(final String mes) {
//         Bundle h = new Bundle();
//         h.putString("message", mes);
//         return h;
//     }
// 
//     public static ErrorMessage message(final String mes) {
//         Bundle h = new Bundle();
//         h.putString("message", mes);
//         ErrorMessage e = new ErrorMessage();
//         e.setArguments(h);
//         return e;
//     }
// 
// 
//     protected void onNoticedErrorMessage(DialogInterface dialog, int id, String original_message) {
//     }
// 
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         // Use the Builder class for convenient dialog construction
//         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
//         builder.setMessage(getArguments().getString("message"))
//                 .setNeutralButton("try again", new DialogInterface.OnClickListener() {
//                     public void onClick(DialogInterface dialog, int id) {
//                         onNoticedErrorMessage(dialog, id, getArguments().getString("message"));
//                         dialog.dismiss();
//                         if (ErrorMessage.onclickrun != null) {
//                             ErrorMessage.onclickrun.run();
//                             ErrorMessage.onclickrun = null;
//                         }
//                     }
//                 });
//         // Create the AlertDialog object and return it
//         return builder.create();
//     }
// }


import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import com.hkm.advancedtoolbar.R;
import com.hkm.advancedtoolbar.Util.ErrorMessage;
package com.hkm.advancedtoolbar.socialbar;



/**
 * Created by hesk on 24/7/15.
 * com.facebook.messenger.intents.ShareIntentHandler
 * com.facebook.orca
 * jp.naver.line.android.activity.selectchat.SelectChatActivity
 * jp.naver.line.android
 * com.pinterest.activity.create.PinItActivity
 * com.pinterest
 */
public enum Hg {
    pintrest("com.pinterest", R.drawable.pinterest, R.id.social_bar_pinterest),
    facebook("com.facebook.katana", R.drawable.fb, R.id.social_bar_facebook),
    whatsapp("com.whatsapp", R.drawable.whatsapp, R.id.social_bar_whatsapp),
    twitter("com.twitter.android", R.drawable.twitter, R.id.social_bar_twitter),
    message("com.tencent.mm.ui.tools.ShareToTimeLineUI", R.drawable.message, R.id.social_bar_sms);

    private String package_name;
    private int drawbable, extn;

    Hg(final String packagename, final @DrawableRes int fl, final @IdRes int extn) {
        this.package_name = packagename;
        this.drawbable = fl;
        this.extn = extn;
    }

    public String getPackageName() {
        return package_name;
    }

    @DrawableRes
    public int getDrawable() {
        return drawbable;
    }

    @IdRes
    public int Id() {
        return extn;
    }

    public void alert(@Nullable FragmentManager g, @Nullable Context context) {
        if (g == null || context == null) return;
        String message = context.getString(R.string.not_found_share_app);
// Path: advancedtoolbar/src/main/java/com/hkm/advancedtoolbar/Util/ErrorMessage.java
// public class ErrorMessage extends DialogFragment {
//     private static Runnable onclickrun;
// 
//     public static void alert(final String message, FragmentManager manager) {
//         ErrorMessage.message(message).show(manager, "errorMessageOnce");
//     }
// 
//     public static void alert(final String message, FragmentManager manager, Runnable onclickrun) {
//         ErrorMessage.onclickrun = onclickrun;
//         ErrorMessage.message(message).show(manager, "errorMessageOnce");
//     }
// 
//     public static Bundle getMessageBundle(final String mes) {
//         Bundle h = new Bundle();
//         h.putString("message", mes);
//         return h;
//     }
// 
//     public static ErrorMessage message(final String mes) {
//         Bundle h = new Bundle();
//         h.putString("message", mes);
//         ErrorMessage e = new ErrorMessage();
//         e.setArguments(h);
//         return e;
//     }
// 
// 
//     protected void onNoticedErrorMessage(DialogInterface dialog, int id, String original_message) {
//     }
// 
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         // Use the Builder class for convenient dialog construction
//         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
//         builder.setMessage(getArguments().getString("message"))
//                 .setNeutralButton("try again", new DialogInterface.OnClickListener() {
//                     public void onClick(DialogInterface dialog, int id) {
//                         onNoticedErrorMessage(dialog, id, getArguments().getString("message"));
//                         dialog.dismiss();
//                         if (ErrorMessage.onclickrun != null) {
//                             ErrorMessage.onclickrun.run();
//                             ErrorMessage.onclickrun = null;
//                         }
//                     }
//                 });
//         // Create the AlertDialog object and return it
//         return builder.create();
//     }
// }


// Path: advancedtoolbar/src/main/java/com/hkm/advancedtoolbar/socialbar/Hg.java
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import com.hkm.advancedtoolbar.R;
import com.hkm.advancedtoolbar.Util.ErrorMessage;

package com.hkm.advancedtoolbar.socialbar;



/**
 * Created by hesk on 24/7/15.
 * com.facebook.messenger.intents.ShareIntentHandler
 * com.facebook.orca
 * jp.naver.line.android.activity.selectchat.SelectChatActivity
 * jp.naver.line.android
 * com.pinterest.activity.create.PinItActivity
 * com.pinterest
 */
public enum Hg {
    pintrest("com.pinterest", R.drawable.pinterest, R.id.social_bar_pinterest),
    facebook("com.facebook.katana", R.drawable.fb, R.id.social_bar_facebook),
    whatsapp("com.whatsapp", R.drawable.whatsapp, R.id.social_bar_whatsapp),
    twitter("com.twitter.android", R.drawable.twitter, R.id.social_bar_twitter),
    message("com.tencent.mm.ui.tools.ShareToTimeLineUI", R.drawable.message, R.id.social_bar_sms);

    private String package_name;
    private int drawbable, extn;

    Hg(final String packagename, final @DrawableRes int fl, final @IdRes int extn) {
        this.package_name = packagename;
        this.drawbable = fl;
        this.extn = extn;
    }

    public String getPackageName() {
        return package_name;
    }

    @DrawableRes
    public int getDrawable() {
        return drawbable;
    }

    @IdRes
    public int Id() {
        return extn;
    }

    public void alert(@Nullable FragmentManager g, @Nullable Context context) {
        if (g == null || context == null) return;
        String message = context.getString(R.string.not_found_share_app);
        ErrorMessage.alert(message, g);