Merge pull request #857 from TebbeUbben/disable-tdd-load-button

Hide TDD buttons
This commit is contained in:
Milos Kozak 2018-04-09 00:36:48 +02:00 committed by GitHub
commit b2129fa48e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 28 additions and 2 deletions

View file

@ -129,6 +129,9 @@ public class TDDStatsActivity extends Activity {
} }
totalBaseBasal.setText(TBB); totalBaseBasal.setText(TBB);
if (!ConfigBuilderPlugin.getActivePump().getPumpDescription().needsManualTDDLoad)
reloadButton.setVisibility(View.GONE);
// stats table // stats table
tl = (TableLayout) findViewById(R.id.main_table); tl = (TableLayout) findViewById(R.id.main_table);
TableRow tr_head = new TableRow(this); TableRow tr_head = new TableRow(this);
@ -436,7 +439,7 @@ public class TDDStatsActivity extends Activity {
TableLayout.LayoutParams.WRAP_CONTENT)); TableLayout.LayoutParams.WRAP_CONTENT));
} }
if (isOldData(historyList)) { if (isOldData(historyList) && ConfigBuilderPlugin.getActivePump().getPumpDescription().needsManualTDDLoad) {
statsMessage.setVisibility(View.VISIBLE); statsMessage.setVisibility(View.VISIBLE);
statsMessage.setText(getString(R.string.danar_stats_olddata_Message)); statsMessage.setText(getString(R.string.danar_stats_olddata_Message));

View file

@ -41,4 +41,7 @@ public class PumpDescription {
public boolean storesCarbInfo = true; public boolean storesCarbInfo = true;
public boolean is30minBasalRatesCapable = false; public boolean is30minBasalRatesCapable = false;
public boolean supportsTDDs = false;
public boolean needsManualTDDLoad = true;
} }

View file

@ -79,7 +79,6 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
tddStats = view.findViewById(R.id.actions_tddstats); tddStats = view.findViewById(R.id.actions_tddstats);
history = view.findViewById(R.id.actions_historybrowser); history = view.findViewById(R.id.actions_historybrowser);
profileSwitch.setOnClickListener(this); profileSwitch.setOnClickListener(this);
tempTarget.setOnClickListener(this); tempTarget.setOnClickListener(this);
extendedBolus.setOnClickListener(this); extendedBolus.setOnClickListener(this);
@ -191,6 +190,9 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
tempTarget.setVisibility(View.GONE); tempTarget.setVisibility(View.GONE);
else else
tempTarget.setVisibility(View.VISIBLE); tempTarget.setVisibility(View.VISIBLE);
if (!ConfigBuilderPlugin.getActivePump().getPumpDescription().supportsTDDs) tddStats.setVisibility(View.GONE);
else tddStats.setVisibility(View.VISIBLE);
} }
}); });
} }

View file

@ -112,6 +112,9 @@ public class ComboPlugin extends PluginBase implements PumpInterface, Constraint
pumpDescription.storesCarbInfo = false; pumpDescription.storesCarbInfo = false;
pumpDescription.is30minBasalRatesCapable = false; pumpDescription.is30minBasalRatesCapable = false;
pumpDescription.supportsTDDs = true;
pumpDescription.needsManualTDDLoad = true;
} }
@NonNull @NonNull

View file

@ -72,6 +72,9 @@ public class DanaRPlugin extends AbstractDanaRPlugin {
pumpDescription.isRefillingCapable = true; pumpDescription.isRefillingCapable = true;
pumpDescription.storesCarbInfo = true; pumpDescription.storesCarbInfo = true;
pumpDescription.supportsTDDs = true;
pumpDescription.needsManualTDDLoad = true;
} }
@Override @Override

View file

@ -73,6 +73,9 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
pumpDescription.isRefillingCapable = true; pumpDescription.isRefillingCapable = true;
pumpDescription.storesCarbInfo = true; pumpDescription.storesCarbInfo = true;
pumpDescription.supportsTDDs = true;
pumpDescription.needsManualTDDLoad = true;
} }
@Override @Override

View file

@ -111,6 +111,9 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
pumpDescription.isRefillingCapable = true; pumpDescription.isRefillingCapable = true;
pumpDescription.storesCarbInfo = true; pumpDescription.storesCarbInfo = true;
pumpDescription.supportsTDDs = true;
pumpDescription.needsManualTDDLoad = true;
} }
@Override @Override

View file

@ -73,6 +73,9 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
pumpDescription.isRefillingCapable = true; pumpDescription.isRefillingCapable = true;
pumpDescription.storesCarbInfo = true; pumpDescription.storesCarbInfo = true;
pumpDescription.supportsTDDs = true;
pumpDescription.needsManualTDDLoad = true;
} }
@Override @Override

View file

@ -142,6 +142,9 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai
pumpDescription.isRefillingCapable = true; pumpDescription.isRefillingCapable = true;
pumpDescription.storesCarbInfo = false; pumpDescription.storesCarbInfo = false;
pumpDescription.supportsTDDs = true;
pumpDescription.needsManualTDDLoad = false;
} }