Merge pull request #1174 from hismaeel/1130(b)

issue #1130 (b)
This commit is contained in:
neslihanturan 2018-02-27 16:09:08 +02:00 committed by GitHub
commit 5c51e2e00c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import android.view.ViewTreeObserver;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException;
import java.text.SimpleDateFormat;
@ -273,7 +274,12 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
}
private void setOnClickListeners(final Media media) {
license.setOnClickListener(v -> openWebBrowser(licenseLink(media)));
if (licenseLink(media) != null) {
license.setOnClickListener(v -> openWebBrowser(licenseLink(media)));
} else {
Toast toast = Toast.makeText(getContext(), getString(R.string.null_url), Toast.LENGTH_SHORT);
toast.show();
}
if (media.getCoordinates() != null) {
coordinates.setOnClickListener(v -> openMap(media.getCoordinates()));
}

View file

@ -224,6 +224,7 @@
<string name="login_to_your_account">Login to your account</string>
<string name="send_log_file">Send log file</string>
<string name="send_log_file_description">Send log file to developers via email</string>
<string name="null_url">Error! URL not found</string>
<string name="nearby_location_has_not_changed">Location has not changed.</string>
<string name="nearby_location_not_available">Location not available.</string>