working? worker commands
This commit is contained in:
parent
0ad6500257
commit
fe95c69201
|
|
@ -10,13 +10,16 @@ import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Switch;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
@ -153,6 +156,7 @@ public class WorkerInterface {
|
||||||
return valueToReturn;
|
return valueToReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject addTrader(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject addTrader(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -195,6 +199,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject removeTrader(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject removeTrader(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -237,6 +242,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject restartTrader(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject restartTrader(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -279,6 +285,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject importTrader(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject importTrader(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -321,6 +328,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject togglePause(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject togglePause(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -363,6 +371,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject toggleAutoswitch(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject toggleAutoswitch(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -405,6 +414,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject toggleCleanup(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject toggleCleanup(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -490,6 +500,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject switchToLong(String exchange, String pair, boolean calculateProfits, boolean retry) throws IOException {
|
public static JsonObject switchToLong(String exchange, String pair, boolean calculateProfits, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -537,6 +548,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject switchToShort(String exchange, String pair, boolean retry) throws IOException {
|
public static JsonObject switchToShort(String exchange, String pair, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -579,6 +591,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject switchQuoteCurrency(String exchange, String pair, String targetQuoteCurrency, boolean retry) throws IOException {
|
public static JsonObject switchQuoteCurrency(String exchange, String pair, String targetQuoteCurrency, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -622,6 +635,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject addSafetyOrders(String exchange, String pair, int amount, boolean retry) throws IOException {
|
public static JsonObject addSafetyOrders(String exchange, String pair, int amount, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -665,6 +679,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JsonObject addQuote(String exchange, String pair, double amount, boolean retry) throws IOException {
|
public static JsonObject addQuote(String exchange, String pair, double amount, boolean retry) throws IOException {
|
||||||
String[] pairBaseAndQuote = pair.split("/");
|
String[] pairBaseAndQuote = pair.split("/");
|
||||||
String base = pairBaseAndQuote[0];
|
String base = pairBaseAndQuote[0];
|
||||||
|
|
@ -708,6 +723,7 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void showToggleDialog(JsonObject result, Context context) {
|
public static void showToggleDialog(JsonObject result, Context context) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
|
||||||
|
|
@ -719,6 +735,7 @@ public class WorkerInterface {
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void sendTogglePause(String exchange, String pair, Context context) {
|
public static void sendTogglePause(String exchange, String pair, Context context) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
@ -731,6 +748,7 @@ public class WorkerInterface {
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void sendToggleAutoswitch(String exchange, String pair, Context context) {
|
public static void sendToggleAutoswitch(String exchange, String pair, Context context) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
@ -755,6 +773,7 @@ public class WorkerInterface {
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void sendToggleLastCall(String exchange, String pair, Context context) {
|
public static void sendToggleLastCall(String exchange, String pair, Context context) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
@ -767,6 +786,67 @@ public class WorkerInterface {
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendSwitchToLongCall(String exchange, String pair, Context context) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
builder.setTitle("Switch "+ pair + " to long mode?");
|
||||||
|
|
||||||
|
builder.setPositiveButton("Switch to long", (dialog, which) -> {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
JsonObject response = WorkerInterface.switchToLong(exchange, pair, true,true);
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
showToggleDialog(response, context);
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// Show an error dialog on the main thread
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
AlertDialog.Builder errorBuilder = new AlertDialog.Builder(context);
|
||||||
|
errorBuilder.setTitle("Error");
|
||||||
|
errorBuilder.setMessage("Failed to switch to long: " + e.getMessage());
|
||||||
|
errorBuilder.setPositiveButton("OK", null);
|
||||||
|
errorBuilder.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.cancel());
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendSwitchToShortCall(String exchange, String pair, Context context) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
builder.setTitle("Switch "+ pair + " to short mode?");
|
||||||
|
|
||||||
|
builder.setPositiveButton("Switch to short", (dialog, which) -> {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
JsonObject response = WorkerInterface.switchToShort(exchange, pair, true);
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
showToggleDialog(response, context);
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// Show an error dialog on the main thread
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
AlertDialog.Builder errorBuilder = new AlertDialog.Builder(context);
|
||||||
|
errorBuilder.setTitle("Error");
|
||||||
|
errorBuilder.setMessage("Failed to switch to short: " + e.getMessage());
|
||||||
|
errorBuilder.setPositiveButton("OK", null);
|
||||||
|
errorBuilder.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.cancel());
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void sendAddTraderCall(String exchange, Context context) {
|
public static void sendAddTraderCall(String exchange, Context context) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle("Enter pair to add to "+ exchange);
|
builder.setTitle("Enter pair to add to "+ exchange);
|
||||||
|
|
@ -803,6 +883,64 @@ public class WorkerInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendRemoveTraderCall(String exchange, String pair, Context context) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
builder.setTitle("Remove "+ pair + " from instance?");
|
||||||
|
builder.setPositiveButton("Remove trader", (dialog, which) -> {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
JsonObject response = WorkerInterface.removeTrader(exchange, pair, true);
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
showToggleDialog(response, context);
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// Show an error dialog on the main thread
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
AlertDialog.Builder errorBuilder = new AlertDialog.Builder(context);
|
||||||
|
errorBuilder.setTitle("Error");
|
||||||
|
errorBuilder.setMessage("Failed to remove trader: " + e.getMessage());
|
||||||
|
errorBuilder.setPositiveButton("OK", null);
|
||||||
|
errorBuilder.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.cancel());
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendRestartTraderCall(String exchange, String pair, Context context) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
builder.setTitle("Restart "+ pair + "?");
|
||||||
|
builder.setPositiveButton("Restart trader", (dialog, which) -> {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
JsonObject response = WorkerInterface.restartTrader(exchange, pair, true);
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
showToggleDialog(response, context);
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// Show an error dialog on the main thread
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
AlertDialog.Builder errorBuilder = new AlertDialog.Builder(context);
|
||||||
|
errorBuilder.setTitle("Error");
|
||||||
|
errorBuilder.setMessage("Failed to restart trader: " + e.getMessage());
|
||||||
|
errorBuilder.setPositiveButton("OK", null);
|
||||||
|
errorBuilder.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.cancel());
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void sendImportTraderCall(String exchange, Context context) {
|
public static void sendImportTraderCall(String exchange, Context context) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle("Enter pair to import to "+ exchange);
|
builder.setTitle("Enter pair to import to "+ exchange);
|
||||||
|
|
@ -841,7 +979,7 @@ public class WorkerInterface {
|
||||||
|
|
||||||
public static void sendSwitchQuoteCurrencyCall(String exchange, String pair, Context context) {
|
public static void sendSwitchQuoteCurrencyCall(String exchange, String pair, Context context) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle("Enter new quote currency "+ exchange);
|
builder.setTitle("Enter new quote currency of"+ pair);
|
||||||
|
|
||||||
final EditText input = new EditText(context);
|
final EditText input = new EditText(context);
|
||||||
input.setInputType(InputType.TYPE_CLASS_TEXT);
|
input.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
|
|
@ -874,6 +1012,78 @@ public class WorkerInterface {
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendAddSafetyOrdersCall(String exchange, String pair, Context context) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
builder.setTitle("Add safety orders to "+ pair);
|
||||||
|
|
||||||
|
final EditText input = new EditText(context);
|
||||||
|
input.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
|
input.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
|
||||||
|
builder.setView(input);
|
||||||
|
|
||||||
|
builder.setPositiveButton("Add safety orders", (dialog, which) -> {
|
||||||
|
final int amountToAdd = Integer.parseInt(input.getText().toString());
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
JsonObject response = WorkerInterface.addSafetyOrders(exchange, pair, amountToAdd,true);
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
showToggleDialog(response, context);
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// Show an error dialog on the main thread
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
AlertDialog.Builder errorBuilder = new AlertDialog.Builder(context);
|
||||||
|
errorBuilder.setTitle("Error");
|
||||||
|
errorBuilder.setMessage("Failed to add safety orders: " + e.getMessage());
|
||||||
|
errorBuilder.setPositiveButton("OK", null);
|
||||||
|
errorBuilder.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.cancel());
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendAddQuoteCall(String exchange, String pair, Context context) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
|
builder.setTitle("Add quote currency to "+ pair);
|
||||||
|
|
||||||
|
final EditText input = new EditText(context);
|
||||||
|
input.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
|
input.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
|
||||||
|
builder.setView(input);
|
||||||
|
|
||||||
|
builder.setPositiveButton("Add quote", (dialog, which) -> {
|
||||||
|
final double amountToAdd = Double.parseDouble(input.getText().toString());
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
JsonObject response = WorkerInterface.addQuote(exchange, pair, amountToAdd,true);
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
showToggleDialog(response, context);
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// Show an error dialog on the main thread
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
AlertDialog.Builder errorBuilder = new AlertDialog.Builder(context);
|
||||||
|
errorBuilder.setTitle("Error");
|
||||||
|
errorBuilder.setMessage("Failed to add quote currency: " + e.getMessage());
|
||||||
|
errorBuilder.setPositiveButton("OK", null);
|
||||||
|
errorBuilder.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.cancel());
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
public static void fetchWorkerStats(String exchange, String pair, Context context) {
|
public static void fetchWorkerStats(String exchange, String pair, Context context) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,10 @@ public class BinanceFragment extends Fragment implements WorkerCardAdapter.OnCar
|
||||||
WorkerInterface.sendAddTraderCall("binance",getContext());
|
WorkerInterface.sendAddTraderCall("binance",getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.removeTrader) {
|
} else if (item.getItemId() == R.id.removeTrader) {
|
||||||
System.err.println(pair + " Remove trader option clicked");
|
WorkerInterface.sendRemoveTraderCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.restartTrader) {
|
} else if (item.getItemId() == R.id.restartTrader) {
|
||||||
System.err.println(pair + " Restart option clicked");
|
WorkerInterface.sendRestartTraderCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.importTrader) {
|
} else if (item.getItemId() == R.id.importTrader) {
|
||||||
WorkerInterface.sendImportTraderCall("binance",getContext());
|
WorkerInterface.sendImportTraderCall("binance",getContext());
|
||||||
|
|
@ -100,19 +100,19 @@ public class BinanceFragment extends Fragment implements WorkerCardAdapter.OnCar
|
||||||
WorkerInterface.sendToggleLastCall("binance", pair, getContext());
|
WorkerInterface.sendToggleLastCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToLong) {
|
} else if (item.getItemId() == R.id.switchToLong) {
|
||||||
System.err.println(pair + " Switch to long option clicked");
|
WorkerInterface.sendSwitchToLongCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToShort) {
|
} else if (item.getItemId() == R.id.switchToShort) {
|
||||||
System.err.println(pair + " Switch to short option clicked");
|
WorkerInterface.sendSwitchToShortCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
||||||
WorkerInterface.sendSwitchQuoteCurrencyCall("binance", pair, getContext());
|
WorkerInterface.sendSwitchQuoteCurrencyCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
||||||
System.err.println(pair + " Add safety orders option clicked");
|
WorkerInterface.sendAddSafetyOrdersCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addQuote) {
|
} else if (item.getItemId() == R.id.addQuote) {
|
||||||
System.err.println(pair + " Add quote option clicked");
|
WorkerInterface.sendAddQuoteCall("binance", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -93,19 +93,19 @@ public class GateioFragment extends Fragment implements WorkerCardAdapter.OnCard
|
||||||
WorkerInterface.sendToggleLastCall("gateio", pair, getContext());
|
WorkerInterface.sendToggleLastCall("gateio", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToLong) {
|
} else if (item.getItemId() == R.id.switchToLong) {
|
||||||
System.err.println(pair + " Switch to long option clicked");
|
WorkerInterface.sendSwitchToLongCall("gateio", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToShort) {
|
} else if (item.getItemId() == R.id.switchToShort) {
|
||||||
System.err.println(pair + " Switch to short option clicked");
|
WorkerInterface.sendSwitchToShortCall("gateio", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
||||||
WorkerInterface.sendSwitchQuoteCurrencyCall("binance", pair, getContext());
|
WorkerInterface.sendSwitchQuoteCurrencyCall("gateio", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
||||||
System.err.println(pair + " Add safety orders option clicked");
|
WorkerInterface.sendAddSafetyOrdersCall("gateio", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addQuote) {
|
} else if (item.getItemId() == R.id.addQuote) {
|
||||||
System.err.println(pair + " Add quote option clicked");
|
WorkerInterface.sendAddQuoteCall("gateio", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -93,19 +93,19 @@ public class KucoinFragment extends Fragment implements WorkerCardAdapter.OnCard
|
||||||
WorkerInterface.sendToggleLastCall("kucoin", pair, getContext());
|
WorkerInterface.sendToggleLastCall("kucoin", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToLong) {
|
} else if (item.getItemId() == R.id.switchToLong) {
|
||||||
System.err.println(pair + " Switch to long option clicked");
|
WorkerInterface.sendSwitchToLongCall("kucoin", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToShort) {
|
} else if (item.getItemId() == R.id.switchToShort) {
|
||||||
System.err.println(pair + " Switch to short option clicked");
|
WorkerInterface.sendSwitchToShortCall("kucoin", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
||||||
WorkerInterface.sendSwitchQuoteCurrencyCall("binance", pair, getContext());
|
WorkerInterface.sendSwitchQuoteCurrencyCall("kucoin", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
||||||
System.err.println(pair + " Add safety orders option clicked");
|
WorkerInterface.sendAddSafetyOrdersCall("kucoin", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addQuote) {
|
} else if (item.getItemId() == R.id.addQuote) {
|
||||||
System.err.println(pair + " Add quote option clicked");
|
WorkerInterface.sendAddQuoteCall("kucoin", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -93,19 +93,19 @@ public class OkxFragment extends Fragment implements WorkerCardAdapter.OnCardLon
|
||||||
WorkerInterface.sendToggleLastCall("okex", pair, getContext());
|
WorkerInterface.sendToggleLastCall("okex", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToLong) {
|
} else if (item.getItemId() == R.id.switchToLong) {
|
||||||
System.err.println(pair + " Switch to long option clicked");
|
WorkerInterface.sendSwitchToLongCall("okex", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchToShort) {
|
} else if (item.getItemId() == R.id.switchToShort) {
|
||||||
System.err.println(pair + " Switch to short option clicked");
|
WorkerInterface.sendSwitchToShortCall("okex", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
} else if (item.getItemId() == R.id.switchQuoteCurrency) {
|
||||||
WorkerInterface.sendSwitchQuoteCurrencyCall("binance", pair, getContext());
|
WorkerInterface.sendSwitchQuoteCurrencyCall("okex", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
} else if (item.getItemId() == R.id.addSafetyOrders) {
|
||||||
System.err.println(pair + " Add safety orders option clicked");
|
WorkerInterface.sendAddSafetyOrdersCall("okex", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.addQuote) {
|
} else if (item.getItemId() == R.id.addQuote) {
|
||||||
System.err.println(pair + " Add quote option clicked");
|
WorkerInterface.sendAddQuoteCall("okex", pair, getContext());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue