Flexbox for Android

Overview

FlexboxLayout

Circle CI Download

FlexboxLayout is a library project which brings the similar capabilities of CSS Flexible Box Layout Module to Android.

Installation

Add the following dependency to your build.gradle file:

dependencies {
    implementation 'com.google.android:flexbox:2.0.1'
}

Note that the default values for alignItems and alignContent for FlexboxLayout have been changed from stretch to flex_start starting from 2.0.0, it may break the existing apps. Please make sure to set stretch explicitly if you want to apply the behavior of stretch.

Note that starting from 1.1.0, the library is expected to use with AndroidX. Please migrate to AndroidX if you use 1.1.0 or above.

Please use 1.0.0 if you haven't migrated to AndroidX.

Usage

There are two ways of using Flexbox in your layout.

FlexboxLayout

The first one is FlexboxLayout that extends the ViewGroup like LinearLayout and RelativeLayout. You can specify the attributes from a layout XML like:

<com.google.android.flexbox.FlexboxLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:flexWrap="wrap"
    app:alignItems="stretch"
    app:alignContent="stretch" >

    <TextView
        android:id="@+id/textview1"
        android:layout_width="120dp"
        android:layout_height="80dp"
        app:layout_flexBasisPercent="50%"
        />

    <TextView
        android:id="@+id/textview2"
        android:layout_width="80dp"
        android:layout_height="80dp"
        app:layout_alignSelf="center"
        />

    <TextView
        android:id="@+id/textview3"
        android:layout_width="160dp"
        android:layout_height="80dp"
        app:layout_alignSelf="flex_end"
        />
</com.google.android.flexbox.FlexboxLayout>

Or from code like:

FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexbox_layout);
flexboxLayout.setFlexDirection(FlexDirection.ROW);

View view = flexboxLayout.getChildAt(0);
FlexboxLayout.LayoutParams lp = (FlexboxLayout.LayoutParams) view.getLayoutParams();
lp.setOrder(-1);
lp.setFlexGrow(2);
view.setLayoutParams(lp);

FlexboxLayoutManager (within RecyclerView)

The second one is FlexboxLayoutManager that can be used within RecyclerView.

RecyclerView recyclerView = (RecyclerView) context.findViewById(R.id.recyclerview);
FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(context);
layoutManager.setFlexDirection(FlexDirection.COLUMN);
layoutManager.setJustifyContent(JustifyContent.FLEX_END);
recyclerView.setLayoutManager(layoutManager);

or for the attributes for the children of the FlexboxLayoutManager you can do like:

mImageView.setImageDrawable(drawable);
ViewGroup.LayoutParams lp = mImageView.getLayoutParams();
if (lp instanceof FlexboxLayoutManager.LayoutParams) {
    FlexboxLayoutManager.LayoutParams flexboxLp = (FlexboxLayoutManager.LayoutParams) lp;
    flexboxLp.setFlexGrow(1.0f);
    flexboxLp.setAlignSelf(AlignSelf.FLEX_END);
}

The advantage of using FlexboxLayoutManager is that it recycles the views that go off the screen for reuse for the views that are appearing as the user scrolls instead of inflating every individual view, which consumes much less memory especially when the number of items contained in the Flexbox container is large.

FlexboxLayoutManager in action

Supported attributes/features comparison

Due to some characteristics of RecyclerView, some Flexbox attributes are not available/not implemented to the FlexboxLayoutManager. Here is a quick overview of the attributes/features comparison between the two implementations.

Attribute / Feature FlexboxLayout FlexboxLayoutManager (RecyclerView)
flexDirection Check Check
flexWrap Check Check (except wrap_reverse)
justifyContent Check Check
alignItems Check Check
alignContent Check -
layout_order Check -
layout_flexGrow Check Check
layout_flexShrink Check Check
layout_alignSelf Check Check
layout_flexBasisPercent Check Check
layout_(min/max)Width Check Check
layout_(min/max)Height Check Check
layout_wrapBefore Check Check
Divider Check Check
View recycling - Check
Scrolling *1 Check

*1 Partially possible by wrapping it with ScrollView. But it isn't likely to work with a large set of views inside the layout. Because it doesn't consider view recycling.

Supported attributes

Attributes for the FlexboxLayout:

  • flexDirection

    • This attribute determines the direction of the main axis (and the cross axis, perpendicular to the main axis). The direction children items are placed inside the Flexbox layout. Possible values are:

      • row (default)
      • row_reverse
      • column
      • column_reverse

      Flex Direction explanation

  • flexWrap

    • This attribute controls whether the flex container is single-line or multi-line, and the direction of the cross axis. Possible values are:

      • nowrap (default for FlexboxLayout)
      • wrap (default for FlexboxLayoutManager)
      • wrap_reverse (not supported by FlexboxLayoutManager)

      Flex Wrap explanation

  • justifyContent

    • This attribute controls the alignment along the main axis. Possible values are:

      • flex_start (default)
      • flex_end
      • center
      • space_between
      • space_around
      • space_evenly

      Justify Content explanation

  • alignItems

    • This attribute controls the alignment along the cross axis. Possible values are:

      • flex_start (default for FlexboxLayout)
      • flex_end
      • center
      • baseline
      • stretch (default for FlexboxLayoutManager)

      Align Items explanation

  • alignContent

    • This attribute controls the alignment of the flex lines in the flex container. Possible values are:

      • flex_start (default)
      • flex_end
      • center
      • space_between
      • space_around
      • stretch

      Align Content explanation

  • showDividerHorizontal (one or more of none | beginning | middle | end)

  • dividerDrawableHorizontal (reference to a drawable)

    • Puts horizontal dividers between flex lines (or flex items when flexDirection is set to column or column_rebase).
  • showDividerVertical (one or more of none | beginning | middle | end)

  • dividerDrawableVertical (reference to a drawable)

    • Puts vertical dividers between flex items (or flex lines when flexDirection is set to column or column_rebase).
  • showDivider (one or more of none | beginning | middle | end)

  • dividerDrawable (reference to a drawable)

    • Shorthand for setting both horizontal and vertical dividers. Note that if used with other attributes (such as justifyContent="space_around" or alignContent="space_between" ... etc) for putting spaces between flex lines or flex items, you may see unexpected spaces. Please avoid using these at the same time.

    Example of putting both vertical and horizontal dividers.

    res/drawable/divider.xml

    <shape xmlns:android="http://schemas.android.com/apk/res/android">
      <size
          android:width="8dp"
          android:height="12dp" />
      <solid android:color="#44A444" />
    </shape> 

    res/layout/content_main.xml

    <com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:alignContent="flex_start"
      app:alignItems="flex_start"
      app:flexWrap="wrap"
      app:showDivider="beginning|middle"
      app:dividerDrawable="@drawable/divider" >
    
      <TextView
          style="@style/FlexItem"
          android:layout_width="220dp"
          android:layout_height="80dp"
          android:text="1" />
      <TextView
          style="@style/FlexItem"
          android:layout_width="120dp"
          android:layout_height="80dp"
          android:text="2" />
      <TextView
          style="@style/FlexItem"
          android:layout_width="160dp"
          android:layout_height="80dp"
          android:text="3" />
      <TextView
          style="@style/FlexItem"
          android:layout_width="80dp"
          android:layout_height="80dp"
          android:text="4" />
      <TextView
          style="@style/FlexItem"
          android:layout_width="100dp"
          android:layout_height="80dp"
          android:text="5" />

    Dividers beginning and middle

Attributes for the children of a FlexboxLayout

  • layout_order (integer)

    • This attribute can change how the ordering of the children views are laid out. By default, children are displayed and laid out in the same order as they appear in the layout XML. If not specified, 1 is set as a default value.

      Order explanation

  • layout_flexGrow (float)

    • This attribute determines how much this child will grow if positive free space is distributed relative to the rest of other flex items included in the same flex line. If a flex item has a positive layout_flexGrow value, the item will take up the remaining space in the flex line. If multiple flex items in the same flex line have positive layout_flexGrow values, the remaining free space is distributed depending on the proportion of their declared layout_flexGrow value. (Similar to the layout_weight attribute in the LinearLayout) If not specified, 0 is set as a default value.

      Flex Grow explanation

  • layout_flexShrink (float)

    • This attribute determines how much this child will shrink if negative free space is distributed relative to the rest of other flex items included in the same flex line. If not specified, 1 is set as a default value.

      Flex Shrink explanation

  • layout_alignSelf

    • This attribute determines the alignment along the cross axis (perpendicular to the main axis). The alignment in the same direction can be determined by the alignItems in the parent, but if this is set to other than auto, the cross axis alignment is overridden for this child. Possible values are:

      • auto (default)
      • flex_start
      • flex_end
      • center
      • baseline
      • stretch

      Align Self explanation

  • layout_flexBasisPercent (fraction)

    • The initial flex item length in a fraction format relative to its parent. The initial main size of this child view is trying to be expanded as the specified fraction against the parent main size. If this value is set, the length specified from layout_width (or layout_height) is overridden by the calculated value from this attribute. This attribute is only effective when the parent's length is definite (MeasureSpec mode is MeasureSpec.EXACTLY). The default value is -1, which means not set.

      Flex basis percent explanation

  • layout_minWidth / layout_minHeight (dimension)

    • These attributes impose minimum size constraints for the children of FlexboxLayout. A child view won't shrink less than the value of these attributes (varies based on the flexDirection attribute as to which attribute imposes the size constraint along the main axis) regardless of the layout_flexShrink attribute.

      Min width explanation

  • layout_maxWidth / layout_maxHeight (dimension)

    • These attributes impose maximum size constraints for the children of FlexboxLayout. A child view won't be expanded more than the value of these attributes (varies based on the flexDirection attribute as to which attribute imposes the size constraint along the main axis) regardless of the layout_flexGrow attribute.

      Max width explanation

  • layout_wrapBefore (boolean)

    • This attribute forces a flex line wrapping, the default value is false. i.e. if this is set to true for a flex item, the item will become the first item of a flex line. (A wrapping happens regardless of the flex items being processed in the previous flex line) This attribute is ignored if the flex_wrap attribute is set to nowrap. The equivalent attribute isn't defined in the original CSS Flexible Box Module specification, but having this attribute is useful for Android developers. For example, to flatten the layouts when building a grid-like layout or for a situation where developers want to put a new flex line to make a semantic difference from the previous one, etc.

      Wrap before explanation

Others

Known differences from the original CSS specification

This library tries to achieve the same capabilities of the original Flexible Box specification as much as possible, but due to some reasons such as the way specifying attributes can't be the same between CSS and Android XML, there are some known differences from the original specification.

(1) There is no flex-flow equivalent attribute

  • Because flex-flow is a shorthand for setting the flex-direction and flex-wrap properties, specifying two attributes from a single attribute is not practical in Android.

(2) There is no flex equivalent attribute

  • Likewise flex is a shorthand for setting the flex-grow, flex-shrink and flex-basis, specifying those attributes from a single attribute is not practical.

(3) layout_flexBasisPercent is introduced instead of flexBasis

  • Both layout_flexBasisPercent in this library and flex-basis property in the CSS are used to determine the initial length of an individual flex item. The flex-basis property accepts width values such as 1em, 10px, and content as strings as well as percentage values such as 10% and 30%. layout_flexBasisPercent only accepts percentage values. However, specifying initial fixed width values can be done by specifying width (or height) values in layout_width (or layout_height, varies depending on the flexDirection). Also, the same effect can be done by specifying "wrap_content" in layout_width (or layout_height) if developers want to achieve the same effect as 'content'. Thus, layout_flexBasisPercent only accepts percentage values, which can't be done through layout_width (or layout_height) for simplicity.

(4) layout_wrapBefore is introduced.

  • The equivalent attribute doesn't exist in the CSS Flexible Box Module specification, but as explained above, Android developers will benefit by having this attribute for having more control over when a wrapping happens.

(5) Default values for alignItems and alignContent are set to flex_start instead of stretch.

  • Setting stretch for the alignItems is expensive because the children of FlexboxLayout are measured more than twice. The difference is more obvious when the layout hierarchy is deeply nested.

Xamarin Binding

Xamarin binding is now available on NuGet thanks to @btripp

Demo apps

Flexbox Playground demo app

The demo-playground module works as a playground demo app for trying various values for the supported attributes. You can install it by

./gradlew demo-playground:installDebug

Cat gallery demo app

The demo-cat-gallery module showcases the usage of the FlexboxLayoutManager inside the RecyclerView that handles various sizes of views aligned nicely regardless of the device width like the Google Photo app without loading all the images on the memory. Thus compared to using the {@link FlexboxLayout}, it's much less likely to abuse the memory, which sometimes leads to the OutOfMemoryError.

./gradlew demo-cat-gallery:installDebug

How to make contributions

Please read and follow the steps in CONTRIBUTING.md

License

Please see LICENSE

Comments
  • Please publish to maven central or maven.google.com

    Please publish to maven central or maven.google.com

    Currently, flexbox-layout releases appear to only be published to jcenter and are not present on maven central. JCenter has a long history of artifact integrity issues and we try to avoid it at all costs. I recognize that maven central's publishing process is sometimes considered more tedious, but this signing/verification process is part of why it's preferred.

    https://blog.autsoft.hu/a-confusing-dependency https://twitter.com/jakewharton/status/1073102730443526144?lang=en

    opened by ZacSweers 31
  • Dependency not resolved by default

    Dependency not resolved by default

    • [ ✅] There is a similar issue, but not the same. I have searched existing issues and confirmed this is not a duplicate.

    Problem

    With Gradle, 'com.google.android:flexbox' artifact is not available in default jCenter repo, and also not available in MavenCentral. The error is "Failed to resolve artifact". I checked the URLs that Gradle tries to resolve, and it's looking for the lib in jcenter.bintray.com, but the code is actually at google.bintray.com as found through your 'download' badge -- which is (I believe) the reason that causes the issue.

    How to reproduce it?

    Create a new empty project in Android Studio and try to add this dependency. It can be an empty project. Use Android Studio 3.0 or later. I don't know which plugins you have for project creation, but it's extremely important not to add any Google-specific dependencies, as everyone outside of Google would not have them included by default. Having a Google repository pre-included is probably the reason why it's working for you and other people are complaining about not resolving the artifact (as in this issue and this one).

    Version of the flexbox library

    1.0.0 and 1.1.0

    Preferred resolution

    Looks like we need to add a Google jCenter repo somehow, can you tell us how? Or can you publicly include this in jCenter index? There is a button to do so after you publish a lib to your local repo inside of jCenter. Flexbox is not even visible by search in jCenter or MavenCental index pages, so please also check why that is the case.

    opened by milosmns 18
  • RecyclerView Height issue

    RecyclerView Height issue

    Hi I am using RecyclerView with FlexboxLayoutManager for layoutManager.setFlexDirection(FlexDirection.ROW); RecyclerView height is resctrited to show only 3 rows . this is my layout `

    <TextView
        android:id="@+id/reviews_label"
        style="@style/body1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/_10dp"
        android:text="Reviews"
        android:textAllCaps="true"
        android:textColor="@color/dark_gray_color" />
    
    
    <TextView
        android:id="@+id/rating_count"
        style="@style/caption"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/reviews_label"
        android:layout_marginLeft="@dimen/_10dp"
        android:layout_marginTop="@dimen/_20dp"
        android:layout_toRightOf="@id/rating_layout"
        android:text="Based on 150 ratings"
        android:textColor="@color/dark_gray_color" />
    
    <TextView
        style="@style/small2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/rating_count"
        android:layout_marginLeft="@dimen/_10dp"
        android:layout_marginTop="@dimen/_1dp"
        android:layout_toRightOf="@id/rating_layout"
        android:text="Weighted average based on user credibility on purplle" />
    
    <TextView
        android:id="@+id/pros_label"
        style="@style/caption"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/rating_layout"
        android:layout_marginBottom="@dimen/_10dp"
        android:layout_marginLeft="@dimen/_10dp"
        android:layout_marginTop="@dimen/_20dp"
        android:text="@string/positives"
        android:textColor="@color/forest_green" />
    
    <TextView
        android:id="@+id/tap_to_filter_pros"
        style="@style/small2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/rating_layout"
        android:layout_marginLeft="@dimen/_10dp"
        android:layout_marginTop="@dimen/_22dp"
        android:layout_toRightOf="@id/pros_label"
        android:text="@string/tap_to_filter"
        android:textColor="@color/light_gray_color" />
    
    <android.support.v7.widget.RecyclerView
        android:id="@+id/pros_highlight_recyclerview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/pros_label"
        android:layout_marginLeft="@dimen/_5dp"
        android:nestedScrollingEnabled="false" />
    

    `

    This is RecyclerView item layout

    <com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/highlight_root"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_5dp">
    
        <TextView
            android:id="@+id/selected_icon"
            style="@style/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/_2dp"
            android:gravity="center"
            android:paddingLeft="@dimen/_5dp"
            android:text="@string/circular_tickbox"
            android:textSize="@dimen/_13dp" />
    
        <TextView
            android:id="@+id/name"
            style="@style/small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:paddingBottom="@dimen/_6dp"
            android:paddingRight="@dimen/_13dp"
            android:paddingTop="@dimen/_6dp" />
    
    </com.google.android.flexbox.FlexboxLayout>
    
    opened by rahuldevanavar91 17
  • merge methods FlexboxHelper#calculateHorizontalFlexLines() and FlexboxHelper#calculateVerticalFlexLines()

    merge methods FlexboxHelper#calculateHorizontalFlexLines() and FlexboxHelper#calculateVerticalFlexLines()

    calculateHorizontalFlexLines() and calculateVerticalFlexLines() have more than 100 lines. They are mostly similar.

    Tell me if you think it is a good idea to merge them. I merged them into one method. I made helper methods. There are a lot more similar methods like them you can merge and basically refer to horizontal and vertical as one.

    note: I didn't changed the logic behind the algorithm.

    opened by Gavras 15
  • NullPointerException

    NullPointerException

    Frequently call addview() and removeAllViews().

    java.lang.NullPointerException at com.google.android.flexbox.FlexboxLayout.drawDividersHorizontal(FlexboxLayout.java:2095) at com.google.android.flexbox.FlexboxLayout.onDraw(FlexboxLayout.java:2047) at android.view.View.draw(View.java:15114) at android.view.View.updateDisplayListIfDirty(View.java:14048) at android.view.View.getDisplayList(View.java:14071) at android.view.View.draw(View.java:14838) at android.view.ViewGroup.drawChild(ViewGroup.java:3404) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.updateDisplayListIfDirty(View.java:14043) at android.view.View.getDisplayList(View.java:14071) at android.view.View.draw(View.java:14838)

    bug 
    opened by zhangxu1005 13
  • LayoutManager for RecyclerView

    LayoutManager for RecyclerView

    FlexboxLayout is implemented as a subclass of the ViewGroup, so view recycles are not considered when used as a scrollable view (e.g. wrapped with the ScrollView).

    Adding a new class as a subclass of RecyclerView.LayoutManager is more useful in that situation to take view recycles into account.

    enhancement workload high 
    opened by thagikura 13
  • [Wiki] Another use case where FlexboxLayout is useful than other existing layouts

    [Wiki] Another use case where FlexboxLayout is useful than other existing layouts

    Such as the #59 would be a nice example that demonstrates usefulness of the FlexboxLayout, otherwise it would be tricky if building it with existing layouts.

    enhancement 
    opened by thagikura 12
  • Crash on data-set update when DiffUtils is used

    Crash on data-set update when DiffUtils is used

    • [x] I have searched existing issues and confirmed this is not a duplicate

    Issues and steps to reproduce

    I'm seeing this crash when trying to filter my list items using a search query:

    FATAL EXCEPTION: main
    java.lang.ArrayIndexOutOfBoundsException: length=45; index=-1
        at com.google.android.flexbox.FlexboxLayoutManager$AnchorInfo.assignFromView(FlexboxLayoutManager.java:2863)
        at com.google.android.flexbox.FlexboxLayoutManager$AnchorInfo.access$1900(FlexboxLayoutManager.java:2792)
        at com.google.android.flexbox.FlexboxLayoutManager.updateAnchorFromChildren(FlexboxLayoutManager.java:1136)
        at com.google.android.flexbox.FlexboxLayoutManager.updateAnchorInfoForLayout(FlexboxLayoutManager.java:1032)
        at com.google.android.flexbox.FlexboxLayoutManager.onLayoutChildren(FlexboxLayoutManager.java:700)
        at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583)
        at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3312)
        at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844)
    

    Steps to reproduce This started to happen after I added DiffUtils for showing item animations. Here's what I'm doing:

    List<FolderSubscription> oldSubscriptions = ...;
    List<FolderSubscription> newSubscriptions = ...;
    
    FolderSubscriptionDiffCallbacks callback = new FolderSubscriptionDiffCallbacks(oldSubscriptions, newSubscriptions);
    DiffUtil.DiffResult folderDiffResult = DiffUtil.calculateDiff(callback, true /* detectMoves */);
    
    folderAdapter.updateData(newSubscriptions);
    folderDiffResult.dispatchUpdatesTo(folderAdapter);
    

    Version of the flexbox library

    I tested on both v0.3-alpha3 and v0.3.

    bug 
    opened by saket 11
  • Items not displaying correctly

    Items not displaying correctly

    I am using FlexboxLayout for my sorting and filtering options. I noticed that on some items with a long text, they display wrongly. ie, the last character is on the next line. See attached. Any solution for this?

    Also, i have to use "middle|end" for app:showDividerVertical as "middle" alone shows on the middle items per row. So if i have 3 rows, the last item of the first 2 rows will not have the divider line showing. Unlike CSS, middle would me all elements except the last.

    <com.google.android.flexbox.FlexboxLayout android:id="@+id/layout_sort_options" android:layout_width="match_parent" android:layout_height="wrap_content" app:flexWrap="wrap" app:flexDirection="row" app:alignItems="flex_start" app:alignContent="flex_start" app:showDividerVertical="middle|end" app:dividerDrawableVertical="@drawable/ic_divider" app:showDividerHorizontal="middle" app:dividerDrawableHorizontal="@drawable/ic_divider_horizontal"/>

    flexboxerror

    opened by janicelco 11
  • Support horizontal scrolling with FlexDirection.ROW

    Support horizontal scrolling with FlexDirection.ROW

    Hello, thanks for this fantastic library. I'm trying to create a horizontally scrollable list, but FlexboxLayoutManager doesn't seem to be wrapping the list items. In each column, all items have the same width, which doesn't look correct. Is there something I'm missing? I'm using this code:

    FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager();
    flexboxLayoutManager.setFlexWrap(FlexWrap.WRAP);
    flexboxLayoutManager.setFlexDirection(FlexDirection.COLUMN);
    

    Update: Oh wait, supplying setAlignItems() with something other than STRETCH fixes the width of the items. As in, they're no longer equi sized. So I've realized that I want the items to be laid out in row fashion, but the list should be horizontally scrollable. Is this possible?

    enhancement 
    opened by saket 11
  • Not working properly with Glide

    Not working properly with Glide

    I am using Glide library to load images in RecyclerView but when I am scrolling the RecyclerView sometimes 2 images showing per row some time 1 image per row. Following is my code

    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(); layoutManager.setFlexWrap(FlexWrap.WRAP); layoutManager.setFlexDirection(FlexDirection.ROW); layoutManager.setAlignItems(AlignItems.STRETCH); mRecyclerView.setLayoutManager(layoutManager);

    private void setImageView(final ImageView imageView, Integer resourceId) {
            Glide.with(mContext)
                    .load(resourceId)
                    .asBitmap()
                    .format(DecodeFormat.PREFER_RGB_565)
                    .diskCacheStrategy(DiskCacheStrategy.RESULT)
                    //.skipMemoryCache(true)
                    .thumbnail(0.1f)
                    .placeholder(resourceId)
                    .error(resourceId)
                    .centerCrop()
                    .listener(new RequestListener<Integer, Bitmap>() {
                        @Override
                        public boolean onException(Exception e, Integer model, Target<Bitmap> target, boolean isFirstResource) {
                            return false;
                        }
    
                        @Override
                        public boolean onResourceReady(Bitmap resource, Integer model, Target<Bitmap> target, boolean isFromMemoryCache, boolean isFirstResource) {
                            ViewGroup.LayoutParams lp = imageView.getLayoutParams();
                            if (lp instanceof FlexboxLayoutManager.LayoutParams) {
                                FlexboxLayoutManager.LayoutParams flexboxLp = (FlexboxLayoutManager.LayoutParams)
                                        imageView.getLayoutParams();
                                flexboxLp.setFlexGrow(1.0f);
                            }
                            return false;
                        }
                    })
                    .into(imageView);
        }
    

    XML file

    <?xml version="1.0" encoding="utf-8"?> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/image" android:src="@drawable/ic_guest_services_light" android:scaleType="centerCrop" android:layout_margin="1dp" android:contentDescription="@null"/>

    opened by krishnameena 11
  • bugfix: #614

    bugfix: #614

    bug: when using FlexboxLayoutManager with flex-direction set to column, a child having top margin will result in an unexpected top margin on every following child cause: previous child's TOP_MARGIN is added when moving childTop down. I think it should be BOTTOM_MARGIN instead. similar for childBottom

    opened by hjhjw1991 1
  • FlexboxLayoutManager child item margin is wrong when flex-direction is column

    FlexboxLayoutManager child item margin is wrong when flex-direction is column

    • [x] I have searched existing issues and confirmed this is not a duplicate

    Issues and steps to reproduce

    Please replace this with steps to reproduce your issue. parent flex-direction: column and only the first child in recyclerview has topMargin.

    Expected behavior

    Please describe what you expected would happen. layout should respect child margin correctly

    Version of the flexbox library

    3.0.0

    Link to code

    Please link to the code we can use to reproduce this issue. A complete project we can build/run is preferred, if you can't provide one, please show us relevant code

    I have already figured out what went wrong. see my pull request

    opened by hjhjw1991 0
  • ComposeView in flexbox crashes, because it is not attached when measured

    ComposeView in flexbox crashes, because it is not attached when measured

    • [x] I have searched existing issues and confirmed this is not a duplicate

    Issues and steps to reproduce

    When I try to use ComposeView or AbstractComposeView with FlexboxLayoutManager, it crashes due to

     java.lang.IllegalStateException: Cannot locate windowRecomposer; View androidx.compose.ui.platform.ComposeView{7ae95e1 V.E...... ......I. 0,0-0,0} is not attached to a window
                                                                                                        	at androidx.compose.ui.platform.WindowRecomposer_androidKt.getWindowRecomposer(WindowRecomposer.android.kt:294)
                                                                                                        	at androidx.compose.ui.platform.AbstractComposeView.resolveParentCompositionContext(ComposeView.android.kt:242)
                                                                                                        	at androidx.compose.ui.platform.AbstractComposeView.ensureCompositionCreated(ComposeView.android.kt:249)
    ...
                                                                                                        	at android.view.View.measure(View.java:25466)
                                                                                                        	at com.google.android.flexbox.FlexboxHelper.calculateFlexLines(FlexboxHelper.java:477)
                                                                                                        	at com.google.android.flexbox.FlexboxHelper.calculateHorizontalFlexLines(FlexboxHelper.java:249)
                                                                                                        	at com.google.android.flexbox.FlexboxLayoutManager.updateLayoutState(FlexboxLayoutManager.java:2112)
                                                                                                        	at com.google.android.flexbox.FlexboxLayoutManager.handleScrollingMainOrientation(FlexboxLayoutManager.java:1993)
                                                                                                        	at com.google.android.flexbox.FlexboxLayoutManager.scrollVerticallyBy(FlexboxLayoutManager.java:1957)
                                                                                                        	at androidx.recyclerview.widget.RecyclerView.scrollStep(RecyclerView.java:2009)
    

    This basically prevents usage of FlexboxLayoutManager with compose views.

    Root cause is that FlexboxLayoutManager attempts to measure composable before it is attached to window, which crashes in ComposeView:

    /**
     * Get or lazily create a [Recomposer] for this view's window. The view must be attached
     * to a window with a [ViewTreeLifecycleOwner] registered at the root to access this property.
     */
    @OptIn(InternalComposeUiApi::class)
    internal val View.windowRecomposer: Recomposer
        get() {
            check(isAttachedToWindow) {
                "Cannot locate windowRecomposer; View $this is not attached to a window"
            }
            val rootView = contentChild
            return when (val rootParentRef = rootView.compositionContext) {
                null -> WindowRecomposerPolicy.createAndInstallWindowRecomposer(rootView)
                is Recomposer -> rootParentRef
                else -> error("root viewTreeParentCompositionContext is not a Recomposer")
            }
        }
    

    Expected behavior

    It should not crash, as it does not crash with other managers (e.g. LinearLayourManager)

    Version of the flexbox library

    Flexbox: 3.0.0 Compose: 1.3.0 Recycler view: 1.3.0-rc1

    Link to code

    class ComposeAdapter : RecyclerView.Adapter<ComposeHolder>() {
    
        override fun onCreateViewHolder(
            parent: ViewGroup,
            viewType: Int,
        ): MyComposeViewHolder {
            return ComposeHolder(ComposeView(parent.context))
        }
    
    class MyComposeViewHolder(
        val composeView: ComposeView
    ) : RecyclerView.ViewHolder(composeView) {
    
        fun bind(input: String) {
            composeView.setContent {
                MdcTheme {
                    Text(input)
                }
            }
        }
    }
    
    opened by Direwolfik 0
  • RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)

    RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)

    Problem and steps to reproduce

    RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)。

    But when FlexboxLayoutManager is set to FlexDirection.COLUMN. Vertical display can all be displayed, and LinearLayoutManager or GridLayoutManager can also be used to display all

    Only when FlexboxLayoutManager is set to FlexDirection.ROW is not fully displayed

    Version of the flexbox library 3.0.0 and earlier

    opened by wkp91 0
  • FlexboxLayoutManager.computeScrollOffset(); It is wrong to be equal to 0

    FlexboxLayoutManager.computeScrollOffset(); It is wrong to be equal to 0

    • [ ] I have searched existing issues and confirmed this is not a duplicate

    Issues and steps to reproduce

    *Why is flexboxmanager. Computescrolloffset() equal to 0 when only half of the first line is visible;I can't judge whether recyclerView.canScrollVertically() can continue to slide

    Expected behavior

    • when only half of the first line is visible,should return Height of the first line invisible part
    • I found that the expectation of findfirstreferenceviewinline() was different from what I thought

    Version of the flexbox library

    *1.1.1 - 3.0.0

    Link to code

    //bottomSheetBehavior.java if (!target.canScrollVertically(-1)) { if (newTop <= collapsedOffset || hideable) { if (!isDraggable) { // Prevent dragging return } consumed[1] = dyUnconsumed ViewCompat.offsetTopAndBottom(child, -dyUnconsumed) setStateInternal(STATE_DRAGGING) } else { consumed[1] = currentTop - collapsedOffset ViewCompat.offsetTopAndBottom(child, -consumed[1]) setStateInternal(STATE_COLLAPSED) } }

    opened by shenliangshanghai 0
Releases(3.0.0)
  • 3.0.0(May 21, 2021)

    Artifacts are now hosted on google maven

    Starting from 3.0.0 and moving forward, this library is hosted on google maven.

    In relation to the change of the hosted server, the groupId of this library was changed from com.google.android to com.google.android.flexbox. Old versions of libraries are still hosted on JCenter as read only mode.

    Source code(tar.gz)
    Source code(zip)
  • 2.0.1(Jan 17, 2020)

    Bug fix release

    • Flexline width exceeds container width (#521)
    • Take CompoundButtons drawables min size into account during measurements (#528)
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Nov 22, 2019)

    Performance improvements by avoiding child views are measured more than twice #46

    The version 2.0.0 improves the performance significantly especially FlexboxLayout is deeply nested. As described in #514, there were unnecessary measure calls even if any Flexitems in a FlexLine didn't have any flexGrow or flexShrink attributes set. Similarly, the default values for alignItems and alignContent for FlexboxLayout has changed from stretch to flex_start starting from 2.0.0 because setting stretch for alignItems turned out to be expensive. Setting the default value as stretch might increase the unnecessary measure calls.

    This is a major version release because the change may break the existing apps.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Sep 20, 2019)

    Bug fixes

    • Fixes the wrong positioning (#470)
    • Add JustifyContent.SPACE_EVENLY to IntDef (#489)
    • canScrollHorizontally() throws NPE if the RecyclerView is not attached to the Window (#490)
    • Update the API level to 29 (#509)
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Sep 25, 2018)

    AndroidX support!

    From 1.1.0 moving forward, the library is going to depend on the androidx artifacts. No API changes from the flexbox library point of view.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0-beta1(Jul 19, 2018)

    Support AndroidX. AndroidX libraries are still in beta versions, so this release is not from the master branch. Once AndroidX becomes stable, we'll merge the androidx branch to master.

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(May 17, 2018)

    Semantic versioning

    Start to follow the semantic versioning. flexbox-layout has been considered as stable for a while, but the version wasn't updated to 1.x. From this release on, the library starts to follow the semantic versioning.

    New features

    • Added "space-evenly" support as one of the justifyContent values. #284
    • Added maxLine attribute support, that specifies the maximum number of flex lines #156

    Bug fixes

    • Crash in using DiffUtil #425
    • Change proguard rule to keep FlexboxLayoutManager to keepnames to avoid FlexboxLayoutManager is left even if it's not used #426
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Jan 5, 2018)

    • Raised the targetSdkVersion to 27
    • Made the support library dependencies as compileOnly instead of api not to force the dependent of the flexbox-layout projects to use the specific version of the support libraries (or explicitly exclude them). (#395)
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Sep 27, 2017)

    Backward incompatible changes

    • Raised minSdkVersion from 9 to 14.

    Bug fixes

    • Dividers stop being displayed between all visible items once you set visibility as "gone" of one of those items (#357)
    • Flexbox not respecting children margins added programmatically (#356)
    • Horizontal margins are ignored on devices with API level < 17 for the calculation to judge is a wrapping is required (#353)
    • Fix the baseline calculation above API Level 24+ (#341)
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jun 28, 2017)

    Stable release including RecyclerView integration!

    New features

    • FlexboxLayoutManager is now stable. #2
    • FlexboxLayoutManager can now scroll both directions #215

    horizontal_scroll

    Bug fixes

    • no need to measure child when it is GONE #170
    • Removed the set of methods from FlexLine to retrieve the positions of it. #244
    • Layout becomes invisible if the first item is gone and the first line only contains the invisible view. #283
    • Fixes the issue that the index of the view becomes inconsistent #311
    • Horizontal scroll isn't handled correctly when layout direction is RTL and flex direction is row or row_reverse #318
    • Scroll direction is broken when flexDirection is column or column_reverse and layout direction is RTL #319

    Backward incompatible changes

    • FlexboxLayout can be used in the same manner as the 0.2.x versions, but Flexbox specific constants are now defined in each individual class such as: (including other values (such as FLEX_END, STRETCH) are now moved to each individual class.)

      • FlexboxLayout.FLEX_DIRECTION_ROW -> FlexDirection.ROW
      • FlexboxLayout.FLEX_WRAP_WRAP -> FlexWrap.WRAP
      • FlexboxLayout.JUSTIFY_CONTENT_FLEX_START -> JustifyContent.FLEX_START
      • FlexboxLayout.ALIGN_ITEMS_FLEX_START -> AlignItems.FLEX_START
      • FlexboxLayout.ALIGN_CONTENT_FLEX_START -> AlignContent.FLEX_START
    • Attributes in FlexboxLayout.LayoutParams are now accessible through getter/setter methods instead of accessing to the instance fields directly. For example changing the wrapBefore attribute can be done in a following manner:

      FlexboxLayout.LayoutParams lp = (FlexboxLayout.LayoutParams) view.getLayoutParams();
      lp.setWrapBefore(true);
      
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0-alpha4(Jun 16, 2017)

    New features for FlexboxLayoutManager

    • Add a set of find*Position (find(First|Last)(Completely)?VisibleItemPosition) methods to retrieve the positions of the visible view. #217
    • Add support for scrollBars #249
    • Add support for smoothScrollToPosition #264

    Bug fixes

    • Child views are not measured properly when they are not visible #262
    • Fixes the issue the FlexboxItemDecoration is misplaced upon scrolling #285
    • Nested RecyclerView with FlexboxLayoutManager shows only one line #290
    • FlexboxLayoutManager doesn't work with payloads #297
    • Fixes the issue that the items becoms invisible on the condition as follows #303
      • the first item's visibility is gone
      • the rest of the items (e.g. three in total) have layout_flexGrow attribute set.
      • the second view has layout_wrapBefore attribute set (no items are added to the flex line where the gone view is included)

    API Changes

    • The constructor of FlexboxLayoutManager now requires a Context.
      FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(context);
      
    Source code(tar.gz)
    Source code(zip)
  • 0.2.7(Jun 16, 2017)

    Bug fixes

    • Cached order values are not updated #266
    • "Wrap Reverse" and "Flex End" do not mesh well when the content is larger than the flexbox #250
    • Fixes the case where the cross size of the child is affected by an appended flex line in which the child being processed is the first item. #236
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0-alpha3(Mar 30, 2017)

    Bunch of bug fixes.

    • Fix the issue RecyclerView becomes invisible when wrapped with another RecyclerView or ScrollView (#199, #208)
    • Fix the issue the first line disappeared when the user scrolls that makes the first line invisible then try to scroll back to the top, on the condition the second line has more items than the first line. (#228, #229)
    • Fix the issue after the scrollTo method is called the item specified as the argument is always placed at the first line. (#206)
    • Fix the issue when developers handle configuration changes by themselves, the flex lines before the anchor position were not discarded (#198)
    • Fix the issue a ViewHolder was created multiple times in a single layout pass (#242)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.6(Mar 22, 2017)

    • Replaced appcompat-v7 dependency to the more focused support-comapat dependency making the size of the library reduced by 30% (40kb to 28kb) #220
    • Fixed the issue that alignment for space_between and space_around for the justifyContent when any views are included whose visibilitys are GONE #162
    • Fixed NPE that might happen when any dividers are set and addition and removal of a view is repeatedly executed in a short period of time #222
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0-alpha2(Feb 1, 2017)

  • 0.3.0-alpha1(Jan 27, 2017)

    RecyclerView integration!

    Flexbox can now be used inside the RecyclerView as a LayoutManager (FlexboxLayoutManager). Now you can use Flexbox with large number of items in a scrollable container!

    Along the way, we introduced some backward-incompatible changes such as:

    • Now Flexbox specific constants are now defined in each individual class such as:

      • FlexboxLayout.FLEX_DIRECTION_ROW -> FlexDirection.ROW
      • FlexboxLayout.FLEX_WRAP_WRAP -> FlexWrap.WRAP
      • FlexboxLayout.JUSTIFY_CONTENT_FLEX_START -> JustifyContent.FLEX_START
      • FlexboxLayout.ALIGN_ITEMS_FLEX_START -> AlignItems.FLEX_START
      • FlexboxLayout.ALIGN_CONTENT_FLEX_START -> AlignContent.FLEX_START

      including other values (such as FLEX_END, STRETCH) are now moved to each individual class.

    See the RecyclerView integration document for more details.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.5(Dec 8, 2016)

    Fix the issue #154 that the child margin doesn't expand the flexbox container with wrap_content.

    • layout_height is set to wrap_content for the FlexboxLayout
    • Bottom (or top) margin is set to a child
    • The child which has the bottom (top) margin has the largest height in the same flex line (or only a single child exists)
    • The child has a positive layout_flexGrow attribute set

    If these conditions were met, the width of the FlexboxLayout didn't take the bottom margin on the child into account.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.4(Nov 21, 2016)

    • Fix the issue invalid height is set in the following situation (#139)
      • flex direction is set to row (or row_reverse)
      • FlexboxLayout has a TextView (or other views that expand vertically if not enough space is left horizontally)
      • TextView's layout_width is set to 0dp, layout_height is set to wrap_content and layout_flexGrow is set to positive
    • Fix the center alignment when margin is set only one side of a flex item to be consistent with the CSS spec (#138)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.3(Jul 27, 2016)

    • Adds the feature to put dividers between flex items or flex lines. Following attributes are now supported ( #100 )
      • showDivider
      • showDividerHorizontal
      • showDividerVertical
      • dividerDrawable
      • dividerDrawableHorizontal
      • dividerDrawableVertical
    • Exposes the FlexLine class and getFlexLines() method to offer the read-only information about the flex lines contained in the FlexboxLayout. ( #102 )
    • Fixes the issue that an empty flex line is added if the initial length of the first item is large ( #88)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(Jun 8, 2016)

    Bug fixes

    • Incorrect layout when parent has a padding and alignItems == flex_end or alignContent == flex_end ( #72 )
    • Take parent paddings and child margins into account for judging if a line wrapping required ( #62 )
    • Add a copy constructor for the layout parameters ( #76 )
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Jun 3, 2016)

    • Add the layout_wrapBefore attribute, which forces a flex line wrapping when set to true for a flex item (child view) #32
    • Fix the issue #63
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Jun 1, 2016)

    • Lower the minSdkVersion to 9. Now the > 99% of devices are covered. ( #35 )
    • Implement layout_minWidth/layout_minHeight and layout_maxWidth/layout_maxHeight attributes to impose size constraints ( #1 )
    • Fixes the issue FlexboxLayout becomes invisible when a flex item's visibility is gone, which is the first item in the second flex line ( #47 )
    • Performance improvement by avoiding object creations in the onMeasure method. ( #44 )
    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(May 19, 2016)

  • 0.1.2(May 10, 2016)

  • 0.1.1(May 10, 2016)

Owner
Google
Google ❤️ Open Source
Google
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.

Please switch to DragView, for the best support, thank you DraggablePanel Download allprojects { repositories { ... maven { url 'https://jitp

Hoàng Anh Tuấn 103 Oct 12, 2022
FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

null 33 Dec 8, 2022
A wave view of android,can be used as progress bar.

WaveView ![Gitter](https://badges.gitter.im/Join Chat.svg) A wave view of android,can be used as progress bar. Screenshot APK demo.apk What can be use

Kai Wang 1.3k Dec 28, 2022
An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu

ResideLayout An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu. Can be used on Android 1.6(I haven't try it.)

Yang Hui 392 Oct 12, 2022
An Android library that help you to build app with swipe back gesture.

SwipeBackLayout An Android library that help you to build app with swipe back gesture. Demo Apk GooglePlay Requirement The latest android-support-v4.j

ike_w0ng 6.1k Dec 29, 2022
TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.

This project isn't maintained anymore. It is now recommended to use https://github.com/peterLaurence/MapView. MapView is maintained by Peter, one of o

Mike Dunn 1.5k Nov 21, 2022
Ultra Pull to Refresh for Android. Support all the views.

Welcome to follow me on GitHub or Twitter GitHub: https://github.com/liaohuqiu Twitter: https://twitter.com/liaohuqiu 中文版文档 Wanna auto-load-more? This

Huqiu Liao 9.6k Jan 5, 2023
SwipeBack is an android library that can finish a activity by using gesture.

SwipeBack SwipeBack is a android library that can finish a activity by using gesture. You can set the swipe direction,such as left,top,right and botto

Eric 1.7k Nov 21, 2022
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

ogaclejapan 1.4k Dec 26, 2022
Android layout that simulates physics using JBox2D

PhysicsLayout Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall! See it in action with the sam

John Carlson 689 Dec 29, 2022
Android component which presents a dismissible view from the bottom of the screen

BottomSheet BottomSheet is an Android component which presents a dismissible view from the bottom of the screen. BottomSheet can be a useful replaceme

Flipboard 4.5k Dec 28, 2022
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Umano: News Read To You 9.4k Dec 31, 2022
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
Stale Android Toasts made tasty.

FrenchToast Stale Android Toasts made tasty. Android Toasts are amazing, but they have a few major drawbacks: You cannot control when they show up as

py - Pierre Yves Ricau 367 Nov 15, 2022
waveview for android

中文介绍 WaveView A view to display wave effect. Screenshot Integration implementation 'com.gelitenight.waveview:waveview:1.0.0' Setter methods: setWaveS

NIGHT 1.6k Dec 21, 2022
An Android demo of a foldable layout implementation. Engineered by Vincent Brison.

Foldable Layout This code is a showcase of a foldable animation I created for Worldline. The code is fully written with java APIs from the Android SDK

Worldline 599 Dec 23, 2022
A floating menu library for Android.

Hover Hover is a floating menu implementation for Android. Goals The goals of Hover are to: Provide an easy-to-use, out-of-the-box floating menu imple

Google 2.7k Dec 27, 2022
Simple android library to present an animated ferris wheel

Ferris Wheel View Overview An Android Library used to implement an animated Ferris Wheel in android. API SDK 15+ Written in Kotlin Supports landscape

Igor Lashkov 318 Dec 7, 2022