Menus mostly populated
This commit is contained in:
parent
2b06374d74
commit
74d4194443
|
|
@ -9,6 +9,7 @@ import android.text.SpannableString;
|
|||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
@ -349,15 +350,26 @@ public class HomeFragment extends Fragment {
|
|||
private void showExchangePopupMenu(View anchorView, String exchange) {
|
||||
PopupMenu popupMenu = new PopupMenu(requireContext(), anchorView);
|
||||
popupMenu.getMenuInflater().inflate(R.menu.exchange_popup_menu, popupMenu.getMenu());
|
||||
|
||||
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
if (item.getItemId() == R.id.exchangeStatus) {
|
||||
if (item.getItemId() == R.id.exchangeMenuGlobalStatus) {
|
||||
// Handle the "Details..." option
|
||||
// For example, navigate to a details fragment
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeCommands) {
|
||||
} else if (item.getItemId() == R.id.exchangeMenuMissingPairs) {
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeMenuServerTime) {
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeMenuTraderTime) {
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeMenuPausedTraders) {
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeMenuConfigFile) {
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeMenuBacktests) {
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.exchangeMenuGetBalance) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,27 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/exchangeStatus"
|
||||
android:title="Status">
|
||||
<menu>
|
||||
<item android:id="@+id/status1"
|
||||
android:title="Status 1" />
|
||||
<item android:id="@+id/status2"
|
||||
android:title="Status 2" />
|
||||
<item android:id="@+id/status3"
|
||||
android:title="Status 3" />
|
||||
</menu>
|
||||
</item>
|
||||
<item
|
||||
android:id="@+id/exchangeCommands"
|
||||
android:title="Commands">
|
||||
<menu>
|
||||
<item android:id="@+id/command1"
|
||||
android:title="Command 1" />
|
||||
<item android:id="@+id/command2"
|
||||
android:title="Command 2" />
|
||||
<item android:id="@+id/command3"
|
||||
android:title="Command 3" />
|
||||
</menu>
|
||||
</item>
|
||||
<item android:id="@+id/exchangeMenuGlobalStatus"
|
||||
android:title="Global Status" />
|
||||
<item android:id="@+id/exchangeMenuMissingPairs"
|
||||
android:title="Missing pairs" />
|
||||
<item android:id="@+id/exchangeMenuServerTime"
|
||||
android:title="Server time" />
|
||||
<item android:id="@+id/exchangeMenuTraderTime"
|
||||
android:title="Trader time" />
|
||||
<item android:id="@+id/exchangeMenuPausedTraders"
|
||||
android:title="View paused traders" />
|
||||
<item android:id="@+id/exchangeMenuConfigFile"
|
||||
android:title="View config file" />
|
||||
<item android:id="@+id/exchangeMenuBacktests"
|
||||
android:title="Backtests" />
|
||||
<item android:id="@+id/exchangeMenuGetBalance"
|
||||
android:title="Get balance" />
|
||||
</menu>
|
||||
Loading…
Reference in New Issue