From 3139d41ba4deeddef9602c9fd39a7961c94e5518 Mon Sep 17 00:00:00 2001 From: Domagalski Date: Sat, 15 Dec 2018 15:29:29 +0100 Subject: [PATCH] strings fixed, base url server moved to Const class --- app/src/main/AndroidManifest.xml | 20 ++++++++++++++----- .../com/uam/wmi/findmytutor/FindMyTutor.java | 4 +++- .../wmi/findmytutor/network/ApiClient.java | 5 +++-- .../com/uam/wmi/findmytutor/utils/Const.java | 1 + app/src/main/res/layout/pref_main.xml | 6 +++--- app/src/main/res/values/strings.xml | 2 +- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 80031db..5ccbfb9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,7 +28,9 @@ + android:theme="@style/AppTheme.NoActionBar" + android:screenOrientation="portrait" + android:configChanges="keyboardHidden|orientation|screenSize"> @@ -37,14 +39,20 @@ + android:launchMode="singleTop" + android:screenOrientation="portrait" + android:configChanges="keyboardHidden|orientation|screenSize"/> + android:noHistory="true" + android:screenOrientation="portrait" + android:configChanges="keyboardHidden|orientation|screenSize"/> + android:name=".activity.SettingsActivity" + android:screenOrientation="portrait" + android:configChanges="keyboardHidden|orientation|screenSize"/> + android:theme="@style/AppTheme" + android:screenOrientation="portrait" + android:configChanges="keyboardHidden|orientation|screenSize"/> \ No newline at end of file diff --git a/app/src/main/java/com/uam/wmi/findmytutor/FindMyTutor.java b/app/src/main/java/com/uam/wmi/findmytutor/FindMyTutor.java index 0c2298f..3c2eabf 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/FindMyTutor.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/FindMyTutor.java @@ -5,6 +5,8 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; +import com.uam.wmi.findmytutor.utils.Const; + import static org.acra.ReportField.*; import org.acra.ACRA; import org.acra.annotation.AcraLimiter; @@ -50,7 +52,7 @@ public class FindMyTutor extends Application { builder.getPluginConfigurationBuilder( HttpSenderConfigurationBuilder.class // ).setUri("http://192.168.0.15:3000/api/acra") - ).setUri("https://s416084.projektstudencki.pl/develop/api/Feedback/autoFeedback") + ).setUri(Const.BASE_URL +"api/Feedback/autoFeedback") .setHttpMethod(HttpSender.Method.POST) .setHttpHeaders(header) .setEnabled(true); diff --git a/app/src/main/java/com/uam/wmi/findmytutor/network/ApiClient.java b/app/src/main/java/com/uam/wmi/findmytutor/network/ApiClient.java index 1835496..6897226 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/network/ApiClient.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/network/ApiClient.java @@ -4,6 +4,7 @@ import android.content.Context; import android.text.TextUtils; import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import com.uam.wmi.findmytutor.utils.Const; import com.uam.wmi.findmytutor.utils.PrefUtils; import java.io.IOException; @@ -26,7 +27,7 @@ public class ApiClient { private static Retrofit retrofit = null; private static int REQUEST_TIMEOUT = 60; 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/master/"; public static Retrofit getClient(Context context) { @@ -35,7 +36,7 @@ public class ApiClient { if (retrofit == null) { retrofit = new Retrofit.Builder() - .baseUrl(BASE_URL) + .baseUrl(Const.BASE_URL) .client(okHttpClient) .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) diff --git a/app/src/main/java/com/uam/wmi/findmytutor/utils/Const.java b/app/src/main/java/com/uam/wmi/findmytutor/utils/Const.java index 6a4282a..4d78589 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/utils/Const.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/utils/Const.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.List; public class Const { + public final static String BASE_URL = "https://s416084.projektstudencki.pl/master/"; public final static Integer onlineBackgroundLocationInterval = 15000; public final static Integer offlineBackgroundLocationInterval = 36000; public final static Integer defaultMapZoom = 17; diff --git a/app/src/main/res/layout/pref_main.xml b/app/src/main/res/layout/pref_main.xml index 2977f17..eedf7e1 100644 --- a/app/src/main/res/layout/pref_main.xml +++ b/app/src/main/res/layout/pref_main.xml @@ -16,11 +16,11 @@ android:title="@string/title_language" /> + android:defaultValue="true"/> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7f493bb..4788c32 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -246,7 +246,7 @@ Allow to send raport to developers is ON Allow to send raport to developers is OFF - App issues reporting + App issues reporting Sorry, the application crashed. A report will be sent to the developers