use of com.ferg.awfulapp.task.VoteRequest in project Awful.apk by Awful.
the class ThreadDisplayFragment method rateThread.
/**
* Display a thread-rating dialog.
*
* This handles the network request to submit the vote, and user feedback.
*/
private void rateThread() {
final CharSequence[] items = { "1", "2", "3", "4", "5" };
final Activity activity = this.getActivity();
new AlertDialog.Builder(activity).setTitle("Rate this thread").setItems(items, (dialog, item) -> queueRequest(new VoteRequest(activity, getThreadId(), item).build(ThreadDisplayFragment.this, new AwfulRequest.AwfulResultCallback<Void>() {
@Override
public void success(Void result) {
getAlertView().setTitle(R.string.vote_succeeded).setSubtitle(R.string.vote_succeeded_sub).setIcon(R.drawable.ic_mood).show();
}
@Override
public void failure(VolleyError error) {
}
}))).show();
}
Aggregations