From e2ddb484983d44b1cf500e8ae258ee1ab14f3c2a Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Thu, 20 Sep 2018 18:04:06 +0100 Subject: [PATCH] Some extension on VirtualPump for testing. --- .../plugins/Actions/ActionsFragment.java | 9 +++--- .../plugins/Actions/defs/CustomAction.java | 16 ++++++---- .../PumpVirtual/VirtualPumpFragment.java | 30 +++++++++++++++++++ 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java index 6a8422b2dd..dd48054738 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java @@ -254,15 +254,15 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL LinearLayout ll = (LinearLayout)actionsFragmentView.findViewById(R.id.action_buttons_layout); for (CustomAction customAction : customActions) { - // TODO - SingleClickButton btn = new SingleClickButton(MainApp.instance().getApplicationContext()); - btn.setText(customAction.getName()); + btn.setText(MainApp.gs(customAction.getName())); + // TODO style and drawableTop //btn.setTextAppearance(R.style.buttonStyle); + LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 0.5f); layoutParams.setMargins(10, 3, 10, 3); @@ -273,11 +273,10 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL ll.addView(btn); - this.currentCustomActions.put(customAction.getName(), customAction); + this.currentCustomActions.put(MainApp.gs(customAction.getName()), customAction); this.customButtons.add(btn); - // TODO add to map //