diff --git a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java index 78e1531..cd07e4a 100644 --- a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java +++ b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java @@ -418,6 +418,8 @@ public class InstanceInterface { JsonObject value = jsonObject.get(key).getAsJsonObject(); try { boolean isShort = value.has("is_short") && value.get("is_short").isJsonPrimitive() && value.get("is_short").getAsBoolean(); + boolean isBoosted = value.has("is_boosted") && value.get("is_boosted").isJsonPrimitive() && value.get("is_boosted").getAsBoolean(); + boolean isAutoSwitchEnabled = value.has("is_auto_switch_enabled") && value.get("is_auto_switch_enabled").isJsonPrimitive() && value.get("is_auto_switch_enabled").getAsBoolean(); boolean stopWhenProfit = value.has("stop_when_profit") && value.get("stop_when_profit").isJsonPrimitive() && value.get("stop_when_profit").getAsBoolean(); double orderSize = value.has("order_size") && value.get("order_size").isJsonPrimitive() ? value.get("order_size").getAsDouble() : 0.0; double quoteSpent = value.has("quote_spent") && value.get("quote_spent").isJsonPrimitive() ? value.get("quote_spent").getAsDouble() : 0.0; @@ -464,6 +466,8 @@ public class InstanceInterface { valueToReturn.add(new WorkerStatsData( key, isShort, + isBoosted, + isAutoSwitchEnabled, stopWhenProfit, orderSize, quoteSpent, @@ -635,6 +639,7 @@ public class InstanceInterface { false, false, false, + workerStatsData.getStopWhenProfit(), workerStatsData.getOldLongDictionary()); workerDataList.add(workerData); } @@ -788,6 +793,8 @@ public class InstanceInterface { public static class WorkerStatsData { private final String pair; private final boolean isShort; + private final boolean isBoosted; + private final boolean autoSwitchEnabled; private final boolean stopWhenProfit; private final double orderSize; private final double quoteSpent; @@ -818,9 +825,11 @@ public class InstanceInterface { private final OldLongDictionary oldLongDictionary; //Change type private final String statusString; - public WorkerStatsData(String pair, boolean isShort, boolean stopWhenProfit, double orderSize, double quoteSpent, double baseBought, int soAmount, int numberOfSafetyOrders, int tpMode, String profitTable, double startTime, double startPrice, double dealStartTime, double dealUptime, double totalUptime, double price, double takeProfitPrice, double nextSoPrice, String tpOrderId, JsonObject takeProfitOrder, String soOrderId, JsonObject safetyOrder, double feesPaidInBase, double feesPaidInQuote, double partialProfit, String safetyPriceTable, String dealOrderHistory, String pauseReason, OldLongDictionary oldLong, String statusString) { + public WorkerStatsData(String pair, boolean isShort, boolean isBoosted, boolean autoSwitchEnabled, boolean stopWhenProfit, double orderSize, double quoteSpent, double baseBought, int soAmount, int numberOfSafetyOrders, int tpMode, String profitTable, double startTime, double startPrice, double dealStartTime, double dealUptime, double totalUptime, double price, double takeProfitPrice, double nextSoPrice, String tpOrderId, JsonObject takeProfitOrder, String soOrderId, JsonObject safetyOrder, double feesPaidInBase, double feesPaidInQuote, double partialProfit, String safetyPriceTable, String dealOrderHistory, String pauseReason, OldLongDictionary oldLong, String statusString) { this.pair = pair; this.isShort = isShort; + this.isBoosted = isBoosted; + this.autoSwitchEnabled = autoSwitchEnabled; this.stopWhenProfit = stopWhenProfit; this.orderSize = orderSize; this.quoteSpent = quoteSpent; @@ -853,6 +862,8 @@ public class InstanceInterface { public String getPair() {return pair; } public boolean getIsShort() { return isShort; } + public boolean getIsBoosted() { return isBoosted; } + public boolean getAutoSwitchEnabled() { return autoSwitchEnabled; } public boolean getStopWhenProfit() { return stopWhenProfit; } public double getOrderSize() { return orderSize; } public double getQuoteSpent() { return quoteSpent; } diff --git a/app/src/main/java/com/example/dcav2gui/ui/exchanges/WorkerData.java b/app/src/main/java/com/example/dcav2gui/ui/exchanges/WorkerData.java index ec430a8..e4d0581 100644 --- a/app/src/main/java/com/example/dcav2gui/ui/exchanges/WorkerData.java +++ b/app/src/main/java/com/example/dcav2gui/ui/exchanges/WorkerData.java @@ -16,11 +16,12 @@ public class WorkerData { private final boolean isBoosted; private final boolean isAuto; private final boolean isPaused; + private final boolean stopWhenProfit; private final InstanceInterface.OldLongDictionary oldLongDictionary; public WorkerData(String pair, int amountOfSafetyOrders, int maxSafetyOrders, double uptime, double nextSoPrice, double price, double takeProfitPrice, double totalAmountOfQuote, double totalAmountOfBase, boolean isShort, - boolean isBoosted, boolean isAuto, boolean isPaused, + boolean isBoosted, boolean isAuto, boolean isPaused, boolean stopWhenProfit, InstanceInterface.OldLongDictionary oldLongDictionary) { // TODO: Add total_amount_of_quote and total_amount_of_base @@ -37,6 +38,7 @@ public class WorkerData { this.isBoosted = isBoosted; this.isAuto = isAuto; this.isPaused = isPaused; + this.stopWhenProfit = stopWhenProfit; this.oldLongDictionary = oldLongDictionary; } @@ -53,5 +55,6 @@ public class WorkerData { public boolean isBoosted() { return isBoosted; } public boolean isAuto() { return isAuto; } public boolean isPaused() { return isPaused; } + public boolean getStopWhenProfit() { return stopWhenProfit; } public InstanceInterface.OldLongDictionary getOldLongDictionary() { return oldLongDictionary; } } \ No newline at end of file diff --git a/app/src/main/java/com/example/dcav2gui/ui/exchanges/adapters/WorkerCardAdapter.java b/app/src/main/java/com/example/dcav2gui/ui/exchanges/adapters/WorkerCardAdapter.java index b141c47..a5ad77d 100644 --- a/app/src/main/java/com/example/dcav2gui/ui/exchanges/adapters/WorkerCardAdapter.java +++ b/app/src/main/java/com/example/dcav2gui/ui/exchanges/adapters/WorkerCardAdapter.java @@ -1,23 +1,15 @@ package com.example.dcav2gui.ui.exchanges.adapters; import static java.lang.Math.abs; - -import android.annotation.SuppressLint; -import android.content.Context; import android.graphics.Color; -import android.graphics.drawable.ClipDrawable; -import android.graphics.drawable.GradientDrawable; -import android.graphics.drawable.LayerDrawable; -import android.graphics.drawable.shapes.Shape; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.appcompat.view.menu.MenuView; -import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.example.dcav2gui.R; import com.example.dcav2gui.ui.exchanges.WorkerData; @@ -25,7 +17,6 @@ import java.util.List; import java.util.Locale; import java.util.concurrent.TimeUnit; -import android.graphics.drawable.Drawable; public class WorkerCardAdapter extends RecyclerView.Adapter { @@ -45,8 +36,6 @@ public class WorkerCardAdapter extends RecyclerView.Adapter=breakEven){ @@ -95,7 +100,7 @@ public class WorkerCardAdapter extends RecyclerView.Adapter + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4ed6eee..b0697e0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -17,5 +17,6 @@ #006A00 #FF424242 #FFF6F6F6 + #C5C281 #FF000000 \ No newline at end of file