Android widgets to implement folding animation

Overview

FoldableLayout

Maven Central Size

Android widgets to implement folding animation.

Demo video

Sample app

Get it on Google Play

Usage

Note: minimum Android SDK version is 14.

Add dependency to your build.gradle file:

compile 'com.alexvasilkov:foldable-layout:1.2.1'

Unfoldable details usage (wiki)

Foldable list usage (wiki)

API reference (wiki)

See sample app sources for complete usage example.

Basic library concepts

Read this blog post.

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Fatal Exception: java.lang.OutOfMemoryError

    Fatal Exception: java.lang.OutOfMemoryError

    com.alexvasilkov.foldablelayout.FoldableItemLayout.onSizeChanged (FoldableItemLayout.java:76)

    When doing a heap dump and doing an HPROF I noticed that the memory is not being released on UnfoldableLayout. Eventually there is an out of memory error.

    opened by alsajoo 16
  • FoldableLayout for recyclerview

    FoldableLayout for recyclerview

    Hi,

    I'm getting below error while trying to adding "UnfoldableView" with recyclerview.

    java.lang.ClassCastException: android.support.v7.widget.GridLayoutManager$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams at android.widget.FrameLayout.onMeasure(FrameLayout.java:431) at com.alexvasilkov.foldablelayout.UnfoldableView$CoverHolderLayout.onMeasure(UnfoldableView.java:444) .......................................................

    In activity I'm using like thus-

        recyclerView.setAdapter(fileAdapter);
        gridLayoutManager = new GridLayoutManager(this, 1);
        recyclerView.setLayoutManager(gridLayoutManager);
    

    Thanks in Advance.

    question 
    opened by reversecoder 11
  • Issue with RecyclerView

    Issue with RecyclerView

    I get this error when I click items in my recyclerView to open the detailed view:

    java.lang.ClassCastException: android.support.v7.widget.RecyclerView$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams

    I pass in the outer element in my recyclerView items as the coveView (it's a LinearLayout) to unfold method.

    mUnfoldableView.unfold(coverView, mDetailsLayout); //cover view is a LinearLayout

    Here is my layout:

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
       <android.support.v4.widget.SwipeRefreshLayout android:layout_width="match_parent" android:layout_height="match_parent">
          <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="match_parent" />
       </android.support.v4.widget.SwipeRefreshLayout>
       <View android:id="@+id/touch_interceptor_view" android:layout_width="match_parent" android:layout_height="match_parent" />
       <MYDETAILEDVIEWISHERE />
       <UnfoldableView android:id="@+id/unfoldable_view" android:layout_width="match_parent" android:layout_height="match_parent" />
    </FrameLayout>```
    
    opened by hatpick 9
  • double touch has a problem

    double touch has a problem

    Thanks for your wonderful widget. I found a bug. In listview with foldable layout, Double touch( like double-click in mouse button) does not open folder and works wrong. Please check and fix it. Thank you in advance.

    opened by cypark 6
  • I encountered errors when adding some libraries.

    I encountered errors when adding some libraries.

    Hello I encountered errors when adding some libraries to the sample. So what should I do to add these libraries?

    ================================================== ==== Https://github.com/500px/500px-android-blur (Https://android-arsenal.com/details/1/1674#!description)


    Error: Execution failed for task ': sample: processDebugManifest'.

    Manifest merger failed with multiple errors, this log


    Or

    ================================================== ==== Compile 'com.github.jd-alexander: LikeButton: 0.2.1' (Https://android-arsenal.com/details/1/3038#!description)


    Error: Execution failed for task ': sample: processDebugManifest'.

    Manifest merger failed: Attribute application @ label value = (FoldableLayout) from AndroidManifest.xml: 9: 9-39 Is also present at [com.github.jd-alexander: LikeButton: 0.2.1] AndroidManifest.xml: 13: 9-41 value = (@ string / app_name). Suggestion: add 'tools: replace =' android: label '' to element at AndroidManifest.xml: 6: 5-34: 19 to override.


    help wanted invalid 
    opened by sadafi 4
  • GitHub code does not run on Android 4.2.2

    GitHub code does not run on Android 4.2.2

    Hello Your Sample in Google Play runs correctly on my Android phone (Android 4.2.2) But the GitHub code does not run on Android (Foldable list works correctly But Unfoldable details , clicking on the items does not happen, and the details Layout not open) Of course, there's no problem with Android devices > 4.2.2

    I need this library. Help me please

    bug 
    opened by bahmanShahveisi 4
  • How to put a ScrollView inside the details_layout

    How to put a ScrollView inside the details_layout

    I would like to put a scrollView inside the details layout.

    I have disabled the layout from folding back into the coverView, using the setGesturesEnabled(false); method, calling it once the layout is fully unfolded (when rotation == 180 && !mIsUnfolded).

    Now the layout doesn't fold back up except when I press the back button, and if I put a button inside the ScrollView, it picks up the touch. But, the ScrollView does not scroll, even when I try to scroll the ScrollView programatically without touching the screen it doesn't scroll. I did that using this code:

     scrollView.post(new Runnable() {
                    @Override
                    public void run() {
                        scrollView.scrollTo(0, scrollView.getBottom());
                    }
                });
    

    Can you advise me on how to implement a ScrollView in the details_layout please ?

    Thank in advance.

    opened by Meeks91 4
  • Problem on gradle sync

    Problem on gradle sync

    Hi Alex,

    I added your library as submodule and then I tried to run the project and it gave this error

    I didn't make any implementation after I add your llibrary(When I delete your library from project gradle doesn't give any error on run process)

    Error:Execution failed for task ':app:dexDebug'.

    com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Users/zafer/Desktop/adt-bundle-mac-x86_64-20140624/sdk/build-tools/android-4.4W/dx --dex --output /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/dex/debug /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/classes/debug /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/dependency-cache/debug /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/classes-3bc693fe3609e71975c6fef7761714cbe58d5101.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/classes-7288d1d22233c4bcdea448a282a24043050ad428.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/classes-94e2aa4d781c859eb16112efbdaeb548fca351ad.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/classes-c1e650034a5d9a5babc6e51c9a57d4414b0f9d11.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/classes-f7765d6f23deee9d1dbac0d7190a9f04daa25cfa.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/classes-fd8f32b2f91882db9822feaf3ea843998f1a3c25.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/internal_impl-20.0.0-f1f474f4d8e22737dbd108a567cc5c3428b508ca.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/picasso-2.2.0-b5ffb23592d350d9040a3851702ba413732c65c8.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/support-annotations-20.0.0-1709d613f71cf537b6d104637edff1ca29e414ab.jar /Users/zafer/Desktop/AndroidStudioProjects/AydınŞehirRehberi/app/build/intermediates/pre-dexed/debug/volley-3ab37249e6479b1dfbb6e1a8f91ff9d7ff6b6865.jar Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/alexvasilkov/foldablelayout/BuildConfig; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) at com.android.dx.command.dexer.Main.run(Main.java:230) at com.android.dx.command.dexer.Main.main(Main.java:199) at com.android.dx.command.Main.main(Main.java:103)

    opened by zcelaloglu 4
  • FoldableList onClick doesn't return the current view

    FoldableList onClick doesn't return the current view

    When using FoldableListLayout and implement onClick it doesn't return the currently view element instead it returns the next one or some other from the list. I have tested it with sample app and its not even working with that. The view returned in onClick is not what is currently displayed.

    opened by skhanzada 3
  • ScrollView after unfolding

    ScrollView after unfolding

    Great work man!

    Unfoldable details usage

    Please help me on this. After I click on a listview item, the item is expanding -> unfolding to the details layout. Until now everything is perfect.

    But I have a ScrollView in details layout.

    The problem is that I cannot scroll, because if I try to scroll, I get the folding animation -> back to the listView items.

    Please advice.

    duplicate 
    opened by tphaseitx 2
  • Need a simpler example

    Need a simpler example

    Hi, the library is quite powerful however the sample is a bit on the complicated side... I get it you want to showcase what it is capable of but trust me, a simpler example would be far, far more helpful...

    I hope it possible for you to put together and release a simple demo source code where some pictures are displayed using arrayAdapter, just a picture collection, nothing fancy,no customized Views. I'm working on your rather complicated example now and ended up have to sift through tons of code and removing unwanted functions one by one.

    Can you please simplify it?

    Furthermore, the instructions on foldableList are way too brief, I have to pretty much figure everything out myself. I'm still trying to figure out if an arrayAdapter will work with the foldableList which takes in BaseAdapter by default? Will there be complications?

    question 
    opened by tweedledum909 2
  • ImageView

    ImageView

    It is a great library. But ... it seems that the ImageView must exist. (I may not know it well.) My list item has no images. Is there a way I can use without the ImageView?

    opened by part1 0
  • getting to user defined position other than 0

    getting to user defined position other than 0

    Hello, I am trying to implement this library. The list view is displayed in the android activity when the item in list view is clicked it displays the content related to the clicked list element inside the foldable layout. For that during i have to get to the list view clicked item's content and not to the first content.

    how to make the foldable layout to directly show the 10 or 24th element. Note scrolltoposition is not fit for me to use

    opened by apraveenkumar1197 2
  • loadMore

    loadMore

    Hi, this library is great! This is not an issue. I'm creating a library wrapper for React Native and I wanted to know how hard would it be to add a loadMore to the FoldableList, so when you reach the last item (or a threshold) you can add more items to the list. I'll be more than glad to create a PR for this if I can figure it out how to do this myself

    Thanks!

    opened by tafelito 1
Owner
Alex Vasilkov
Alex Vasilkov
ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way

ConstraintLayout is a layout manager for Android which allows you to position and size widgets in a flexible way. It's available for both the Android view system and Jetpack Compose.

Android Jetpack 970 Jan 6, 2023
Maetrial Design Delete Concept Implement

MaterialDeleteLayout 说明 早上逛github的时候,发现ParticleLayout这个开源项目,觉得这个创意还可以... 从说明中又点进去看IOS的效果,也从那里看到了原设计图... 原设计图是这样子的: IOS的效果是这样的: 那一刻感觉android的效果lower了好多

CJJ 355 Nov 19, 2022
Android drawer icon with material design animation

LDrawer Android drawer icon with material design animation Note Basically same as appcompat_v7 version 21, you can use appcompat_v7 compile 'com.andro

Hasan Keklik 1.4k Dec 25, 2022
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page

Google Plus Layout Google Plus Layout is a custom layout that support playing animation on child view(s) in a serialize manner like the the main

Ahmed Nammari 224 Nov 25, 2022
a custom pull-to-refresh layout which contains a interesting animation

This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by https://dribbble.com/sho

ZhangLei 1.8k Dec 27, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Jan 5, 2023
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