Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 41 additions & 15 deletions android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,49 @@ public static void launch(Context context, String url) {
}

public static void addTopBottomInsets(@NonNull Window w, @NonNull View v) {
android.util.Log.e(TAG, ">>> addTopBottomInsets METHOD CALLED <<<");

// Enable edge-to-edge mode
androidx.core.view.WindowCompat.setDecorFitsSystemWindows(w, false);

w.setStatusBarColor(android.graphics.Color.TRANSPARENT);
w.setNavigationBarColor(android.graphics.Color.TRANSPARENT);

View decorView = w.getDecorView();

decorView.post(() -> {
WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(decorView);
if (insets != null) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
params.topMargin = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
params.bottomMargin = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
v.setLayoutParams(params);
final android.util.DisplayMetrics metrics = v.getContext().getResources().getDisplayMetrics();
final int screenHeight = metrics.heightPixels;
final float density = metrics.density;

ViewCompat.setOnApplyWindowInsetsListener(decorView, (view, windowInsets) -> {

int statusBarInset = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars()).top;
int navBarInset = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;

// Apply defensive caps to prevent device-specific bugs with inflated inset values
final int maxTopInset = Math.min((int)(60 * density), (int)(screenHeight * 0.10));
final int maxBottomInset = Math.min((int)(120 * density), (int)(screenHeight * 0.10));

int topInset = Math.min(statusBarInset, maxTopInset);
int bottomInset = Math.min(navBarInset, maxBottomInset);

decorView.setOnApplyWindowInsetsListener((view, windowInsets) -> {
view.setBackgroundColor(JitsiMeetView.BACKGROUND_COLOR);
// Apply insets as margins
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) v.getLayoutParams();

return windowInsets;
});
if (params.topMargin != topInset || params.bottomMargin != bottomInset) {
params.topMargin = topInset;
params.bottomMargin = bottomInset;
v.setLayoutParams(params);
}

view.setBackgroundColor(JitsiMeetView.BACKGROUND_COLOR);

// Consume insets to prevent double-application
return WindowInsetsCompat.CONSUMED;
});

// Trigger initial inset application
ViewCompat.requestApplyInsets(decorView);
}

// Overrides
Expand All @@ -136,10 +161,11 @@ protected void onCreate(Bundle savedInstanceState) {

setContentView(R.layout.activity_jitsi_meet);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM
&& getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
addTopBottomInsets(getWindow(), findViewById(android.R.id.content));
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM
&& getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
addTopBottomInsets(getWindow(), findViewById(android.R.id.content));
}

this.jitsiView = findViewById(R.id.jitsiView);

Expand Down
4 changes: 2 additions & 2 deletions react/features/base/ui/Tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ export const colorMap = {

// Welcome Page
welcomeBackground: 'surface01', // Welcome page background (same as uiBackground)
welcomeCard: 'ui01', // Welcome page tab bar background
welcomeCard: 'surface02', // Welcome page tab bar background
welcomeTabActive: 'icon01', // Welcome page active tab icon
welcomeTabInactive: 'icon03', // Welcome page inactive tab icon
welcomeTabInactive: 'ui03', // Welcome page inactive tab icon

// ----- Form Components -----

Expand Down
2 changes: 1 addition & 1 deletion react/features/welcome/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { IconCalendar, IconGear, IconRestore } from '../base/icons/svg';
import BaseTheme from '../base/ui/components/BaseTheme';
import BaseTheme from '../base/ui/components/BaseTheme.native';

import TabIcon from './components/TabIcon';

Expand Down