fixed toast on send feedback, minor model adjustment of feedback

This commit is contained in:
marcin.jedynski 2018-12-06 22:31:02 +01:00
parent 8be7d3aa11
commit 367bc7518e
2 changed files with 5 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import retrofit2.http.POST;
public interface FeedbackService {
@POST("api/Feedback")
Observable<Void> postFeedback(@Body Feedback feedback);
Observable<Response<Void>> postFeedback(@Body Feedback feedback);
@GET("api/Feedback")
Observable<Void> getFeedback();

View File

@ -82,10 +82,9 @@ public class FeedbackUtils {
try {
appVersion = activityContext.getPackageManager().getPackageInfo(activityContext.getPackageName(), 0).versionName;
if( !mode ){
body = PrefUtils.getUserFirstName(activityContext) + " " + PrefUtils.getUserLastName(activityContext) + "\n" + body;
userFeedback = new Feedback(mode,
header,
PrefUtils.getUserId(activityContext),
PrefUtils.getUserFirstName(activityContext) + " " + PrefUtils.getUserLastName(activityContext) + " | " + PrefUtils.getUserId(activityContext),
"Android "+ Build.VERSION.RELEASE,
appVersion,
Build.MODEL,
@ -113,8 +112,10 @@ public class FeedbackUtils {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::handleResponse, this::handleError));
}
private void handleResponse( Void resp) {
private void handleResponse( Response<Void> resp) {
Toast.makeText(activityContext, activityContext.getString(R.string.modal_feedback_thankyou), Toast.LENGTH_SHORT).show();
Log.d("FEEDBACK toast","gdzie jest mój tost");
}
private void handleError(Throwable error) {