Merge pull request #10436 from osmandapp/master

update test branch
This commit is contained in:
Hardy 2020-12-19 01:50:42 +01:00 committed by GitHub
commit 953a0bc9e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ import android.text.TextUtils;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.webkit.WebSettings; import android.webkit.WebSettings;
@ -67,7 +68,7 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment {
this.lang = lang; this.lang = lang;
} }
@SuppressLint("SetJavaScriptEnabled") @SuppressLint({"SetJavaScriptEnabled", "ClickableViewAccessibility"})
@Nullable @Nullable
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@ -120,7 +121,25 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment {
selectedLangTv.setBackgroundResource(nightMode selectedLangTv.setBackgroundResource(nightMode
? R.drawable.wikipedia_select_lang_bg_dark_n : R.drawable.wikipedia_select_lang_bg_light_n); ? R.drawable.wikipedia_select_lang_bg_dark_n : R.drawable.wikipedia_select_lang_bg_light_n);
contentWebView = (WebView) mainView.findViewById(R.id.content_web_view); contentWebView = mainView.findViewById(R.id.content_web_view);
contentWebView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_SCROLL:
case MotionEvent.ACTION_MOVE:
readFullArticleButton.setVisibility(View.GONE);
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_UP:
readFullArticleButton.setVisibility(View.VISIBLE);
break;
}
return false;
}
});
WebSettings webSettings = contentWebView.getSettings(); WebSettings webSettings = contentWebView.getSettings();
webSettings.setJavaScriptEnabled(true); webSettings.setJavaScriptEnabled(true);
webSettings.setTextZoom((int) (getResources().getConfiguration().fontScale * 100f)); webSettings.setTextZoom((int) (getResources().getConfiguration().fontScale * 100f));