WorkerCardAdapter cleanup

This commit is contained in:
Nicolás Sánchez 2024-12-18 08:58:00 -03:00
parent 9371aea39d
commit b297ea0212
2 changed files with 5 additions and 34 deletions

View File

@ -9,8 +9,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.dcav2gui.R;
import com.example.dcav2gui.ui.exchanges.WorkerData;
import java.util.List;
@ -20,7 +18,7 @@ import java.util.concurrent.TimeUnit;
public class WorkerCardAdapter{
private ViewGroup container;
private final ViewGroup container;
public WorkerCardAdapter(ViewGroup container) {
this.container = container;
@ -102,11 +100,11 @@ public class WorkerCardAdapter{
workerCardIcon.setVisibility(View.INVISIBLE);
}
if (worker.getStopWhenProfit()) {
workerStatusString.setText("LAST DEAL");
workerStatusString.setText(R.string.last_deal_notice);
} else if (worker.isPaused()) {
cardLayout.setBackgroundColor(Color.parseColor("#C5C281"));
} else if (worker.isAuto()) {
workerStatusString.setText("AUTO");
workerStatusString.setText(R.string.autoswitch_notice);
} else {
workerStatusString.setText("");
}
@ -139,33 +137,4 @@ public class WorkerCardAdapter{
statusBar.setText(statusBarText);
}
public static class WorkerViewHolder extends RecyclerView.ViewHolder {
TextView pair;
TextView safetyOrders;
TextView uptime;
TextView nextSoPrice;
TextView price;
TextView takeProfitPrice;
TextView percentage;
ProgressBar progressBar;
TextView workerStatusString;
ImageView workerCardIcon;
LinearLayout cardLayout;
public WorkerViewHolder(@NonNull View itemView) {
super(itemView);
pair = itemView.findViewById(R.id.workerCardPair);
safetyOrders = itemView.findViewById(R.id.workerCardSafetyOrders);
uptime = itemView.findViewById(R.id.workerCardUptime);
nextSoPrice = itemView.findViewById(R.id.workerCardNextSoPrice);
price = itemView.findViewById(R.id.workerCardCurrentPrice);
takeProfitPrice = itemView.findViewById(R.id.workerCardTakeProfitPrice);
percentage = itemView.findViewById(R.id.workerCardPercentageToDeal);
progressBar = itemView.findViewById(R.id.workerCardProgressBar);
workerStatusString = itemView.findViewById(R.id.workerCardStatusString);
workerCardIcon = itemView.findViewById(R.id.workerCardIcon);
cardLayout = itemView.findViewById(R.id.workerCard);
}
}
}

View File

@ -79,4 +79,6 @@
<string name="exchange_3_log_title" translatable="false">Kucoin log</string>
<string name="exchange_4_log_title" translatable="false">OKX log</string>
<string name="loading_message">Querying data sources…</string>
<string name="last_deal_notice">LAST DEAL</string>
<string name="autoswitch_notice">AUTO</string>
</resources>