All Projects → Yalantis → Todolist

Yalantis / Todolist

Micro-Transitions for Smooth Android To-Do List Animations

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Todolist

Toro
Video list auto playback made simple, specially built for RecyclerView
Stars: ✭ 1,380 (-12.77%)
Mutual labels:  recyclerview
Jkcardlayout
高仿即刻APP探索页卡片布局拖拽、卡片前进、回退和下拉效果,采用RecyclerView和自定义LayoutManager实现
Stars: ✭ 111 (-92.98%)
Mutual labels:  recyclerview
Swipemenulayout
🔥一个零耦合的侧滑菜单,支持RecyclerView、ListView、GridView等不同条目布局,支持菜单在左或在右,可选滑动阻塞,是否禁用等功能
Stars: ✭ 120 (-92.41%)
Mutual labels:  recyclerview
Zoomrecyclerview
A Zoomable RecyclerView for comic
Stars: ✭ 102 (-93.55%)
Mutual labels:  recyclerview
Reel Search Android
Reel Search for Android is a UI/UX design for autocomplete action. It is a beautiful minimalistic addition to any use case.
Stars: ✭ 110 (-93.05%)
Mutual labels:  recyclerview
Featureadapter
FeatureAdapter (FA) is an Android Library providing an optimized way to display complex screens on Android.
Stars: ✭ 112 (-92.92%)
Mutual labels:  recyclerview
Flowlayout
An Android Layout Manager to create a gridview with cells of different sizes inspired by Flow Layout for iOS.
Stars: ✭ 98 (-93.81%)
Mutual labels:  recyclerview
Easyadapter
Recyclerview adapter library- Create adapter in just 3 lines of code
Stars: ✭ 122 (-92.29%)
Mutual labels:  recyclerview
Pull To Make Soup
Custom animated pull-to-refresh that can be easily added to RecyclerView
Stars: ✭ 1,443 (-8.79%)
Mutual labels:  recyclerview
Imagezoom
An Android library that makes any view to be zoomable.
Stars: ✭ 118 (-92.54%)
Mutual labels:  recyclerview
Multi Type Adapter
Super simple and easy to use common multi-type-adapter by android data-binding
Stars: ✭ 102 (-93.55%)
Mutual labels:  recyclerview
Vue Recyclerview
Mastering Large Lists with the vue-recyclerview
Stars: ✭ 1,442 (-8.85%)
Mutual labels:  recyclerview
Poweradapter
Adapter for RecyclerView(only 21KB).RecyclerView万能适配器(仅21KB)
Stars: ✭ 112 (-92.92%)
Mutual labels:  recyclerview
Cartlayout
🦄 使用 RecyclerView 实现店铺分组购物车。 高仿京东购物车、高仿淘宝购物车、高仿天猫购物车
Stars: ✭ 101 (-93.62%)
Mutual labels:  recyclerview
Baserecyclerviewadapter
⚡ Fast way to bind RecyclerView adapter and ViewHolder for implementing clean sections.
Stars: ✭ 120 (-92.41%)
Mutual labels:  recyclerview
Multi Selection
Multiselection Solution for Android in Kotlin
Stars: ✭ 1,361 (-13.97%)
Mutual labels:  recyclerview
Kotlin Playground
Kotlin practice
Stars: ✭ 111 (-92.98%)
Mutual labels:  recyclerview
Greedo Layout For Android
Full aspect ratio grid LayoutManager for Android's RecyclerView
Stars: ✭ 1,588 (+0.38%)
Mutual labels:  recyclerview
Recyclerview
How to use a recyclerview
Stars: ✭ 121 (-92.35%)
Mutual labels:  recyclerview
Flingappbarlayout
A custom AppBarLayout that can fling smoothly
Stars: ✭ 117 (-92.6%)
Mutual labels:  recyclerview

ToDoList

License Yalantis

Get it on Google Play

Live DEMO on appetize.io

Check this project on dribbble

Read how we did it on our blog

##Requirements

  • Android SDK 16+

##Usage

Add to your root build.gradle:

allprojects {
	repositories {
	...
	maven { url "https://jitpack.io" }
	}
}

Add the dependency:

dependencies {
	compile 'com.github.yalantis:todolist:v1.0.1'
}

How to use this library

Add BatRecyclerView to your xml layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/gradient"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:background="@android:color/transparent"
        app:logo="@drawable/ic_menu">

        <TextView
            android:id="@+id/text_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="14 Feb, 2016"
            android:textColor="@android:color/white"
            android:textSize="20sp" />

    </android.support.v7.widget.Toolbar>

    <com.yalantis.beamazingtoday.ui.widget.BatRecyclerView
        android:id="@+id/bat_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal"
        app:add_button_color="@drawable/selector_button_add"
        app:hint="@string/str_add_goal"
        app:radio_button_res="@drawable/selector_radio_button" />

</LinearLayout>

Create BatListener

private BatListener mListener = new BatListener() {
        @Override
        public void add(String string) {
            mGoals.add(0, new Goal(string));
            mAdapter.notify(AnimationType.ADD, 0);
        }

        @Override
        public void delete(int position) {
            mGoals.remove(position);
            mAdapter.notify(AnimationType.REMOVE, position);
        }

        @Override
        public void move(int from, int to) {
            if (from >= 0 && to >= 0) {
                
                //if you use 'BatItemAnimator'
                mAnimator.setPosition(to);
                
                BatModel model = mGoals.get(from);
                mGoals.remove(model);
                mGoals.add(to, model);
                mAdapter.notify(AnimationType.MOVE, from, to);

                if (from == 0 || to == 0) {
                    mRecyclerView.getView().scrollToPosition(Math.min(from, to));
                }
            }
        }
    };

Create BatAdapter. Pass to its constructor list of models and BatListener. Note that your model should implement BatModel interface

mAdapter = new BatAdapter(mGoals = new ArrayList<BatModel>() {{
      add(new Goal("first"));
      add(new Goal("second"));
      add(new Goal("third"));
      add(new Goal("fourth"));
      add(new Goal("fifth"));
      add(new Goal("sixth"));
      add(new Goal("seventh"));
      add(new Goal("eighth"));
      add(new Goal("ninth"));
      add(new Goal("tenth"));
}}, mListener);
        
mAdapter.setOnItemClickListener(new OnItemClickListener() {
      @Override
      public void onClick(BatModel item, int position) {
            Toast.makeText(ExampleActivity.this, item.getText(), Toast.LENGTH_SHORT).show();
      }
});

Initialize your recycler view

mRecyclerView.getView().setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.getView().setAdapter(mAdapter);

ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new BatCallback(this));
itemTouchHelper.attachToRecyclerView(mRecyclerView.getView());
mRecyclerView.setAddItemListener(mListener);

Extra

You can use BatItemAnimator to animate list items just like in our demo:

mAnimator = new BatItemAnimator();
mAdapter = new BatAdapter(mGoals = new ArrayList<BatModel>() {{
            add(new Goal("first"));
            add(new Goal("second"));
            add(new Goal("third"));
            add(new Goal("fourth"));
            add(new Goal("fifth"));
            add(new Goal("sixth"));
            add(new Goal("seventh"));
            add(new Goal("eighth"));
            add(new Goal("ninth"));
            add(new Goal("tenth"));
}}, mListener, mAnimator);
mRecyclerView.getView().setItemAnimator(mAnimator);

You need to pass the animator instance to BatRecyclerView and to BatAdapter. Also it's necessary to pass the position of the moved item in move() callback:

@Override
public void move(int from, int to) {
     if (from >= 0 && to >= 0) {
           mAnimator.setPosition(to);
           BatModel model = mGoals.get(from);
           mGoals.remove(model);
           mGoals.add(to, model);
           mAdapter.notify(AnimationType.MOVE, from, to);

           if (from == 0 || to == 0) {
                 mRecyclerView.getView().scrollToPosition(Math.min(from, to));
           }
     }
}

For more usage examples please review sample app

Changelog

Version: 1.0.1

  • Cursor fixed.
  • cursor_drawable attribute and setCursorDrawable(@DrawableRes int res) method added. Should be used instead of cursor_color attribute and setCursorColor(@ColorInt int color) method respectively

Let us know!

We’d be really happy if you could send 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 iOS (Android) better than better. Stay tuned!

License

The MIT License (MIT)

Copyright © 2017 Yalantis, https://yalantis.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].