Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
vNext
----------
- [MINOR] Full edge to edge support (#2721)
- [MAJOR] Bump TargetSdk to 35, minSdk to 24, AGP to 8.10.0 (#2713)
- [Minor] Improve tenant-based flighting for broker supporting code (#2717)
- [PATCH] Fix caching of secret key and add retries for InvalidKeyException during unwrap (#2659)
Expand Down
1 change: 1 addition & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ dependencies {

implementation 'org.apache.httpcomponents.core5:httpcore5:5.3'
implementation "com.nimbusds:nimbus-jose-jwt:$rootProject.ext.nimbusVersion"
implementation "androidx.activity:activity:1.8.2"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation "androidx.appcompat:appcompat:$rootProject.ext.appCompatVersion"
implementation "com.google.code.gson:gson:$rootProject.ext.gsonVersion"
implementation "com.squareup.moshi:moshi:$rootProject.ext.moshiVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Surface;
import android.view.WindowManager;
import android.widget.RelativeLayout;

import androidx.activity.EdgeToEdge;
import androidx.activity.SystemBarStyle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.ConstraintSet;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.Fragment;
Expand All @@ -52,6 +58,22 @@
// This activity readjusts its child layouts so that they're displayed on both single-screen and dual-screen device correctly.
public class DualScreenActivity extends FragmentActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.ENABLE_HANDLING_FOR_EDGE_TO_EDGE)) {
// Force set to a light theme (to status and navigation bars) since broker/common activities always have white background.
// We don't support dark mode in broker/common activities yet.
// Until then, having everything consistently rendered with a white background looks better.
// This will also guarantee that the icons on those bars are always visible.
setTheme(R.style.Theme_AppCompat_Light);
EdgeToEdge.enable(this,
SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT),
SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT));
}
}

@Override
public void setContentView(int layoutResID) {
initializeContentView();
Expand All @@ -65,18 +87,19 @@ private void initializeContentView(){
if (CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.ENABLE_HANDLING_FOR_EDGE_TO_EDGE)) {
try {
ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content), (view, insets) -> {
int topInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
int bottomInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
int leftInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).left;
int rightInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).right;

view.setPadding(leftInset, topInset, rightInset, bottomInset);
// Set the padding of the view to the insets of system bars, display cutout, system gestures, and Input (keyboards).
final Insets inset = insets.getInsets(WindowInsetsCompat.Type.systemBars()
| WindowInsetsCompat.Type.displayCutout()
| WindowInsetsCompat.Type.systemGestures()
| WindowInsetsCompat.Type.ime());
view.setPadding(inset.left, inset.top, inset.right, inset.bottom);
return insets;
});
} catch (final Throwable throwable) {
Logger.warn("DualScreenActivity:initializeContentView", "Failed to set OnApplyWindowInsetsListener");
}
}

adjustLayoutForDualScreenActivity();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public enum CommonFlight implements IFlightConfig {
/**
* Flight to enable handling the UI in edge to edge mode
*/
ENABLE_HANDLING_FOR_EDGE_TO_EDGE("EnableHandlingEdgeToEdge", false),
ENABLE_HANDLING_FOR_EDGE_TO_EDGE("EnableHandlingEdgeToEdge", true),

/**
* Flight to enable the Web CP in WebView.
Expand Down
Loading