mobile: fullscreen (immersive Android + PWA) + auto-hide reported nudity avatars
Fullscreen on mobile: - Android (Capacitor): MainActivity now runs edge-to-edge and hides the status + navigation bars (immersive, transient-on-swipe), re-asserted on focus. - PWA: manifest display -> "fullscreen" with display_override fallback chain; viewport gains viewport-fit: cover for proper safe-area/edge-to-edge handling. Moderation auto-hide: - ProfileService.ReportUser now de-dupes nudity reports per reporter and, once NudityHideThreshold (3) distinct players flag a target's avatar as nudity, auto-removes their custom photo (reverts to default avatar). Counted from the ledger, so still no schema change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,38 @@
|
||||
package com.bargevasat.app;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.core.view.WindowCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
|
||||
public class MainActivity extends BridgeActivity {}
|
||||
/**
|
||||
* Runs the game edge-to-edge and hides the Android status + navigation bars for
|
||||
* a fullscreen, console-like experience (they reappear transiently on a swipe).
|
||||
*/
|
||||
public class MainActivity extends BridgeActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
enableImmersive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
// Re-assert immersive mode whenever the window regains focus (e.g. after a
|
||||
// system dialog, or the bars were swiped in).
|
||||
if (hasFocus) enableImmersive();
|
||||
}
|
||||
|
||||
private void enableImmersive() {
|
||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
|
||||
WindowInsetsControllerCompat controller =
|
||||
WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView());
|
||||
if (controller != null) {
|
||||
controller.hide(WindowInsetsCompat.Type.systemBars());
|
||||
controller.setSystemBarsBehavior(
|
||||
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user