|
1 | 1 | package ui.pane |
2 | 2 |
|
3 | 3 | import androidx.compose.foundation.layout.* |
| 4 | +import androidx.compose.foundation.lazy.LazyColumn |
4 | 5 | import androidx.compose.foundation.rememberScrollState |
5 | 6 | import androidx.compose.foundation.verticalScroll |
6 | 7 | import androidx.compose.material3.* |
@@ -101,66 +102,76 @@ fun RequestPane( |
101 | 102 | .fillMaxSize() |
102 | 103 | .padding(it) |
103 | 104 | ) { |
104 | | - Column( |
| 105 | + LazyColumn( |
105 | 106 | modifier = Modifier |
106 | 107 | .verticalScroll(scrollState) |
107 | 108 | .padding(horizontal = 16.dp), |
108 | 109 | ) { |
109 | | - Spacer(modifier = Modifier.height(8.dp)) |
110 | | - Text( |
111 | | - text = "Request", |
112 | | - style = MaterialTheme.typography.titleLarge |
113 | | - ) |
114 | | - Spacer(modifier = Modifier.height(16.dp)) |
115 | | - Text( |
116 | | - text = "Header", |
117 | | - style = MaterialTheme.typography.titleMedium |
118 | | - ) |
119 | | - Spacer(modifier = Modifier.height(4.dp)) |
120 | | - Text( |
121 | | - modifier = Modifier.padding(horizontal = 16.dp), |
122 | | - text = transaction.requestHeader.orEmpty(), |
123 | | - style = MaterialTheme.typography.bodySmall |
124 | | - ) |
125 | | - Spacer(modifier = Modifier.height(16.dp)) |
126 | | - Text( |
127 | | - text = "Content", |
128 | | - style = MaterialTheme.typography.titleMedium, |
129 | | - ) |
130 | | - Spacer(modifier = Modifier.height(4.dp)) |
131 | | - Text( |
132 | | - modifier = Modifier.padding(horizontal = 16.dp), |
133 | | - text = transaction.requestBody.orEmpty(), |
134 | | - style = MaterialTheme.typography.bodySmall |
135 | | - ) |
136 | | - Spacer(modifier = Modifier.height(24.dp)) |
137 | | - Text( |
138 | | - text = "Response", |
139 | | - style = MaterialTheme.typography.titleLarge |
140 | | - ) |
141 | | - Spacer(modifier = Modifier.height(16.dp)) |
142 | | - Text( |
143 | | - text = "Header", |
144 | | - style = MaterialTheme.typography.titleMedium |
145 | | - ) |
146 | | - Spacer(modifier = Modifier.height(4.dp)) |
147 | | - Text( |
148 | | - modifier = Modifier.padding(horizontal = 16.dp), |
149 | | - text = transaction.responseHeader.orEmpty(), |
150 | | - style = MaterialTheme.typography.bodySmall |
151 | | - ) |
152 | | - Spacer(modifier = Modifier.height(16.dp)) |
153 | | - Text( |
154 | | - text = "Content", |
155 | | - style = MaterialTheme.typography.titleMedium |
156 | | - ) |
157 | | - Spacer(modifier = Modifier.height(4.dp)) |
158 | | - Text( |
159 | | - modifier = Modifier.padding(horizontal = 16.dp), |
160 | | - text = transaction.responseBody.orEmpty(), |
161 | | - style = MaterialTheme.typography.bodySmall |
162 | | - ) |
163 | | - Spacer(modifier = Modifier.height(16.dp)) |
| 110 | + item { |
| 111 | + Spacer(modifier = Modifier.height(8.dp)) |
| 112 | + } |
| 113 | + stickyHeader { |
| 114 | + Text( |
| 115 | + text = "Request", |
| 116 | + style = MaterialTheme.typography.titleLarge |
| 117 | + ) |
| 118 | + } |
| 119 | + item { |
| 120 | + Spacer(modifier = Modifier.height(16.dp)) |
| 121 | + Text( |
| 122 | + text = "Header", |
| 123 | + style = MaterialTheme.typography.titleMedium |
| 124 | + ) |
| 125 | + Spacer(modifier = Modifier.height(4.dp)) |
| 126 | + Text( |
| 127 | + modifier = Modifier.padding(horizontal = 16.dp), |
| 128 | + text = transaction.requestHeader.orEmpty(), |
| 129 | + style = MaterialTheme.typography.bodySmall |
| 130 | + ) |
| 131 | + Spacer(modifier = Modifier.height(16.dp)) |
| 132 | + Text( |
| 133 | + text = "Content", |
| 134 | + style = MaterialTheme.typography.titleMedium, |
| 135 | + ) |
| 136 | + Spacer(modifier = Modifier.height(4.dp)) |
| 137 | + Text( |
| 138 | + modifier = Modifier.padding(horizontal = 16.dp), |
| 139 | + text = transaction.requestBody.orEmpty(), |
| 140 | + style = MaterialTheme.typography.bodySmall |
| 141 | + ) |
| 142 | + Spacer(modifier = Modifier.height(24.dp)) |
| 143 | + } |
| 144 | + stickyHeader { |
| 145 | + Text( |
| 146 | + text = "Response", |
| 147 | + style = MaterialTheme.typography.titleLarge |
| 148 | + ) |
| 149 | + } |
| 150 | + item { |
| 151 | + Spacer(modifier = Modifier.height(16.dp)) |
| 152 | + Text( |
| 153 | + text = "Header", |
| 154 | + style = MaterialTheme.typography.titleMedium |
| 155 | + ) |
| 156 | + Spacer(modifier = Modifier.height(4.dp)) |
| 157 | + Text( |
| 158 | + modifier = Modifier.padding(horizontal = 16.dp), |
| 159 | + text = transaction.responseHeader.orEmpty(), |
| 160 | + style = MaterialTheme.typography.bodySmall |
| 161 | + ) |
| 162 | + Spacer(modifier = Modifier.height(16.dp)) |
| 163 | + Text( |
| 164 | + text = "Content", |
| 165 | + style = MaterialTheme.typography.titleMedium |
| 166 | + ) |
| 167 | + Spacer(modifier = Modifier.height(4.dp)) |
| 168 | + Text( |
| 169 | + modifier = Modifier.padding(horizontal = 16.dp), |
| 170 | + text = transaction.responseBody.orEmpty(), |
| 171 | + style = MaterialTheme.typography.bodySmall |
| 172 | + ) |
| 173 | + Spacer(modifier = Modifier.height(16.dp)) |
| 174 | + } |
164 | 175 | } |
165 | 176 | } |
166 | 177 | } |
|
0 commit comments