Merge branch 'fix-pref-sharing' of s416084/find-my-tutor-android into develop
This commit is contained in:
commit
e9f71d5790
@ -10,7 +10,7 @@ android {
|
|||||||
applicationId "com.uam.wmi.findmytutor"
|
applicationId "com.uam.wmi.findmytutor"
|
||||||
minSdkVersion 22
|
minSdkVersion 22
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 36
|
versionCode 37
|
||||||
versionName "0.9.6-beta"
|
versionName "0.9.6-beta"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
@ -72,4 +72,6 @@ dependencies {
|
|||||||
// FloatingBarMenu
|
// FloatingBarMenu
|
||||||
implementation 'com.getbase:floatingactionbutton:1.10.1'
|
implementation 'com.getbase:floatingactionbutton:1.10.1'
|
||||||
implementation 'org.apache.commons:commons-collections4:4.0'
|
implementation 'org.apache.commons:commons-collections4:4.0'
|
||||||
|
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||||
|
implementation 'com.android.support:design:27.1.1'
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import android.preference.Preference;
|
|||||||
import android.preference.PreferenceCategory;
|
import android.preference.PreferenceCategory;
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
import android.preference.SwitchPreference;
|
import android.preference.SwitchPreference;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -21,6 +22,7 @@ import com.annimon.stream.IntPair;
|
|||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
||||||
import com.uam.wmi.findmytutor.R;
|
import com.uam.wmi.findmytutor.R;
|
||||||
|
import com.uam.wmi.findmytutor.adapters.TutorsListAdapter;
|
||||||
import com.uam.wmi.findmytutor.model.PredefinedCoordViewModel;
|
import com.uam.wmi.findmytutor.model.PredefinedCoordViewModel;
|
||||||
import com.uam.wmi.findmytutor.network.ApiClient;
|
import com.uam.wmi.findmytutor.network.ApiClient;
|
||||||
import com.uam.wmi.findmytutor.service.PredefinedCoordinatesService;
|
import com.uam.wmi.findmytutor.service.PredefinedCoordinatesService;
|
||||||
@ -44,7 +46,6 @@ import io.reactivex.disposables.CompositeDisposable;
|
|||||||
import io.reactivex.observers.DisposableSingleObserver;
|
import io.reactivex.observers.DisposableSingleObserver;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
|
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
|
||||||
|
|
||||||
|
|
||||||
@ -164,11 +165,12 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("ResourceType")
|
@SuppressLint("ResourceType")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(final Bundle savedInstanceState) {
|
public void onCreate(final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
addPreferencesFromResource(R.layout.pref_sharing);
|
addPreferencesFromResource(R.xml.pref_sharing);
|
||||||
locationSharing = (SwitchPreference) findPreference("key_sharing_enabled");
|
locationSharing = (SwitchPreference) findPreference("key_sharing_enabled");
|
||||||
statusSwitch = (SwitchPreference) findPreference("key_status_enabled");
|
statusSwitch = (SwitchPreference) findPreference("key_status_enabled");
|
||||||
locationMode = findPreference("key_location_level");
|
locationMode = findPreference("key_location_level");
|
||||||
@ -261,6 +263,7 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Button 'choose from map' button listener **/
|
/** Button 'choose from map' button listener **/
|
||||||
manualLocationButton.setOnPreferenceChangeListener((preference, o) -> {
|
manualLocationButton.setOnPreferenceChangeListener((preference, o) -> {
|
||||||
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
||||||
@ -294,6 +297,7 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
|
|||||||
showRemoveDialog(statusList.getEntries(),"status");
|
showRemoveDialog(statusList.getEntries(),"status");
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
removeManualLocation.setOnPreferenceChangeListener(((preference, newValue) -> {
|
removeManualLocation.setOnPreferenceChangeListener(((preference, newValue) -> {
|
||||||
showRemoveDialog(manualLocationList.getEntries(),"location");
|
showRemoveDialog(manualLocationList.getEntries(),"location");
|
||||||
return true;
|
return true;
|
||||||
|
@ -7,7 +7,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Const {
|
public class Const {
|
||||||
public final static String BASE_URL = "https://s416084.projektstudencki.pl/master/";
|
public final static String BASE_URL = "https://s416084.projektstudencki.pl/master/";
|
||||||
public final static Integer mapRefreshInterval = 5000;
|
public final static Integer mapRefreshInterval = 6000;
|
||||||
public final static Integer onlineBackgroundLocationInterval = 7000;
|
public final static Integer onlineBackgroundLocationInterval = 7000;
|
||||||
public final static Integer offlineBackgroundLocationInterval = 360000;
|
public final static Integer offlineBackgroundLocationInterval = 360000;
|
||||||
public final static Integer defaultMapZoom = 17;
|
public final static Integer defaultMapZoom = 17;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:tools="http://schemas.android.com/tools"
|
<PreferenceScreen xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
tools:ignore="MissingDefaultResource"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:id="@+id/pref_screen"
|
||||||
android:fontFamily="@font/lato_regular"
|
android:fontFamily="@font/lato_regular"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
@ -66,7 +66,4 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user