-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing InfoDialog and PromptDialog for inheritance, assing BounceP…
…romptDialog example and fixing some bugs
- Loading branch information
1 parent
2334453
commit e9172b5
Showing
8 changed files
with
137 additions
and
60 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
2 changes: 1 addition & 1 deletion
2
sample/src/main/java/com/techyourchance/dialoghelpersample/DialogEnterAnimation.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.techyourchance.dialoghelpersample; | ||
|
||
public enum DialogEnterAnimation { | ||
SLIDE_IN_FROM_RIGHT | ||
SLIDE_IN_FROM_RIGHT, SLIDE_IN_AND_BOUNCE_FROM_TOP | ||
} |
2 changes: 1 addition & 1 deletion
2
sample/src/main/java/com/techyourchance/dialoghelpersample/DialogExitAnimation.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.techyourchance.dialoghelpersample; | ||
|
||
public enum DialogExitAnimation { | ||
SLIDE_OUT_FROM_LEFT | ||
SLIDE_OUT_FROM_LEFT, SLIDE_OUT_FROM_BOTTOM | ||
} |
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
53 changes: 53 additions & 0 deletions
53
.../src/main/java/com/techyourchance/dialoghelpersample/bouncedialog/BouncePromptDialog.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,53 @@ | ||
package com.techyourchance.dialoghelpersample.bouncedialog; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.view.View; | ||
|
||
import com.techyourchance.dialoghelpersample.DialogEnterAnimation; | ||
import com.techyourchance.dialoghelpersample.DialogExitAnimation; | ||
import com.techyourchance.dialoghelpersample.promptdialog.PromptDialog; | ||
import com.techyourchance.dialoghelpersample.promptdialog.PromptDialogDismissedEvent; | ||
|
||
public class BouncePromptDialog extends PromptDialog { | ||
|
||
public static BouncePromptDialog newBouncePromptDialog() { | ||
BouncePromptDialog bouncePromptDialog = new BouncePromptDialog(); | ||
Bundle args = new Bundle(4); | ||
args.putString(ARG_TITLE, "Bounce dialog"); | ||
args.putString(ARG_MESSAGE, "Which direction would you like the dialog to exit?"); | ||
args.putString(ARG_POSITIVE_BUTTON_CAPTION, "Left"); | ||
args.putString(ARG_NEGATIVE_BUTTON_CAPTION, "Bottom"); | ||
bouncePromptDialog.setArguments(args); | ||
bouncePromptDialog.setEnterAnimation(DialogEnterAnimation.SLIDE_IN_AND_BOUNCE_FROM_TOP); | ||
return bouncePromptDialog; | ||
} | ||
|
||
|
||
|
||
@Override | ||
protected void onPositiveButtonClicked() { | ||
setExitAnimation(DialogExitAnimation.SLIDE_OUT_FROM_LEFT); | ||
dismiss(); | ||
mEventBus.post( | ||
new PromptDialogDismissedEvent( | ||
mDialogHelper.getDialogId(this), | ||
PromptDialogDismissedEvent.ClickedButton.POSITIVE | ||
) | ||
); | ||
} | ||
|
||
@Override | ||
protected void onNegativeButtonClicked() { | ||
setExitAnimation(DialogExitAnimation.SLIDE_OUT_FROM_BOTTOM); | ||
dismiss(); | ||
mEventBus.post( | ||
new PromptDialogDismissedEvent( | ||
mDialogHelper.getDialogId(this), | ||
PromptDialogDismissedEvent.ClickedButton.NEGATIVE | ||
) | ||
); | ||
} | ||
|
||
} |
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
Oops, something went wrong.