Resizable Apps & Multi-Window Support in Android

Mar 30 2021 · Kotlin 1.4, Android 11, Android Studio 4

Part 1: Resizable Apps & Multi-Window Support in Android

05. Implement Multi-Window Mode Checks

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 04. Handle Multi-Window Lifecycle Next episode: 06. Launch Activities In Multi-Window Mode

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

If you tried resizing your app while in multi-window mode, you’d notice that the onMultiWindowModeChanged() function doesn’t trigger on every resize.

  override fun onConfigurationChanged(newConfig: Configuration) {
    super.onConfigurationChanged(newConfig)

    val newHeight = newConfig.screenHeightDp


  }
    if (isInMultiWindowMode && newHeight < 270) {
      binding.notes.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)
    } else {
      binding.notes.layoutManager = LinearLayoutManager(this)
    }