parent
e9e2846532
commit
0b7c22886d
3 changed files with 16 additions and 2 deletions
|
@ -23,6 +23,7 @@ import android.content.ClipData;
|
|||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
@ -309,7 +310,9 @@ public class ConversationFragment extends LoggingFragment {
|
|||
list.setTranslationY(Math.min(0, -chTop));
|
||||
list.setOverScrollMode(RecyclerView.OVER_SCROLL_NEVER);
|
||||
}
|
||||
listener.onListVerticalTranslationChanged(list.getTranslationY());
|
||||
|
||||
int offset = WindowUtil.isStatusBarPresent(requireActivity().getWindow()) ? ViewUtil.getStatusBarHeight(list) : 0;
|
||||
listener.onListVerticalTranslationChanged(list.getTranslationY() - offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -141,7 +141,7 @@ public final class ConversationReactionOverlay extends RelativeLayout {
|
|||
}
|
||||
|
||||
public void setListVerticalTranslation(float translationY) {
|
||||
maskView.setTargetParentTranslationY(translationY - ViewUtil.getStatusBarHeight(maskView));
|
||||
maskView.setTargetParentTranslationY(translationY);
|
||||
}
|
||||
|
||||
public void show(@NonNull Activity activity,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
@ -62,6 +63,16 @@ public final class WindowUtil {
|
|||
window.setStatusBarColor(color);
|
||||
}
|
||||
|
||||
/**
|
||||
* A sort of roundabout way of determining if the status bar is present by seeing if there's a
|
||||
* vertical window offset.
|
||||
*/
|
||||
public static boolean isStatusBarPresent(@NonNull Window window) {
|
||||
Rect rectangle = new Rect();
|
||||
window.getDecorView().getWindowVisibleDisplayFrame(rectangle);
|
||||
return rectangle.top > 0;
|
||||
}
|
||||
|
||||
private static void clearSystemUiFlags(@NonNull Window window, int flags) {
|
||||
View view = window.getDecorView();
|
||||
int uiFlags = view.getSystemUiVisibility();
|
||||
|
|
Loading…
Add table
Reference in a new issue