Coder Social home page Coder Social logo

foldablelayout's Introduction

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.

foldablelayout's People

Contributors

alexvasilkov avatar bharathmg avatar ravidsrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foldablelayout's Issues

Opening details of UnfoldableView programatically, after list is shown on screen

Hi,
I have tried using your UnfoldableView control, following UnfoldableDetailsActivity sample, and it works great. It's really nice, great job.

I was wondering if it would be possible to programmatically open details of let's say first element from the list, just after the list is loaded on screen. I would like to have the list displayed, and right after that, start animation transition to details. I was trying to achieve this, but I can only manage to show details view without animation that should precede it. In other words I would like to simulate click on some list item, right after the list is loaded and shown on screen. Do you have any solution for this?

Implemeting on Fragment Class

Hi Alex,

I tried to implement your library on my app but I have some concern on how can I implement this library on fragment? I'm using sliding menu in my app and menu items only accept fragment class on it so I need to convert all activity to fragment.I tried to convert but I always see unfoldabledetails layout

I want to implement the unfoldable Details as an fragment

Hi Alex,

First of all, really great library.

I want to use the unfoldable Details Activity as a fragment. I'm facing an issue at the paintingsAdapter wherein

@OverRide
public void onClick(View view) {
Painting item = (Painting) view.getTag(R.id.list_item_image);
if (view.getContext() instanceof UnfoldableDetailsActivity) {
((UnfoldableDetailsActivity) view.getContext()).openDetails(view, item);
}
else if (view.getContext() instanceof FoldableListActivity) {
Toast.makeText(view.getContext(), item.getTitle(), Toast.LENGTH_SHORT).show();
}
}
is used to pass the items and the view to the openDetails.

The issue is this
if (view.getContext() instanceof UnfoldableDetailsActivity) {
((UnfoldableDetailsActivity) view.getContext()).openDetails(view, item);
}

Shows me an inconvertible type error if i pass a fragment instead of UnfoldableDetailsActivity.

Please help me with this.

Thank You.

foldablelayout cause of crash my application when i try to close inside EventBus

Hi, its very useful library which i using that on my projects, but when i try to foling back on EventBus methods, its cause of crash application and i cant resolve that

for more information: when i fold layout and EventBus methods trigger i can't foldback that on onBackPressed

@OverRide
public void onBackPressed() {
if (unfoldableView != null && (unfoldableView.isUnfolded() || unfoldableView.isUnfolding())) {
unfoldableView.foldBack();
}

Full Stack Error:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.ViewGroup.indexOfChild(android.view.View)' on a null object 
at com.alexvasilkov.foldablelayout.UnfoldableView.switchViews(UnfoldableView.java:384)
at com.alexvasilkov.foldablelayout.UnfoldableView.clearCoverViewInternal(UnfoldableView.java:368)
at com.alexvasilkov.foldablelayout.UnfoldableView.onFoldedBack(UnfoldableView.java:150)
at com.alexvasilkov.foldablelayout.UnfoldableView.setState(UnfoldableView.java:186)
at com.alexvasilkov.foldablelayout.UnfoldableView.setFoldRotation(UnfoldableView.java:254)
at com.alexvasilkov.foldablelayout.FoldableListLayout.setFoldRotation(FoldableListLayout.java:251)
at android.animation.PropertyValuesHolder.nCallFloatMethod(Native Method)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:37)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1296)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:981)
at android.animation.ValueAnimator.animationFrame(ValueAnimator.java:1384)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1427)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:759)
at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:234)
at android.app.ActivityThread.main(ActivityThread.java:5526)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

FoldableLayout content scroll is intermittent

I have a ImageView within a horizontal scroll view for FoldableLayout.
Not all images scroll. Some of the images scroll properly. Some don't scroll at all.
The only pattern I found is that every 3rd image scrolls without any issue. The remaining ones don't scroll at all.
Any idea what is the cause of the issue.
I am not sure if foldableListLayout.setGesturesEnabled(true); would help as scroll works for some images.

Views.find() not working properly

Hi Alex,

your findViewById implemantation is different so when I try to initialize an object I'm always getting Null Pointer Exception.I always changed from View.fınd(...) to findViewById(....)

I also added your compile 'com.alexvasilkov:android-commons:1.2.3' library as an dependency into build.gradle

RecyclerView IllegalArgumentException

I am using your library and instead of listview I am using RecyclerView.

I am getting the exception:

lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true

Will it work for recyclerview? if yes, can please provide me an example

remove onChangeListeners

As a standard practice, after setting a setOnFoldingListener, we need a way to remove it too.
The app crashed because of a nullpointerexception. It's better to remove the listener instead of letting it stay in the background, the objects inside it may cause NPE
Thanks.

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.

how i used this library correctly

Initially, thank you alexvasilkov for your perfect library..
I wrote all codes completely but i didnt work.. So, i changed some codes than it worked well.. I'm writing in here.. I hope it is benefit to someone..(this solutions just research, not my own)

  1. gradle/module
 compile 'com.alexvasilkov:android-commons:1.2.4'
 compile 'com.alexvasilkov:foldable-layout:1.2.0'
  1. add function to PaintingsAdapter.class
private Activity getActivityX() {
        Context context = getContext();
        while (context instanceof ContextWrapper) {
            if (context instanceof Activity) {
                return (Activity)context;
            }
            context = ((ContextWrapper)context).getBaseContext();
        }
        return null;
    }
  1. change onClick() function in PaintingsAdapter.class
@Override
    public void onClick(View view) {
        Painting item = (Painting) view.getTag(R.id.list_item_image);
        if (getActivityX() instanceof UnfoldableDetailsActivity) {
            ((UnfoldableDetailsActivity) getActivityX()).openDetails(view, item);
        } else if (getActivityX() instanceof FoldableListActivity) {
            Toast.makeText(getActivityX(), item.getTitle(), Toast.LENGTH_SHORT).show();
        }
    }

4)change bindView() function in MainActivity.class

@Override
        protected void bindView(ActivityInfo item, int pos, View convertView) {
            TextView tv = (TextView) convertView;
            if (TextUtils.isEmpty(item.nonLocalizedLabel)) {
                tv.setText(String.valueOf(item.labelRes));
            } else {
                tv.setText(String.valueOf(item.nonLocalizedLabel));
            }
        }

note : if your thema is Fullscreen than delete the line in classes
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

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.

have to perform multiple clicks to fire on click event

like the title this is my problem
and i use onclicklistner in the adapter and

here that the code for my adapter

public class PaintingsAdapter extends ItemsAdapter<ArrayList> implements View.OnClickListener {
private ArrayList<ArrayList> list = new ArrayList<>();

public PaintingsAdapter(Context context,ArrayList<ArrayList<String>> data) {
    super(context);
    list=data;
    Log.d("my trace", "data size " + data.size());
      setItemsList(data);
}

@Override
protected View createView(ArrayList<String> item, int pos, ViewGroup parent, LayoutInflater inflater) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_row, parent, false);
    ViewHolder vh = new ViewHolder();
    vh.image = Views.find(view, R.id.art_img);
   vh.image.setOnClickListener(this);
    vh.title = Views.find(view, R.id.text_head);
    vh.content=Views.find(view,R.id.text_superhero);
    view.setTag(vh);
    Log.d("my trace", "in paiting adaper oncreateview ");
    return view;
}

@Override
protected void bindView(ArrayList<String> item, int pos, View convertView) {
    ViewHolder vh = (ViewHolder) convertView.getTag();

    vh.image.setTag(item);

    File f=new File(list.get(pos).get(4));
    Log.d("my trace", "before set photo"+f.getPath());
    Picasso.with(convertView.getContext()).load(f).placeholder(R.drawable.art_pic).error(R.drawable.logo).noFade().resize(800,600).into(vh.image);
    vh.title.setText(list.get(pos).get(0));
    vh.content.setText(list.get(pos).get(1));
}

@Override
public void onClick(View view) {
    Log.d("my trace","presed");
    if (view.getContext() instanceof UnfoldableDetailsActivity) {
        UnfoldableDetailsActivity activity = (UnfoldableDetailsActivity) view.getContext();
        activity.openDetails(view, (Painting) view.getTag());
    }

   Intent intent = new Intent(getContext(), fullArticleDetails.class);
    getContext().startActivity(intent);
}



private static class ViewHolder {
    ImageView image;
    TextView title;
    TextView content;
    TextView write_name;
}

}

note : i need around 40 clicks to fire the event handler :(

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.

How do i use It???

Hi. I Have Imported The Library In my project and it is working fine...
now i want to know how do i use it
i want to use the unfoldableLyaout
i created and instance of it UnfoldableView uv = new UnfoldableView(this);
so how do i add items to the list and there details......

iOS

Is there an iOS equivalent to this library? I want to replicate so that I can have the same experience on both platforms.

How to add FoldableListLayout displaying normal in ScrollView

I modified the FoldableListLayout in order to add FoldableListLayout displaying normal in ScrollView ,but failed.
Like modify the method onMeasure() of ListView,
eg:
@OverRide
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);

    super.onMeasure(widthMeasureSpec, expandSpec);
}

How can I achieve this effect?
Thank you for your open source.

Using FoldableLayout with TabLayout

The problem is that I want the details view to unfold from the RecyclerView and either be below the Toolbar and above the TabLayout, or above both the Toolbar and the AppBarLayout.

I figured out 2 possible solutions. Firstly, programatically change layout params of the ViewPager which contains the RecyclerView that houses the CoverView, so that when the RecyclerView item is clicked, the ViewPager positions itself above the TabLayout allowing the details view to draw above the TabLayout.

Or secondly, to have the ViewPager always above the TabLayout and setting the XML topMargin on the RecyclerView to make it look like its below the TabLayout, but as the ViewPager is above the TabLayout this allows the details view to unfold above the TabLayout.

This approach works really well, except when the RecyclerView item is scrolled behind the TabLayout, when this happens, the unfoldable layout ** animates through **the TabLayout and whole item row becomes visible through the TabLayout, maybe this is the result of the bitmap you create ?

Problem in a nutshell: How would you suggest I use the FoldableLayout with a TabLayout if I want the details view to appear above the TabLayout and/or Toolbar ??

Thanks in advance,

I can provide video of the problem if it would help

Edit: Actually, when the RecyclerView scroll so any item is behind the TabLayout, the item behind the tabLayout will appear drawn over the TabLayout even if it is not the item that has been clicked.

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)

sample not importable into eclipse

I am using the most up to date version of Eclipse and the android ADT bundle. I downloaded the ZIP file of this repository. I was able to import the Library folder into eclipse without errors. The sample folder however is not able to be imported. I believe that the Sample Folder is not actually a complete app project folder.

Is there any way to apply better documentation? I am trying to incorporate the library into a project but unfortunately I am unable to get it to work. I am extremely limited as my only example, the sample, wont import into Eclipse and the code itself is not commented.

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>```

Not working with Fragment

I am having an issue folding and unfolding using Fragment. I have successful passed the image and text but when I click, nothing happens.

 public class PaintingsAdapter extends ItemsAdapter<Painting> implements View.OnClickListener {

public PaintingsAdapter(Context context) {
    super(context);
    setItemsList(Arrays.asList(Painting.getAllPaintings(context.getResources())));
}

@Override
protected View createView(Painting item, int pos, ViewGroup parent, LayoutInflater inflater) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.style_item, parent, false);
    ViewHolder vh = new ViewHolder();
    vh.image = Views.find(view, R.id.list_item_image);
    vh.image.setOnClickListener(this);
    vh.title = Views.find(view, R.id.list_item_title);
    view.setTag(vh);

    return view;
}

@Override
     protected void bindView(Painting item, int pos, View convertView) {
    ViewHolder vh = (ViewHolder) convertView.getTag();

    vh.image.setTag(item);
    Picasso.with(convertView.getContext()).load(item.getImageId()).noFade().into(vh.image);
    vh.title.setText(item.getTitle());
}

@Override
public void onClick(View view) {

    WhatsHotFragment fm = new WhatsHotFragment();
    fm.openDetails(view, (Painting)view.getTag());

}
private static class ViewHolder {
    ImageView image;
    TextView title;
}

}

(FoldableListLayout) Only the last item in the adapter has clickable views, and that item intercepts clicks of the other views even when it's not shown

I have three list items, and in each list item contains two buttons. When I click on the buttons in the third item in the list (the last item) the onClick for those buttons is called and everything works perfectly. For the other two items, when I click only the third item registers the clicks and its OnClick is called even though it is not currently in view. How can I get items that aren't the last item in the adapter to register their own clicks? I have tried setting isGestureEnabled to false, which did nothing.
Here is the code for my view:

public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    v = inflater.inflate(R.layout.flipping_circle, container, false);

    final FoldableListLayout foldableListLayout = (FoldableListLayout) v.findViewById(R.id.foldable_list);

    View circle1 = inflater.inflate(R.layout.item_circle, container, false);

    View circle2 = inflater.inflate(R.layout.item_circle2, container, false);

    View dummyView = inflater.inflate(R.layout.item_circle, container, false);

    FlyButton buttonSemiCircleTop1 = (FlyButton) circle1.findViewById(R.id.button_semi_circle_top);

    FlyButton buttonSemiCircleBottom1 = (FlyButton) circle1.findViewById(R.id.button_semi_circle_bottom);

    FlyButton buttonSemiCircleBottom2 = (FlyButton) circle2.findViewById(R.id.button_semi_circle_bottom2);

    MergeAdapter viewList = new MergeAdapter();

    viewList.addView(dummyView);

    viewList.addView(circle2);

    viewList.addView(circle1);

    foldableListLayout.setAdapter(viewList);

    foldableListLayout.setGesturesEnabled(true);

    buttonSemiCircleTop1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            foldableListLayout.scrollToPosition(0);

            System.out.println("Circle 1 Top Clicked");

        }
    });

    buttonSemiCircleBottom1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            foldableListLayout.scrollToPosition(1);

            System.out.println("Circle 1 Bottom Clicked");

        }
    });

    buttonSemiCircleBottom2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            foldableListLayout.scrollToPosition(2);

            System.out.println("Circle 2 Bottom Clicked");

        }
    });

    return v;
}

Getting Current View Position from the List

Hello ,
I have been trying to get the current view position from the foldable list Adapter (Base Adapter) I tried to get it through getview method and pass it to the Activity so I can do certain tasks based on the image viewed . but the position is always incorrect sometimes +1 or -1 of the real position .
any suggestions ?

Event flipped page

How can i get position of flipped page?
onFoldRotation is not suitable

Library not working.

hello I've made sample application using this library but, somehow it's not working. here's the link. There's no Error Logs coming in Console showing error message. So, Ii's hard for me to figure out what's going wrong.

all onclick events in foldablelistlayout goes to the second view

although the views are displayed correctly when i click an item like image view in the third view
the click event excute like it was fired from seconed view and so on
and i tested this in the sample app
and it is the same result
in FoldableListLayout
the second view
overide all the onclick events except only for the first time
are there any suggestions ??

Porting the code to Xamarin.Android

Hi Alex,

I tried to port the code to c# (Xamarin.Android). The logic is the same but the animations are bit different than what is expected, Can I share my code with you. Will you be able to help?

Library lacks

Could you tell where could I find the utility of Views??? I thought that you imported some external libraries like fluffycommons.

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.

Does not scroll when in detailed view

When using the unfoldable view, the details are not scrollable. This is especially problematic when in landscape mode on a lower end phone with low resolution display.

Gradle sync error

When I am importing the sample project into my android studio, and I try to sync the gradle file, it gives me following error:
"Error:No such property: sourceFiles for class: org.gradle.api.internal.file.DefaultSourceDirectorySet"
Have to say that I am new to android studio.
Can you help me?

I need a help

Hi.
I need a help. I am using your library and its great.
But I have a problem that I can solve. The problem is that want to set different fragment between text and star_image in frame layout . But when I try to do it works like : in 1 page - it sets but in 2 doesn't set then in 3 -sets in 4 doesn't i.t.c. I find that it depends on field MAX_CHILDREN_COUNT in FoldableListLayout.class. Right now MAX_CHILDREN_COUNT = 2 when i set it just delete my screen( .
How can I solve it ? I want display fragments in each item of FoldableListLayout
I am using
FragmentManager manager = ((MainActivity) getContext()).getSupportFragmentManager();
manager.beginTransaction()
.replace(R.id.flip_conteiner, new MyCustomeFragment())
.commit();
screenshot_2016-02-09-16-41-03
screenshot_2016-02-09-16-38-55

Adapter overrides OnClickListener

Thanks for this library.

When you use a FoldableListLayout that have 2 or more views and you have multiple elements in it, if you set a OnClickListener to one of those elements in the first position and then in the second position you set a OnClickListener too, it replaces the first OnClickListener for the second one.

Thanks

Doc

Can you provide doc about quick usage?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.