Skip to content

Commit

Permalink
added option to set Don't show again checked by default. resolved issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yarolegovich committed Mar 12, 2017
1 parent 481ef3a commit 876346a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This library is a set of simple wrapper classes that are aimed to help you easil
## Gradle
Add this into your dependencies block.
```
compile 'com.yarolegovich:lovely-dialog:1.0.5'
compile 'com.yarolegovich:lovely-dialog:1.0.7'
```

## Wiki
Expand Down Expand Up @@ -56,6 +56,7 @@ new LovelyInfoDialog(this)
.setIcon(R.drawable.ic_info_outline_white_36dp)
//This will add Don't show again checkbox to the dialog. You can pass any ID as argument
.setNotShowAgainOptionEnabled(0)
.setNotShowAgainOptionChecked(true)
.setTitle(R.string.info_title)
.setMessage(R.string.info_message)
.show();
Expand Down Expand Up @@ -159,15 +160,15 @@ and pass it as a second argument to dialog's constructor
new LovelyTextInputDialog(this, R.style.TintTheme)
```
###Standard dialogs compatibility
If you don't want to rewrite your
If you don't want to rewrite your
```java
Dialog.OnClickListener
```
implementations, you can simply use
Dialog.OnClickListener
```
implementations, you can simply use
```java
LovalyDialogCompat.wrap(yourImplementation)
```
to pass it to one of the
to pass it to one of the
```java
.setPositiveButton(...)
.setNegativeButton(...)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ ext {
groupId = 'com.yarolegovich'
uploadName = 'LovelyDialog'
description = 'This library is a set of simple wrapper classes that are aimed to help you easily create fancy dialogs.'
publishVersion = '1.0.5'
publishVersion = '1.0.7'
licences = ['Apache-2.0']
}
3 changes: 1 addition & 2 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yarolegovich.lovelydialog"/>
<manifest package="com.yarolegovich.lovelydialog" />
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public void onClick(View v) {
return this;
}

public LovelyInfoDialog setNotShowAgainOptionChecked(boolean defaultChecked) {
cbDontShowAgain.setChecked(defaultChecked);
return this;
}

public LovelyInfoDialog setConfirmButtonText(@StringRes int text) {
return setConfirmButtonText(string(text));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private void showInfoDialog(Bundle savedInstanceState) {
.setIcon(R.drawable.ic_info_outline_white_36dp)
.setInstanceStateHandler(ID_INFO_DIALOG, saveStateHandler)
.setNotShowAgainOptionEnabled(0)
.setNotShowAgainOptionChecked(true)
.setSavedInstanceState(savedInstanceState)
.setTitle(R.string.info_title)
.setMessage(R.string.info_message)
Expand Down

0 comments on commit 876346a

Please sign in to comment.