Two Stage Rate


Source link: https://github.com/shaileshmamgain5/TwoStageRate

TwoStageRate

TwoStageRate is a library to help you promote your android app by prompting users to rate the app after using it for a few days. Also its two stage process ensures higher reviews to go to playstore while getting useful feedback on lower ratings.

Screenshots and stages

Stage 1) A dialog is displayed to prompt users to rate your app.

Stage 2) If user gives 3 or less rating -> A feedback dialog is shown asking users what went wrong? If users gives 4 or more rating -> User is requested to rate your app on playstore.

Install

For gradle, go to your app.gradle file and inside dependencies{ } add :


  compile 'com.morsebyte.shailesh.twostagerating:TwoStageRate:2.0' 

Thats it, you are good to go.

Usage

To put it simply, it can be done just in one line of code inside your activity's ' onCreate(...'


  TwoStageRate.with(this).twoStageRate.showIfMeetsConditions();
 

It sets the texts (as in above pics) and conditions (5 days of use or 5 times opening of app or 5 times setting of an custom event) to defaults.

( optional) If you want to change conditions, you can do this insted inside activity's ' onCreate(..'

TwoStageRate twoStageRate = TwoStageRate.with(this);
 //initialises condintions to 5 days of use, 10 times of launch use or 5 triggers of custom event. twoStageRate.setInstallDays(5).setLaunchTimes(10).setEventsTimes(5);
  //If user dismisses it, it simply resets again. (when user dismissed by clicking anywhere else on screen) twoStageRate.resetOnDismiss(true);
  //it is true by default  //If user gives rating the first time but declines to give playstore rating/ feedback we can reset the //TwoStageRate. These are false by default. twoStageRate.resetOnFeedBackDeclined(true).resetOnRatingDeclined(true);
  //You may choose to show/hide your app icon in rating prompt (default true) twoStageRate.setShowAppIcon(true);
  //Finally call to show feedback dialog if any of condition is met. twoStageRate.showIfMeetsConditions();
 

'setEventsTime(int n)' sets this dialog on 'n' custom event triggers (like 'n times user clicks a button/ buys a product etc.'). You can increment this trigger anywhere like this:


  TwoStageRate.with(MainActivity.this).incrementEvent();
 

For now you need to add a feedback listener wherever you want to listen for feedback (see below how). You may want to add a feedback listener to this as well.


  TwoStageRate.with(MainActivity.this).incrementEvent()

.setFeedbackReceivedListener(new FeedbackReceivedListener() {

  @Override

  public void onFeedbackReceived(String feedback) {

Toast.makeText(MainActivity.this, feedback, Toast.LENGTH_SHORT).show();

}

  
}
; 

( optional) On receiving feedback, any action can be done on the feedback using feedbacklistener. There are two types, one with feedback only as an argument and one with feedback and rating as argument.


  //Feedback listener giving back only the feedback

twoStageRate.setFeedbackReceivedListener(new FeedbackReceivedListener() {

  @Override

  public void onFeedbackReceived(String feedback) {

Toast.makeText(MainActivity.this, feedback, Toast.LENGTH_SHORT).show();

}

  
}

  //Feedback listener with rating information as well

twoStageRate.setFeedbackWithRatingReceivedListener(new FeedbackWithRatingReceivedListener() {

@Override

public void onFeedbackReceived(float rating, String feedback) {

 Toast.makeText(MainActivity.this, "Rating :" + rating + "Feedback :" + feedback, Toast.LENGTH_SHORT).show();

}

  
}
);
 

**( optional)**However if you want to costumize all three diologs as per your app specific text, you can do it like this (You may want to include it inside such a function to be called from 'onCreate(.. ':


  initTwoStage {

TwoStageRate twoStageRate = TwoStageRate.with(this);

 //Setting conditions

twoStageRate.setInstallDays(5).setEventsTimes(5).setLaunchTimes(5);

twoStageRate.resetOnDismiss(true).resetOnFeedBackDeclined(true).resetOnRatingDeclined(false);

twoStageRate.showIfMeetsConditions();

 //Setting feedback listener

twoStageRate.setFeedbackReceivedListener(new FeedbackReceivedListener() {

  @Override

  public void onFeedbackReceived(String feedback) {

Toast.makeText(MainActivity.this, feedback, Toast.LENGTH_SHORT).show();

  
}

 
}
);

  //Setting texts for initial prompt

 twoStageRate.with(this).setRatePromptTitle("INITIAL_TITLE").

setRatePromptLaterText("LATER_TEXT").setRatePromptNeverText("NEVER_TEXT").setRatePromptDismissible(false);

  //Setting texts for confirmation dialog

 twoStageRate.with(this).setConfirmRateDialogTitle("CONFIRMATION_TITLE").

 setConfirmRateDialogDescription("CONFIRMATION_DESCRITPION").

 setConfirmRateDialogPositiveText("POSITIVE_BUTTON_TEXT").

 setConfirmRateDialogNegativeText("NEGATIVE_BUTTON_TEXT").

 setConfirmRateDialogDismissible(true);

  //Setting texts for feedback title

 twoStageRate.with(this).setFeedbackDialogTitle("FEEDBACK_TITLE").

 setFeedbackDialogDescription("FEEDBACK_DIALOG_DESCRIPTION").

 setFeedbackDialogPositiveText("POSITIVE_BUTTON_TEXT").

 setFeedbackDialogNegativeText("NEGATIVE_BUTTON_TEXT").

 setFeedbackDialogDismissible(false);

 
}
 

Contributors

Dmitriy Mishin ( https://github.com/mishindmitriy)

Kindly contribute the library to include

  1. Custom styles. Or Picking up application's app icon and accent colors.
  2. Reporting and fixing bugs

Cheers!

Resources

Awesome Audio Widget for any Android Music App.

A toolbar that morphs from a FloatingActionButton.

Unify activity and fragment life cycle for MVVM architecture.

This a indoor map view named MapView for Android. It also offers some layers.

Custom Lint checks for Android development.

Automatic resource exporter plugin for android projects: generating density specific drawables from PDF files.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes