Vineeth
Vineeth

Reputation: 150

Android Nougat multi-window minHeight

Anyone tried setting minimum Height for the app to have in Nougat multi-window mode ?

Tried this,

<activity android:name=".MyActivity">
    <layout android:defaultHeight="500dp"
        android:defaultWidth="600dp"
        android:gravity="top|end"
        android:minHeight="450dp"
        android:minWidth="300dp" />
</activity>

My reference was this: https://developer.android.com/guide/topics/ui/multi-window.html

But, didn't found any difference.

App working as normal in multi-window. No difference in the minimum Height for the app.

Upvotes: 1

Views: 2370

Answers (2)

Chaitanya Kusurkar
Chaitanya Kusurkar

Reputation: 11

To change the height of app you actually need to modify AOSP, so that it will effectively set the divider size as per your requirement. You will then have to flash your device with modified AOSP code.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007484

In split-screen mode, minHeight does not change the minimum height of the pane that the activity is in. However, quoting the documentation:

If the user moves the divider in split-screen mode to make an activity smaller than the specified minimum, the system crops the activity to the size the user requests.

Without minHeight, if the user moves the divider and resizes your activity's pane, your activity is resized.

With minHeight, if the user moves the divider and now your activity's pane is smaller than the minHeight, your activity still renders into a minHeight canvas. However, then that canvas is cropped, so the user only sees the top minHeight of it.

Eventually, in free-form window mode, minHeight might behave more like what you would expect from the attribute name, where the activity's window cannot be resized smaller than the designated height.

Upvotes: 1

Related Questions