Last active
October 19, 2020 07:47
-
-
Save huuphuoc1396/c2736505ded8b151257347255e120c52 to your computer and use it in GitHub Desktop.
MainCoverDisplayCallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private inner class MainCoverDisplayCallback : DisplayManagerHelper.CoverDisplayCallback() { | |
override fun onCoverDisplayEnabledChangedCallback(state: Int) { | |
displayManagerHelper?.coverDisplayState?.let { | |
Log.i(TAG, "Current DualScreen Callback state: ${coverDisplayStateToString(it)}") | |
} | |
if (prevDualScreenState != state) { | |
when (state) { | |
DisplayManagerHelper.STATE_UNMOUNT -> { | |
Log.i(TAG, "Changed DualScreen State to STATE_UNMOUNT") | |
} | |
DisplayManagerHelper.STATE_DISABLED -> { | |
Log.i(TAG, "Changed DualScreen State to STATE_DISABLED") | |
} | |
DisplayManagerHelper.STATE_ENABLED -> { | |
toSecondScreen() | |
Log.i(TAG, "Changed DualScreen State to STATE_ENABLED") | |
} | |
} | |
prevDualScreenState = state | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment