Menus prepopulated

This commit is contained in:
Nicolás Sánchez 2024-12-19 08:37:38 -03:00
parent 1057fd291e
commit a74b8c3493
3 changed files with 47 additions and 6 deletions

View File

@ -4,10 +4,10 @@
<selectionStates> <selectionStates>
<SelectionState runConfigName="app"> <SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" /> <option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-12-18T20:02:40.596168739Z"> <DropdownSelection timestamp="2024-12-19T11:30:32.480908965Z">
<Target type="DEFAULT_BOOT"> <Target type="DEFAULT_BOOT">
<handle> <handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=ZY22FN7MHQ" /> <DeviceId pluginId="LocalEmulator" identifier="path=/home/nicolas/.android/avd/Pixel_6_Pro_API_34.avd" />
</handle> </handle>
</Target> </Target>
</DropdownSelection> </DropdownSelection>

View File

@ -137,9 +137,50 @@ public class WorkerCardAdapter{
popupMenu.setOnMenuItemClickListener(new android.widget.PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new android.widget.PopupMenu.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.today_this_month_details) { if (item.getItemId() == R.id.workerMenuDetails) {
// Handle the "Details..." option System.err.println("Details... option clicked");
// For example, navigate to a details fragment return true;
} else if (item.getItemId() == R.id.addTrader) {
System.err.println("Add trader option clicked");
return true;
} else if (item.getItemId() == R.id.removeTrader) {
System.err.println("Remove trader option clicked");
return true;
} else if (item.getItemId() == R.id.restartTrader) {
System.err.println("Restart option clicked");
return true;
} else if (item.getItemId() == R.id.importTrader) {
System.err.println("Import option clicked");
return true;
} else if (item.getItemId() == R.id.togglePause) {
System.err.println("Toggle pause option clicked");
return true;
} else if (item.getItemId() == R.id.toggleAutoswitch) {
System.err.println("Toggle autoswitch option clicked");
return true;
} else if (item.getItemId() == R.id.toggleCleanup) {
System.err.println("Toggle cleanup option clicked");
return true;
} else if (item.getItemId() == R.id.toggleLastCall) {
System.err.println("Toggle last call option clicked");
return true;
} else if (item.getItemId() == R.id.switchToLong) {
System.err.println("Switch to long option clicked");
return true;
} else if (item.getItemId() == R.id.switchToShort) {
System.err.println("Switch to short option clicked");
return true;
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
System.err.println("Switch quote currency option clicked");
return true;
} else if (item.getItemId() == R.id.addSafetyOrders) {
System.err.println("Add safety orders option clicked");
return true;
} else if (item.getItemId() == R.id.addQuote) {
System.err.println("Add quote option clicked");
return true;
} else if (item.getItemId() == R.id.workerMenuLastCall) {
System.err.println("Worker menu last call option clicked");
return true; return true;
} }
return false; return false;

View File

@ -5,7 +5,7 @@
<item android:id="@+id/workerMenuTrader" <item android:id="@+id/workerMenuTrader"
android:title="Trader..."> android:title="Trader...">
<menu> <menu>
<item android:id="@+id/AddTrader" <item android:id="@+id/addTrader"
android:title="Add trader"/> android:title="Add trader"/>
<item android:id="@+id/removeTrader" <item android:id="@+id/removeTrader"
android:title="Remove trader"/> android:title="Remove trader"/>