remove button if pump is DanaR Korean

This commit is contained in:
Roumen Georgiev 2018-06-07 09:26:33 +03:00
parent 7ef97a5334
commit 9e2074433e
2 changed files with 11 additions and 0 deletions

View file

@ -11,6 +11,7 @@ import android.text.Spanned;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -29,12 +30,14 @@ import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.plugins.Common.SubscriberFragment;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.PumpDanaR.Dialogs.ProfileViewDialog;
import info.nightscout.androidaps.plugins.PumpDanaR.activities.DanaRHistoryActivity;
import info.nightscout.androidaps.plugins.PumpDanaR.activities.DanaRUserOptionsActivity;
import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRNewStatus;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.events.EventQueueChanged;
import info.nightscout.utils.DateUtil;
@ -89,6 +92,8 @@ public class DanaRFragment extends SubscriberFragment {
LinearLayout pumpStatusLayout;
@BindView(R.id.overview_pumpstatus)
TextView pumpStatusView;
@BindView(R.id.danar_user_options)
Button danar_user_options;
public DanaRFragment() {
}
@ -267,6 +272,11 @@ public class DanaRFragment extends SubscriberFragment {
queueView.setText(status);
}
}
//hide user options button if not an RS pump
boolean isKorean = MainApp.getSpecificPlugin(DanaRKoreanPlugin.class) != null && MainApp.getSpecificPlugin(DanaRKoreanPlugin.class).isEnabled(PluginType.PUMP);
if(isKorean){
danar_user_options.setVisibility(View.GONE);
}
}
});
}

View file

@ -23,6 +23,7 @@
android:defaultValue="false"
android:key="openapsama_useautosens"
android:title="@string/openapsama_useautosens" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_use_smb"