use of com.ferg.awfulapp.task.ProfileRequest in project Awful.apk by Awful.
the class ThreadDisplayFragment method ignoreUser.
/**
* Add a user to the ignore list.
*
* @param userId The awful ID of the user
*/
public void ignoreUser(int userId) {
final Activity activity = getActivity();
if (getPrefs().ignoreFormkey == null) {
queueRequest(new ProfileRequest(activity, null).build());
}
if (getPrefs().showIgnoreWarning) {
DialogInterface.OnClickListener onClickListener = (dialog, which) -> {
if (which == AlertDialog.BUTTON_NEUTRAL) {
// cancel future alerts if the user clicks the "don't warn" option
getPrefs().setPreference(Keys.SHOW_IGNORE_WARNING, false);
}
doIgnoreUser(activity, userId);
};
new AlertDialog.Builder(activity).setPositiveButton(R.string.confirm, onClickListener).setNeutralButton(R.string.dont_show_again, onClickListener).setNegativeButton(R.string.cancel, null).setTitle(R.string.ignore_title).setMessage(R.string.ignore_message).show();
} else {
doIgnoreUser(activity, userId);
}
}
Aggregations