Quantcast
Jump to content


Recommended Posts

Posted

2020-09-21-01-banner.jpg

Foldable devices

Although new to the industry, the concept of folding devices already has plenty of iterations. Samsung and other OEMs have presented devices with folding capabilities, that allow them to expand into small tablets, compress into smaller footprints, or enable more productive multi-tasking.

Consensus is now, that a “foldable” is a device that folds. While this might seem trivial, the details of how many screens, where/how they fold, and what size and shape the device should be, etc, were all up for discussion. Let’s agree for now that indeed, a foldable is a device that folds. Independent of whether it’s a vertical or horizontal fold, or if it is one big flexible screen or two adjacent ones, how many logical regions the folding translates to, or if it is the size of a phone or a laptop.

1*lK_WtwZiD-WnhdU2Wshuag.png
different types of “foldables”

a foldable is a device that folds

Some time ago I wrote about how to make sure websites looked good on the original Samsung Galaxy Fold. All that information, which summarizes into “make your websites responsive”, is very valid and I’d assume already a common practice. This was a good initial approach at making sure that the Web would continue to flow into different screen sizes, but these new devices were more than just expanded screen real estate. Treating them as just more space for Web content was against the intrinsic nature of the hardware itself, and against the full capabilities that could be enabled for the developer and end user. I knew that in the future I would be sharing information regarding more organic layouts for these types of devices.

Current Web on Galaxy Fold
How to make sure your website looks great on the Galaxy Fold on medium.com

We realized it made sense to embrace the physicality of the state of the device to provide a seamless (pun intended) experience for the user, by giving the developer access to more information regarding this aforementioned physicality.

Foldable Related APIs

Several lines of work started in parallel to address these challenges at Samsung, Microsoft and Intel. The CSS spanning media query and Window Segments Enum API allow developers to detect where the fold occurs, so that they can avoid positioning content on it. This is very handy especially in scenarios where you have dual screen devices with a physical separation between the screens. Microsoft have written an excellent post about these APIs. With the CSS spanning media query it is possible to know the layout of the foldable device and make sure there’s no content cut in half.

I want to introduce the work that we’ve been doing to address other use cases related to foldable devices here at Samsung with collaboration of our lovely friends at Intel.

Screen Fold API

1*Z__KbD6KvE2ZOC9smlMM8g.png
Screen Fold API logo

We envision the need to adapt content to the physical way a device is being used. I mentioned earlier that foldables are more than just extra on-screen space for content. To embrace them we need to take into account the angle in which the screen(s) is folded. We can abstract this into a concept called the “posture” of the device. Considering posture, we can immediately see the benefits of making our content react to these changes. This is the basic concept behind the Screen Fold API.

Disclaimer: All the things I’m writing about at the moment are drafts that are subject to change, evolution or may never even see the light of day, nonetheless I believe it can be exciting to get an early glimpse into the future of Web design and to hear feedback from anyone interested.

The Screen Fold API is an extension to the Screen interface that exposes an angle value, a posture attribute and a change event. It allows developers to identify which posture a device is in and rearrange content accordingly. Working in conjunction with the CSS spanning media queries, one could achieve very interesting layouts. The API identifies a set of predefined postures for common use cases as seen in the image below. (Do note that names or states are not final and we are already considering adding a ‘peek’ state and changing the ‘laptop’ moniker that doesn’t bode well for phones for example.)

1*QDYaRrLuEfPdUx-8_1vt5Q.png
diagram of the postures available in the Screen Fold API (laptop, flat, book, tablet, tent, no fold)

Use Cases

These postures respond to different use cases, as detailed in the explainer linked below, you might recognize some of this functionality already shipped in some native apps under the names of ‘flex mode’.

SamsungInternet/Explainers
See the latest draft of the specification here New types of mobile devices are appearing that have some sort of folding… github.com

These postures are not always what a developer might need so the API also allows us to directly query the angle values. The image below shows the proposed mapping between postures and angles.

1*eoAE6wVtS_jkRB4xIAKO4w.png
Mapping between postures and angles

Examples

There is a way to query these attributes both from JS and CSS. The former is through the screen object, the latter through handy CSS media queries. You can refer to an example below.

1*jBDFTZsrReoQdCQfqdxfEg.png


@media (screen-fold-posture: laptop) and (spanning: single-fold-horizontal){
   body {
     display: flex;
     flex-flow: column nowrap;
   }

   .videocall-area, .videocall-controls {
     flex: 1 1 env(fold-bottom);
   }
}

State of the API

If you’ve read up to here, it is very likely you find this interesting and are wondering what is the current state of the API? As I mentioned before, these are all early concepts. Fortunately, there is a specification draft and work under way at W3C. The Screen Fold API is expected to officially be a part of the Devices and Sensors Working Group and is already listed in the DAS WG roadmap.

1*Nti1pINXqEqlCgNpdi5CQQ.png
Devices and Sensors Working Group

The Screen Fold API
This document specifies an API that allows web applications to request the angular value to which a device with a… w3c.github.io

1*i8vZ-f2YvBoLxBmnx5i-4A.png
Samsung Internet Beta

Furthermore, at Samsung we have been experimenting internally with implementations for the Screen Fold API. We are committed to the Screen Fold API and hope to share an update and more news in the future. This is how a basic example for the Screen Fold API looks running on a Galaxy Z Fold2 device on a custom Samsung Internet build.

1*N8f45wKC_-t09vf5afYRMg.png
Screen Fold API behind a flag in Samsung Internet custom build

 

 

html {
    background-color: blue;
}

@media (max-screen-fold-angle: 120deg) {
    html {
        background-color: red;
    }
}

Finally, to enable you to jump into the fun and experimentation with the Screen Fold API, we have a very early version of a Polyfill and a settings widget for browsers that don’t support the specification draft or that do not fold.

1*iyfsRYjrUQiewKt0JJsmtA.png
Screen Fold Settings widget

Screen Fold Polyfill demo
The Screen Fold API allows you to know the angle and posture that the screen(s) of a device is in. The polyfill allows… w3c.github.io

Yes, I am aware there are compatibility issues in the settings widget at the moment in some browsers and I’m more than happy to welcome help 😉.

The Road Ahead

The journey to properly supporting the Web on foldable devices is just getting started. There are various efforts from different fronts and discussions in standards groups and among the community are under way. At Samsung, we are committed to continue the conversation and advance the implementation. We are looking into ways to bring experimental support for the API in the future and we are in talks with other vendors to make sure we have more implementations.

As technical co-editor of the specification, I am very interested in knowing what you think of the Screen Fold API and if you have any considerations of things we might have left out. Feel free to contact myself (@diekus) or Daniel Appelquist for any questions.

In the meantime, play with the polyfill and let us know your thoughts and designs, as they will help us better shape the folding future of the Web.

Acknowledgements

I’d like to finish this post with a huge thank you to Jo Franchetti. She has lent her support and her CSS expertize from the beginning with every weird idea that comes into my head. Additionally, even though in it’s infancy, this work is possible due to the great advice from my co-editor, Kenneth, and to the internal support from Daniel Appelquist, Heejin Chung and the amazing engineering team in Suwon, Baul and Kangil. ✨

1*kNL65VJsJ-2WA-Rgbyw6Xw.png

View the full blog at its source



  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Similar Topics

    • By Samsung Newsroom
      Starting in 2026, Samsung will enhance its Auto Blocker feature on Galaxy phones and tablets running Android to provide users with greater flexibility while maintaining strong security protections. With this update, users will be able to directly install third-party Android app stores and their apps without Auto Blocker preventing installation, as long as the stores meet certain security and compliance requirements.
      Auto Blocker is a sophisticated security tool designed to give users more control over their device protection, primarily by preventing app installations from unauthorized sources. This upcoming enhancement builds on that foundation by supporting additional app distribution channels, while continuing to apply platform protections across the broader Galaxy security framework.
      Further details will be announced and implemented later this year.
      View the full blog at its source
    • By Samsung Newsroom
      Samsung Galaxy Fold devices have taken the mobile industry by storm, offering users a revolutionary way to interact with their applications. One of their key features is the rear display mode that enables users to continue their tasks seamlessly on the cover display while the main display remains turned off. Jetpack WindowManager has introduced APIs to enable this mode programmatically, and starting from One UI 6.0, developers can now utilize these APIs to integrate rear display mode into their applications, enhancing usability and maximizing the potential of foldable devices.
      In this blog post, we dive deeper into implementing Jetpack WindowManager's rear display mode in a camera application. By leveraging this mode, users can take selfies with superior image quality using the rear camera instead of the front camera. Join us as we explore the exciting possibilities of foldable technology and uncover how to optimize your applications for the Samsung Galaxy Fold.
      You can download the sample camera application here.
      CameraXApp.zip (623.3 KB) Sep 26, 2024 Step 1: Add the WindowManager library into the project
      WindowManager, a Jetpack library introduced by Google, supports rear display mode starting from version 1.2.0-beta03. To add the WindowManager library, go to Gradle Scripts > build.gradle (Module: app) and enter the following to the dependencies block:
      implementation "androidx.window:window:1.3.0" Step 2: Implement the WindowAreaSessionCallback interface in MainActivity.kt
      The WindowAreaSessionCallback interface updates an Activity about when the WindowAreaSession is started and ended. Using the onSessionStarted method, this interface provides the current WindowAreaSession as soon as a new window session is started.
      class MainActivity : AppCompatActivity() , WindowAreaSessionCallback { … override fun onSessionEnded(t: Throwable?) { if(t != null) { println("Something was broken: ${t.message}") } } override fun onSessionStarted(session: WindowAreaSession) { } } Step 3: Declare variables
      The WindowAreaController provides information about the moving windows between the cover display and the main display of the Galaxy Fold device.
      The WindowAreaSession interface provides an active window session in the onSessionStarted method.
      WindowAreaInfo represents the current state of a window area. It provides a token which is used later to activate rear display mode.
      WindowAreaCapability.Status represents the availability and capability status of the window area defined by the WindowAreaInfo object. We utilize this status to change the UI of our application. The status of the Galaxy Fold device can be one of the following:
      WINDOW_AREA_STATUS_ACTIVE: if the cover display is currently active.
      WINDOW_AREA_STATUS_AVAILABLE: if the cover display is available to be enabled.
      WINDOW_AREA_STATUS_UNAVAILABLE: if the cover display is currently not available to be enabled.
      WINDOW_AREA_STATUS_UNSUPPORTED: if the Galaxy Fold device is running on Android 13 or lower.
      private lateinit var windowAreaController: WindowAreaController private var windowAreaSession: WindowAreaSession? = null private var windowAreaInfo: WindowAreaInfo? = null private var capabilityStatus: WindowAreaCapability.Status = WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNSUPPORTED private val operation = WindowAreaCapability.Operation.OPERATION_TRANSFER_ACTIVITY_TO_AREA Step 4: Create an instance of WindowAreaController in the onCreate method
      windowAreaController = WindowAreaController.getOrCreate() Step 5: Set up a flow to get information from WindowAreaController
      In the onCreate() method, add a lifecycle-aware coroutine to query the list of available WindowAreaInfo objects and their status. The coroutine executes each time the lifecycle starts.
      lifecycleScope.launch(Dispatchers.Main) { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { windowAreaController.windowAreaInfos .map { info -> info.firstOrNull { it.type == WindowAreaInfo.Type.TYPE_REAR_FACING } } .onEach { info -> windowAreaInfo = info } .map { it?.getCapability(operation)?.status ?: WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNSUPPORTED } .distinctUntilChanged() .collect { capabilityStatus = it updateUI() } } } Step 6: Update the UI according to the device's WindowAreaCapability.Status
      private fun updateUI() { if(windowAreaSession != null) { viewBinding.switchScreenButton.isEnabled = true } else { when(capabilityStatus) { WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNSUPPORTED -> { viewBinding.switchScreenButton.isEnabled = false Toast.makeText(baseContext, "RearDisplay is not supported on this device", Toast.LENGTH_SHORT).show() } WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNAVAILABLE -> { viewBinding.switchScreenButton.isEnabled = false Toast.makeText(baseContext, "RearDisplay is not currently available", Toast.LENGTH_SHORT).show() } WindowAreaCapability.Status.WINDOW_AREA_STATUS_AVAILABLE -> { viewBinding.switchScreenButton.isEnabled = true } WindowAreaCapability.Status.WINDOW_AREA_STATUS_ACTIVE -> { viewBinding.switchScreenButton.isEnabled = true Toast.makeText(baseContext, "RearDisplay is currently active", Toast.LENGTH_SHORT).show() } else -> { viewBinding.switchScreenButton.isEnabled = false Toast.makeText(baseContext, "RearDisplay status is unknown", Toast.LENGTH_SHORT).show() } } } } Step 7: Toggle to rear display mode with WindowAreaController
      Close the session if it is already active, otherwise start a transfer session to move the MainActivity to the window area identified by the token.
      While activating rear display mode, the system creates a dialog to request the user’s permission to allow the application to switch screens. This dialog is not customizable.
      private fun toggleRearDisplayMode() { if(capabilityStatus == WindowAreaCapability.Status.WINDOW_AREA_STATUS_ACTIVE) { if(windowAreaSession == null) { windowAreaSession = windowAreaInfo?.getActiveSession( operation ) } windowAreaSession?.close() } else { windowAreaInfo?.token?.let { token -> windowAreaController.transferActivityToWindowArea( token = token, activity = this, executor = displayExecutor, windowAreaSessionCallback = this ) } } } Step 8: Start the camera preview
      Call startCamera() when onSessionStarted is triggered by the WindowAreaSessionCallback interface.
      override fun onSessionStarted(session: WindowAreaSession) { startCamera() } Step 9: Add a button and set a listener to it for activating rear display mode
      <Button android:id="@+id/switch_screen_button" android:layout_width="110dp" android:layout_height="110dp" android:layout_marginStart="50dp" android:elevation="2dp" android:text="@string/switch_screen" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toTopOf="@+id/horizontal_baseline" app:layout_constraintStart_toEndOf="@id/vertical_centerline" /> viewBinding.switchScreenButton.setOnClickListener{ updateUI() toggleRearDisplayMode() } Incorporating rear display mode into your application can significantly enhance user experience by providing more intuitive control and greater flexibility. By following the outlined steps, you can create a more dynamic and user-friendly interface. As technology continues to evolve, staying ahead with features like rear display mode can set your application apart and offer users a seamless, professional-quality experience. To learn more about developing applications for Galaxy Foldable devices, visit: developer.samsung.com/galaxy-z.
      View the full blog at its source
    • Government UFO Files
    • By Samsung Newsroom
      The end of a year is the perfect time to gather friends and family and celebrate the year that has passed as well as the one that is to come. When it comes to planning the perfect year-end party, curating the perfect playlist is a must — but so is ensuring that your audio devices are able to set the tone all night long for that perfect celebratory mood.
       
      In order to help you make your celebration unforgettable, Samsung Newsroom has put together some ideas of ways you can ensure your party is the best in town with Samsung’s sound technologies.
       
       
      Ultra Slim Soundbar: Rock Out in Style

       
      For those who prioritize style as well as great audio quality, Samsung’s Ultra Slim Soundbar (S801B) is the perfect choice for your year-end celebrations. As its name suggests, the Ultra Slim Soundbar features an incredibly slim design of just 38mm in height and 40mm in thickness — a size equivalent to that of a soda can — meaning that its wall-mounted design is sure to stand out. You can also install it freely around your space thanks to its wireless connectivity to ensure your sound system blends seamlessly into your surroundings.
       

       
      If you’re looking to further personalize your space, you can give your Soundbar a boost with the Ultra Slim Soundbar Skin (SCFBS8[BW/TK]) released earlier this year, which comes in warm brown and teak colors. Paired with your The Frame and its elegant, modern design, you are set to enjoy not only top-level audio experiences but also a cozy, festive feel.
       

       
      Despite its slim appearance, the Ultra Slim Soundbar is capable of powerful sound. Designed with 3.1.2-channel technology that features seven front speakers and one subwoofer centered on the top two speakers, the Ultra Slim Soundbar provides complete and truly surround-sound experiences. Dolby Atmos support also further contributes to providing you with captivating entertainment experiences.
       
       
      S-Series Soundbar: Envelop Your Space With Truly Immersive Sound

       
      For those who love to set the scene with truly immersive sound experiences during a celebration or party, the S-Series Soundbar is the soundbar for you.
       
      The S-Series Soundbar delivers rich, room-filling surround sound able to reach every person in the room. This compact, 67cm, all-in-one 5.0-channel soundbar has an impressive four built-in woofers and three tweeter speakers, providing you with a fully immersive, 3D sound experience — all without the need for a subwoofer.
       

       
      In addition, Adaptive Sound technology is able to analyze the source of any sound in order to automatically deliver optimized audio based on its specific genre. Experience the best, most immersive audio for each and every type of content you’re enjoying, whether it’s a sports game, a classical performance or an action movie.
       

       
      Your S-Series Soundbar can be easily connected to your Samsung Smart TV and is the first soundbar in the industry to support Dolby Atmos connection for room-filling, optimized 3D sound.
       
       
      Q-Series Soundbar: Bring the Cinema Experience Into Your Home

       
      If you’re looking to celebrate the year-end season with your favorite movies or TV shows, you can transform your home into a cinema with the room-filling sound of Samsung’s premium soundbar, the Q-Series Soundbar (Q990B).
       
      With an astounding 17 front surround sound speakers, one subwoofer and four up-firing speakers, the Q-Series Soundbar fills the room with truly cinematic surround sound. Synced with your Samsung Neo QLEDs, these 22-channel speakers can deliver truly immersive surround sound experiences like no other.
       

       
      Samsung’s proprietary Q-Symphony technology allows for compatible TVs and soundbars to play audio at the same time, in sync, taking your listening experiences to the next level through powerful sound quality. Meanwhile, Spacefit Sound technology optimizes your audio based on the structure and layout of your room, providing you with sound that is perfectly crafted for your space and rivals a VIP seat in a movie theater.
       
      In addition, the Q-Series Soundbar has been recognized by renowned global media outlets for its immersive sound experiences, as well as its sleek design.
       

       
       
      Sound Tower: Take the Party Spirit to the Next Level

       
      If you’re planning to celebrate the year-end with a bang and throw a party, the Sound Tower (MX-ST90B) is a must-have. This oval Sound Tower fills up virtually any space with 3D audio. The 24.5cm speaker with a built-in woofer provides the perfect punching bass experience, with up to 1700W bass boosting for a beat that sets the party mood perfectly.
       

       
      In addition to its powerful audio capabilities, the Sound Tower’s various light modes provide an audio-visual harmony that truly matches the mood of the night. Its Bluetooth multi-connection, which allows for two smart devices to be connected simultaneously, and its Group Play functionality, which connects up to 10 Sound Towers, really help you get the party started both indoors as well as outdoors.
       
      Be sure to finish your year strong with Samsung’s range of soundbar and Sound Tower devices. Once you’ve chosen your perfect soundbar based on your own preferences and purposes, enjoy enriching sound during your year-end festivities and beyond.
      View the full article





×
×
  • Create New...