Flex Window

The Cover Screen of the Galaxy Z Flip5 is far bigger than that of previous models. We call this new screen the Flex Window.
Since the screen is larger, it is important to use the Flex Window efficiently.
We can use the optimized full size application widget on the Flex Window.

Add your Widgets to the Flex Window

To show widgets on the Flex Window, we need to add some attributes to AndroidManifest.xml.

Folding features

Each display feature area can be characterized by its bounding rectangle in the window coordinate space and its type.

        android:name="com.samsung.android.myFlip5WidgetProvider ">

                android:resource="@xml/meta_info_calendar_widget" />
                android:resource="@xml/samsung_meta_info_sample_widget" />

First, add the following to “android.appwidget.provider”:

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"




There, you must set four attributes: The size of flex window using the “minWidth” and “minHeight” attributes, as well as the “resizeMode” value at “horizontal | vertical”, and the “widgetCategory” value at “keyguard”.

Second, in “com.samsung.android.appwidget.provider”, add “display = “sub_screen”” which sets the widget to show on the Flex Window:


You can now see your own widgets on the Flex Window of the Flip5. Next, let’s increase the usability of your widgets!

Choose the Screen Where to Start an Activity

Let’s start an activity from your widget. If you set the launchDisplayId value of the Activity Options to pendingIntent, you can start the activity on the screen you declared.

val pIntent = PendingIntent.getActivity(
    PendingIntent.FLAG_CANCEL_CURRENT or
     ActivityOptions.makeBasic().apply {
    launchDisplayId = ( MAIN_SCREEN_ID = 0 , COVER_SCREEN_ID = 1)

remoteViews.setOnClickPendingIntent(YOUR_LAYOUT_ID, pIntent)

Create an Ongoing Notification on the Flex Window

We have also provided a way to show ongoing notifications on the Flex Window. When a widget on the Flex Window sends the ongoing notification, you can customize the view of the notification:

NotificationCompat.Builder(context, CHANNEL_ID)



  1. setSmallIcon: Image to show on the left side of the notification.
  2. setTicker: Description to show on the notification.
  3. setColor: Background color of the notification on
  • setOngoing: Set to “True” to show the notification.