2015-10-13 21:44:01 -07:00
|
|
|
package org.thoughtcrime.securesms.components.reminder;
|
|
|
|
|
2019-08-07 14:22:51 -04:00
|
|
|
import android.annotation.SuppressLint;
|
2015-10-13 21:44:01 -07:00
|
|
|
import android.content.Context;
|
|
|
|
import android.os.AsyncTask;
|
2019-06-05 15:47:14 -04:00
|
|
|
import androidx.annotation.NonNull;
|
2015-10-13 21:44:01 -07:00
|
|
|
import android.view.View;
|
|
|
|
import android.view.View.OnClickListener;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.R;
|
|
|
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
2017-08-01 08:56:00 -07:00
|
|
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
2019-08-07 14:22:51 -04:00
|
|
|
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
|
2015-10-13 21:44:01 -07:00
|
|
|
|
|
|
|
public class InviteReminder extends Reminder {
|
|
|
|
|
2019-08-07 14:22:51 -04:00
|
|
|
@SuppressLint("StaticFieldLeak")
|
2015-10-13 21:44:01 -07:00
|
|
|
public InviteReminder(final @NonNull Context context,
|
2017-08-01 08:56:00 -07:00
|
|
|
final @NonNull Recipient recipient)
|
2015-10-13 21:44:01 -07:00
|
|
|
{
|
|
|
|
super(context.getString(R.string.reminder_header_invite_title),
|
2017-08-01 08:56:00 -07:00
|
|
|
context.getString(R.string.reminder_header_invite_text, recipient.toShortString()));
|
2015-10-13 21:44:01 -07:00
|
|
|
|
2019-08-07 14:22:51 -04:00
|
|
|
setDismissListener(v -> SignalExecutors.BOUNDED.execute(() -> {
|
|
|
|
DatabaseFactory.getRecipientDatabase(context).setSeenInviteReminder(recipient.getId(), true);
|
|
|
|
}));
|
2015-10-13 21:44:01 -07:00
|
|
|
}
|
|
|
|
}
|