Skip to content

Commit b130564

Browse files
committed
Consider translucent window for root background
1 parent 895825d commit b130564

File tree

1 file changed

+7
-2
lines changed
  • dynamic-support/src/main/java/com/pranavpandey/android/dynamic/support

1 file changed

+7
-2
lines changed

dynamic-support/src/main/java/com/pranavpandey/android/dynamic/support/Dynamic.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,10 +1895,15 @@ public static void setElevation(@Nullable View view, float elevation) {
18951895
*/
18961896
public static <T> void setRootBackground(@Nullable T dynamic, @ColorInt int color) {
18971897
if (dynamic instanceof Window) {
1898-
((Window) dynamic).setBackgroundDrawable(withThemeOpacity(new ColorDrawable(color)));
1898+
((Window) dynamic).setBackgroundDrawable(
1899+
DynamicTheme.getInstance().get().isTranslucentWindow()
1900+
? withThemeOpacity(new ColorDrawable(color))
1901+
: new ColorDrawable(color));
18991902
} else if (dynamic instanceof View) {
19001903
DynamicDrawableUtils.setBackground((View) dynamic,
1901-
withThemeOpacity(new ColorDrawable(color)));
1904+
DynamicTheme.getInstance().get().isTranslucentWindow()
1905+
? withThemeOpacity(new ColorDrawable(color))
1906+
: new ColorDrawable(color));
19021907
}
19031908
}
19041909

0 commit comments

Comments
 (0)