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.
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.
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:
setSmallIcon: Image to show on the left side of the notification.
setTicker: Description to show on the notification.
setColor: Background color of the notification on
setOngoing: Set to “True” to show the notification.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.