Skip to content
1 change: 1 addition & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ dependencies {
implementation "com.google.code.gson:gson:$rootProject.ext.gsonVersion"
implementation "com.squareup.moshi:moshi:$rootProject.ext.moshiVersion"
implementation "androidx.browser:browser:$rootProject.ext.browserVersion"
implementation "androidx.core:core:$rootProject.ext.androidxCoreVersion"
implementation "androidx.constraintlayout:constraintlayout:$rootProject.ext.constraintLayoutVersion"
//For Executive Order work
implementation "com.yubico.yubikit:android:$rootProject.ext.yubikitAndroidVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.ConstraintSet;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentTransaction;

import com.microsoft.device.display.DisplayMask;
import com.microsoft.identity.common.R;
import com.microsoft.identity.common.java.flighting.CommonFlightsManager;
import com.microsoft.identity.common.java.flighting.CommonFlight;
import com.microsoft.identity.common.logging.Logger;

import java.util.List;
Expand All @@ -58,6 +62,21 @@ public void setContentView(int layoutResID) {

private void initializeContentView(){
super.setContentView(R.layout.dual_screen_layout);
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);
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 @@ -119,7 +119,12 @@ public enum CommonFlight implements IFlightConfig {
/**
* Flight to enable exposing the JavaScript API for AuthUx requests
*/
ENABLE_JS_API_FOR_AUTHUX("EnableJsApiForAuthUx", true);
ENABLE_JS_API_FOR_AUTHUX("EnableJsApiForAuthUx", true),

/**
* Flight to enable handling the UI in edge to edge mode
*/
ENABLE_HANDLING_FOR_EDGE_TO_EDGE("EnableHandlingEdgeToEdge", true);

private String key;
private Object defaultValue;
Expand Down
1 change: 1 addition & 0 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ext {
androidxTestCoreVersion = "1.5.0"
androidxJunitVersion = "1.1.3"
annotationVersion = "1.0.0"
androidxCoreVersion = "1.5.0"
appCompatVersion = "1.1.0"
browserVersion = "1.0.0"
constraintLayoutVersion = "1.1.3"
Expand Down
Loading