Git Product home page Git Product logo

chathurahettiarachchi / recycleclick Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 9.0 110 KB

Android recycler view not supports for onItemClickListner event. This library helps to wrap up and gain the missing recycle view item click and item long click functions. This library is a project carried by Lakitha, give a visit https://github.com/LakithaRav

License: Apache License 2.0

Java 100.00%
recycleview android android-recycler android-listview android-library android-studio onitemclicklistner-event missing-recycle recycler-item-click

recycleclick's Introduction

RecycleClick Download

Android recycler view not supports for onItemClickListner event. This library helps to wrap up and gain the missing recycle view item click and item long click functions. This library is a project carried by Lakitha, give a visit https://github.com/LakithaRav

Anyway... when talk about Android ListView and RecycleView, in old times through the development i preffer Android ListView. It already have click suport inbuilt. with the development I got to know using Android RecycleView is more efficient and memory saving.

recycleclick

This library contains mainly two functions,

  • RecycleClick - OnItemClickListener
  • RecycleClick - OnItemLongClickListener

####Let's take a look how to add this to your project

For the android project just include the following dependency inside you build.gradle's depedency list.

Gradle

repositories {
  jcenter()
}

dependencies {
    ...
    compile 'com.chootdev:recycleclick:1.0.0'
}

if you using maven use following Maven

<dependency>
  <groupId>com.chootdev</groupId>
  <artifactId>recycleclick</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

After setup installing lib to your project you just need only to call it using just few lines of code. It will return you a string with the results.

Usage

To add item click support

RecycleClick.addTo(YOUR_RECYCLEVIEW).setOnItemClickListener(new RecycleClick.OnItemClickListener() {
            @Override
            public void onItemClicked(RecyclerView recyclerView, int position, View v) {
                // YOUR CODE
            }
        });

To change item click to long click,

RecycleClick.addTo(YOUR_RECYCLEVIEW).setOnItemLongClickListener(new RecycleClick.OnItemLongClickListener() {
            @Override
            public boolean onItemLongClicked(RecyclerView recyclerView, int position, View v) {
                // YOUR CODE
                return true;
            }
        });

Both of these functions are providing all necessary information you need to get from an item selection in RecycleView.

i.e :

RecyclerView recyclerView :- current recycleView
int position :- selected positoin of populated data set
View v :- selected view

With the "View" you can manupulate any view associate with selected item.

Limitations

  • Currently min SDK is set to 16

Output Generated

ezgif com-video-to-gif

Changelog

  • 1.0.0
    • Stable the release with sample code
  • 0.1.1
    • Support for click events
  • 0.1.0
    • Initial release

Authors

Chathura Hettiarachchi, [email protected]

Lakitha Samarasinghe, [email protected]

Checkout my other contributions, https://github.com/ChathuraHettiarachchi?tab=repositories

License

Copyright 2016 Chathura Hettiarachchi

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.

recycleclick's People

Stargazers

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

Watchers

 avatar  avatar

recycleclick's Issues

Issue with maven?

Sir will you please give extra information about how to add when using maven?

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.