mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 07:16:04 -04:00
Fix fullscreen and autohide interaction #454
This commit is contained in:
parent
b3be115ada
commit
6ff7cce803
@ -802,6 +802,10 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
expandDrawers();
|
expandDrawers();
|
||||||
isFullscreenOpened = true;
|
isFullscreenOpened = true;
|
||||||
getCurrentWebView().requestLayout();
|
getCurrentWebView().requestLayout();
|
||||||
|
if (isHideToolbar) {
|
||||||
|
toolbarContainer.setTranslationY(0);
|
||||||
|
this.getCurrentWebView().setTranslationY(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeFullScreen() {
|
private void closeFullScreen() {
|
||||||
@ -818,6 +822,10 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
shrinkDrawers();
|
shrinkDrawers();
|
||||||
isFullscreenOpened = false;
|
isFullscreenOpened = false;
|
||||||
getCurrentWebView().requestLayout();
|
getCurrentWebView().requestLayout();
|
||||||
|
if (isHideToolbar) {
|
||||||
|
toolbarContainer.setTranslationY(DimenUtils.getTranslucentStatusBarHeight(this));
|
||||||
|
this.getCurrentWebView().setTranslationY(DimenUtils.getToolbarAndStatusBarHeight(this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showHelpPage() {
|
public void showHelpPage() {
|
||||||
|
@ -23,6 +23,7 @@ import android.content.Context;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import org.kiwix.kiwixmobile.KiwixMobileActivity;
|
||||||
import org.kiwix.kiwixmobile.WebViewCallback;
|
import org.kiwix.kiwixmobile.WebViewCallback;
|
||||||
import org.kiwix.kiwixmobile.utils.DimenUtils;
|
import org.kiwix.kiwixmobile.utils.DimenUtils;
|
||||||
|
|
||||||
@ -72,6 +73,10 @@ public class ToolbarScrollingKiwixWebView extends KiwixWebView {
|
|||||||
startY = event.getRawY();
|
startY = event.getRawY();
|
||||||
break;
|
break;
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
|
// If we are in fullscreen don't scroll bar
|
||||||
|
if (KiwixMobileActivity.isFullscreenOpened) {
|
||||||
|
return super.onTouchEvent(event);
|
||||||
|
}
|
||||||
// Filter out zooms since we don't want to affect the toolbar when zooming
|
// Filter out zooms since we don't want to affect the toolbar when zooming
|
||||||
if (event.getPointerCount() == 1) {
|
if (event.getPointerCount() == 1) {
|
||||||
int diffY = (int) (event.getRawY() - startY);
|
int diffY = (int) (event.getRawY() - startY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user