no recyclerview
This commit is contained in:
parent
ddda285f41
commit
82acb86d63
|
|
@ -33,7 +33,9 @@ public class BinanceFragment extends Fragment {
|
||||||
workerCardAdapter = new WorkerCardAdapter(binding.binanceCardsContainer);
|
workerCardAdapter = new WorkerCardAdapter(binding.binanceCardsContainer);
|
||||||
|
|
||||||
binanceViewModel.getWorkerData().observe(getViewLifecycleOwner(), workerDataList -> {
|
binanceViewModel.getWorkerData().observe(getViewLifecycleOwner(), workerDataList -> {
|
||||||
workerCardAdapter.updateData(workerDataList);
|
if (workerDataList != null) {
|
||||||
|
workerCardAdapter.updateData(workerDataList);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.example.dcav2gui.ui.exchanges;
|
package com.example.dcav2gui.ui.exchanges;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.lifecycle.AndroidViewModel;
|
import androidx.lifecycle.AndroidViewModel;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@ public class WorkerCardAdapter{
|
||||||
public void updateData(List<WorkerData> workerDataList) {
|
public void updateData(List<WorkerData> workerDataList) {
|
||||||
container.removeAllViews(); // Clear existing views
|
container.removeAllViews(); // Clear existing views
|
||||||
for (WorkerData worker : workerDataList) {
|
for (WorkerData worker : workerDataList) {
|
||||||
addCard(worker);
|
//addCard(worker);
|
||||||
|
View cardView = LayoutInflater.from(container.getContext()).inflate(R.layout.worker_card, container, false);
|
||||||
|
container.addView(cardView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="#FF0000"
|
android:visibility="visible"
|
||||||
android:visibility="visible">
|
android:scrollbars="vertical">
|
||||||
|
|
||||||
<!-- Each card will be added dynamically here -->
|
<!-- Each card will be added dynamically here -->
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue