Merge pull request #5088 from osmandapp/WikiTitleFix

title and content have the same language
This commit is contained in:
Alexey 2018-03-02 11:50:33 +03:00 committed by GitHub
commit 83d2f69f84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,8 +167,6 @@ public class WikipediaDialogFragment extends DialogFragment {
if (TextUtils.isEmpty(preferredLanguage)) {
preferredLanguage = getMyApplication().getLanguage();
}
final String title = TextUtils.isEmpty(preferredLanguage) ? amenity.getName() : amenity.getName(preferredLanguage);
((TextView) mainView.findViewById(R.id.title_text_view)).setText(title);
String lng = amenity.getContentLanguage("content", preferredLanguage, "en");
if (Algorithms.isEmpty(lng)) {
@ -176,6 +174,8 @@ public class WikipediaDialogFragment extends DialogFragment {
}
final String langSelected = lng;
final String title = amenity.getName(langSelected);
((TextView) mainView.findViewById(R.id.title_text_view)).setText(title);
mainView.findViewById(R.id.read_full_article).setOnClickListener(new View.OnClickListener() {
@Override