• Stars
    star
    575
  • Rank 76,917 (Top 2 %)
  • Language
    Java
  • Created over 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Custom LayoutManager for the inner RecyclerView

CycleMenu Awesome

Header image

Meet CycleMenu for Android by Cleveroad

What can be better than an eye-catching design in couple with reasonable features? While using this menu you do not need to worry about the lack of space for some useful features since the scroll type can be endless as well as basic. Choose an appropriate corner, customize your icons and here you go!

Demo image

During its development, we have created a custom LayoutManager for the inner RecyclerView in order to display the elements in a circle with the possibility to scroll them.

In case you are in need of beautiful and functional app menu, you are welcome to use CycleMenu. Make your scroll last forever!

Awesome

Setup and usage

To include this library to your project add dependency in build.gradle file:

    dependencies {
        implementation 'com.cleveroad:cycle-menu:1.0.2'
    }

Use the CycleMenu in layout file

<com.cleveroad.sy.cyclemenuwidget.CycleMenuWidget
        android:id="@+id/itemCycleMenuWidget"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        app:cm_autoMaxRadius="220dp"
        app:cm_autoMinRadius="10dp"
        app:cm_corner="right_top"
        app:cm_fixedRadius="200dp"
        app:cm_radius_scale_type="auto"
        app:cm_scroll_type="endless"
        app:cm_item_background_tint="#449955"
        app:cm_corner_image_src="@drawable/ic_corner_image"
        app:cm_ripple_color="#009933"
        />
/>

or programmatically

CycleMenuWidget cycleMenuWidget = new CycleMenuWidget(mContext);
cycleMenuWidget.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
container.addView(cycleMenuWidget);

To set menu resources from xml resource or Collection use:

cycleMenuWidget.setMenuRes(R.menu.menu_items);
cycleMenuWidget.setMenuItems(Collection<CycleMenuItem> items);

You can setup any attribute from xml via method. Methods for setting radius scaling type:

void setScalingType(RADIUS_SCALING_TYPE scalingType)
void setAutoMinRadius(int autoMinRadius)
void setAutoMaxRadius(int autoMaxRadius)
void setFixedRadius(int fixedRadius)

If you choose to use RADIUS_SCALING_TYPE.AUTO then you need to setup autoMinRadius and autoMaxRadius. This values will be use to calculate radius of menu. If menu has small amount of items - the radius will be calculated to fit all items but not less then autoMinRadius. If there is a lot of items in the menu then radius will be equal autoMaxRadius. if you setup autoMaxRadius bigger then available space for the menu - radius will be reduced. If you choose to use RADIUS_SCALING_TYPE.FIXED the the menu radius will be equal to fixedRadius. But not bigger then available space for the menu.

To setup scroll type. The scroll type can be ENDLESS (infinite scrolling) ans BASIC (general scrolling).

void setScrollType(SCROLL scrollType)

To setup corner in which will be placed menu use:

void setCorner(CORNER corner)

And methods to setup UI:

void setItemsBackgroundTint(ColorStateList itemsBackgroundTint)
void setRippleColor(int rippleColor)
void setCornerImageDrawable(Drawable cornerImageDrawable)
void setCornerImageResource(@DrawableRes int drawableRes)
void setCornerImageBitmap(Bitmap bitmap)
void setCollapsedRadius(int collapsedRadius)
void setBackground(int backgroundColor)

For listening changing menu state use

setStateChangeListener(
    new OnStateChangedListener() {
        void onStateChanged(CycleMenuWidget.STATE state){};
        void onOpen(){};
        void onClose(){};
})

For listening menu items clicks use

setOnMenuItemClickListener(
    new OnMenuItemClickListener() {
        void onMenuItemClick(View view, int itemPosition) {}
})

For providing saving state listener use

setStateSaveListener(
    new StateSaveListener() {
        void saveState(int itemPosition, double lastItemAngleShift){}
});

Changelog

See changelog history.

Support

If you have any questions, issues or propositions, please create a new issue in this repository.

If you want to hire us, send an email to [email protected] or fill the form on contact page

Follow us:

Awesome Awesome Awesome Awesome Awesome

License


The MIT License (MIT)

Copyright (c) 2016 Cleveroad Inc.

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.

More Repositories

1

SlidingTutorial-Android

Android Library for making animated tutorials inside your app
Java
2,486
star
2

FanLayoutManager

Using Fan Layout Manager you can implement the horizontal list, the items of which move like fan blades
Java
2,056
star
3

AdaptiveTableLayout

Library that makes it possible to read, edit and write CSV files
Java
1,902
star
4

WaveInApp

Live Audio Equalizer with wave effect
Java
1,785
star
5

MusicBobber

Awesome Audio Widget for any Android Music App
Java
881
star
6

LoopBar

Tap Bar with infinite scrolling. Make the navigation menu right at fingerprints, in a tab bar.
Java
741
star
7

CRNetworkButton

Send Button for iOS
Swift
654
star
8

FireworkyPullToRefresh

Let's try to refresh your data with our library!
Java
641
star
9

BubbleAnimationLayout

You donโ€™t want your apps look and feel boring, do you? Add some bubbles!
Java
577
star
10

CRPageViewController

While a standard page view allows you to navigate between pages by using simple gestures, our component goes further
Objective-C
394
star
11

PlayWidget

Break the monotony and make your music player unique!
Java
366
star
12

Bitutorial

Crumbling tutorial for Android Apps
Java
357
star
13

CRParticleEffect

A CocoaPod that simplifies creation of the particle effects.
Objective-C
348
star
14

Android-Marshmallow-Boot-Animation

Java
244
star
15

DroidArt

Android library that allows perform manipulations with text and easily combine it with images.
Kotlin
209
star
16

BlurTutorial

Library for creating blur effects under Android UI elements
Kotlin
155
star
17

flutter_sliding_tutorial

User onboarding library with smooth animation of objects and background colors
Dart
127
star
18

CRRulerControl

Customizable component, created by Cleveroad iOS developers, is aimed at turning a simple ruler into a handy and smart instrument
Objective-C
112
star
19

ARFaceDetection

AR-based library for Android which is capable of detecting faces and overlaying images above the userโ€™s head
Kotlin
52
star
20

slidingtutorial-ios

iOS Library for making animated tutorials inside your app
Objective-C
49
star
21

Bootstrap

This set of libraries is designed to help developers accomplish various tasks easier and faster
Kotlin
40
star
22

cr_calendar

Highly customizable, feature-packed calendar widget for Flutter.
Dart
31
star
23

CRRollingLabel

Objective-C
30
star
24

CRCellCollectionView

With this component, pictures in your apps collection view will look like honeycomb instead of the boring standard variant
Objective-C
28
star
25

ColorDetection

ColorDetection is an app built with OpenCV and using computer vision at its core. Itโ€™s able to detect and change colors of objects using a camera of iOS devices.
Objective-C++
22
star
26

cr_logger

Dart
15
star
27

cr_file_saver

Kotlin
3
star
28

CRRefreshControl

2
star
29

cr_json_widget

Dart
2
star
30

CRPlotView

1
star
31

CRPinCodeControl

1
star
32

cr_mentions

Dart
1
star