Merge pull request #979 from MilosKozak/lp-ps-always

LP: Allow ProfileSwitch before pump is connected.
This commit is contained in:
Milos Kozak 2018-05-02 22:37:23 +02:00 committed by GitHub
commit f9bbb72831
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,22 +199,14 @@ public class LocalProfileFragment extends SubscriberFragment {
if (isValid) {
invalidProfile.setVisibility(View.GONE); //show invalid profile
if (isEdited || !ConfigBuilderPlugin.getActivePump().isInitialized() || ConfigBuilderPlugin.getActivePump().isSuspended()) {
if (isEdited) {
//edited profile -> save first
//pump not initialized -> don't update profile yet
profileswitchButton.setVisibility(View.GONE);
} else {
profileswitchButton.setVisibility(View.VISIBLE);
}
if(isEdited){
saveButton.setVisibility(View.VISIBLE);
} else {
profileswitchButton.setVisibility(View.VISIBLE);
saveButton.setVisibility(View.GONE);
}
} else {
invalidProfile.setVisibility(View.VISIBLE);
profileswitchButton.setVisibility(View.GONE);