Merge branch 'fmt-296' of s416084/find-my-tutor-android into develop

This commit is contained in:
Marcin Jedyński 2018-12-06 23:08:27 +00:00 committed by Gogs
commit 5a8ec2d9fc
3 changed files with 6 additions and 5 deletions

View File

@ -26,7 +26,7 @@ public class ApiClient {
private static Retrofit retrofit = null; private static Retrofit retrofit = null;
private static int REQUEST_TIMEOUT = 60; private static int REQUEST_TIMEOUT = 60;
private static OkHttpClient okHttpClient; private static OkHttpClient okHttpClient;
private static final String BASE_URL = "https://s416084.projektstudencki.pl/master/"; private static final String BASE_URL = "https://s416084.projektstudencki.pl/develop/";
public static Retrofit getClient(Context context) { public static Retrofit getClient(Context context) {

View File

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

View File

@ -82,10 +82,9 @@ public class FeedbackUtils {
try { try {
appVersion = activityContext.getPackageManager().getPackageInfo(activityContext.getPackageName(), 0).versionName; appVersion = activityContext.getPackageManager().getPackageInfo(activityContext.getPackageName(), 0).versionName;
if( !mode ){ if( !mode ){
body = PrefUtils.getUserFirstName(activityContext) + " " + PrefUtils.getUserLastName(activityContext) + "\n" + body;
userFeedback = new Feedback(mode, userFeedback = new Feedback(mode,
header, header,
PrefUtils.getUserId(activityContext), PrefUtils.getUserFirstName(activityContext) + " " + PrefUtils.getUserLastName(activityContext) + " | " + PrefUtils.getUserId(activityContext),
"Android "+ Build.VERSION.RELEASE, "Android "+ Build.VERSION.RELEASE,
appVersion, appVersion,
Build.MODEL, Build.MODEL,
@ -113,8 +112,10 @@ public class FeedbackUtils {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(this::handleResponse, this::handleError)); .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(); 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) { private void handleError(Throwable error) {