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
package com.certpathvalidator; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.view.animation.AccelerateInterpolator; | |
import android.view.animation.AlphaAnimation; | |
import android.view.animation.Animation; | |
import android.view.animation.AnimationSet; |
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
ssh-add ~/.ssh/your_id_rsa | |
ssh-add -l | |
ssh -Tv [email protected] |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.android.multiplescreens"> | |
<application | |
<!-- See about the taskAffinity attribute at http://bit.ly/34RKvzC --> | |
<activity | |
android:name=".SecondActivity" | |
android:launchMode="singleTask" | |
android:taskAffinity="cover.container" /> | |
</application> | |
</manifest> |
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
val displayManager = getSystemService(Context.DISPLAY_SERVICE) as DisplayManager |
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
val displays = displayManager.displays |
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
if (displays.size > 1) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | |
// Activity options are used to select the display screen. | |
val options = ActivityOptions.makeBasic() | |
// Select the display screen that you want to show the second activity | |
options.launchDisplayId = displays[1].displayId | |
// To display on the second screen that your intent must be set flag to make | |
// single task (combine FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_NEW_TASK) | |
// or you also set it in the manifest (see more at the manifest file) | |
startActivity( |
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") | |
} |
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 MainSmartCoverCallback : DisplayManagerHelper.SmartCoverCallback() { | |
override fun onTypeChanged(type: Int) { | |
Log.i(TAG, "SmartCoverCallback type: ${displayManagerHelper?.coverType}") | |
} | |
override fun onStateChanged(state: Int) { | |
displayManagerHelper?.coverState?.let { | |
Log.i(TAG, "Current SmartCoverCallback state: ${smartCoverStateToString(it)}") | |
} | |
when (state) { |
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
try { | |
// Try to construct the DisplayMangerHelper. | |
// If it isn't successful, this device isn't LG dual screens | |
displayManagerHelper = DisplayManagerHelper(applicationContext) | |
coverDisplayCallback = MainCoverDisplayCallback() | |
smartCoverCallback = MainSmartCoverCallback() | |
// Register the callbacks for covers | |
displayManagerHelper?.registerCoverDisplayEnabledCallback( | |
applicationContext.packageName, |
OlderNewer