de.psdev.licensesdialog.model.Notices Java Examples

The following examples show how to use de.psdev.licensesdialog.model.Notices. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LicensesDialogFragment.java    From LicensesDialog with Apache License 2.0 6 votes vote down vote up
private static LicensesDialogFragment newInstance(final Notices notices,
                                                  final boolean showFullLicenseText,
                                                  final boolean includeOwnLicense,
                                                  final String noticeStyle,
                                                  final int themeResourceId,
                                                  final int dividerColor) {
    final LicensesDialogFragment licensesDialogFragment = new LicensesDialogFragment();
    final Bundle args = new Bundle();
    args.putParcelable(ARGUMENT_NOTICES, notices);
    args.putBoolean(ARGUMENT_FULL_LICENSE_TEXT, showFullLicenseText);
    args.putBoolean(ARGUMENT_INCLUDE_OWN_LICENSE, includeOwnLicense);
    args.putString(ARGUMENT_NOTICE_STYLE, noticeStyle);
    args.putInt(ARGUMENT_THEME_XML_ID, themeResourceId);
    args.putInt(ARGUMENT_DIVIDER_COLOR, dividerColor);
    licensesDialogFragment.setArguments(args);
    return licensesDialogFragment;
}
 
Example #2
Source File: FragmentAbout.java    From Saiy-PS with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Prepare the license information to show to the user
 */
private void prepareLicenses() {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "prepareLicenses");
    }

    AsyncTask.execute(new Runnable() {
        @Override
        public void run() {
            final Notices notices = helper.getLicenses();
            FragmentAbout.this.getParentActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {

                    new LicensesDialog.Builder(FragmentAbout.this.getParentActivity())
                            .setNotices(notices).setIncludeOwnLicense(true)
                            .setShowFullLicenseText(false)
                            .setCloseText(R.string.close).build().show();
                }
            });
        }
    });
}
 
Example #3
Source File: NoticesXmlParser.java    From LicensesDialog with Apache License 2.0 6 votes vote down vote up
private static Notices parse(final XmlPullParser parser) throws IOException, XmlPullParserException {
    final Notices notices = new Notices();
    parser.require(XmlPullParser.START_TAG, null, "notices");
    while (parser.next() != XmlPullParser.END_TAG) {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }
        final String name = parser.getName();
        // Starts by looking for the entry tag
        if ("notice".equals(name)) {
            notices.addNotice(readNotice(parser));
        } else {
            skip(parser);
        }
    }
    return notices;
}
 
Example #4
Source File: SettingsFragment.java    From always-on-amoled with GNU General Public License v3.0 6 votes vote down vote up
private void openSourceLicenses() {
    findPreference("open_source_licenses").setOnPreferenceClickListener(preference -> {
        Notices notices = new Notices();
        notices.addNotice(new Notice("AppIntro", "https://github.com/PaoloRotolo/AppIntro", "Copyright 2015 Paolo Rotolo ,  Copyright 2016 Maximilian Narr", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("android-issue-reporter", "https://github.com/HeinrichReimer/android-issue-reporter", "", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("ButterKnife", "https://github.com/JakeWharton/butterknife", "Copyright 2013 Jake Wharton", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("Custom Analog Clock View", "https://github.com/rosenpin/custom-analog-clock-view", "Copyright (C) 2016 Tomer Rosenfeld", new GnuGeneralPublicLicense30()));
        notices.addNotice(new Notice("CircleImageView", "https://github.com/hdodenhof/CircleImageView", "Copyright 2014 - 2016 Henning Dodenhof", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("LicensesDialog", "https://github.com/PSDev/LicensesDialog", "", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("material-dialogs", "https://github.com/afollestad/material-dialogs", "Copyright (c) 2014-2016 Aidan Michael Follestad", new MITLicense()));
        new LicensesDialog.Builder(getActivity())
                .setNotices(notices)
                .build()
                .show();
        return true;
    });
}
 
Example #5
Source File: GeneralPreferenceFragment.java    From Toutiao with Apache License 2.0 6 votes vote down vote up
private void createLicenseDialog() {
    Notices notices = new Notices();
    notices.addNotice(new Notice("PhotoView", "https://github.com/chrisbanes/PhotoView", "Copyright 2017 Chris Banes", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("OkHttp", "https://github.com/square/okhttp", "Copyright 2016 Square, Inc.", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("Gson", "https://github.com/google/gson", "Copyright 2008 Google Inc.", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("Glide", "https://github.com/bumptech/glide", "Sam Judd - @sjudd on GitHub, @samajudd on Twitter", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("Stetho", "https://github.com/facebook/stetho", "Copyright (c) 2015, Facebook, Inc. All rights reserved.", new BSD3ClauseLicense()));
    notices.addNotice(new Notice("PersistentCookieJar", "https://github.com/franmontiel/PersistentCookieJar", "Copyright 2016 Francisco José Montiel Navarro", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("jsoup", "https://jsoup.org", "Copyright © 2009 - 2016 Jonathan Hedley ([email protected])", new MITLicense()));

    new LicensesDialog.Builder(context)
            .setNotices(notices)
            .setIncludeOwnLicense(true)
            .build()
            .show();
}
 
Example #6
Source File: PBAboutActivity.java    From client-android with GNU General Public License v2.0 6 votes vote down vote up
public void clickOnOpenSourceLicenses(final View view) throws Exception {
    final Notices notices = new Notices();
    notices.addNotice(new Notice(
            "Android v7 Support Libraries",
            "https://developer.android.com/topic/libraries/support-library/features.html#v7",
            "Copyright (C) 2012 The Android Open Source Project",
            new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice(
            "LicensesDialog",
            "http://psdev.de",
            "Copyright 2013 Philip Schiffer <[email protected]>",
            new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice(
            "OkHttp",
            "http://square.github.io/okhttp/",
            "Copyright 2016 Square, Inc.",
            new ApacheSoftwareLicense20()));

    new LicensesDialog.Builder(this)
            .setNotices(notices)
            .build()
            .show();
}
 
Example #7
Source File: LicensesDialog.java    From LicensesDialog with Apache License 2.0 5 votes vote down vote up
private static Notices getNotices(final Context context, final int rawNoticesResourceId) {
    try {
        final Resources resources = context.getResources();
        if ("raw".equals(resources.getResourceTypeName(rawNoticesResourceId))) {
            return NoticesXmlParser.parse(resources.openRawResource(rawNoticesResourceId));
        } else {
            throw new IllegalStateException("not a raw resource");
        }
    } catch (final Exception e) {
        throw new IllegalStateException(e);
    }
}
 
Example #8
Source File: MainActivity.java    From LicensesDialog with Apache License 2.0 5 votes vote down vote up
public void onMultipleProgrammaticFragmentClick(final View view) {
    final Notices notices = new Notices();
    notices.addNotice(new Notice("Test 1", "http://example.org", "Example Person", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("Test 2", "http://example.org", "Example Person 2", new GnuLesserGeneralPublicLicense21()));

    final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this)
        .setNotices(notices)
        .setShowFullLicenseText(false)
        .setIncludeOwnLicense(true)
        .build();

    fragment.show(getSupportFragmentManager(), null);
}
 
Example #9
Source File: MainActivity.java    From LicensesDialog with Apache License 2.0 5 votes vote down vote up
public void onMultipleProgrammaticClick(final View view) {
    final Notices notices = new Notices();
    notices.addNotice(new Notice("Test 1", "http://example.org", "Example Person", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("Test 2", "http://example.org", "Example Person 2", new GnuLesserGeneralPublicLicense21()));

    new LicensesDialog.Builder(this)
        .setNotices(notices)
        .setIncludeOwnLicense(true)
        .build()
        .show();
}
 
Example #10
Source File: NoticesXmlParser.java    From LicensesDialog with Apache License 2.0 5 votes vote down vote up
public static Notices parse(final InputStream inputStream) throws Exception {
    try {
        final XmlPullParser parser = Xml.newPullParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
        parser.setInput(inputStream, null);
        parser.nextTag();
        return parse(parser);
    } finally {
        inputStream.close();
    }
}
 
Example #11
Source File: LicensesDialog.java    From LicensesDialog with Apache License 2.0 5 votes vote down vote up
private static String getLicensesText(final Context context, final Notices notices, final boolean showFullLicenseText,
                                      final boolean includeOwnLicense, final String style) {
    try {
        if (includeOwnLicense) {
            final List<Notice> noticeList = notices.getNotices();
            noticeList.add(LICENSES_DIALOG_NOTICE);
        }
        return NoticesHtmlBuilder.create(context).setShowFullLicenseText(showFullLicenseText).setNotices(notices).setStyle(style).build();
    } catch (final Exception e) {
        throw new IllegalStateException(e);
    }
}
 
Example #12
Source File: MainActivity.java    From MockSMS with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        new AlertDialog.Builder(MainActivity.this)
                .setTitle("Info")
                .setItems(new String[]{"Terms & Conditions", "Privacy Policy", "Disclaimer", "Help"}, (dialog, which) -> handleInfoItemClick(which))
                .setPositiveButton("Back", null)
                .setNeutralButton("Open-Source Licenses", (dialog, which) -> {
                    Notices notices = new Notices();
                    notices.addNotice(new Notice("AppCompat", "https://developer.android.com/reference/android/support/v7/appcompat/package-summary", "Google", new ApacheSoftwareLicense20()));
                    notices.addNotice(new Notice("Android Support Library", "https://developer.android.com/topic/libraries/support-library/", "Google", new ApacheSoftwareLicense20()));
                    notices.addNotice(new Notice("MaterialDateTimePicker", "https://github.com/wdullaer/MaterialDateTimePicker", "wdullaer", new ApacheSoftwareLicense20()));
                    notices.addNotice(new Notice("PiracyChecker", "https://github.com/javiersantos/PiracyChecker", "javiersantos", new ApacheSoftwareLicense20()));

                    new LicensesDialog.Builder(MainActivity.this)
                            .setNotices(notices)
                            .setIncludeOwnLicense(true)
                            .build()
                            .show();

                })
                .show();
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
Example #13
Source File: Licenses.java    From fontster with Apache License 2.0 5 votes vote down vote up
public static Notices getNotices() {
  if (mNotices.getNotices().isEmpty()) {
    for (Notice notice : NOTICE_LIST) {
      mNotices.addNotice(notice);
    }
  }
  return mNotices;
}
 
Example #14
Source File: AboutAppActivity.java    From ForceDoze with GNU General Public License v3.0 5 votes vote down vote up
public void showLicences(View v) {
    final Notices notices = new Notices();
    notices.addNotice(new Notice("Material Dialogs", "https://github.com/afollestad/material-dialogs", "Aidan Michael Follestad", new MITLicense()));
    notices.addNotice(new Notice("libsuperuser", "https://github.com/Chainfire/libsuperuser", "Chainfire", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("Nanotasks", "https://github.com/fabiendevos/nanotasks", "Fabien Devos", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("ProcessPhoenix", "https://github.com/JakeWharton/ProcessPhoenix", "Jake Wharton", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("ckChangelog", "https://github.com/cketti/ckChangeLog", "cketti", new ApacheSoftwareLicense20()));
    notices.addNotice(new Notice("SimpleCustomTabs", "https://github.com/eliseomartelli/SimpleCustomTabs", "Eliseo Martelli", new MITLicense()));
    notices.addNotice(new Notice("MaterialList", "https://github.com/dexafree/MaterialList", "Dexafree", new MITLicense()));
    new LicensesDialog.Builder(this).setNotices(notices).setIncludeOwnLicense(true).build().show();
}
 
Example #15
Source File: MainActivity.java    From MockSMS with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        View topView = getLayoutInflater().inflate(R.layout.bad_quality_content, null);
        setupGrids(topView);
        new AlertDialog.Builder(MainActivity.this)
                .setTitle("Info")
                .setView(topView)
                .setPositiveButton("Back", null)
                .setNeutralButton("Open-Source Licenses", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Notices notices = new Notices();
                        notices.addNotice(new Notice("AppCompat", "https://developer.android.com/reference/android/support/v7/appcompat/package-summary", "Google", new ApacheSoftwareLicense20()));
                        notices.addNotice(new Notice("Android Support Library", "https://developer.android.com/topic/libraries/support-library/", "Google", new ApacheSoftwareLicense20()));
                        notices.addNotice(new Notice("MaterialDateTimePicker", "https://github.com/wdullaer/MaterialDateTimePicker", "wdullaer", new ApacheSoftwareLicense20()));
                        notices.addNotice(new Notice("PiracyChecker", "https://github.com/javiersantos/PiracyChecker", "javiersantos", new ApacheSoftwareLicense20()));
                        notices.addNotice(new Notice("LicensesDialog", "https://github.com/PSDev/LicensesDialog", "PSDev", new ApacheSoftwareLicense20()));

                        new LicensesDialog.Builder(MainActivity.this)
                                .setNotices(notices)
                                .build()
                                .show();

                        Toast.makeText(MainActivity.this, "Scroll Down", Toast.LENGTH_SHORT).show();
                    }
                })
                .show();
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
Example #16
Source File: LicensesDialog.java    From LicensesDialog with Apache License 2.0 4 votes vote down vote up
public Builder setNotices(final Notices notices) {
    mNotices = notices;
    mRawNoticesId = null;
    return this;
}
 
Example #17
Source File: LicensesDialog.java    From LicensesDialog with Apache License 2.0 4 votes vote down vote up
private static Notices getSingleNoticeNotices(final Notice notice) {
    final Notices notices = new Notices();
    notices.addNotice(notice);
    return notices;
}
 
Example #18
Source File: FragmentAboutHelper.java    From Saiy-PS with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * Get the license information we need to display
 *
 * @return the {@link Notices} object containing the required {@link Notice} elements
 */
public Notices getLicenses() {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "getLicenses");
    }

    final Notices notices = new Notices();

    notices.addNotice(new Notice(getString(R.string.google_play_services),
            Constants.LICENSE_URL_GOOGLE_PLAY_SERVICES,
            getString(R.string.license_android_open_source),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.gson),
            Constants.LICENSE_URL_GSON,
            getString(R.string.license_google_inc),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.volley),
            Constants.LICENSE_URL_VOLLEY,
            getString(R.string.license_volley),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.two_forty_four),
            Constants.LICENSE_URL_TWO_FORTY_FOUR,
            getString(R.string.license_two_forty_four),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.speechutils),
            Constants.LICENSE_URL_KAAREL_KALJURAND,
            getString(R.string.license_kaarel_kaljurand),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.microsoft_translator),
            Constants.LICENSE_URL_MICROSOFT_TRANSLATOR,
            getString(R.string.license_microsoft_translator),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.apache_commons),
            Constants.LICENSE_URL_APACHE_COMMONS,
            getString(R.string.license_apache_commons),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.simmetrics),
            Constants.LICENSE_URL_SIMMETRICS,
            getString(R.string.license_simmetrics),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.nuance_speechkit),
            Constants.LICENSE_URL_NUANCE_SPEECHKIT,
            getString(R.string.license_nuance_speechkit),
            new BSD2ClauseLicense()));

    notices.addNotice(new Notice(getString(R.string.guava),
            Constants.LICENSE_URL_GUAVA,
            getString(R.string.license_guava),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.microsoft_cognitive),
            Constants.LICENSE_URL_MICROSOFT_COGNITIVE,
            getString(R.string.license_microsoft_cognitive),
            new MITLicense()));

    notices.addNotice(new Notice(getString(R.string.api_ai),
            Constants.LICENSE_URL_API_AI,
            getString(R.string.license_api_ai),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.simple_xml),
            Constants.LICENSE_URL_SIMPLE_XML,
            getString(R.string.license_simple_xml),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.material_icons),
            Constants.LICENSE_MATERIAL_ICONS,
            getString(R.string.license_material_icons),
            new ApacheSoftwareLicense20()));

    notices.addNotice(new Notice(getString(R.string.material_dialogs),
            Constants.LICENSE_MATERIAL_DIALOGS,
            getString(R.string.license_material_dialogs),
            new MITLicense()));

    notices.addNotice(new Notice(getString(R.string.pocketsphinx),
            Constants.LICENSE_POCKETSPHINX,
            getString(R.string.license_pocketsphinx),
            new BSD2ClauseLicense()));

    notices.addNotice(new Notice(getString(R.string.sound_bible),
            Constants.LICENSE_SOUND_BIBLE,
            getString(R.string.license_sound_bible),
            new CreativeCommonsAttributionShareAlike30Unported()));

    return notices;
}
 
Example #19
Source File: LicensesDialogFragment.java    From LicensesDialog with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Resources resources = getResources();

    if (savedInstanceState != null) {
        mTitleText = savedInstanceState.getString(STATE_TITLE_TEXT);
        mLicensesText = savedInstanceState.getString(STATE_LICENSES_TEXT);
        mCloseButtonText = savedInstanceState.getString(STATE_CLOSE_TEXT);
        if (savedInstanceState.containsKey(STATE_THEME_XML_ID)) {
            mThemeResourceId = savedInstanceState.getInt(STATE_THEME_XML_ID);
        }
        if (savedInstanceState.containsKey(STATE_DIVIDER_COLOR)) {
            mDividerColor = savedInstanceState.getInt(STATE_DIVIDER_COLOR);
        }
    } else {
        mTitleText = resources.getString(R.string.notices_title);
        mCloseButtonText = resources.getString(R.string.notices_close);
        try {
            final Notices notices;
            final Bundle arguments = getArguments();
            if (arguments != null) {
                if (arguments.containsKey(ARGUMENT_NOTICES_XML_ID)) {
                    notices = NoticesXmlParser.parse(resources.openRawResource(getNoticesXmlResourceId()));
                } else if (arguments.containsKey(ARGUMENT_NOTICES)) {
                    notices = arguments.getParcelable(ARGUMENT_NOTICES);
                } else {
                    throw new IllegalStateException("Missing ARGUMENT_NOTICES_XML_ID / ARGUMENT_NOTICES");
                }
                if (arguments.getBoolean(ARGUMENT_INCLUDE_OWN_LICENSE, false)) {
                    notices.getNotices().add(LicensesDialog.LICENSES_DIALOG_NOTICE);
                }
                final boolean showFullLicenseText = arguments.getBoolean(ARGUMENT_FULL_LICENSE_TEXT, false);
                if (arguments.containsKey(ARGUMENT_THEME_XML_ID)) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                        mThemeResourceId = arguments.getInt(ARGUMENT_THEME_XML_ID, android.R.style.Theme_DeviceDefault_Light_Dialog);
                    } else {
                        mThemeResourceId = arguments.getInt(ARGUMENT_THEME_XML_ID);
                    }
                }
                if (arguments.containsKey(ARGUMENT_DIVIDER_COLOR)) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                        mDividerColor = arguments.getInt(ARGUMENT_DIVIDER_COLOR, android.R.color.holo_blue_light);
                    } else {
                        mDividerColor = arguments.getInt(ARGUMENT_DIVIDER_COLOR);
                    }
                }
                String noticeStyle = arguments.getString(ARGUMENT_NOTICE_STYLE);
                if (noticeStyle == null) {
                    noticeStyle = resources.getString(R.string.notices_default_style);
                }
                mLicensesText = NoticesHtmlBuilder.create(getActivity()).setNotices(notices).setShowFullLicenseText(showFullLicenseText).setStyle(noticeStyle).build();
            } else {
                throw new IllegalStateException("Missing arguments");
            }
        } catch (final Exception e) {
            throw new IllegalStateException(e);
        }
    }
}
 
Example #20
Source File: LicensesDialogFragment.java    From LicensesDialog with Apache License 2.0 4 votes vote down vote up
public Builder setNotice(final Notice notice) {
    mNotices = new Notices();
    mNotices.addNotice(notice);
    return this;
}
 
Example #21
Source File: LicensesDialogFragment.java    From LicensesDialog with Apache License 2.0 4 votes vote down vote up
public Builder setNotices(final Notices notices) {
    mNotices = notices;
    return this;
}
 
Example #22
Source File: NoticesHtmlBuilder.java    From LicensesDialog with Apache License 2.0 4 votes vote down vote up
public NoticesHtmlBuilder setNotices(final Notices notices) {
    mNotices = notices;
    mNotice = null;
    return this;
}
 
Example #23
Source File: SettingsAboutFragment.java    From Rey-MusicPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate(Bundle onSavedInstanceState) {
    super.onCreate(onSavedInstanceState);
    addPreferencesFromResource(R.xml.settings_about);
    ((SettingActivity) getActivity()).setToolbarTitle(getString(R.string.licenses_and_about));
    mPreferenceManager = getPreferenceManager();

    mContactsUsPreference = mPreferenceManager.findPreference("preference_key_contact_us");
    mAboutUsPreference=mPreferenceManager.findPreference("preference_key_about_us");
    mAboutUsPreference.setOnPreferenceClickListener(preference -> {
        AlertDialog.Builder  builder    =new AlertDialog.Builder(getActivity());
        View view  =LayoutInflater.from(getActivity()).inflate(R.layout.layout_about,null);
        ((TextView)view.findViewById(R.id.version_name)).setText(Common.getVersionName());
        builder.setView(view);
        builder.setTitle(R.string.about);
        builder.setPositiveButton(R.string.ok, (dialog, which) -> dialog.dismiss());
        builder.create().show();
        return false;
    });

    mLicensesPreference = mPreferenceManager.findPreference("preference_key_licenses");

    mContactsUsPreference.setOnPreferenceClickListener(preference -> {
        Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "[email protected]", null));
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Boom Music Player Support");
        startActivity(Intent.createChooser(emailIntent, "Send email"));
        return false;
    });

    mLicensesPreference.setOnPreferenceClickListener(preference -> {
        final Notices notices = new Notices();
        notices.addNotice(new Notice("SeekArc", "https://github.com/neild001/SeekArc", "Neil Davies", new MITLicense()));
        notices.addNotice(new Notice("RangeSliderView", "https://github.com/channguyen/range-slider-view", "Chan Nguyen", new MITLicense()));
        notices.addNotice(new Notice("range-seek-bar", "https://github.com/anothem/android-range-seek-bar", "Neil Davies", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("jaudiotagger", "https://bitbucket.org/ijabz/jaudiotagger", "Paul Taylor", new GnuGeneralPublicLicense20()));
        notices.addNotice(new Notice("Universal Image Loader", "https://github.com/nostra13/Android-Universal-Image-Loader", "Sergey Tarasevich", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("android-betterpickers", "https://github.com/code-troopers/android-betterpickers", "Derek Brameyer", new ApacheSoftwareLicense20()));
        notices.addNotice(new Notice("VerticalSeekBar", "https://github.com/h6ah4i/android-verticalseekbar", "Derek Brameyer", new ApacheSoftwareLicense20()));


        new LicensesDialog.Builder(getActivity())
                .setNotices(notices)
                .setIncludeOwnLicense(true)
                .build()
                .show();
        return false;
    });

}