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

Commit a0b78d56 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Add API to set divider color in code

Change-Id: Ie7489095a598a760d23fe507e831e9327ac9a2e5
Fixes: 68776845
Test: android.systemui.cts
parent 8f0d71e3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -47670,6 +47670,7 @@ package android.view {
    method protected final int getLocalFeatures();
    method public android.media.session.MediaController getMediaController();
    method public abstract int getNavigationBarColor();
    method public int getNavigationBarDividerColor();
    method public android.transition.Transition getReenterTransition();
    method public android.transition.Transition getReturnTransition();
    method public android.transition.Transition getSharedElementEnterTransition();
@@ -47738,6 +47739,7 @@ package android.view {
    method public void setLogo(int);
    method public void setMediaController(android.media.session.MediaController);
    method public abstract void setNavigationBarColor(int);
    method public void setNavigationBarDividerColor(int);
    method public void setReenterTransition(android.transition.Transition);
    method public abstract void setResizingCaptionDrawable(android.graphics.drawable.Drawable);
    method public final void setRestrictedCaptionAreaListener(android.view.Window.OnRestrictedCaptionAreaChangedListener);
+27 −0
Original line number Diff line number Diff line
@@ -2244,9 +2244,36 @@ public abstract class Window {
     * <p>
     * The transitionName for the view background will be "android:navigation:background".
     * </p>
     * @attr ref android.R.styleable#Window_navigationBarColor
     */
    public abstract void setNavigationBarColor(@ColorInt int color);

    /**
     * Shows a thin line of the specified color between the navigation bar and the app
     * content.
     * <p>
     * For this to take effect,
     * the window must be drawing the system bar backgrounds with
     * {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS} and
     * {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_NAVIGATION} must not be set.
     *
     * @param dividerColor The color of the thin line.
     * @attr ref android.R.styleable#Window_navigationBarDividerColor
     */
    public void setNavigationBarDividerColor(@ColorInt int dividerColor) {
    }

    /**
     * Retrieves the color of the navigation bar divider.
     *
     * @return The color of the navigation bar divider color.
     * @see #setNavigationBarColor(int)
     * @attr ref android.R.styleable#Window_navigationBarDividerColor
     */
    public @ColorInt int getNavigationBarDividerColor() {
        return 0;
    }

    /** @hide */
    public void setTheme(int resId) {
    }
+13 −0
Original line number Diff line number Diff line
@@ -3810,6 +3810,19 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        }
    }

    @Override
    public void setNavigationBarDividerColor(int navigationBarDividerColor) {
        mNavigationBarDividerColor = navigationBarDividerColor;
        if (mDecor != null) {
            mDecor.updateColorViews(null, false /* animate */);
        }
    }

    @Override
    public int getNavigationBarDividerColor() {
        return mNavigationBarDividerColor;
    }

    public void setIsStartingWindow(boolean isStartingWindow) {
        mIsStartingWindow = isStartingWindow;
    }
+2 −1
Original line number Diff line number Diff line
@@ -2066,7 +2066,8 @@
             <p>For this to take effect, the window must be drawing the system bar backgrounds with
             {@link android.R.attr#windowDrawsSystemBarBackgrounds} and the navigation bar must not
             have been requested to be translucent with
             {@link android.R.attr#windowTranslucentNavigation}. -->
             {@link android.R.attr#windowTranslucentNavigation}.
             Corresponds to {@link android.view.Window#setNavigationBarDividerColor(int)}. -->
        <attr name="navigationBarDividerColor" format="color" />

        <!-- The duration, in milliseconds, of the window background fade duration