Skip to content

Commit

Permalink
Build the license dialog with an external library
Browse files Browse the repository at this point in the history
  • Loading branch information
trishika committed Jan 18, 2015
1 parent 6994d23 commit c2208f2
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 229 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ dependencies {

// Pull To Refresh
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'

compile('de.psdev.licensesdialog:licensesdialog:1.6.0') {
exclude module: 'support-v4'
}
}

android {
Expand Down
83 changes: 0 additions & 83 deletions src/main/java/org/droidupnp/view/LicenseDialog.java

This file was deleted.

35 changes: 31 additions & 4 deletions src/main/java/org/droidupnp/view/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
import java.util.ArrayList;
import java.util.List;

import de.psdev.licensesdialog.LicensesDialog;
import de.psdev.licensesdialog.licenses.ApacheSoftwareLicense20;
import de.psdev.licensesdialog.licenses.BSD3ClauseLicense;
import de.psdev.licensesdialog.licenses.GnuLesserGeneralPublicLicense21;
import de.psdev.licensesdialog.model.Notice;
import de.psdev.licensesdialog.model.Notices;

public class SettingsActivity extends PreferenceActivity {

public static final String CONTENTDIRECTORY_SERVICE = "pref_contentDirectoryService";
Expand Down Expand Up @@ -248,14 +255,34 @@ public void onCreate(Bundle savedInstanceState)
}

// Dialog for external license
Preference customPref = findPreference("license_other");
customPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
Preference pref = findPreference("licenses_other");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
LicenseDialog.showDialog(getActivity());
Notices notices = new Notices();
notices.addNotice(new Notice(
"AppCompat", "http://developer.android.com/tools/support-library/",
"Copyright (C) The Android Open Source Project", new ApacheSoftwareLicense20()));
notices.addNotice(new Notice(
"Cling", "http://4thline.org/projects/cling/",
"Copyright (C) 4th Line GmbH", new GnuLesserGeneralPublicLicense21()));
notices.addNotice(new Notice(
"NanoHttpd", "https://github.com/NanoHttpd/nanohttpd",
"Copyright (C) 2012-2013 by Paul S. Hawke, 2001,2005-2013 by Jarno Elonen, 2010 by Konstantinos Togias", new BSD3ClauseLicense()));
notices.addNotice(new Notice(
"ActionBar-PullToRefresh", "https://github.com/chrisbanes/ActionBar-PullToRefresh",
"Copyright (C) Chris Banes", new ApacheSoftwareLicense20()));
notices.addNotice(new Notice(
"LicenseDialog", "http://psdev.de/LicensesDialog/",
"Copyright (C) Philip Schiffer", new ApacheSoftwareLicense20()));

LicensesDialog.Builder licensesDialog = new LicensesDialog.Builder(getActivity());
licensesDialog.setNotices(notices);
licensesDialog.setTitle(R.string.licenses_other);
licensesDialog.build().show();
return false;
}
});

});
}
}

Expand Down
46 changes: 0 additions & 46 deletions src/main/res/layout/about.xml

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,5 @@
Wenn sie Entwickler sind dürfen sie gern beitragen!</p>
]]>
</string>
<string name="about_cling">
<![CDATA[
<p>DroidUPnP nutzt die Java/Android UPnP Bibliothek <b>Cling</b>. Cling ist lizenziert unter LGPLv2.
Der Quellcode steht auf <a href="http://4thline.org/projects/cling/">4thline.org</a> zur Verfügung.</p>
]]>
</string>
<string name="about_nanohttpd">
<![CDATA[
<p>DroidUPnP nutzt <b>NanoHttpd</b>. NanoHttpd ist lizenziert unter einer angepassten BSD Lizenz.
Der Quellcode steht auf <a href="https://github.com/NanoHttpd/nanohttpd">GitHub</a> zur Verfügung.
]]>
</string>
<string name="about_pulltorefresh">
<![CDATA[
<p>DroidUPnP nutzt <b>ActionBar-PullToRefresh</b>. ActionBar-PullToRefresh unter einer Apache License, Version 2.0.
SDer Quellcode steht auf <a href="https://github.com/chrisbanes/ActionBar-PullToRefresh">GitHub</a> zur Verfügung.
]]>
</string>

</resources>
18 changes: 0 additions & 18 deletions src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,5 @@
El código fuente está disponible en <a href="https://github.com/trishika/DroidUPnP">GitHub</a>.</p>
]]>
</string>
<string name="about_cling">
<![CDATA[
<p>DroidUPnP usa <b>Cling</b> que es una biblioteca UPnP Java/Android. Cling está licenciado bajo LGPLv2.
El código fuente está disponible en <a href="http://4thline.org/projects/cling/">4thline.org</a></p>
]]>
</string>
<string name="about_nanohttpd">
<![CDATA[
<p>DroidUPnP usa <b>NanoHttpd</b>. NanoHttpd está bajo una licencia BSD modificada.
El código fuente está disponible en <a href="https://github.com/NanoHttpd/nanohttpd">GitHub</a>.
]]>
</string>
<string name="about_pulltorefresh">
<![CDATA[
<p>DroidUPnP usa <b>ActionBar-PullToRefresh</b>. ActionBar-PullToRefresh está licenciado bajo Apache License, Version 2.0.
El código fuente está disponible en <a href="https://github.com/chrisbanes/ActionBar-PullToRefresh">GitHub</a>.
]]>
</string>

</resources>
18 changes: 0 additions & 18 deletions src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,5 @@
Les contributions sont les bienvenues !</p>
]]>
</string>
<string name="about_cling">
<![CDATA[
<p>DroidUPnP utilise <b>Cling</b>, une librairie UPNP écrite en Java/Android. Cling est sous license LGPLv2.
Le code source est disponible à <a href="http://4thline.org/projects/cling/">4thline.org</a></p>
]]>
</string>
<string name="about_nanohttpd">
<![CDATA[
<p>DroidUPnP utilise <b>NanoHttpd</b>. NanoHttpd est sous une license BSD modifi�.
Le code source est disponible à <a href="https://github.com/NanoHttpd/nanohttpd">GitHub</a></p>
]]>
</string>
<string name="about_pulltorefresh">
<![CDATA[
<p>DroidUPnP utilise <b>ActionBar-PullToRefresh</b>. ActionBar-PullToRefresh est sous une license Apache License, Version 2.0.
Le code source est disponible à <a href="https://github.com/chrisbanes/ActionBar-PullToRefresh">GitHub</a>.
]]>
</string>

</resources>
18 changes: 0 additions & 18 deletions src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,5 @@
Als je een develloper bijdrage zijn van harte welkom !</p>
]]>
</string>
<string name="about_cling">
<![CDATA[
<p>DroidUPnP gebruik <b>Cling</b> dat is een Java/Android UPnP bibliotheek. Cling is gelicenseerd onder LGPLv2.
Broncode is beschikbaar op <a href="http://4thline.org/projects/cling/">4thline.org</a></p>
]]>
</string>
<string name="about_nanohttpd">
<![CDATA[
<p>DroidUPnP gebruik <b>NanoHttpd</b>. NanoHttpd is onder een modify BSD licentie.
Broncode is beschikbaar op <a href="https://github.com/NanoHttpd/nanohttpd">GitHub</a>.
]]>
</string>
<string name="about_pulltorefresh">
<![CDATA[
<p>DroidUPnP gebruik <b>ActionBar-PullToRefresh</b>. ActionBar-PullToRefresh is gelicenseerd onder Apache License, Version 2.0.
Broncode is beschikbaar op <a href="https://github.com/chrisbanes/ActionBar-PullToRefresh">GitHub</a>.
]]>
</string>

</resources>
24 changes: 3 additions & 21 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@

<!-- About -->
<string name="copyright">Copyright</string>
<string name="about_copyright">Copyright © 2013 Aurélien Chabot</string>
<string name="about_copyright">Copyright © 2014 Aurélien Chabot</string>
<string name="about_contact">Contact : aurelien@chabot.fr</string>
<string name="license">License</string>
<string name="about_license">GPLv3</string>
<string name="link_license">http://www.gnu.org/licenses/gpl-3.0.html</string>
<string name="license_other">Library license</string>
<string name="about_license_other"></string>
<string name="licenses_other">Library licenses</string>
<string name="about_licenses_other"></string>
<string name="source">Source Code</string>
<string name="source_url">http://github.com/trishika/droidupnp</string>
<string name="more">More information</string>
Expand All @@ -106,23 +106,5 @@
If you\'re a develloper contribution are welcome !</p>
]]>
</string>
<string name="about_cling">
<![CDATA[
<p>DroidUPnP use <b>Cling</b> which is a Java/Android UPnP library. Cling is licensed under LGPLv2.
Source code is available at <a href="http://4thline.org/projects/cling/">4thline.org</a></p>
]]>
</string>
<string name="about_nanohttpd">
<![CDATA[
<p>DroidUPnP use <b>NanoHttpd</b>. NanoHttpd is under a modify BSD license.
Source code is available on <a href="https://github.com/NanoHttpd/nanohttpd">GitHub</a>.
]]>
</string>
<string name="about_pulltorefresh">
<![CDATA[
<p>DroidUPnP use <b>ActionBar-PullToRefresh</b>. ActionBar-PullToRefresh is under the Apache License, Version 2.0.
Source code is available on <a href="https://github.com/chrisbanes/ActionBar-PullToRefresh">GitHub</a>.
]]>
</string>

</resources>
6 changes: 3 additions & 3 deletions src/main/res/xml/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ along with DroidUPNP. If not, see <http://www.gnu.org/licenses/>.
</Preference>

<Preference
android:key="license_other"
android:title="@string/license_other"
android:summary="@string/about_license_other" >
android:key="licenses_other"
android:title="@string/licenses_other"
android:summary="@string/about_licenses_other" >
</Preference>

</PreferenceScreen>

0 comments on commit c2208f2

Please sign in to comment.