Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 177ec4ed authored by Mark Harman's avatar Mark Harman
Browse files

try to avoid google play recommendation for calling setNavigationBarColor().

parent 5760c4ef
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -3802,10 +3802,19 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
                getWindow().getDecorView().setSystemUiVisibility(flags & ~View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
            }*/
            test_set_show_under_navigation = enable;
            // in theory the VANILLA_ICE_CREAM is redundant as we shouldn't be here on Android 15+ anyway (since edge_to_edge_mode==true), but
            // wrapping in case this helps Google Play recommendation to avoid deprecated APIs for edge-to-edge
            if( Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM ) {
                WindowCompat.setDecorFitsSystemWindows(getWindow(), !enable);
            }
        }

        // in theory the VANILLA_ICE_CREAM is redundant as we shouldn't be here on Android 15+ anyway (since edge_to_edge_mode==true), but
        // wrapping in case this helps Google Play recommendation to avoid deprecated APIs for edge-to-edge
        if( Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM ) {
            getWindow().setNavigationBarColor(enable ? Color.TRANSPARENT : Color.BLACK);
        }
    }

    public int getNavigationGap() {
        return (want_no_limits || edge_to_edge_mode) ? navigation_gap : 0;