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

This commit is contained in:
Adam Domagalski 2018-12-15 17:34:20 +00:00 committed by Gogs
commit 39da105bc8
11 changed files with 104 additions and 68 deletions

View File

@ -28,7 +28,9 @@
<activity
android:name=".activity.StartupActivity"
android:launchMode="singleInstance"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -37,14 +39,20 @@
</activity>
<activity
android:name=".activity.MapActivity"
android:launchMode="singleTop" />
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name=".activity.LoginActivity"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:noHistory="true" />
android:noHistory="true"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name=".activity.SettingsActivity" />
android:name=".activity.SettingsActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<service
android:name=".service.BackgroundLocalizationService"
@ -54,7 +62,9 @@
<activity
android:name=".activity.TutorTab"
android:theme="@style/AppTheme"/>
android:theme="@style/AppTheme"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
</application>
</manifest>

View File

@ -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);

View File

@ -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())

View File

@ -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;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#e9ffffff"/>
<stroke android:width="3dp" android:color="#B1BCBE" />
<solid android:color="#ffffff"/>
<stroke android:width="3dp" android:color="#b1bcbe" />
<corners android:radius="10dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>

View File

@ -1,74 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@drawable/layout_bg"
android:orientation="vertical"
android:padding="10dp"
android:background="@drawable/layout_bg">
android:textColor="@color/half_black">
<TextView
android:id="@+id/textViewP1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="@string/map_info_text_p1" />
android:layout_weight="1"
android:text="@string/map_info_text_p1"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/textViewP2"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/map_info_text_p2" />
android:text="@string/map_info_text_p2"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/textViewP3"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/map_info_text_p3" />
android:text="@string/map_info_text_p3"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/exactMarkerTextView"
android:gravity="center"
android:drawableLeft="@drawable/exact_localization_marker"
android:layout_marginTop="20dp"
android:layout_marginLeft="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/map_info_text_marker_exact" />
android:drawableLeft="@drawable/exact_localization_marker"
android:drawablePadding="5dp"
android:gravity="center"
android:text="@string/map_info_text_marker_exact"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/approximateTextView"
android:drawableLeft="@drawable/approximate_localization_marker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:layout_marginLeft="5dp"
android:gravity="center"
android:layout_weight="1"
android:text="@string/map_info_text_marker_approximated" />
android:drawableLeft="@drawable/approximate_localization_marker"
android:drawablePadding="5dp"
android:gravity="center"
android:text="@string/map_info_text_marker_approximated"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/manualMarkerTextView"
android:drawableLeft="@drawable/manual_localization_marker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:layout_marginLeft="5dp"
android:gravity="center"
android:layout_weight="1"
android:text="@string/map_info_text_marker_manual" />
android:drawableLeft="@drawable/manual_localization_marker"
android:drawablePadding="5dp"
android:gravity="center"
android:text="@string/map_info_text_marker_manual"
android:textColor="@color/half_black" />
</LinearLayout>

View File

@ -11,7 +11,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p1" />
android:text="@string/info_icon_sharing_tab_p1"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/textViewP2"
@ -19,7 +20,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p2" />
android:text="@string/info_icon_sharing_tab_p2"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP3"
@ -27,16 +29,17 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p3" />
android:text="@string/info_icon_sharing_tab_p3"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP3exactlvl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p3_level_exact" />
android:text="@string/info_icon_sharing_tab_p3_level_exact"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP3approximatelvl"
@ -44,7 +47,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p3_level_approximate" />
android:text="@string/info_icon_sharing_tab_p3_level_approximate"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP3manuallvl"
@ -52,7 +56,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p3_level_manual" />
android:text="@string/info_icon_sharing_tab_p3_level_manual"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP3presencelvl"
@ -60,7 +65,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p3_level_presence" />
android:text="@string/info_icon_sharing_tab_p3_level_presence"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP4"
@ -68,7 +74,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p4" />
android:text="@string/info_icon_sharing_tab_p4"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP5"
@ -76,7 +83,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p5" />
android:text="@string/info_icon_sharing_tab_p5"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP6"
@ -84,7 +92,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p6" />
android:text="@string/info_icon_sharing_tab_p6"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP7"
@ -92,7 +101,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="@string/info_icon_sharing_tab_p7" />
android:text="@string/info_icon_sharing_tab_p7"
android:textColor="@color/half_black"/>
</LinearLayout>

View File

@ -12,7 +12,8 @@
android:layout_marginLeft="5dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="@string/info_icon_tutor_tab_p1" />
android:text="@string/info_icon_tutor_tab_p1"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP2"
@ -21,7 +22,8 @@
android:layout_marginLeft="5dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="@string/info_icon_tutor_tab_p2" />
android:text="@string/info_icon_tutor_tab_p2"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP3"
@ -30,7 +32,8 @@
android:layout_marginLeft="5dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="@string/info_icon_tutor_tab_p3" />
android:text="@string/info_icon_tutor_tab_p3"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/textViewP4"
@ -40,6 +43,7 @@
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_weight="1"
android:text="@string/info_icon_tutor_tab_p4" />
android:text="@string/info_icon_tutor_tab_p4"
android:textColor="@color/half_black"/>
</LinearLayout>

View File

@ -11,13 +11,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/info_icon_userlist_tab_p1" />
android:text="@string/info_icon_userlist_tab_p1"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/userListPopupInfoTextViewP2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/info_icon_userlist_tab_p2" />
android:text="@string/info_icon_userlist_tab_p2"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/userListPopupInfoTextViewOnline"
@ -27,7 +30,8 @@
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:layout_weight="1"
android:text="@string/info_icon_userlist_tab_level_status_online" />
android:text="@string/info_icon_userlist_tab_level_status_online"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/userListPopupInfoTextVieOffline"
@ -37,7 +41,8 @@
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:layout_weight="1"
android:text="@string/info_icon_userlist_tab_level_status_offline" />
android:text="@string/info_icon_userlist_tab_level_status_offline"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/userListPopupInfoTextViewInactive"
@ -47,13 +52,15 @@
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:layout_weight="1"
android:text="@string/info_icon_userlist_tab_level_status_inactive" />
android:text="@string/info_icon_userlist_tab_level_status_inactive"
android:textColor="@color/half_black"/>
<TextView
android:id="@+id/userListPopupInfoTextViewTip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/info_icon_userlist_tab_level_status_inactive_tip" />
android:text="@string/info_icon_userlist_tab_level_status_inactive_tip"
android:textColor="@color/half_black"/>
</LinearLayout>

View File

@ -16,11 +16,11 @@
android:title="@string/title_language" />
<SwitchPreference
android:key="acra.disable"
android:title="@string/pref_disable_acra"
android:key="acra.enable"
android:title="@string/pref_title_acra"
android:summaryOn="@string/pref_acra_disabled"
android:summaryOff="@string/pref_acra_enabled"
android:defaultValue="false"/>
android:defaultValue="true"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@ -233,12 +233,8 @@
<string name="network_error">Network Error!</string>
<string name="manual_status_error">Error handling status fetch</string>
<string name="error_status_fetch">Error handling status fetch</string>
<string name="error_location_fetch">Error handling status fetch</string>
<string name="error_location_fetch" translatable="false">Error handling status fetch</string>
<!--<string name="pref_acra_disabled" translatable="false">Auto reporting on issue is OFF</string>-->
<!--<string name="pref_acra_enabled" translatable="false">Auto reporting on issue is ON</string>-->
<!--<string name="pref_disable_acra" translatable="false">ACRA reporting tool</string>-->
<string name="acra_toast_text" translatable="false">Sorry, the application crashed. A report will be sent to the developers</string>
<string name="notification_text">Sorry, the application crashed. A report will be sent to the developers</string>
<string name="notification_title" translatable="false">FMT Issue</string>
<string name="notification_channel" translatable="false">FMT</string>
@ -250,7 +246,8 @@
<!--ACRA ON/OFF switch-->
<string name="pref_acra_disabled" translatable="false">Allow to send raport to developers is ON</string>
<string name="pref_acra_enabled" translatable="false">Allow to send raport to developers is OFF</string>
<string name="pref_disable_acra" translatable="false">App issues reporting</string>
<string name="pref_title_acra" translatable="false">App issues reporting</string>
<string name="acra_toast_text" translatable="false">Sorry, the application crashed. A report will be sent to the developers</string>
<!--(ENG) Map Activity info helper-->
<string name="map_info_text_p1">On the map there are markers which represents tutors sharing their location right now.</string>