kopia lustrzana https://github.com/ryukoposting/Signal-Android
rodzic
e9e2846532
commit
0b7c22886d
|
@ -23,6 +23,7 @@ import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -309,7 +310,9 @@ public class ConversationFragment extends LoggingFragment {
|
||||||
list.setTranslationY(Math.min(0, -chTop));
|
list.setTranslationY(Math.min(0, -chTop));
|
||||||
list.setOverScrollMode(RecyclerView.OVER_SCROLL_NEVER);
|
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
|
@Override
|
||||||
|
|
|
@ -141,7 +141,7 @@ public final class ConversationReactionOverlay extends RelativeLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setListVerticalTranslation(float translationY) {
|
public void setListVerticalTranslation(float translationY) {
|
||||||
maskView.setTargetParentTranslationY(translationY - ViewUtil.getStatusBarHeight(maskView));
|
maskView.setTargetParentTranslationY(translationY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show(@NonNull Activity activity,
|
public void show(@NonNull Activity activity,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.thoughtcrime.securesms.util;
|
package org.thoughtcrime.securesms.util;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
@ -62,6 +63,16 @@ public final class WindowUtil {
|
||||||
window.setStatusBarColor(color);
|
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) {
|
private static void clearSystemUiFlags(@NonNull Window window, int flags) {
|
||||||
View view = window.getDecorView();
|
View view = window.getDecorView();
|
||||||
int uiFlags = view.getSystemUiVisibility();
|
int uiFlags = view.getSystemUiVisibility();
|
||||||
|
|
Ładowanie…
Reference in New Issue