use of me.ccrama.redditslide.CaseInsensitiveArrayList in project Slide by ccrama.
the class Login method doSubStrings.
private void doSubStrings(ArrayList<Subreddit> subs) {
subNames = new CaseInsensitiveArrayList();
for (Subreddit s : subs) {
subNames.add(s.getDisplayName().toLowerCase(Locale.ENGLISH));
}
subNames = UserSubscriptions.sort(subNames);
if (!subNames.contains("slideforreddit")) {
new AlertDialogWrapper.Builder(Login.this).setTitle(R.string.login_subscribe_rslideforreddit).setMessage(R.string.login_subscribe_rslideforreddit_desc).setPositiveButton(R.string.btn_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
subNames.add(2, "slideforreddit");
UserSubscriptions.setSubscriptions(subNames);
Reddit.forceRestart(Login.this, true);
}
}).setNegativeButton(R.string.btn_no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
UserSubscriptions.setSubscriptions(subNames);
Reddit.forceRestart(Login.this, true);
}
}).setCancelable(false).show();
} else {
UserSubscriptions.setSubscriptions(subNames);
Reddit.forceRestart(Login.this, true);
}
}
Aggregations