Java Code Examples for android.view.Display#getSupportedModes()
The following examples show how to use
android.view.Display#getSupportedModes() .
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: PlaybackController.java From jellyfin-androidtv with GNU General Public License v2.0 | 5 votes |
@TargetApi(23) private void getDisplayModes() { Display display = mApplication.getCurrentActivity().getWindowManager().getDefaultDisplay(); mDisplayModes = display.getSupportedModes(); Timber.i("** Available display refresh rates:"); for (Display.Mode mDisplayMode : mDisplayModes) { Timber.i("%f", mDisplayMode.getRefreshRate()); } }
Example 2
Source File: ScreenUtils.java From leanback-extensions with Apache License 2.0 | 5 votes |
@RequiresApi(api = Build.VERSION_CODES.M) private static void getDisplaySizeV23(@NonNull final Display display, @NonNull final Point outSize) { /* Still not worth enabling 4K, but that's where video modes can be checked. */ Display.Mode[] modes = display.getSupportedModes(); if (modes != null && modes.length > 0) { Display.Mode mode = modes[0]; outSize.x = mode.getPhysicalWidth(); outSize.y = mode.getPhysicalHeight(); } else { display.getRealSize(outSize); } }