correct SPDX links when the License: tag contains a +

The "+" is syntax on top of the license name:
https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60
This commit is contained in:
Hans-Christoph Steiner 2017-05-02 15:04:11 +02:00
parent 27453855b2
commit 676b2b9093

View File

@ -747,6 +747,9 @@ public class AppDetailsRecyclerViewAdapter
// License link // License link
if (!TextUtils.isEmpty(app.license)) { if (!TextUtils.isEmpty(app.license)) {
String firstLicense = app.license.split(",")[0]; String firstLicense = app.license.split(",")[0];
if (firstLicense.endsWith("+")) { // the + is SPDX syntax on top of the license name
firstLicense = firstLicense.substring(0, firstLicense.length() - 1);
}
String url = "https://spdx.org/licenses/" + firstLicense + ".html"; String url = "https://spdx.org/licenses/" + firstLicense + ".html";
if (uriIsSetAndCanBeOpened(url)) { if (uriIsSetAndCanBeOpened(url)) {
addLinkItemView(contentView, R.string.menu_license, R.drawable.ic_license, url, app.license); addLinkItemView(contentView, R.string.menu_license, R.drawable.ic_license, url, app.license);