Class Flap

All Implemented Interfaces:
Swipeable, Accessible, Buildable, ConstraintTarget, Orientable, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public final class Flap extends Widget implements Swipeable, Accessible, Buildable, ConstraintTarget, Orientable
Deprecated.

An adaptive container acting like a box or an overlay.

flap-wide flap-narrow

The AdwFlap widget can display its children like a Box does or like a Overlay does, according to the Flap:fold-policy value.

AdwFlap has at most three children: Flap:content, Flap:flap and Flap:separator. Content is the primary child, flap is displayed next to it when unfolded, or overlays it when folded. Flap can be shown or hidden by changing the Flap:reveal-flap value, as well as via swipe gestures if Flap:swipe-to-open and/or Flap:swipe-to-close are set to TRUE.

Optionally, a separator can be provided, which would be displayed between the content and the flap when there's no shadow to separate them, depending on the transition type.

Flap:flap is transparent by default; add the .background style class to it if this is unwanted.

If Flap:modal is set to TRUE, content becomes completely inaccessible when the flap is revealed while folded.

The position of the flap and separator children relative to the content is determined by orientation, as well as the Flap:flap-position value.

Folding the flap will automatically hide the flap widget, and unfolding it will automatically reveal it. If this behavior is not desired, the Flap:locked property can be used to override it.

Common use cases include sidebars, header bars that need to be able to overlap the window content (for example, in fullscreen mode) and bottom sheets.

AdwFlap as GtkBuildable

The AdwFlap implementation of the Buildable interface supports setting the flap child by specifying “flap” as the “type” attribute of a <child> element, and separator by specifying “separator”. Specifying “content” child type or omitting it results in setting the content child.

CSS nodes

AdwFlap has a single CSS node with name flap. The node will get the style classes .folded when it is folded, and .unfolded when it's not.

  • Constructor Details

    • Flap

      public Flap(MemorySegment address)
      Deprecated.
      Create a Flap instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Flap

      public Flap()
      Deprecated.
      Create a new Flap.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Deprecated.
      Get the GType of the Flap class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      Deprecated.
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected Flap asParent()
      Deprecated.
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • getContent

      @Deprecated public @Nullable Widget getContent()
      Deprecated.
      Gets the content widget for self.
      Returns:
      the content widget for this Flap
    • getFlap

      @Deprecated public @Nullable Widget getFlap()
      Deprecated.
      Gets the flap widget for self.
      Returns:
      the flap widget for this Flap
    • getFlapPosition

      @Deprecated public PackType getFlapPosition()
      Deprecated.
      Gets the flap position for self.
      Returns:
      the flap position for this Flap
    • getFoldDuration

      @Deprecated public int getFoldDuration()
      Deprecated.
      Gets the fold transition animation duration for self, in milliseconds.
      Returns:
      the fold transition duration
    • getFoldPolicy

      @Deprecated public FlapFoldPolicy getFoldPolicy()
      Deprecated.
      Gets the fold policy for self.
      Returns:
      the fold policy for this Flap
    • getFoldThresholdPolicy

      @Deprecated public FoldThresholdPolicy getFoldThresholdPolicy()
      Deprecated.
      Gets the fold threshold policy for self.
      Returns:
      the fold threshold policy
    • getFolded

      @Deprecated public boolean getFolded()
      Deprecated.

      Gets whether this Flap is currently folded.

      See Flap:fold-policy.

      Returns:
      TRUE if this Flap is currently folded
    • getLocked

      @Deprecated public boolean getLocked()
      Deprecated.
      Gets whether this Flap is locked.
      Returns:
      TRUE if this Flap is locked
    • getModal

      @Deprecated public boolean getModal()
      Deprecated.
      Gets whether this Flap is modal.
      Returns:
      TRUE if this Flap is modal
    • getRevealFlap

      @Deprecated public boolean getRevealFlap()
      Deprecated.
      Gets whether the flap widget is revealed for self.
      Returns:
      TRUE if the flap widget is revealed
    • getRevealParams

      @Deprecated public SpringParams getRevealParams()
      Deprecated.
      Gets the reveal animation spring parameters for self.
      Returns:
      the reveal animation parameters
    • getRevealProgress

      @Deprecated public double getRevealProgress()
      Deprecated.

      Gets the current reveal progress for self.

      0 means fully hidden, 1 means fully revealed.

      See Flap:reveal-flap.

      Returns:
      the current reveal progress for this Flap
    • getSeparator

      @Deprecated public @Nullable Widget getSeparator()
      Deprecated.
      Gets the separator widget for self.
      Returns:
      the separator widget for this Flap
    • getSwipeToClose

      @Deprecated public boolean getSwipeToClose()
      Deprecated.
      Gets whether this Flap can be closed with a swipe gesture.
      Returns:
      TRUE if this Flap can be closed with a swipe gesture
    • getSwipeToOpen

      @Deprecated public boolean getSwipeToOpen()
      Deprecated.
      Gets whether this Flap can be opened with a swipe gesture.
      Returns:
      TRUE if this Flap can be opened with a swipe gesture
    • getTransitionType

      @Deprecated public FlapTransitionType getTransitionType()
      Deprecated.
      Gets the type of animation used for reveal and fold transitions in self.
      Returns:
      the current transition type of this Flap
    • setContent

      @Deprecated public void setContent(@Nullable Widget content)
      Deprecated.

      Sets the content widget for self.

      It's always displayed when unfolded, and partially visible when folded.

      Parameters:
      content - the content widget
    • setFlap

      @Deprecated public void setFlap(@Nullable Widget flap)
      Deprecated.

      Sets the flap widget for self.

      It's only visible when Flap:reveal-progress is greater than 0.

      Parameters:
      flap - the flap widget
    • setFlapPosition

      @Deprecated public void setFlapPosition(PackType position)
      Deprecated.

      Sets the flap position for self.

      If it's set to Gtk.PackType.start, the flap is displayed before the content, if Gtk.PackType.end, it's displayed after the content.

      Parameters:
      position - the new value
    • setFoldDuration

      @Deprecated public void setFoldDuration(int duration)
      Deprecated.
      Sets the fold transition animation duration for self, in milliseconds.
      Parameters:
      duration - the new duration, in milliseconds
    • setFoldPolicy

      @Deprecated public void setFoldPolicy(FlapFoldPolicy policy)
      Deprecated.
      Sets the fold policy for self.
      Parameters:
      policy - the fold policy
    • setFoldThresholdPolicy

      @Deprecated public void setFoldThresholdPolicy(FoldThresholdPolicy policy)
      Deprecated.

      Sets the fold threshold policy for self.

      If set to Adw.FoldThresholdPolicy.minimum, flap will only fold when the children cannot fit anymore. With Adw.FoldThresholdPolicy.natural, it will fold as soon as children don't get their natural size.

      This can be useful if you have a long ellipsizing label and want to let it ellipsize instead of immediately folding.

      Parameters:
      policy - the policy to use
    • setLocked

      @Deprecated public void setLocked(boolean locked)
      Deprecated.

      Sets whether this Flap is locked.

      If FALSE, folding when the flap is revealed automatically closes it, and unfolding it when the flap is not revealed opens it. If TRUE, Flap:reveal-flap value never changes on its own.

      Parameters:
      locked - the new value
    • setModal

      @Deprecated public void setModal(boolean modal)
      Deprecated.

      Sets whether this Flap is modal.

      If TRUE, clicking the content widget while flap is revealed, as well as pressing the Esc key, will close the flap. If FALSE, clicks are passed through to the content widget.

      Parameters:
      modal - whether this Flap is modal
    • setRevealFlap

      @Deprecated public void setRevealFlap(boolean revealFlap)
      Deprecated.
      Sets whether the flap widget is revealed for self.
      Parameters:
      revealFlap - whether to reveal the flap widget
    • setRevealParams

      @Deprecated public void setRevealParams(SpringParams params)
      Deprecated.

      Sets the reveal animation spring parameters for self.

      The default value is equivalent to:

      adw_spring_params_new (1, 0.5, 500)
      
      Parameters:
      params - the new parameters
    • setSeparator

      @Deprecated public void setSeparator(@Nullable Widget separator)
      Deprecated.

      Sets the separator widget for self.

      It's displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the Flap:transition-type value.

      Parameters:
      separator - the separator widget
    • setSwipeToClose

      @Deprecated public void setSwipeToClose(boolean swipeToClose)
      Deprecated.

      Sets whether this Flap can be closed with a swipe gesture.

      The area that can be swiped depends on the Flap:transition-type value.

      Parameters:
      swipeToClose - whether this Flap can be closed with a swipe gesture
    • setSwipeToOpen

      @Deprecated public void setSwipeToOpen(boolean swipeToOpen)
      Deprecated.

      Sets whether this Flap can be opened with a swipe gesture.

      The area that can be swiped depends on the Flap:transition-type value.

      Parameters:
      swipeToOpen - whether this Flap can be opened with a swipe gesture
    • setTransitionType

      @Deprecated public void setTransitionType(FlapTransitionType transitionType)
      Deprecated.

      Sets the type of animation used for reveal and fold transitions in self.

      Flap:flap is transparent by default, which means the content will be seen through it with Adw.FlapTransitionType.over transitions; add the .background style class to it if this is unwanted.

      Parameters:
      transitionType - the new transition type
    • builder

      public static Flap.Builder<? extends Flap.Builder> builder()
      Deprecated.
      A Flap.Builder object constructs a Flap with the specified properties. Use the various set...() methods to set properties, and finish construction with Flap.Builder.build().
      Returns:
      the builder object