Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'

Expand Down
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 @@
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
16 changes: 16 additions & 0 deletions library/src/main/java/com/baoyz/actionsheet/ActionSheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class ActionSheet extends Fragment implements View.OnClickListener {

private boolean mDismissed = true;
private ActionSheetListener mListener;
private Bundle mExtras;
private View mView;
private LinearLayout mPanel;
private ViewGroup mGroup;
Expand Down Expand Up @@ -388,6 +389,14 @@ public void setActionSheetListener(ActionSheetListener listener) {
mListener = listener;
}

public void setExtras(Bundle extras) {
mExtras = extras;
}

public Bundle getExtras() {
return mExtras;
}

@Override
public void onClick(View v) {
if (v.getId() == ActionSheet.BG_VIEW_ID && !getCancelableOnTouchOutside()) {
Expand Down Expand Up @@ -467,6 +476,7 @@ public static class Builder {
private String mTag = "actionSheet";
private boolean mCancelableOnTouchOutside;
private ActionSheetListener mListener;
private Bundle mExtras;

public Builder(Context context, FragmentManager fragmentManager) {
mContext = context;
Expand Down Expand Up @@ -497,6 +507,11 @@ public Builder setListener(ActionSheetListener listener) {
return this;
}

public Builder setExtras(Bundle extras) {
this.mExtras = extras;
return this;
}

public Builder setCancelableOnTouchOutside(boolean cancelable) {
mCancelableOnTouchOutside = cancelable;
return this;
Expand All @@ -515,6 +530,7 @@ public ActionSheet show() {
ActionSheet actionSheet = (ActionSheet) Fragment.instantiate(
mContext, ActionSheet.class.getName(), prepareArguments());
actionSheet.setActionSheetListener(mListener);
actionSheet.setExtras(mExtras);
actionSheet.show(mFragmentManager, mTag);
return actionSheet;
}
Expand Down