Java Code Examples for android.content.pm.ActivityInfo#ColorMode

The following examples show how to use android.content.pm.ActivityInfo#ColorMode . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Window.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 * <p>Sets the requested color mode of the window. The requested the color mode might
 * override the window's pixel {@link WindowManager.LayoutParams#format format}.</p>
 *
 * <p>The requested color mode must be one of {@link ActivityInfo#COLOR_MODE_DEFAULT},
 * {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT} or {@link ActivityInfo#COLOR_MODE_HDR}.</p>
 *
 * <p>The requested color mode is not guaranteed to be honored. Please refer to
 * {@link #getColorMode()} for more information.</p>
 *
 * @see #getColorMode()
 * @see Display#isWideColorGamut()
 * @see Configuration#isScreenWideColorGamut()
 */
public void setColorMode(@ActivityInfo.ColorMode int colorMode) {
    final WindowManager.LayoutParams attrs = getAttributes();
    attrs.setColorMode(colorMode);
    dispatchWindowAttributesChanged(attrs);
}
 
Example 2
Source File: Window.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the requested color mode of the window, one of
 * {@link ActivityInfo#COLOR_MODE_DEFAULT}, {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT}
 * or {@link ActivityInfo#COLOR_MODE_HDR}. If {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT}
 * was requested it is possible the window will not be put in wide color gamut mode depending
 * on device and display support for that mode. Use {@link #isWideColorGamut} to determine
 * if the window is currently in wide color gamut mode.
 *
 * @see #setColorMode(int)
 * @see Display#isWideColorGamut()
 * @see Configuration#isScreenWideColorGamut()
 */
@ActivityInfo.ColorMode
public int getColorMode() {
    return getAttributes().getColorMode();
}
 
Example 3
Source File: WindowManager.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 * <p>Set the color mode of the window. Setting the color mode might
 * override the window's pixel {@link WindowManager.LayoutParams#format format}.</p>
 *
 * <p>The color mode must be one of {@link ActivityInfo#COLOR_MODE_DEFAULT},
 * {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT} or
 * {@link ActivityInfo#COLOR_MODE_HDR}.</p>
 *
 * @see #getColorMode()
 */
public void setColorMode(@ActivityInfo.ColorMode int colorMode) {
    mColorMode = colorMode;
}
 
Example 4
Source File: WindowManager.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the color mode of the window, one of {@link ActivityInfo#COLOR_MODE_DEFAULT},
 * {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT} or {@link ActivityInfo#COLOR_MODE_HDR}.
 *
 * @see #setColorMode(int)
 */
@ActivityInfo.ColorMode
public int getColorMode() {
    return mColorMode;
}