use of com.frostwire.android.gui.views.RichNotificationActionLink in project frostwire by frostwire.
the class SearchFragment method showRatingsReminder.
private void showRatingsReminder(View v) {
final RichNotification ratingReminder = findView(v, R.id.fragment_search_rating_reminder_notification);
ratingReminder.setVisibility(View.GONE);
final ConfigurationManager CM = ConfigurationManager.instance();
boolean alreadyRated = CM.getBoolean(Constants.PREF_KEY_GUI_ALREADY_RATED_US_IN_MARKET);
if (alreadyRated || ratingReminder.wasDismissed()) {
// LOG.info("SearchFragment.showRatingsReminder() aborted. alreadyRated="+alreadyRated + " wasDismissed=" + ratingReminder.wasDismissed());
return;
}
long installationTimestamp = CM.getLong(Constants.PREF_KEY_GUI_INSTALLATION_TIMESTAMP);
long daysInstalled = TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - installationTimestamp);
if (installationTimestamp == -1 || daysInstalled < 5) {
// LOG.info("SearchFragment.showRatingsReminder() aborted. Too soon to show ratings reminder. daysInstalled=" + daysInstalled);
return;
}
ClickAdapter<SearchFragment> onRateAdapter = new OnRateClickAdapter(SearchFragment.this, ratingReminder, CM);
ratingReminder.setOnClickListener(onRateAdapter);
RichNotificationActionLink rateFrostWireActionLink = new RichNotificationActionLink(ratingReminder.getContext(), getString(R.string.love_frostwire), onRateAdapter);
RichNotificationActionLink sendFeedbackActionLink = new RichNotificationActionLink(ratingReminder.getContext(), getString(R.string.send_feedback), new OnFeedbackClickAdapter(this, ratingReminder, CM));
ratingReminder.updateActionLinks(rateFrostWireActionLink, sendFeedbackActionLink);
ratingReminder.setVisibility(View.VISIBLE);
}
Aggregations