Coder Social home page Coder Social logo

yeon-kyu / holdableswipehandler Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 0.0 14.48 MB

Open Source Library for Holdable(partial-swipe) ViewHolder in RecyclerView

License: Apache License 2.0

Kotlin 100.00%
open-source library recyclerview partial-swipe awesome-ui animation animations android android-library android-libraries

holdableswipehandler's Introduction

HoldableSwipeHandler

Open Source Library for Holdable ViewHolder in RecyclerView

Gradle Setup

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.yeon-kyu.HoldableSwipeHandler:HoldableSwipeHandler:1.2.2'
}

Latest Version : 1.2.2

ScreenShot Examples

๐ŸŒด๐ŸŒด ๐ŸŒด๐ŸŒด

How To Use in Activity/Fragment with RecyclerView

val yourRecyclerView: RecyclerView
val yourAdapter: RecyclerView.Adapter or ListAdapter ..

HoldableSwipeHandler.Builder(requireContext())
    .setOnRecyclerView(yourRecyclerView) // mandatory.
    .setSwipeButtonAction(object : SwipeButtonAction { // mandatory.
        override fun onClickFirstButton(absoluteAdapterPosition: Int) {
            val item = yourAdapter.currentList[absoluteAdapterPosition]
            viewModel.deletePushDB(item.articleId) // this is an example.
        }
    })
    .setBackgroundColor("#ff0000") // optional. default value is pink color
    .setFirstItemDrawable(ContextCompat.getDrawable(context, R.drawable.ic_check)!!) // optional. default value is a 'trash can' icon
    .setFirstItemSideMarginDp(20) // optional. default value is 18. (in dip unit)
    .setDismissOnClickFirstItem(true) // optional. default value is 'true'
    .excludeFromHoldableViewHolder(10010) // optional. add ViewType that you want to exclude from holdable ViewHolder
    .build()

Version Updates

v.1.2.2

  • ์™ผ์ชฝ -> ์˜ค๋ฅธ์ชฝ ์Šค์™€์ดํ”„๋„ ๊ฐ€๋Šฅํ•˜๋„๋ก ๋ณ€๊ฒฝ
    • setDirectionAsRightToLeft() ํŒŒ๋ผ๋ฏธํ„ฐ์— false๋ฅผ ๋„ฃ์–ด์„œ ์ ์šฉ ๊ฐ€๋Šฅ (default๊ฐ’ : true)

v.1.2.0

  • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ Builder Pattern์œผ๋กœ ๋ฆฌํŒฉํ† ๋ง
    • ๊ธฐ์กด์˜ ๊ธฐ๋Šฅ๋“ค์€ ์ด์ „ ๋ฐฉ์‹(์ž๋ฐ”๋นˆ์ฆˆ ํŒจํ„ด)์œผ๋กœ๋„ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‚˜ ๊ถŒ์žฅํ•˜์ง€ ์•Š์Œ

v.1.1.1

  • ์ง€์ •ํ•œ ItemViewType์—๋Š” Swipe ๋ถˆ๊ฐ€๋Šฅํ•˜๊ฒŒ ๊ฐ€๋Šฅํ•˜๋„๋ก ์ˆ˜์ •
    • excludeFromHoldableViewHolder() ์ด์šฉ ๊ฐ€๋Šฅ
    • RecyclerView ๋‚ด์—์„œ ์•„์ดํ…œ ์ข…๋ฅ˜์— ๋”ฐ๋ผ ์—ฌ๋Ÿฌ ViewType์„ ๋‚˜๋ˆ„์—ˆ์„ ๋•Œ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉ ๊ฐ€๋Šฅ

v.1.1.0

  • ๋ฒ„๊ทธ ์ˆ˜์ •
    • ์•„์ดํ…œ ์‚ญ์ œ๋˜๋Š” ๋„์ค‘์— HoldingBackground๊ฐ€ ์ข…์ข… ๋‚จ์•„์žˆ๋Š” ๋ฒ„๊ทธ ์ˆ˜์ •
    • ๋ทฐํ™€๋” ๋ฐฐ๊ฒฝ์ด ํˆฌ๋ช…ํ•œ ๊ฒฝ์šฐ์—์„œ์˜ UI ๋ฒ„๊ทธ ์ˆ˜์ •(๋‚จ์•„์žˆ๋Š” ํˆฌ๋ช… ํด๋ฆญ ๋ฆฌ์Šค๋„ˆ ์ด์Šˆ)
    • ๋ทฐํ™€๋” ์ž์ฒด์˜ ํด๋ฆญ ๋ฆฌ์Šค๋„ˆ๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ์—์„œ์˜ ๋ฒ„๊ทธ ์ฒ˜๋ฆฌ
  • ์•ˆ์ •์ ์ธ ๋ฒ„์ „ ์‹œ์ž‘

v.1.0.10

  • Holding ๋œ ๋ทฐํ™€๋”๊ฐ€ ์‚ญ์ œ๋˜๊ณ  ๋‚˜์„œ ํ•ด๋‹น ๋ทฐํ™€๋”๊ฐ€ ์žฌํ™œ์šฉ๋  ๋•Œ translationX๊ฐ€ ์›๋ณต๋˜์ง€ ์•Š์•˜๋˜ ์ด์Šˆ ์ˆ˜์ •

v.1.0.9

  • HoldingBackground ์˜ ๋ฒ„ํŠผ ํด๋ฆญ์‹œ ์•„์ดํ…œ์„ ์‚ฌ๋ผ์ง€๊ฒŒ ํ•˜๋Š”์ง€์— ๋Œ€ํ•œ ์˜ต์…˜
    • setDismissBackgroundOnClickFirstItem() ์ด์šฉ
      • default value : true

v.1.0.8

  • ๋ทฐํ™€๋”์˜ background๊ฐ€ ํˆฌ๋ช…ํ•œ ๊ฒฝ์šฐ UI ๋ฒ„๊ทธ ์ˆ˜์ •(๋ทฐํ™€๋” ์นจ๋ฒ” ์ด์Šˆ)

License

Designed and developed by 2021 yeon-kyu

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.

holdableswipehandler's People

Contributors

yeon-kyu avatar

Stargazers

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

Watchers

 avatar

holdableswipehandler's Issues

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.