Fix scenario when user doesn't have prefs

This commit is contained in:
Mieszko Wrzeszczyński 2019-01-07 00:05:37 +01:00
parent 1ba6cdf6f0
commit d78ae83877

View File

@ -128,15 +128,8 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
preferenceCategory.removePreference(removeManualLocation);
preferenceCategory.removePreference(manualLocationButton);
}else{
if(predefinedCoordsList.isEmpty()){
locationSharing.setEnabled(false);
locationSharing.setChecked(false);
PrefUtils.disableSharing(getApplicationContext());
((MapActivity) getActivity()).handleBackgroundTaskLifeCycle();
removeManualLocation.setEnabled(false);
manualLocationList.setEnabled(false);
manualLocationList.setSummary("");
}else{
if(!predefinedCoordsList.isEmpty()){
manualLocationList.setEnabled(true);
manualLocationList.setSummary(PrefUtils.getCurrentManualLocationName(getApplicationContext()));
removeManualLocation.setEnabled(true);
@ -221,12 +214,6 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
if (!predefinedCoordsList.isEmpty()) {
preferenceCategory.addPreference(manualLocationList);
preferenceCategory.addPreference(removeManualLocation);
}else{
locationSharing.setEnabled(false);
locationSharing.setChecked(false);
PrefUtils.disableSharing(getApplicationContext());
((MapActivity) getActivity()).handleBackgroundTaskLifeCycle();
}
preferenceCategory.addPreference(manualLocationButton);
} else {