Skip to content

Commit

Permalink
Merge pull request #1 from anshulagarwal06/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
anshulagarwal06 authored Apr 16, 2017
2 parents 06d4348 + ca2c15f commit 4e885b0
Show file tree
Hide file tree
Showing 109 changed files with 411 additions and 141 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/build
/captures
/.idea
/gradle

# Built application files
*.apk
Expand All @@ -24,7 +23,6 @@ bin/
gen/

# Gradle files
.gradle/
build/
/*/build/

Expand Down
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ After that you can easily include the library in your **app** `build.gradle`:

```groovy
dependencies {
compile 'com.github.anshulagarwal06:ExpandableMenu:master-SNAPSHOT'
compile 'com.github.anshulagarwal06:ExpandableMenu::v1.0'
}
```

Expand All @@ -36,14 +36,45 @@ dependencies {
Add ExpandableMenuView to your xml fule

```groovy
<android.anshul.com.expendableMenu.ExpandableMenuView
android:id="@+id/fire_view"
<me.anshulagarwal.expandablemenuoption.ExpandableMenuView
android:id="@+id/expanded_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bottom_drawable="@drawable/location_selector"
app:left_drawable="@drawable/play_selector"
app:menu_color="@color/menu_color"
app:menu_drawable="@drawable/menu_icon"
app:menu_expanded_radius="@dimen/big_radius"
app:menu_radius="@dimen/small_radius"
app:right_drawable="@drawable/phone_selector"
app:top_drawable="@drawable/camera_selector" />
```

Most of xml attributes are self explanatory.


Add menu click callback in java -

```groovy
mExpandableMenuView.setOnMenuListener(new ExpandableMenuView.MenuListener() {
@Override
public void rightPressed() {
}
@Override
public void leftPressed() {
}
@Override
public void topPressed() {
}
@Override
public void bottomPressed() {
}
});
```

--

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/menu/menu_main.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/values/strings.xml

This file was deleted.

1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
File renamed without changes.
6 changes: 4 additions & 2 deletions app/build.gradle → demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.0'
compile project(':library')

}
39 changes: 22 additions & 17 deletions app/app.iml → demo/demo.iml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="ExpendableMenu" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":demo" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="ExpendableMenu" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
<option name="GRADLE_PROJECT_PATH" value=":demo" />
</configuration>
</facet>
<facet type="android" name="Android">
Expand Down Expand Up @@ -62,45 +62,50 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.anshulagarwal06/ExpandableMenu/refactor-SNAPSHOT/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
<excludeFolder url="jar://$MODULE_DIR$/build/intermediates/mockable-android-25.jar!/" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="support-compat-25.3.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-25.3.0" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-25.3.0" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-25.3.0" level="project" />
<orderEntry type="library" exported="" name="ExpandableMenu-refactor-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-25.3.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-25.3.0" level="project" />
<orderEntry type="library" exported="" name="support-fragment-25.3.0" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-25.3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-25.3.0" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-25.3.0" level="project" />
</component>
</module>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.anshul.com.fireview" >
package="android.anshul.com.fireview">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">
<activity
android:name="android.anshul.com.expendableMenu.MainActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package android.anshul.com.expendableMenu;

import android.anshul.com.fireview.R;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
import me.anshulagarwal.expandablemenuoption.ExpandableMenuView;


public class MainActivity extends AppCompatActivity {

private ExpandableMenuView mExpandableMenuView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mExpandableMenuView = (ExpandableMenuView) findViewById(R.id.expanded_menu);

mExpandableMenuView.setOnMenuListener(new ExpandableMenuView.MenuListener() {

@Override
public void rightPressed() {
Toast.makeText(MainActivity.this, "Right Pressed", Toast.LENGTH_SHORT).show();
}

@Override
public void leftPressed() {
Toast.makeText(MainActivity.this, "Left Pressed", Toast.LENGTH_SHORT).show();
}

@Override
public void topPressed() {
Toast.makeText(MainActivity.this, "Top Pressed", Toast.LENGTH_SHORT).show();
}

@Override
public void bottomPressed() {
Toast.makeText(MainActivity.this, "Bottom Pressed", Toast.LENGTH_SHORT).show();
}
});
}

}
File renamed without changes
File renamed without changes
Binary file added demo/src/main/res/drawable-hdpi/menu_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added demo/src/main/res/drawable-mdpi/menu_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added demo/src/main/res/drawable-xhdpi/menu_icon.png
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added demo/src/main/res/drawable-xxhdpi/menu_icon.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
tools:context="android.anshul.com.expendableMenu.MainActivity">

<android.anshul.com.expendableMenu.ExpandableMenuView
android:id="@+id/fire_view"
<me.anshulagarwal.expandablemenuoption.ExpandableMenuView
android:id="@+id/expanded_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bottom_drawable="@drawable/location_selector"
app:left_drawable="@drawable/play_selector"
app:menu_color="@color/menu_color"
app:menu_drawable="@drawable/menu_icon"
app:menu_expanded_radius="@dimen/big_radius"
app:menu_radius="@dimen/small_radius"
app:right_drawable="@drawable/phone_selector"
app:top_drawable="@drawable/camera_selector" />

</RelativeLayout>
File renamed without changes.
5 changes: 5 additions & 0 deletions demo/src/main/res/values/color.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="menu_color">#ffca28</color>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<dimen name="activity_vertical_margin">16dp</dimen>

<dimen name="min_size">100dp</dimen>
<dimen name="small_radius">40dp</dimen>
<dimen name="big_radius">100dp</dimen>
<dimen name="small_radius">60dp</dimen>
<dimen name="big_radius">120dp</dimen>
</resources>
4 changes: 4 additions & 0 deletions demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">Expandable MenuView Demo</string>
<string name="action_settings">Settings</string>
</resources>
File renamed without changes.
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Apr 12 14:58:49 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
1 change: 1 addition & 0 deletions library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Loading

0 comments on commit 4e885b0

Please sign in to comment.