Skip to content

Commit

Permalink
Rating library
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijith0505 committed Aug 15, 2016
1 parent 9796c32 commit d9b4eb1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
18 changes: 10 additions & 8 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
Expand All @@ -80,6 +72,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
Expand All @@ -92,6 +92,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/24.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.hotchemi/android-rate/1.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads-lite/9.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/9.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.0/jars" />
Expand Down Expand Up @@ -126,6 +127,7 @@
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="recyclerview-v7-24.0.0" level="project" />
<orderEntry type="library" exported="" name="android-rate-1.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.0" level="project" />
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dependencies {
compile 'com.android.support:design:24.0.0'
compile 'com.google.firebase:firebase-ads:9.2.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.github.hotchemi:android-rate:1.0.1'
}
27 changes: 26 additions & 1 deletion app/src/main/java/abhijith/carboncontacts/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
import java.util.ArrayList;
import java.util.Collections;

import hotchemi.android.rate.AppRate;
import hotchemi.android.rate.OnClickButtonListener;


public class MainActivity extends AppCompatActivity {

Expand Down Expand Up @@ -93,6 +96,7 @@ protected void onCreate(Bundle savedInstanceState) {
Load loading = new Load();
loading.execute();


mySwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

@Override
Expand Down Expand Up @@ -141,6 +145,27 @@ public void onClick(View v) {
});
}

void AppRating(){
AppRate.with(this)
.setInstallDays(0) // default 10, 0 means install day.
.setLaunchTimes(1) // default 10
.setRemindInterval(1) // default 1
.setShowLaterButton(true) // default true
.setDebug(false) // default false
.setOnClickButtonListener(new OnClickButtonListener() { // callback listener.
@Override
public void onClickButton(int which) {
Log.d(MainActivity.class.getName(), Integer.toString(which));
}
})
.monitor();

// Show a dialog if meets conditions
AppRate.showRateDialogIfMeetsConditions(this);

AppRate.with(this).clearAgreeShowDialog();
}

private void getWhatsAppContactIDs() {
ContentResolver cr = MainActivity.this.getContentResolver();

Expand Down Expand Up @@ -487,7 +512,7 @@ protected void onPostExecute(String unused) {
super.onPostExecute(unused);
progDailog.dismiss();


AppRating();


if(contactDuplicates.size() == 0){
Expand Down

0 comments on commit d9b4eb1

Please sign in to comment.