GithubHelp home page GithubHelp logo

stackcardrecyclerview's Introduction

StackCardRecyclerView

this is RecyclerView like S7 Recent task

View GIF


thanks for CarouselLayoutManager , I use his framework.

dependencies

Maven Central
<dependency>
  <groupId>com.ckenergy.stackcardlayoutmanager</groupId>
  <artifactId>stackcardlayoutmanager</artifactId>
  <version>1.0.1</version>
  <type>pom</type>
</dependency>
Gradle
compile 'com.ckenergy.stackcardlayoutmanager:stackcardlayoutmanager:1.0.1'
Ivy
<dependency org='com.ckenergy.stackcardlayoutmanager' name='stackcardlayoutmanager' rev='1.0.1'>
  <artifact name='stackcardlayoutmanager' ext='pom' ></artifact>
</dependency>

There have two type Vertical and Horizontal


Any Type have two stack order(in stack and out stack) and two number order(positive and negative)

Example Horizontal not circle

  • 1.in stack order, positive
  • 2.out stack order, positive

  • 3.in stack order, negative
  • 4.out stack order, negative

There also have two number count type(less and more) for Vertical and Horizontal

It will be less count when width is bigger than height in Vertical layout and height is bigger than width is Horizontal layout.

  • 1.less have 7 item
  • 2.more have 9 item

How to use?

  • new StackCardLayoutManager default is in stack and positive, you can change this order
          StackCardLayoutManager stackCardLayoutManager = new StackCardLayoutManager(StackCardLayoutManager.VERTICAL,true, new StackCardPostLayout());
        stackCardLayoutManager.setStackOrder(StackCardLayoutManager.OUT_STACK_ORDER);
        stackCardLayoutManager.setNumberOrder(StackCardLayoutManager.NEGATIVE_ORDER);  recyclerView.setLayoutManager(stackCardLayoutManager);                
  • add swip and swip listener

``` java ItemTouchHelperCallBack itemTouchHelperCallBack = new ItemTouchHelperCallBack(); itemTouchHelperCallBack.setOnSwipListener(swipListener); ItemTouchHelper itemTouchHelper = new ItemTouchHelper(itemTouchHelperCallBack); itemTouchHelper.attachToRecyclerView(recyclerView); ```
  • add scroll to position and center listener

``` java // enable center post touching on item and item click listener DefaultChildSelectionListener.initCenterItemListener(new DefaultChildSelectionListener.OnCenterItemClickListener() { @Override public void onCenterItemClicked(@NonNull final RecyclerView recyclerView, @NonNull final StackCardLayoutManager stackCardLayoutManager, @NonNull final View v) { final int position = recyclerView.getChildLayoutPosition(v); final String msg = String.format(Locale.US, "Item %1$d was clicked", position); Log.d("onCenterItemClicked", msg); Toast.makeText(BaseActivity.this, msg, Toast.LENGTH_SHORT).show(); } }, recyclerView, layoutManager); ```

Support (支持)

  • Please Public technical discussion on github is preferred.
  • 请尽量在 github 上公开讨论技术问题

TODO

  • 1.below LOLLIPOP overDraw need fix (i use view.setClipBounds(rect) but in below SDK LOLLIPOP is not work )
  • 2.need more faster (although it have fast scroll,when i scroll more faster the view aren't so fast)
  • 3.my english : )

License

Copyright 2016 ckenergy <[email protected]>
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.

stackcardrecyclerview's People

Contributors

ckenergy avatar

Watchers

James Cloos avatar  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.