35 lines
1004 B
Java
Raw Normal View History

package org.thoughtcrime.securesms.components.reminder;
import android.content.Context;
import android.content.Intent;
import android.view.View.OnClickListener;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.RegistrationActivity;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
public class PushRegistrationReminder extends Reminder {
2018-02-01 19:22:48 -08:00
public PushRegistrationReminder(final Context context) {
super(context.getString(R.string.reminder_header_push_title),
context.getString(R.string.reminder_header_push_text));
2018-02-01 19:22:48 -08:00
final OnClickListener okListener = v -> {
Intent intent = new Intent(context, RegistrationActivity.class);
intent.putExtra("cancel_button", true);
context.startActivity(intent);
};
setOkListener(okListener);
}
@Override
public boolean isDismissable() {
return false;
}
public static boolean isEligible(Context context) {
return !TextSecurePreferences.isPushRegistered(context);
}
}