Search in sources :

Example 1 with InviteReminder

use of org.thoughtcrime.securesms.components.reminder.InviteReminder in project Signal-Android by WhisperSystems.

the class ConversationActivity method updateInviteReminder.

protected void updateInviteReminder(boolean seenInvite) {
    Log.w(TAG, "updateInviteReminder(" + seenInvite + ")");
    if (TextSecurePreferences.isPushRegistered(this) && !isSecureText && !seenInvite && recipients.isSingleRecipient() && recipients.getPrimaryRecipient() != null && recipients.getPrimaryRecipient().getContactUri() != null) {
        InviteReminder reminder = new InviteReminder(this, recipients);
        reminder.setOkListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                handleInviteLink();
                reminderView.get().requestDismiss();
            }
        });
        reminderView.get().showReminder(reminder);
    } else if (reminderView.resolved()) {
        reminderView.get().hide();
    }
}
Also used : InviteReminder(org.thoughtcrime.securesms.components.reminder.InviteReminder) OnClickListener(android.view.View.OnClickListener) ReminderView(org.thoughtcrime.securesms.components.reminder.ReminderView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with InviteReminder

use of org.thoughtcrime.securesms.components.reminder.InviteReminder in project Signal-Android by signalapp.

the class ConversationActivity method updateReminders.

protected void updateReminders(boolean seenInvite) {
    Log.w(TAG, "updateReminders(" + seenInvite + ")");
    if (UnauthorizedReminder.isEligible(this)) {
        reminderView.get().showReminder(new UnauthorizedReminder(this));
    } else if (ExpiredBuildReminder.isEligible()) {
        reminderView.get().showReminder(new ExpiredBuildReminder(this));
    } else if (TextSecurePreferences.isPushRegistered(this) && TextSecurePreferences.isShowInviteReminders(this) && !isSecureText && !seenInvite && !recipient.isGroupRecipient()) {
        InviteReminder reminder = new InviteReminder(this, recipient);
        reminder.setOkListener(v -> {
            handleInviteLink();
            reminderView.get().requestDismiss();
        });
        reminderView.get().showReminder(reminder);
    } else if (reminderView.resolved()) {
        reminderView.get().hide();
    }
}
Also used : InviteReminder(org.thoughtcrime.securesms.components.reminder.InviteReminder) ExpiredBuildReminder(org.thoughtcrime.securesms.components.reminder.ExpiredBuildReminder) UnauthorizedReminder(org.thoughtcrime.securesms.components.reminder.UnauthorizedReminder)

Aggregations

InviteReminder (org.thoughtcrime.securesms.components.reminder.InviteReminder)2 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 TextView (android.widget.TextView)1 ExpiredBuildReminder (org.thoughtcrime.securesms.components.reminder.ExpiredBuildReminder)1 ReminderView (org.thoughtcrime.securesms.components.reminder.ReminderView)1 UnauthorizedReminder (org.thoughtcrime.securesms.components.reminder.UnauthorizedReminder)1