Skip to content

Commit 9227a1a

Browse files
committed
Update README
1 parent dd8f32c commit 9227a1a

File tree

1 file changed

+138
-10
lines changed

1 file changed

+138
-10
lines changed

README.md

Lines changed: 138 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,156 @@
11
Easy Rating Dialog
22
==
33

4-
_brief description_
4+
![Easy Rating Dialog](http://i.imgur.com/3m6WCTP.png?1)
55

6-
_summary_
6+
This lib provides a simple way to display an alert dialog for rating app.
7+
8+
Default conditions to show:
9+
10+
1. User opened the app more than 5 times
11+
2. User opened the app after 7 days of first opening.
12+
13+
- [Easy Rating Dialog](#easy-rating-dialog)
14+
- [Installation](#installation)
15+
- [Using](#using)
16+
- [Tips](#tips)
17+
- [How to contribute?](#how-to-contribute)
18+
- [License](#license)
719

820
## Installation
921

10-
how to install?
22+
* Manually
23+
24+
Create in your root project folder a folder called `libraries`.
25+
26+
Download the library folder and import it into your project and rename `library` to `EasyRatingDialog`.
27+
28+
Now, to setup with gradle, you need to do the following steps:
29+
30+
1. In `gradle.settings` add: `':libraries:EasyRatingDialog'`
31+
2. In `gradle.build` at `dependencies` add `compile project(':libraries:EasyRatingDialog')`
32+
33+
* Gradle Dependency: _**coming soon**_
1134

1235
## Using
1336

14-
how to use?
37+
The main flow usage is:
38+
39+
Create dialog in your main activity or your start activity:
40+
41+
```java
42+
public void onCreate(Bundle savedInstanceState) {
43+
super.onCreate(savedInstanceState);
44+
easyRatingDialog = new EasyRatingDialog(this);
45+
}
46+
```
47+
48+
after you need to start dialog at:
49+
50+
```java
51+
@Override
52+
protected void onStart() {
53+
super.onStart();
54+
easyRatingDialog.onStart();
55+
}
56+
```
57+
58+
this line inc. counters and initialize first app access date if necessary
59+
60+
And to show when needed just call in `onResume`:
61+
62+
```java
63+
@Override
64+
protected void onResume() {
65+
super.onResume();
66+
easyRatingDialog.showIfNeeded(this);
67+
}
68+
```
1569

1670
## Tips
1771

18-
* Condition triggers
72+
### Condition triggers
73+
74+
If you want to change the default lib behavior you can create a custom Condition Trigger:
75+
76+
```java
77+
EasyRatingDialog.ConditionTrigger conditionTrigger = new EasyRatingDialog.ConditionTrigger() {
78+
@Override
79+
public boolean shouldShow() {
80+
//Your custom condition here
81+
return false;
82+
}
83+
};
84+
85+
easyRatingDialog.setConditionTrigger(conditionTrigger);
86+
```
87+
88+
### Useful public methods
89+
90+
If you need to create for user an action rate and link it with dialog conditions, don't be afraid, just create
91+
the easy rating dialog instance and call rate now as below:
92+
93+
```java
94+
public void onCreate(Bundle savedInstanceState) {
95+
super.onCreate(savedInstanceState);
96+
easyRatingDialog = new EasyRatingDialog(this);
97+
}
98+
```
99+
100+
```java
101+
public void onClickRateNow() {
102+
super.onResume();
103+
easyRatingDialog.rateNow();
104+
}
105+
```
106+
107+
You can do it for `neverRemider()` and `remindMeLater()` actions too.
108+
109+
To check stored values just call `didNeverReminder()`, `didRate()`.
110+
111+
### Internationalization
112+
113+
Do you liked the lib but you need to change default strings in en-US, you can do it easily as section below.
114+
115+
Just override default values in your `strings.xml`:
116+
117+
```xml
118+
<resources>
119+
<string name="erd_title">Rate this app</string>
120+
<string name="erd_message">Hi, take a minute to rate this app and help support to improve more new features. ;)</string>
121+
<string name="erd_no_thanks">No, thanks.</string>
122+
<string name="erd_remind_me_later">Remind me later.</string>
123+
<string name="erd_rate_now">Rate now.</string>
124+
</resources>
125+
```
126+
127+
### Constants
128+
129+
Do you want to change hit times or days after condition? It's simple!
130+
131+
You need to override default values the lib, for that, just create in `res/values` folder, or alter, a file
132+
named `constants.xml`.
133+
134+
And override the values:
19135

20-
* Useful public methods
136+
```xml
137+
<?xml version="1.0" encoding="utf-8"?>
138+
<resources>
139+
<integer name="erd_launch_times">10</integer>
140+
<integer name="erd_max_days_after">14</integer>
141+
</resources>
142+
```
21143

22-
* Internationalization
144+
## License
23145

24-
* Constants
146+
Licensed under the Apache License, Version 2.0 (the "License");
147+
you may not use this file except in compliance with the License.
148+
You may obtain a copy of the License at
25149

26-
## How to contribute?
150+
http://www.apache.org/licenses/LICENSE-2.0
27151

28-
how?
152+
Unless required by applicable law or agreed to in writing, software
153+
distributed under the License is distributed on an "AS IS" BASIS,
154+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
155+
See the License for the specific language governing permissions and
156+
limitations under the License.

0 commit comments

Comments
 (0)