Code Monkey home page Code Monkey logo

jjswipelayout's Introduction

JJSwipeLayout

The Sample Swipe Layout!

滑动删除的比较出名的的有代码家的https://github.com/daimajia/AndroidSwipeLayout和Mr.Bao的https://github.com/baoyongzhang/SwipeMenuListView,但是,代码家的那个功能太强大了,我之前用了,有点小bug,看着那么多的代码,心好累,自己改不了bug,我发现如果你不是要求那么多,只是像qq那样的简单功能的话,完全可以自己实现,Mr.bao那个是listView的,如果项目中是recyclerView的朋友要实现,可能又要大改了。。。 所以,我自己又重复造轮子了,请原谅我的无理取闹,明明别人已经写好了,我还没事找事,我只是实现了lv和rv都可以适应,一个方向的SwipeLayout...

效果:

(原谅我无耻的偷了代码家的动图,啊哈哈)

Base layout

swipe for listview

swipe for recyclerview

使用说明

<com.cjj.swipe.JJSwipeLayout
    android:id="@+id/swipelayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="80dp">
          <!--这一层是内容界面,外层包围内容的需要是ViewGroup,所以可以是Framelayout,RelativeLayout-->
    </LinearLayout>

    <LinearLayout
        android:id="@+id/bottom_wrapper_2"
        android:layout_width="210dp"
        android:layout_height="80dp">
       <!--这一层是滑动的菜单界面,可以添加删除,喜欢等功能view-->
    </LinearLayout>
</com.cjj.swipe.JJSwipeLayout>

具体你可以看源码demo,使用很简单的,呵呵。

其他

jjSwipeLayout.isOpen()//是判断打开的状态

jjSwipeLayout.setOnSwipeBackListener()//监听swipe

jjSwipeLayout.close()//关闭swipelayout

jjSwipeLayout.open()//打开swipelayout

jjSwipeLayout.setAlphaAnim(true);//设置菜单滑动出来的时候有透明动画效果

If you want to support me,you can follow me on GitHub: https://github.com/android-cjj.

License

The MIT License (MIT)

Copyright (c) 2015 android-cjj

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.

jjswipelayout's People

Contributors

android-cjj avatar

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.