RateMeMaybe


Source link: https://github.com/nspo/RateMeMaybe

RateMeMaybe

  • Asks the user if (s)he wants to open the Play Store to rate your application when certain requirements are met (see below). This can and should be configured to be very cautious. Don't annoy your users!
  • Dialog icon, title, message and so on can be easily customized
  • The sample Activity uses SherlockFragmentActivity (from [ActionBarSherlock]), but you can use a normal FragmentActivity if you do not use ABS. If you also do not use the android support library, you can change mActivity.getSupportFragmentManager() to mActivity.getFragmentManager()
  • Code is heavily based on [AppRate] by Timothee Jeannin
  • License: MIT [ActionBarSherlock]: http://actionbarsherlock.com [AppRate]: https://github.com/TimotheeJeannin/AppRate

To use it, you can simply copy [RateMeMaybe.java] and [RateMeMaybeFragment.java] into your project. [RateMeMaybe.java]: https://github.com/Kopfgeldjaeger/RateMeMaybe/blob/master/code/src/com/kopfgeldjaeger/ratememaybe/RateMeMaybe.java [RateMeMaybeFragment.java]: https://github.com/Kopfgeldjaeger/RateMeMaybe/blob/master/code/src/com/kopfgeldjaeger/ratememaybe/RateMeMaybeFragment.java

Example usage in your (Sherlock)FragmentActivity:

RateMeMaybe rmm = new RateMeMaybe(this);
 rmm.setPromptMinimums(10, 14, 10, 30);
 rmm.run();
  // More customized example RateMeMaybe rmm = new RateMeMaybe(this);
 rmm.setPromptMinimums(10, 14, 10, 30);
 rmm.setDialogMessage("You really seem to like this app, "
  +"since you have already used it %totalLaunchCount% times! "
  +"It would be great if you took a moment to rate it.");
 rmm.setDialogTitle("Rate this app");
 rmm.setPositiveBtn("Yeeha!");
 rmm.run();

Methods:

 /**   * Sets requirements for when to prompt the user.   *    * @param minLaunchesUntilInitialPrompt   *

Minimum of launches before the user is prompted for the first   *

time. One call of .run() counts as launch.   * @param minDaysUntilInitialPrompt   *

Minimum of days before the user is prompted for the first   *

time.   * @param minLaunchesUntilNextPrompt   *

Minimum of launches before the user is prompted for each next   *

time. One call of .run() counts as launch.   * @param minDaysUntilNextPrompt   *

Minimum of days before the user is prompted for each next   *

time.   */  public void setPromptMinimums(int minLaunchesUntilInitialPrompt,
 int minDaysUntilInitialPrompt, int minLaunchesUntilNextPrompt,
 int minDaysUntilNextPrompt)  /**   * Sets the title of the dialog shown to the user   * @param dialogTitle   */  public void setDialogTitle(String dialogTitle)
/**   * Sets the message shown to the user. %totalLaunchCount% will be replaced   * with total launch count.   *    * @param dialogMessage   *

The message shown   */  public void setDialogMessage(String dialogMessage)
/**   * Sets name of button that opens Play Store entry   *    * @param positiveBtn   */  public void setPositiveBtn(String positiveBtn)
/**   * Sets name of neutral button   *    * @param neutralBtn   */  public void setNeutralBtn(String neutralBtn)
/**   * Sets name of button that makes the prompt never show again   *    * @param negativeBtn   */  public void setNegativeBtn(String negativeBtn)
/**   * @param customIcon   *

Drawable id of custom icon   */  public void setIcon(int customIcon)
/**   * @param handleCancelAsNeutral   *

Standard is true. If set to false, a back press (or other   *

things that lead to the dialog being cancelled), will be   *

handled like a negative choice (click on "Never").   */  public void setHandleCancelAsNeutral(Boolean handleCancelAsNeutral)
 /**   * Sets an additional callback for when the user has made a choice.   * @param listener   */  public void setAdditionalListener(OnRMMUserChoiceListener listener)
 /**   * Standard is false. Whether the run method is executed even if no Play   * Store is installed on device.   *    * @param runWithoutPlayStore   */  public void setRunWithoutPlayStore(Boolean runWithoutPlayStore)
/**   * Reset the launch logs   */  public static void resetData(FragmentActivity activity)
/**   * Forces the dialog to show, even if the requirements are not yet met. Does   * not affect prompt logs. Use with care.   */  public void forceShow()

Resources

A demo project which has FlowLayout to work with tags.

A lot of utility classes for Android development.

A Java fluent assertion wrapper to improve readability of RxJava's TestSubscriber assertions.

Standalone ZXing barcode/qrcode scanner library so that you don't have to install the ZXing Barcode Scanner app explicitly.

Android geographic visualization for UNHCR data.

A simple library to pick images from the gallery and camera.

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