Skip to content

Conversation

mrkcsc
Copy link

@mrkcsc mrkcsc commented Nov 25, 2021

  • Changes to the Android native implementation to modernize this code:

  • Convert to Kotlin.
  • Update grade file and dependencies.
  • Add support for respecting the device auto rotation setting.
  • Add support for ignoring the device auto rotation setting (ignoreAutoRotate).
  • Add utility method for passing configuration change value (OrientationConfigListener.sendBroadcast).

Our package.json is pointing to the latest commit at: e3ff091

@mrkcsc mrkcsc self-assigned this Nov 25, 2021
fun ignoreAutoRotate(ignoreAutoRotate: Boolean) {
this.autoRotateIgnored = ignoreAutoRotate
this.maybeLockToPortrait()
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New API surface to disable the default behavior of respecting the auto-rotate setting.

private const val INTENT_VALUE_KEY = "newConfig"

@Suppress("unused")
fun sendBroadcast(activity: Activity, newConfig: Configuration) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New config method caller can use to report configuration that does not leak magic strings.

import com.facebook.react.bridge.LifecycleEventListener
import com.facebook.react.bridge.ReactContext

internal class OrientationAutoRotateListener(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observer for when the auto rotate setting is toggled.

@Flewp Flewp force-pushed the 3.1.3-discord-1 branch from d41c79d to 22a8900 Compare July 14, 2023 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants