Fix sharing buttons

This commit is contained in:
Mieszko Wrzeszczyński 2019-01-06 11:58:22 +01:00
parent 72eea53a8c
commit 3b4bb9cbae
4 changed files with 12 additions and 9 deletions

View File

@ -10,7 +10,7 @@ android {
applicationId "com.uam.wmi.findmytutor"
minSdkVersion 22
targetSdkVersion 27
versionCode 36
versionCode 37
versionName "0.9.6-beta"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@ -72,4 +72,6 @@ dependencies {
// FloatingBarMenu
implementation 'com.getbase:floatingactionbutton:1.10.1'
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'
}

View File

@ -11,6 +11,7 @@ import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceFragment;
import android.preference.SwitchPreference;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -21,6 +22,7 @@ import com.annimon.stream.IntPair;
import com.annimon.stream.Stream;
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
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.network.ApiClient;
import com.uam.wmi.findmytutor.service.PredefinedCoordinatesService;
@ -44,7 +46,6 @@ import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.observers.DisposableSingleObserver;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
@ -164,11 +165,12 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
}));
}
@SuppressLint("ResourceType")
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.layout.pref_sharing);
addPreferencesFromResource(R.xml.pref_sharing);
locationSharing = (SwitchPreference) findPreference("key_sharing_enabled");
statusSwitch = (SwitchPreference) findPreference("key_status_enabled");
locationMode = findPreference("key_location_level");
@ -261,6 +263,7 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
/** Button 'choose from map' button listener **/
manualLocationButton.setOnPreferenceChangeListener((preference, o) -> {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
@ -294,6 +297,7 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
showRemoveDialog(statusList.getEntries(),"status");
return true;
});
removeManualLocation.setOnPreferenceChangeListener(((preference, newValue) -> {
showRemoveDialog(manualLocationList.getEntries(),"location");
return true;

View File

@ -7,7 +7,7 @@ import java.util.List;
public class Const {
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 offlineBackgroundLocationInterval = 360000;
public final static Integer defaultMapZoom = 17;

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="MissingDefaultResource"
android:layout_width="match_parent"
android:id="@+id/pref_screen"
android:fontFamily="@font/lato_regular"
android:layout_height="match_parent">
@ -35,7 +35,7 @@
android:text="@string/preference_manual_location_button"
/>
<com.uam.wmi.findmytutor.utils.RightButtonPreference
android:key="remove_manual_location"
android:key="remove_manual_location"
android:text="@string/preference_manual_location_button_remove"
/>
</PreferenceCategory>
@ -66,7 +66,4 @@
/>
</PreferenceCategory>
</PreferenceScreen>