Skip to content

Commit 66b13a2

Browse files
Merge pull request #8 from Cleveroad/develop
fix issue #4
2 parents e2170e1 + bf94fdb commit 66b13a2

File tree

26 files changed

+271
-240
lines changed

26 files changed

+271
-240
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CycleMenu [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) <img src="https://www.cleveroad.com/public/comercial/label-android.svg" height="20"> <a href="https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts"><img src="https://www.cleveroad.com/public/comercial/label-cleveroad.svg" height="20"></a>
2+
![Header image](/images/header.jpg)
3+
4+
## Meet CycleMenu for Android by Cleveroad
5+
6+
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!
7+
8+
![Demo image](/images/demo.gif)
9+
10+
11+
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.
12+
13+
In case you are in need of beautiful and functional app menu, you are welcome to use CycleMenu. Make your scroll last forever!
14+
15+
[![Awesome](/images/logo-footer.png)](https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts)
16+
17+
## Changelog
18+
19+
Version | Changes
20+
--- | ---
21+
v.1.0.2 | <ul><li>Updated version of the support libraries</li><li>Updated version of the build tools</li><li>Fix issue #4 https://github.com/Cleveroad/CycleMenu/issues/4</li><li>Implemented issue #5 https://github.com/Cleveroad/CycleMenu/issues/5</li></ul>

LICENSE

-21
This file was deleted.

README.MD

+24-17
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ What can be better than an eye-catching design in couple with reasonable feature
88
![Demo image](/images/demo.gif)
99

1010

11-
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.
11+
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.
1212

1313
In case you are in need of beautiful and functional app menu, you are welcome to use CycleMenu. Make your scroll last forever!
14-
14+
1515
[![Awesome](/images/logo-footer.png)](https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts)
1616

1717
## Setup and usage
1818
To include this library to your project add dependency in **build.gradle** file:
1919
```groovy
2020
dependencies {
21-
compile 'com.cleveroad:cycle-menu:1.0.1'
21+
implementation 'com.cleveroad:cycle-menu:1.0.2'
2222
}
2323
```
2424

@@ -28,7 +28,7 @@ Use the CycleMenu in layout file
2828
android:id="@+id/itemCycleMenuWidget"
2929
android:layout_width="match_parent"
3030
android:layout_height="match_parent"
31-
31+
3232
app:cm_autoMaxRadius="220dp"
3333
app:cm_autoMinRadius="10dp"
3434
app:cm_corner="right_top"
@@ -44,7 +44,7 @@ Use the CycleMenu in layout file
4444
or programmatically
4545
```JAVA
4646
CycleMenuWidget cycleMenuWidget = new CycleMenuWidget(mContext);
47-
cycleMenuWidget.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
47+
cycleMenuWidget.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
4848
container.addView(cycleMenuWidget);
4949
```
5050
To set menu resources from xml resource or Collection use:
@@ -62,12 +62,12 @@ void setAutoMaxRadius(int autoMaxRadius)
6262
void setFixedRadius(int fixedRadius)
6363

6464
```
65-
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.
66-
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.
65+
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.
66+
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.
6767
if you setup autoMaxRadius bigger then available space for the menu - radius will be reduced.
6868
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.
69-
70-
To setup scroll type. The scroll type can be `ENDLESS` (infinite scrolling) ans `BASIC` (general scrolling).
69+
70+
To setup scroll type. The scroll type can be `ENDLESS` (infinite scrolling) ans `BASIC` (general scrolling).
7171
```JAVA
7272
void setScrollType(SCROLL scrollType)
7373
```
@@ -83,33 +83,38 @@ void setRippleColor(int rippleColor)
8383
void setCornerImageDrawable(Drawable cornerImageDrawable)
8484
void setCornerImageResource(@DrawableRes int drawableRes)
8585
void setCornerImageBitmap(Bitmap bitmap)
86+
void setCollapsedRadius(int collapsedRadius)
87+
void setBackground(int backgroundColor)
8688
```
8789

8890
For listening changing menu state use
8991
```JAVA
90-
setStateChangeListener(
91-
new OnStateChangedListener() {
92-
void onStateChanged(CycleMenuWidget.STATE state){};
93-
void onOpen(){};
94-
void onClose(){};
92+
setStateChangeListener(
93+
new OnStateChangedListener() {
94+
void onStateChanged(CycleMenuWidget.STATE state){};
95+
void onOpen(){};
96+
void onClose(){};
9597
})
9698
```
9799
For listening menu items clicks use
98100
```JAVA
99-
setOnMenuItemClickListener(
101+
setOnMenuItemClickListener(
100102
new OnMenuItemClickListener() {
101103
void onMenuItemClick(View view, int itemPosition) {}
102-
})
104+
})
103105
```
104106

105107
For providing saving state listener use
106108
```JAVA
107-
setStateSaveListener(
109+
setStateSaveListener(
108110
new StateSaveListener() {
109111
void saveState(int itemPosition, double lastItemAngleShift){}
110112
});
111113
```
112114

115+
## Changelog
116+
See [changelog history].
117+
113118
## Support
114119

115120
If you have any questions, issues or propositions, please create a <a href="../../issues/new">new issue</a> in this repository.
@@ -145,3 +150,5 @@ Follow us:
145150
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
146151
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
147152
SOFTWARE.
153+
154+
[changelog history]: /CHANGELOG.md

build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
google()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.2'
9+
classpath 'com.android.tools.build:gradle:3.2.1'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
@@ -19,6 +20,7 @@ allprojects {
1920
maven {
2021
url "https://oss.sonatype.org/content/repositories/snapshots"
2122
}
23+
google()
2224
}
2325
}
2426

cycle_menu/.gitignore

-93
Original file line numberDiff line numberDiff line change
@@ -1,94 +1 @@
1-
*.iml
2-
.gradle
3-
/local.properties
4-
/.idea/workspace.xml
5-
/.idea/libraries
6-
.DS_Store
71
/build
8-
/captures
9-
/.idea
10-
*.apk
11-
gradle.properties
12-
### Android template
13-
# Built application files
14-
*.ap_
15-
16-
# Files for the ART/Dalvik VM
17-
*.dex
18-
19-
# Java class files
20-
*.class
21-
22-
# Generated files
23-
bin/
24-
gen/
25-
out/
26-
27-
# Gradle files
28-
.gradle/
29-
build/
30-
31-
# Local configuration file (sdk path, etc)
32-
local.properties
33-
34-
# Proguard folder generated by Eclipse
35-
proguard/
36-
37-
# Log Files
38-
*.log
39-
40-
# Android Studio Navigation editor temp files
41-
.navigation/
42-
43-
# Android Studio captures folder
44-
captures/
45-
46-
# Intellij
47-
.idea/workspace.xml
48-
49-
# Keystore files
50-
*.jks
51-
### JetBrains template
52-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
53-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
54-
55-
# User-specific stuff:
56-
.idea/tasks.xml
57-
.idea/dictionaries
58-
.idea/vcs.xml
59-
.idea/jsLibraryMappings.xml
60-
61-
# Sensitive or high-churn files:
62-
.idea/dataSources.ids
63-
.idea/dataSources.xml
64-
.idea/dataSources.local.xml
65-
.idea/sqlDataSources.xml
66-
.idea/dynamic.xml
67-
.idea/uiDesigner.xml
68-
69-
# Gradle:
70-
.idea/gradle.xml
71-
.idea/libraries
72-
73-
# Mongo Explorer plugin:
74-
.idea/mongoSettings.xml
75-
76-
## File-based project format:
77-
*.iws
78-
79-
## Plugin-specific files:
80-
81-
# IntelliJ
82-
/out/
83-
84-
# mpeltonen/sbt-idea plugin
85-
.idea_modules/
86-
87-
# JIRA plugin
88-
atlassian-ide-plugin.xml
89-
90-
# Crashlytics plugin (for Android Studio and IntelliJ)
91-
com_crashlytics_export_strings.xml
92-
crashlytics.properties
93-
crashlytics-build.properties
94-
fabric.properties

cycle_menu/build.gradle

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
4+
compileSdkVersion 28
5+
buildToolsVersion "28.0.3"
66

77
defaultConfig {
88
minSdkVersion 15
9-
targetSdkVersion 25
10-
versionCode 1
11-
versionName "1.0"
12-
13-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
9+
targetSdkVersion 28
10+
versionCode 5
11+
versionName "1.0.2"
1412

1513
}
1614
buildTypes {
@@ -24,14 +22,15 @@ android {
2422
}
2523

2624
dependencies {
27-
compile fileTree(dir: 'libs', include: ['*.jar'])
28-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
29-
exclude group: 'com.android.support', module: 'support-annotations'
30-
})
31-
testCompile 'junit:junit:4.12'
32-
compile 'com.android.support:appcompat-v7:25.1.0'
33-
compile 'com.android.support:recyclerview-v7:25.1.0'
34-
compile 'com.android.support:design:25.1.0'
35-
36-
apply from: './gradle-mvn-push.gradle'
25+
implementation fileTree(dir: 'libs', include: ['*.jar'])
26+
27+
//versions
28+
final SUPPORT_LIB_VERSION = '28.0.0'
29+
30+
testImplementation 'junit:junit:4.12'
31+
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
32+
implementation "com.android.support:recyclerview-v7:$SUPPORT_LIB_VERSION"
33+
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
3734
}
35+
36+
//apply from: './gradle-mvn-push.gradle'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.cleveroad.sy.cyclemenuwidget;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.cleveroad.sy.cyclelayoutmanager.test", appContext.getPackageName());
25+
}
26+
}

cycle_menu/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.cleveroad.cyclemenuwidget">
2+
package="com.cleveroad.sy.cyclemenuwidget">
33

44
<application android:allowBackup="true"
55
android:label="@string/app_name"
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
package com.cleveroad.cyclemenuwidget;
1+
package com.cleveroad.sy.cyclemenuwidget;
22

33
import android.view.animation.Animation;
44

55
class AnimationListenerAdapter implements Animation.AnimationListener {
66
@Override
77
public void onAnimationStart(Animation animation) {
8-
8+
// do nothing
99
}
1010

1111
@Override
1212
public void onAnimationEnd(Animation animation) {
13-
13+
// do nothing
1414
}
1515

1616
@Override
1717
public void onAnimationRepeat(Animation animation) {
18-
18+
// do nothing
1919
}
2020
}

0 commit comments

Comments
 (0)