Missing strings in FillMenuActivity

This commit is contained in:
Philoul 2019-12-06 09:16:20 +01:00
parent ff96770df9
commit d50f01af3d
2 changed files with 24 additions and 22 deletions

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.interaction.menus;
import android.content.Intent;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.aaps;
import info.nightscout.androidaps.data.ListenerService;
import info.nightscout.androidaps.interaction.actions.FillActivity;
import info.nightscout.androidaps.interaction.utils.MenuListActivity;
@ -16,22 +17,22 @@ public class FillMenuActivity extends MenuListActivity {
@Override
protected String[] getElements() {
return new String[]{
getResources().getString(R.string.action_preset_1),
getResources().getString(R.string.action_preset_2),
getResources().getString(R.string.action_preset_3),
getResources().getString(R.string.action_free_amount)
aaps.gs(R.string.action_preset_1),
aaps.gs(R.string.action_preset_2),
aaps.gs(R.string.action_preset_3),
aaps.gs(R.string.action_free_amount)
};
}
@Override
protected void doAction(String action) {
if ("Preset 1".equals(action)) {
if (aaps.gs(R.string.action_preset_1).equals(action)) {
ListenerService.initiateAction(this, "fillpreset 1");
} else if ("Preset 2".equals(action)) {
} else if (aaps.gs(R.string.action_preset_2).equals(action)) {
ListenerService.initiateAction(this, "fillpreset 2");
} else if ("Preset 3".equals(action)) {
} else if (aaps.gs(R.string.action_preset_3).equals(action)) {
ListenerService.initiateAction(this, "fillpreset 3");
} else if ("Free amount".equals(action)) {
} else if (aaps.gs(R.string.action_free_amount).equals(action)) {
Intent intent = new Intent(this, FillActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);

View file

@ -8,6 +8,7 @@ import android.preference.PreferenceManager;
import java.util.Vector;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.aaps;
import info.nightscout.androidaps.data.ListenerService;
import info.nightscout.androidaps.interaction.AAPSPreferences;
import info.nightscout.androidaps.interaction.actions.AcceptActivity;
@ -47,13 +48,13 @@ public class MainMenuActivity extends MenuListActivity {
boolean showWizard = sp.getBoolean("showWizard", true);
Vector<String> menuitems = new Vector<String>();
menuitems.add(getResources().getString(R.string.menu_tempt));
if(showWizard) menuitems.add(getResources().getString(R.string.menu_wizard));
menuitems.add(getResources().getString(R.string.menu_ecarb));
menuitems.add(getResources().getString(R.string.menu_bolus));
menuitems.add(getResources().getString(R.string.menu_settings));
menuitems.add(getResources().getString(R.string.menu_status));
if (showPrimeFill) menuitems.add(getResources().getString(R.string.menu_prime_fill));
menuitems.add(aaps.gs(R.string.menu_tempt));
if(showWizard) menuitems.add(aaps.gs(R.string.menu_wizard));
menuitems.add(aaps.gs(R.string.menu_ecarb));
menuitems.add(aaps.gs(R.string.menu_bolus));
menuitems.add(aaps.gs(R.string.menu_settings));
menuitems.add(aaps.gs(R.string.menu_status));
if (showPrimeFill) menuitems.add(aaps.gs(R.string.menu_prime_fill));
return menuitems.toArray(new String[menuitems.size()]);
}
@ -63,33 +64,33 @@ public class MainMenuActivity extends MenuListActivity {
Intent intent;
if (getResources().getString(R.string.menu_settings).equals(action)) {
if (aaps.gs(R.string.menu_settings).equals(action)) {
intent = new Intent(this, AAPSPreferences.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
} else if ("Re-Sync".equals(action)) {
ListenerService.requestData(this);
} else if (getResources().getString(R.string.menu_tempt).equals(action)) {
} else if (aaps.gs(R.string.menu_tempt).equals(action)) {
intent = new Intent(this, TempTargetActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
} else if (getResources().getString(R.string.menu_bolus).equals(action)) {
} else if (aaps.gs(R.string.menu_bolus).equals(action)) {
intent = new Intent(this, BolusActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
} else if (getResources().getString(R.string.menu_wizard).equals(action)) {
} else if (aaps.gs(R.string.menu_wizard).equals(action)) {
intent = new Intent(this, WizardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
} else if (getResources().getString(R.string.menu_status).equals(action)) {
} else if (aaps.gs(R.string.menu_status).equals(action)) {
intent = new Intent(this, StatusMenuActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
} else if (getResources().getString(R.string.menu_prime_fill).equals(action)) {
} else if (aaps.gs(R.string.menu_prime_fill).equals(action)) {
intent = new Intent(this, FillMenuActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
} else if (getResources().getString(R.string.menu_ecarb).equals(action)) {
} else if (aaps.gs(R.string.menu_ecarb).equals(action)) {
intent = new Intent(this, ECarbActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);