// Path: app/src/main/java/io/github/marktony/espresso/customtabs/CustomTabsHelper.java
// public class CustomTabsHelper {
// 
//     public static void openUrl(Context context, String url) {
//         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
// 
//         if (sharedPreferences.getBoolean(SettingsUtil.KEY_CUSTOM_TABS, true)) {
//             CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
//             builder.setToolbarColor(ContextCompat.getColor(context, R.color.colorPrimaryDark));
//             builder.build().launchUrl(context, Uri.parse(url));
//         } else {
//             try {
//                 context.startActivity(new Intent(Intent.ACTION_VIEW).setData(Uri.parse(url)));
//             } catch (ActivityNotFoundException e) {
//                 Toast.makeText(context, R.string.error_no_browser, Toast.LENGTH_SHORT).show();
//             }
//         }
//     }
// 
// }


import io.github.marktony.espresso.customtabs.CustomTabsHelper;
import static android.content.Context.CLIPBOARD_SERVICE;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.widget.Toast;
import io.github.marktony.espresso.BuildConfig;
import io.github.marktony.espresso.R;
                        ClipData clipData = ClipData.newPlainText("text", getString(R.string.donate_account));
                        manager.setPrimaryClip(clipData);
                        dialog.dismiss();
                    }
                });
                dialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
                dialog.show();

                return true;
            }
        });

    }

    /**
     * Init the preferences.
     */
    private void initPrefs() {
        prefVersion = findPreference("version");
        prefRate = findPreference("rate");
        prefLicenses = findPreference("licenses");
        prefThx1 = findPreference("thanks_1");
        prefThx2 = findPreference("thanks_2");
        prefSourceCode = findPreference("source_code");
        prefSendAdvices = findPreference("send_advices");
// Path: app/src/main/java/io/github/marktony/espresso/customtabs/CustomTabsHelper.java
// public class CustomTabsHelper {
// 
//     public static void openUrl(Context context, String url) {
//         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
// 
//         if (sharedPreferences.getBoolean(SettingsUtil.KEY_CUSTOM_TABS, true)) {
//             CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
//             builder.setToolbarColor(ContextCompat.getColor(context, R.color.colorPrimaryDark));
//             builder.build().launchUrl(context, Uri.parse(url));
//         } else {
//             try {
//                 context.startActivity(new Intent(Intent.ACTION_VIEW).setData(Uri.parse(url)));
//             } catch (ActivityNotFoundException e) {
//                 Toast.makeText(context, R.string.error_no_browser, Toast.LENGTH_SHORT).show();
//             }
//         }
//     }
// 
// }


// Path: app/src/main/java/io/github/marktony/espresso/ui/AboutFragment.java
import io.github.marktony.espresso.customtabs.CustomTabsHelper;
import static android.content.Context.CLIPBOARD_SERVICE;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.widget.Toast;
import io.github.marktony.espresso.BuildConfig;
import io.github.marktony.espresso.R;

                        ClipData clipData = ClipData.newPlainText("text", getString(R.string.donate_account));
                        manager.setPrimaryClip(clipData);
                        dialog.dismiss();
                    }
                });
                dialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
                dialog.show();

                return true;
            }
        });

    }

    /**
     * Init the preferences.
     */
    private void initPrefs() {
        prefVersion = findPreference("version");
        prefRate = findPreference("rate");
        prefLicenses = findPreference("licenses");
        prefThx1 = findPreference("thanks_1");
        prefThx2 = findPreference("thanks_2");
        prefSourceCode = findPreference("source_code");
        prefSendAdvices = findPreference("send_advices");
        prefDonate = findPreference("donate");