Skip to main content
Samsung Developer Program

Edge Immersive Panels (Deprecated)

You can integrate an Edge Immersive panel into your Android apps. 

Note:  The Edge Immersive Panel has been deprecated.

This section presents programming used only when developing Edge Immersive panels for Android apps.  For programming used when developing all types of Edges apps, see Fundamental Edge Functionality.
 

Implementing an Edge Immersive panel in your Android app requires that your Android app:

  • Must set a sub-window.
  • Must specify the panel layout in activity code.
     

Note: We recommend that your Edge app have a single depth (default setting).

Set an Edge Immersive Panel Sub-window

To make available an Edge Immersive panel as a sub-window in the curved Edge screen area of your app's UI, set a layout resource or a view in a sub-window via SlookCocktailSubWindow class setSubContentView method. To display or hide the panel, set the boolean com.samsung.android.cocktail.sub-window.enable metadata in the AndroidManifest.xml file.

The following example code shows how to specify a layout resource for an Edge Immersive panel:

public class ImmersiveModeActivity extends Activity { 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
        Slook slook = new Slook(); 
        try { 
            slook.initialize(this); 
        } catch (SsdkUnsupportedException e) { 
            return; 
        } 
        if (slook.isFeatureEnabled(Slook.COCKTAIL_BAR)) { 
            /* If the device supports Edge Immersive Panels, set up the sub-window. */ 
            setContentView(R.layout.expaneded_activity_main); 
            SlookCocktailSubWindow.setSubContentView(this, R.layout.sub_view); 
        } else { 
            /* If the device does not support Edge Immersive panels. */
            setContentView(R.layout.activity_main); 
            ...
        } 
    }
}

 

The following example code shows how to enable an Edge Immersive panel sub-window:

/AndroidManifest.xml 
<activity 
...
<meta-data 
    android:name="com.samsung.android.cocktail.subwindow.enable" 
    android:value="true" /> 

</activity>

 

The following example code shows how to disable an Edge Immersive panel sub-window:

/AndroidManifest.xml 
<activity 
...
<meta-data 
    android:name="com.samsung.android.cocktail.subwindow.enable" 
    android:value="false" /> 

</activity>

Vertical and Horizontal Layout Resources

Edge Immersive panels should have a vertical layout and a horizontal layout. When implementing a ListView in RemoteViews, you must implement a ListView for the horizontal layout.

The Android Framework does not support HorizontalListView for widgets; therefore, the Samsung Framework has included a HorizontalListView widget for RemoteViews. You can add layout.xml code that implements HorizontalListView in the layout-land folder in the res directory.

The following example code shows how to specify a vertical layout in /res/layout/layout.xml:

<ListView
    android:id="@+id/widgetlist"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

The following example code shows how to specify a horizontal layout in /res/layout-land/layout.xml:

<HorizontalListView
    android:id="@+id/widgetlist"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
  • Was this article helpful?