mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-29 04:55:15 +00:00
a4e18c515c
Closes #2647 // FREEBIE
42 lines
1.2 KiB
Java
42 lines
1.2 KiB
Java
package org.thoughtcrime.securesms.components;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.view.View;
|
|
import android.view.View.OnClickListener;
|
|
|
|
import org.thoughtcrime.securesms.R;
|
|
import org.thoughtcrime.securesms.RegistrationActivity;
|
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
|
|
|
public class PushRegistrationReminder extends Reminder {
|
|
|
|
public PushRegistrationReminder(final Context context, final MasterSecret masterSecret) {
|
|
super(R.drawable.ic_push_registration_reminder,
|
|
R.string.reminder_header_push_title,
|
|
R.string.reminder_header_push_text);
|
|
|
|
final OnClickListener okListener = new OnClickListener() {
|
|
@Override
|
|
public void onClick(View v) {
|
|
Intent intent = new Intent(context, RegistrationActivity.class);
|
|
intent.putExtra("master_secret", masterSecret);
|
|
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);
|
|
}
|
|
}
|