mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -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();
|
||||
isFullscreenOpened = true;
|
||||
getCurrentWebView().requestLayout();
|
||||
if (isHideToolbar) {
|
||||
toolbarContainer.setTranslationY(0);
|
||||
this.getCurrentWebView().setTranslationY(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void closeFullScreen() {
|
||||
@ -818,6 +822,10 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
||||
shrinkDrawers();
|
||||
isFullscreenOpened = false;
|
||||
getCurrentWebView().requestLayout();
|
||||
if (isHideToolbar) {
|
||||
toolbarContainer.setTranslationY(DimenUtils.getTranslucentStatusBarHeight(this));
|
||||
this.getCurrentWebView().setTranslationY(DimenUtils.getToolbarAndStatusBarHeight(this));
|
||||
}
|
||||
}
|
||||
|
||||
public void showHelpPage() {
|
||||
|
@ -23,6 +23,7 @@ import android.content.Context;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import org.kiwix.kiwixmobile.KiwixMobileActivity;
|
||||
import org.kiwix.kiwixmobile.WebViewCallback;
|
||||
import org.kiwix.kiwixmobile.utils.DimenUtils;
|
||||
|
||||
@ -72,6 +73,10 @@ public class ToolbarScrollingKiwixWebView extends KiwixWebView {
|
||||
startY = event.getRawY();
|
||||
break;
|
||||
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
|
||||
if (event.getPointerCount() == 1) {
|
||||
int diffY = (int) (event.getRawY() - startY);
|
||||
|
Loading…
x
Reference in New Issue
Block a user