百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

FlipViewPager.Draco

> 编程语言
开源

此项目旨在为 ListView 中的使用提供一个可行的页面翻转实现。

1.8K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

此项目旨在为 ListView 中的使用提供一个可行的页面翻转实现。

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)

  • Check this [project on Dribbble] (https://dribbble.com/shots/1758298-Find-Friends-Interaction?list=users&offset=35)

  • See how it works on [Youtube] (https://www.youtube.com/watch?v=zNRPjS53m5w)

#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:

…
  1. 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>
    
  2. 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 {
            // ...
        }
    }
    
  3. Set your adapter in ListView

    final ListView friends = (ListView) findViewById(R.id.friends);
    friends.setAdapter(new FriendsAdapter(this, Utils.friends, settings));
    
  4. 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.

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •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.
  • •Check this [project on Dribbble] (https://dribbble.com/shots/1758298-Find-Friends-Interaction?list=users&offset=35)
  • •See how it works on [Youtube] (https://www.youtube.com/watch?v=zNRPjS53m5w)
  • •Android 4.0+
  • •Initial Build

> 标签

Javaandroidanimationgrid-recyclerviewjava

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言