mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Don't trigger immersive view when clicking a link
This commit is contained in:
parent
01d50affaa
commit
e3963ca19b
3 changed files with 18 additions and 1 deletions
|
@ -563,7 +563,12 @@ public class ReadingItemFragment extends Fragment implements ClassifierDialogFra
|
|||
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
if ((view.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0) {
|
||||
if (web.wasLinkClicked()) {
|
||||
// Clicked a link so ignore immersive view
|
||||
return super.onSingleTapUp(e);
|
||||
}
|
||||
|
||||
if (ViewUtils.isSystemUIHidden(view)) {
|
||||
ViewUtils.showSystemUI(view);
|
||||
} else {
|
||||
ViewUtils.hideSystemUI(view);
|
||||
|
|
|
@ -142,4 +142,8 @@ public class ViewUtils {
|
|||
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE);
|
||||
}
|
||||
|
||||
public static boolean isSystemUIHidden(View view) {
|
||||
return (view.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,4 +67,12 @@ public class NewsblurWebview extends WebView {
|
|||
loadUrl(script);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* http://stackoverflow.com/questions/5994066/webview-ontouch-handling-when-the-user-does-not-click-a-link
|
||||
*/
|
||||
public boolean wasLinkClicked() {
|
||||
WebView.HitTestResult result = getHitTestResult();
|
||||
return (result != null && result.getExtra() != null);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue