-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from saurabharora90/develop
Develop
- Loading branch information
Showing
12 changed files
with
253 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
library/src/main/java/com/sa90/materialarcmenu/StateChangeListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.sa90.materialarcmenu; | ||
|
||
/** | ||
* Created by Saurabh on 25/12/15. | ||
*/ | ||
public interface StateChangeListener { | ||
void onMenuOpened(); | ||
void onMenuClosed(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
samples/src/main/java/com/sa90/arcdemo/AnimationTimeActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.sa90.arcdemo; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.Toast; | ||
|
||
import com.sa90.materialarcmenu.ArcMenu; | ||
|
||
public class AnimationTimeActivity extends AppCompatActivity { | ||
|
||
ArcMenu arcMenu; | ||
Button btnSet; | ||
EditText etAnimationTime; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_animation_time); | ||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
|
||
arcMenu = (ArcMenu) findViewById(R.id.arcMenu); | ||
btnSet = (Button) findViewById(R.id.btnSet); | ||
etAnimationTime = (EditText) findViewById(R.id.etAnimationTime); | ||
|
||
btnSet.setOnClickListener(mSetClickListener); | ||
} | ||
|
||
private View.OnClickListener mSetClickListener = new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
String time = etAnimationTime.getText().toString(); | ||
if(time.isEmpty() || time.length() == 0) | ||
return; | ||
try { | ||
arcMenu.setAnimationTime(Long.parseLong(time)); | ||
} | ||
catch (NumberFormatException e) { | ||
Toast.makeText(AnimationTimeActivity.this, "Keyed in value is not a number", Toast.LENGTH_SHORT).show(); | ||
} | ||
} | ||
}; | ||
|
||
@Override | ||
public void onBackPressed() { | ||
if(arcMenu.isMenuOpened()) | ||
arcMenu.toggleMenu(); | ||
else | ||
super.onBackPressed(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fitsSystemWindows="true" | ||
tools:context=".AnimationTimeActivity"> | ||
|
||
<android.support.design.widget.AppBarLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:theme="@style/AppTheme.AppBarOverlay"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:background="?attr/colorPrimary" | ||
app:popupTheme="@style/AppTheme.PopupOverlay" /> | ||
|
||
</android.support.design.widget.AppBarLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="?android:attr/actionBarSize" | ||
android:padding="10dp" | ||
android:orientation="vertical"> | ||
|
||
<android.support.design.widget.TextInputLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<EditText | ||
android:id="@+id/etAnimationTime" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:inputType="number" | ||
android:hint="Enter Animation Time"/> | ||
|
||
</android.support.design.widget.TextInputLayout> | ||
|
||
<Button | ||
android:id="@+id/btnSet" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="10dp" | ||
android:text="Set Animation Time"/> | ||
|
||
</LinearLayout> | ||
|
||
<com.sa90.materialarcmenu.ArcMenu | ||
android:id="@+id/arcMenu" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom|end" | ||
android:layout_margin="@dimen/fab_margin" | ||
app:menu_scr="@android:drawable/ic_dialog_dialer" | ||
app:menu_open="arc_left"> | ||
|
||
<android.support.design.widget.FloatingActionButton | ||
android:id="@+id/fab1" | ||
android:layout_width="wrap_content" | ||
android:src="@android:drawable/ic_dialog_email" | ||
android:layout_height="wrap_content" /> | ||
|
||
<android.support.design.widget.FloatingActionButton | ||
android:layout_width="wrap_content" | ||
android:src="@android:drawable/ic_dialog_alert" | ||
android:layout_height="wrap_content" /> | ||
|
||
<android.support.design.widget.FloatingActionButton | ||
android:layout_width="wrap_content" | ||
android:src="@android:drawable/ic_dialog_info" | ||
android:layout_height="wrap_content" /> | ||
|
||
<android.support.design.widget.FloatingActionButton | ||
android:layout_width="wrap_content" | ||
android:src="@android:drawable/ic_dialog_map" | ||
android:layout_height="wrap_content" /> | ||
|
||
</com.sa90.materialarcmenu.ArcMenu> | ||
|
||
</android.support.design.widget.CoordinatorLayout> |
Oops, something went wrong.