This project aims to provide a working page flip implementation for usage in ListView.

Overview

Changes:

  • Made clickable views like a button clickable inside the FlipViewPager.
  • Use RecyclerView.
  • Updated to API 23.
  • Added support for close clicks on a MergePage e.g. to add a close button.

FlipViewPager.Draco

This project aims to provide a working page flip implementation for usage in ListView. Made in [Yalantis] (https://yalantis.com/?utm_source=github)

Preview

#Usage

For a working implementation, Have a look at the Sample Project - sample

To achieve the same grid-looking view you should:

  1. Include the library as local library project:

    compile 'com.yalantis:flipviewpager:1.0.0'
  2. Create your main layout, it will be the view with 2 items merged together:

    <!-- ... -->
    
    <ImageView
        android:id="@+id/first"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:contentDescription="left image"
        android:layout_height="wrap_content"
        android:scaleType="fitXY" />
    
    <LinearLayout
        android:layout_width="1dp"
        android:layout_weight="0"
        android:background="#000000"
        android:layout_height="fill_parent"/>
    
    <ImageView
        android:id="@+id/second"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:contentDescription="right image"
        android:layout_height="wrap_content"
        android:scaleType="fitXY" />
    
    <!-- ... -->
  3. Create layout for displaying an additional info for each merged item:

    <!-- ... -->
    
    <com.yalantis.flip.sample.views.FontTextView
        style="@style/TextView.Nickname"
        android:id="@+id/nickname" />
    
    <LinearLayout
        android:layout_below="@+id/nickname"
        android:id="@+id/interestsPrimary"
        style="@style/LinearLayout.Interests">
    
        <com.yalantis.flip.sample.views.FontTextView
            style="@style/TextView.Interest"
            android:id="@+id/interest_1" />
    
        <!-- ... -->
    
    </LinearLayout>
    
  4. Create your adapter and extend it from BaseFlipAdapter<T>

    class FriendsAdapter extends BaseFlipAdapter<Friend> {
    
    	@Override
    	public View getPage(int position,
    			    View convertView,
    			    ViewGroup parent,
    			    Friend friend1,
    			    Friend friend2) {
    		// ...
    	}
    
    	class FriendsHolder {
        	// ...
        }
    }
  5. Set your adapter in ListView

    final ListView friends = (ListView) findViewById(R.id.friends);
    friends.setAdapter(new FriendsAdapter(this, Utils.friends, settings));
  6. You can handle clicks just like in regular ListView

friends.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Friend friend = (Friend) friends.getAdapter().getItem(position);
        Toast.makeText(FriendsActivity.this, friend.getNickname(), Toast.LENGTH_SHORT).show();
    }
});

More options will be added soon :)

#Customization

To customize page will be shown first - create and pass FlipSettings object into adapter

FlipSettings settings = new FlipSettings.Builder().defaultPage(1).build();

#Compatibility

  • Android 4.0+

Changelog

Version: 1.0

  • Initial Build

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for Android (iOS) better than better. Stay tuned!

License

Copyright 2017, Yalantis

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
  • Sample with errors

    Sample with errors

    Hi, I'm trying to implement this beautiful library in my project, what is happening is I cannot set an adapter that extends BaseFlipAdapter in a ListView. In the sample the ListView friends sets a BaseFlipAdapter and for some reason it can't, help please.

    opened by curliq 10
  • When getDegreesDone() >= 90 then other half goes to white

    When getDegreesDone() >= 90 then other half goes to white

    Hello, When getDegreesDone() >= 90 then other half goes to white. For example when I flip right to left, the right side goes to white when getDegreesDone() >= 90. What can I do to solve this problem? Thank you

    opened by ilkea 8
  • listview set a wrong adaptor

    listview set a wrong adaptor

    Java code(FriendsActivity): friends.setAdapter(new FriendsAdapter(this, Utils.friends, settings));

    Here are the errors: Error:(36, 16) error: no suitable method found for setAdapter(FriendsActivity.FriendsAdapter) method AdapterView.setAdapter(ListAdapter) is not applicable (argument mismatch; FriendsActivity.FriendsAdapter cannot be converted to ListAdapter) method AbsListView.setAdapter(ListAdapter) is not applicable (argument mismatch; FriendsActivity.FriendsAdapter cannot be converted to ListAdapter) method ListView.setAdapter(ListAdapter) is not applicable (argument mismatch; FriendsActivity.FriendsAdapter cannot be converted to ListAdapter)

    opened by luoguibin 7
  • about item click

    about item click

    It's not proper about code if(ev.getRowX() == mLastMotionX || ev.getRowY() == mLastMotionY) in FlipViewPager to judge wether user click or not.

    I change the code like below: if (Math.abs(ev.getX() - mLastMotionX) < mTouchSlop || Math.abs(ev.getY() - mLastMotionY) < mTouchSlop) and it works fine.

    opened by weity 3
  • Is it possible to programmatically open a detailled view ?

    Is it possible to programmatically open a detailled view ?

    I think everything is on the subject :-)

    It's in the case a user click on a picture, so the detailed view is opened.

    I think it's not natural to swipe the view if you don't know already what is behind.

    opened by TheBlusky 3
  • Right Image can flip 10 times

    Right Image can flip 10 times

    Hi! I copied all the code from the sample and the images on the right side can flip 10 times, why is it happening? shouldn't it flip just one time? Also, when here is an odd number of items, the very last space (which holds no item, cause it's an odd number) can be flipped Thanks!

    opened by rafaelcorreiapoli 2
  • Row Height on Tablet

    Row Height on Tablet

    Hello,

    Thank you for the library, I am using it in a project but when I test it on a tablet, the row height is too narrow. And the images appears with a very wrong aspect ratio. I tried changing the scale type but nothing worked. The problem seems in the listView row height. ( The problem also is present in the demo provided with your pictures)

    Do you have any idea how to change the row height?

    Thank you Elie

    opened by erahal 2
  • click item will be crashed , when make listview  add footer view

    click item will be crashed , when make listview add footer view

    E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback E/MessageQueue-JNI: java.lang.IndexOutOfBoundsException: Invalid index 9, size is 1 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)

    opened by ghost 1
  • used inside viewpager

    used inside viewpager

    i want to use FlipViewPager inside viewpager, it is not worked.. because when i flip it considered its parent view.. in my side, i am using as parent view, viewpager... so how to implement it inside viewpager...

    opened by MikhilPastagia 1
  • Add release tags

    Add release tags

    Please maintain consistent releases by also adding Git tags and pushing them to this repository. Please consider using semantic versioning for release tags.

    $ git checkout {some-release-commit}
    $ git tag -a "v.1.0.0" -m "Short summary of the release."
    $ git push --tags origin master
    
    opened by johnjohndoe 1
  • Update project

    Update project

    • Update gradle version
    • Fix gradle issues
    • Update mavenpush.gradle script
    • Update compileSdkVersion
    • Update targetSdkVersion
    • Update buildToolsVersion
    • Migrate to AndroidX
    opened by dmytro1morozov 0
  • Horizontal list

    Horizontal list

    Hello...

    I'm working on a news app and I'd like to view my articles in a horizontal fashion i.e once a user opens an article at position say i, I'd like to be able to flip/swipe between the articles.... Unlike your sample project (where we have a horizontal and vertical scroll), I will not be merging any views... I just want the horizontal flip between my items....

    How can I accomplish this with this library ?

    opened by ClaudeHangui 0
  • setOnClickListener inside flipviewpager not working

    setOnClickListener inside flipviewpager not working

    I am trying to implement this in one of my project but the views coming after flip are no taking OnClickListener event. For example textviews after flip the image not taking clicklisener event Please help to sort out this.

    opened by OmiAndroid 10
Owner
Yalantis
Knowledge is power and the way to get power is by sharing knowledge. We are open source because this is a smart way to live, work and play.
Yalantis
Pixplicity 915 Nov 8, 2022
A Page Indicator Lib is realized in a different way.

#FlycoPageIndicator A Page Indicator Lib is realized in a different way. Support for Android 2.2 and up. ##Demo ####Here is a DemoApk download ##Gradl

Flyco 537 Dec 17, 2022
PagedGrid - Custom android view composed by multiple page grids with custom content and layout

PagedGrid A PagedGrid is a ViewPager which pages are GridLayout with equal distributed rows and columns. This project is an Android library, written i

Matteo Pellegrino 1 Jan 23, 2019
UltraViewPager is an extension for ViewPager to provide multiple features in a single ViewPager.

UltraViewPager 中文文档 ProjectUltraViewPager is a ViewPager extension that encapsulates multiple features, mainly to provide a unified solution for multi

Alibaba 5k Dec 20, 2022
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

黄伟平 2.7k Dec 30, 2022
Android - A ViewPager page indicator that displays the current page number and (optionally) the page count

NumericPageIndicator A ViewPager page indicator that displays the current page number and (optionally) the page count. It can also display buttons to

Manuel Peinado Gallego 253 Nov 16, 2022
This library provides Easy Android ListView Adapters(EasyListAdapter & EasyCursorAdapter) which makes designing Multi-Row-Type ListView very simple & cleaner, It also provides many useful features for ListView.

EasyListViewAdapters Whenever you want to display custom items in listview, then only way to achieve this is to implement your own subclass of BaseAda

Biraj Patel 132 Nov 25, 2022
3D Style Page Flip on Android

PageFlip This project is aimed to implement 3D style page flip on Android system based on OpenGL 2.0. For JNI version, please visit: android-PageFlip-

eschao 1.7k Dec 19, 2022
A lightweight, good expandability Android library used for displaying different pages like loading, error, empty, timeout or even your custom page when you load a page

中文 | English LoadSir ?? ?? LoadSir是一个高效易用,低碳环保,扩展性良好的加载反馈页管理框架,在加载网络或其他数据时候,根据需求切换状态页面, 可添加自定义状态页面,如加载中,加载失败,无数据,网络超时,如占位图,登录失效等常用页面。可配合网络加载框架,结合返回 状态

KingJA 3.3k Dec 21, 2022
Help-page-finder - Help page finder for android

help-page-finder This app allows to search for help articles on a website. It is

null 0 Feb 13, 2022
This project aims to provide a reusable pull to refresh widget for Android.

Pull To Refresh for Android Note This library is deprecated, a swipe refresh layout is available in the v4 support library. This project aims to provi

Johan Berg 2.5k Jan 2, 2023
This project aims to provide a solution for finding the right product for a given EAN (European Article Number)

This project aims to provide a solution for finding the right product for a given EAN (European Article Number)

MJ 1 Apr 18, 2022
DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope or time based moving. But you can create your own evaluator.

DexMovingImageView DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope o

Diego Grancini 310 Feb 7, 2022
AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Zomato 2.5k Dec 30, 2022
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Zomato 2.5k Dec 23, 2022
WynnLib is a Fabric mod that aims to provide data-related functionalities for the server Wynncraft

WynnLib is a Fabric mod that aims to provide data-related functionalities for the server Wynncraft. The mod inherits from the mod WynnInvManager (WIM), but comes up with a better framework design and supports newer Minecraft versions. As an open-source project, the contribution is welcome.

Sihan 13 Nov 20, 2022
A simple Discord bot that aims to provide a snapshot of the join logs given a range of time for servers.

?? What is Humpy Dumpy? Humpy Dumpy is a simple Discord bot that aims to provide a snapshot of the join logs given a range of time for servers. It was

Miu 2 Aug 29, 2022
Android library to display a ListView whose cells are not rigid but flabby and react to ListView scroll.

FlabbyListView This library is not maintained anymore and there will be no further releases Android library to display a ListView which cells are not

JPARDOGO 762 Nov 23, 2022
HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView which scrolls vertically).

HorizontalListView HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView w

MeetMe 722 Nov 10, 2022