...
This commit is contained in:
@@ -8,6 +8,7 @@ import androidx.compose.foundation.lazy.grid.GridCells
|
||||
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material.*
|
||||
@@ -22,6 +23,7 @@ import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import kotlinx.coroutines.launch
|
||||
import model.ConfigIndex
|
||||
import model.KisSession
|
||||
import service.AutoTradingManager
|
||||
@@ -29,6 +31,8 @@ import service.AutoTradingManager
|
||||
@OptIn(ExperimentalMaterialApi::class)
|
||||
@Composable
|
||||
fun TradingDecisionLog() {
|
||||
val listState = rememberLazyListState()
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
var searchQuery by remember { mutableStateOf("") }
|
||||
var selectedFilters by remember { mutableStateOf(setOf("전체")) }
|
||||
val filterOptions = listOf("전체", "BUY", "SELL", "HOLD", "SETTING","ANALYZER","PASS")
|
||||
@@ -64,8 +68,15 @@ fun TradingDecisionLog() {
|
||||
|
||||
Row(modifier = Modifier.fillMaxSize().background(Color(0xFFF2F2F2))) {
|
||||
Column(modifier = Modifier.weight(0.5f).padding(8.dp).fillMaxHeight().background(Color.White)) {
|
||||
Button(
|
||||
onClick = {
|
||||
coroutineScope.launch {
|
||||
// index 0으로 부드럽게 스크롤 (즉시 이동은 scrollToItem(0))
|
||||
listState.animateScrollToItem(0)
|
||||
}
|
||||
}
|
||||
) { Text("AI 자동매매 실시간 로그", style = MaterialTheme.typography.h6) }
|
||||
|
||||
Text("AI 자동매매 실시간 로그", style = MaterialTheme.typography.h6)
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp),
|
||||
horizontalArrangement = Arrangement.Start
|
||||
@@ -131,7 +142,9 @@ fun TradingDecisionLog() {
|
||||
Divider(Modifier.padding(bottom = 8.dp))
|
||||
|
||||
// [수정] filteredLogs를 사용하여 최신 로그가 위로 오게 표시
|
||||
LazyColumn(reverseLayout = true) {
|
||||
LazyColumn(
|
||||
state = listState,
|
||||
reverseLayout = true) {
|
||||
items(filteredLogs) { log ->
|
||||
Card(
|
||||
modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
|
||||
|
||||
Reference in New Issue
Block a user