Hide TDD button if pump doesn't support them

Hide reload button if pump doesn't need it
This commit is contained in:
TebbeUbben 2018-04-08 17:54:16 +02:00
parent 2fee7f3186
commit b3c1bf6e7d
9 changed files with 26 additions and 1 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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