Autoswitch multiplier displayed

This commit is contained in:
Nicolás Sánchez 2024-12-27 10:24:33 -03:00
parent 45ee4fefb0
commit c7ba216b34
2 changed files with 11 additions and 3 deletions

View File

@ -145,7 +145,15 @@ public class WorkerCardAdapter{
cardLayout.setBackgroundColor(Color.parseColor("#C5C281")); cardLayout.setBackgroundColor(Color.parseColor("#C5C281"));
workerStatusString.setVisibility(View.INVISIBLE); workerStatusString.setVisibility(View.INVISIBLE);
} else if (worker.isAuto()) { } else if (worker.isAuto()) {
workerStatusString.setText(R.string.autoswitch_notice); String stringToDisplay = "AUTO";
if (worker.getPrice()!=0) {
double percentageToSwitch = (worker.getOldLongDictionary().getTpPrice()-worker.getPrice())*100/worker.getPrice();
int multiplier = (int) (percentageToSwitch/100+1);
if (multiplier>1) {
stringToDisplay = stringToDisplay + " x" + multiplier;
}
}
workerStatusString.setText(stringToDisplay);
workerStatusString.setVisibility(View.VISIBLE); workerStatusString.setVisibility(View.VISIBLE);
} else { } else {
workerStatusString.setText(""); workerStatusString.setText("");

View File

@ -1,9 +1,9 @@
<resources> <resources>
<string name="app_name" translatable="false">DCAv2GUI</string> <string name="app_name" translatable="false">DCAv2GUI</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title" translatable="false">DCAv2</string> <string name="nav_header_title" translatable="false">DCAv2</string>
<string name="nav_header_subtitle">Version 2024.12.26</string> <string name="nav_header_subtitle">Version 2024.12.26</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_desc">Navigation header</string> <string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>