GithubHelp home page GithubHelp logo

hexagon-recyclerview's Introduction

Hexagon-Recyclerview

This is a recyclerview where items are interpolated in a way that looks like a honeycomb. It can be customized to be vertically or horizontally scrollable.

Vertical Horizontal

Download

Download via Gradle:

  • Add the following to the project's build.gralde
allprojects {
    repositories {
       jcenter()
    }
}
  • Add this to your dependencies
compile 'com.mindvalley.android:hexagonrecyclerview:1.0.1'

Usage

The Hexagon-Recyclerview is a child of the default Recyclerview, which makes using the Hexagon-Recyclerview exactly similar to using the default recyclerview.

  • Add the Hexagon-Recyclerview to the xml layout file
<com.abed.hexagonrecyclerview.view.HexagonRecyclerView xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/rvItems"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        app:items_count_in_row="3"
        app:items_horizontal_spacing="20dp"
        app:items_vertical_spacing="20dp"
        app:orientation="horizontal" />
  • The Hexagon-Recyclerview has 4 paramters to specify:
    • items_count_in_row: a number that is more than 2. It specifies the number of the items in the big row of the Hexagon-Recyclerview
    • items_horizontal_spacing: (optional. Default 0dp) It specifies the dimension of the horizontal spacing between the items.
    • items_vertical_spacing: (optional. Default 0dp) It specifies the dimension of the vertical spacing between the items.
    • orientation: has two values horizontal/vertical. If not specified then the default value is horizontal.
The recyclerview item:

The layout of the item inside the Hexagon-Recyclerview (Which will be used inside the adapter) can be anything.

In case you want to show hexagon imagewviews then you write the following in the xml layout file of the item:

  • For horizontal Recyclerview:
<com.abed.hexagonrecyclerview.view.HorizontallyAdaptableHexagonImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/img_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     />
  • For vertical Recyclerview:
<com.abed.hexagonrecyclerview.view.VerticallyAdaptableHexagonImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/img_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     />

Example:

Vertical Horizontal
alt tag

My Contact:

If you have any comment or question don't hesitate to contact me.

my email: [email protected]

Thank you.

License

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.

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.