1 /* 2 * Copyright 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.compose.material3.adaptive.navigationsuite 18 19 import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi 20 import androidx.compose.material3.adaptive.Posture 21 import androidx.compose.material3.adaptive.WindowAdaptiveInfo 22 import androidx.window.core.layout.WindowSizeClass 23 import androidx.window.core.layout.WindowSizeClass.Companion.HEIGHT_DP_EXPANDED_LOWER_BOUND 24 import androidx.window.core.layout.WindowSizeClass.Companion.HEIGHT_DP_MEDIUM_LOWER_BOUND 25 import androidx.window.core.layout.WindowSizeClass.Companion.WIDTH_DP_EXPANDED_LOWER_BOUND 26 import androidx.window.core.layout.WindowSizeClass.Companion.WIDTH_DP_EXTRA_LARGE_LOWER_BOUND 27 import androidx.window.core.layout.WindowSizeClass.Companion.WIDTH_DP_MEDIUM_LOWER_BOUND 28 import com.google.common.truth.Truth.assertThat 29 import org.junit.Test 30 import org.junit.runner.RunWith 31 import org.junit.runners.JUnit4 32 33 @OptIn(ExperimentalMaterial3AdaptiveApi::class) 34 @RunWith(JUnit4::class) 35 class NavigationSuiteScaffoldTest { 36 37 @Test 38 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_compactWidth_compactHeightnull39 fun navigationLayoutTypeTest_compactWidth_compactHeight() { 40 val mockAdaptiveInfo = 41 createMockAdaptiveInfo(windowSizeClass = WindowSizeClass.compute(COMPACT, COMPACT)) 42 43 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 44 .isEqualTo(NavigationSuiteType.ShortNavigationBarCompact) 45 } 46 47 @Test 48 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_compactWidth_mediumHeightnull49 fun navigationLayoutTypeTest_compactWidth_mediumHeight() { 50 val mockAdaptiveInfo = 51 createMockAdaptiveInfo( 52 windowSizeClass = 53 WindowSizeClass.compute(COMPACT, HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat()) 54 ) 55 56 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 57 .isEqualTo(NavigationSuiteType.ShortNavigationBarCompact) 58 } 59 60 @Test 61 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_compactWidth_expandedHeightnull62 fun navigationLayoutTypeTest_compactWidth_expandedHeight() { 63 val mockAdaptiveInfo = 64 createMockAdaptiveInfo( 65 windowSizeClass = 66 WindowSizeClass.compute(COMPACT, HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat()) 67 ) 68 69 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 70 .isEqualTo(NavigationSuiteType.ShortNavigationBarCompact) 71 } 72 73 @Test 74 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_mediumWidth_compactHeightnull75 fun navigationLayoutTypeTest_mediumWidth_compactHeight() { 76 val mockAdaptiveInfo = 77 createMockAdaptiveInfo( 78 windowSizeClass = 79 WindowSizeClass.compute(WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), COMPACT) 80 ) 81 82 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 83 .isEqualTo(NavigationSuiteType.ShortNavigationBarMedium) 84 } 85 86 @Test 87 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_mediumWidth_mediumHeightnull88 fun navigationLayoutTypeTest_mediumWidth_mediumHeight() { 89 val mockAdaptiveInfo = 90 createMockAdaptiveInfo( 91 windowSizeClass = 92 WindowSizeClass.compute( 93 WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), 94 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 95 ) 96 ) 97 98 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 99 .isEqualTo(NavigationSuiteType.WideNavigationRailCollapsed) 100 } 101 102 @Test 103 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_mediumWidth_expandedHeightnull104 fun navigationLayoutTypeTest_mediumWidth_expandedHeight() { 105 val mockAdaptiveInfo = 106 createMockAdaptiveInfo( 107 windowSizeClass = 108 WindowSizeClass.compute( 109 WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), 110 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 111 ) 112 ) 113 114 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 115 .isEqualTo(NavigationSuiteType.WideNavigationRailCollapsed) 116 } 117 118 @Test 119 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_expandedWidth_compactHeightnull120 fun navigationLayoutTypeTest_expandedWidth_compactHeight() { 121 val mockAdaptiveInfo = 122 createMockAdaptiveInfo( 123 windowSizeClass = 124 WindowSizeClass.compute(WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), COMPACT) 125 ) 126 127 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 128 .isEqualTo(NavigationSuiteType.ShortNavigationBarMedium) 129 } 130 131 @Test 132 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_expandedWidth_mediumHeightnull133 fun navigationLayoutTypeTest_expandedWidth_mediumHeight() { 134 val mockAdaptiveInfo = 135 createMockAdaptiveInfo( 136 windowSizeClass = 137 WindowSizeClass.compute( 138 WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), 139 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 140 ) 141 ) 142 143 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 144 .isEqualTo(NavigationSuiteType.WideNavigationRailCollapsed) 145 } 146 147 @Test 148 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_expandedWidth_expandedHeightnull149 fun navigationLayoutTypeTest_expandedWidth_expandedHeight() { 150 val mockAdaptiveInfo = 151 createMockAdaptiveInfo( 152 windowSizeClass = 153 WindowSizeClass.compute( 154 WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), 155 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 156 ) 157 ) 158 159 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 160 .isEqualTo(NavigationSuiteType.WideNavigationRailCollapsed) 161 } 162 163 @Test 164 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_extraLargeWidth_compactHeightnull165 fun navigationLayoutTypeTest_extraLargeWidth_compactHeight() { 166 val mockAdaptiveInfo = 167 createMockAdaptiveInfo( 168 windowSizeClass = 169 WindowSizeClass.compute(WIDTH_DP_EXTRA_LARGE_LOWER_BOUND.toFloat(), COMPACT) 170 ) 171 172 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 173 .isEqualTo(NavigationSuiteType.ShortNavigationBarMedium) 174 } 175 176 @Test 177 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_extraLargeWidth_mediumHeightnull178 fun navigationLayoutTypeTest_extraLargeWidth_mediumHeight() { 179 val mockAdaptiveInfo = 180 createMockAdaptiveInfo( 181 windowSizeClass = 182 WindowSizeClass.compute( 183 WIDTH_DP_EXTRA_LARGE_LOWER_BOUND.toFloat(), 184 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 185 ) 186 ) 187 188 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 189 .isEqualTo(NavigationSuiteType.WideNavigationRailCollapsed) 190 } 191 192 @Test 193 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_extraLargeWidth_expandedHeightnull194 fun navigationLayoutTypeTest_extraLargeWidth_expandedHeight() { 195 val mockAdaptiveInfo = 196 createMockAdaptiveInfo( 197 windowSizeClass = 198 WindowSizeClass.compute( 199 WIDTH_DP_EXTRA_LARGE_LOWER_BOUND.toFloat(), 200 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 201 ) 202 ) 203 204 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 205 .isEqualTo(NavigationSuiteType.WideNavigationRailCollapsed) 206 } 207 208 @Test 209 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_tableTop_compactnull210 fun navigationLayoutTypeTest_tableTop_compact() { 211 val mockAdaptiveInfo = 212 createMockAdaptiveInfo( 213 windowSizeClass = WindowSizeClass.compute(COMPACT, COMPACT), 214 isTableTop = true 215 ) 216 217 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 218 .isEqualTo(NavigationSuiteType.ShortNavigationBarCompact) 219 } 220 221 @Test 222 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_tableTop_mediumnull223 fun navigationLayoutTypeTest_tableTop_medium() { 224 val mockAdaptiveInfo = 225 createMockAdaptiveInfo( 226 windowSizeClass = 227 WindowSizeClass.compute( 228 WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), 229 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 230 ), 231 isTableTop = true 232 ) 233 234 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 235 .isEqualTo(NavigationSuiteType.ShortNavigationBarMedium) 236 } 237 238 @Test 239 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_tableTop_expandednull240 fun navigationLayoutTypeTest_tableTop_expanded() { 241 val mockAdaptiveInfo = 242 createMockAdaptiveInfo( 243 windowSizeClass = 244 WindowSizeClass.compute( 245 WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), 246 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 247 ), 248 isTableTop = true 249 ) 250 251 assertThat(NavigationSuiteScaffoldDefaults.navigationSuiteType(mockAdaptiveInfo)) 252 .isEqualTo(NavigationSuiteType.ShortNavigationBarMedium) 253 } 254 255 @Test 256 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_compactWidth_compactHeightnull257 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_compactWidth_compactHeight() { 258 val mockAdaptiveInfo = 259 createMockAdaptiveInfo(windowSizeClass = WindowSizeClass.compute(COMPACT, COMPACT)) 260 261 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 262 .isEqualTo(NavigationSuiteType.NavigationBar) 263 } 264 265 @Test 266 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_compactWidth_mediumHeightnull267 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_compactWidth_mediumHeight() { 268 val mockAdaptiveInfo = 269 createMockAdaptiveInfo( 270 windowSizeClass = 271 WindowSizeClass.compute(COMPACT, HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat()) 272 ) 273 274 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 275 .isEqualTo(NavigationSuiteType.NavigationBar) 276 } 277 278 @Test 279 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_compactWidth_expandedHeightnull280 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_compactWidth_expandedHeight() { 281 val mockAdaptiveInfo = 282 createMockAdaptiveInfo( 283 windowSizeClass = 284 WindowSizeClass.compute(COMPACT, HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat()) 285 ) 286 287 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 288 .isEqualTo(NavigationSuiteType.NavigationBar) 289 } 290 291 @Test 292 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_mediumWidth_compactHeightnull293 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_mediumWidth_compactHeight() { 294 val mockAdaptiveInfo = 295 createMockAdaptiveInfo( 296 windowSizeClass = 297 WindowSizeClass.compute(WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), COMPACT) 298 ) 299 300 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 301 .isEqualTo(NavigationSuiteType.NavigationBar) 302 } 303 304 @Test 305 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_mediumWidth_mediumHeightnull306 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_mediumWidth_mediumHeight() { 307 val mockAdaptiveInfo = 308 createMockAdaptiveInfo( 309 windowSizeClass = 310 WindowSizeClass.compute( 311 WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), 312 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 313 ) 314 ) 315 316 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 317 .isEqualTo(NavigationSuiteType.NavigationRail) 318 } 319 320 @Test 321 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_mediumWidth_expandedHeightnull322 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_mediumWidth_expandedHeight() { 323 val mockAdaptiveInfo = 324 createMockAdaptiveInfo( 325 windowSizeClass = 326 WindowSizeClass.compute( 327 WIDTH_DP_MEDIUM_LOWER_BOUND.toFloat(), 328 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 329 ) 330 ) 331 332 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 333 .isEqualTo(NavigationSuiteType.NavigationRail) 334 } 335 336 @Test 337 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_expandedWidth_compactHeightnull338 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_expandedWidth_compactHeight() { 339 val mockAdaptiveInfo = 340 createMockAdaptiveInfo( 341 windowSizeClass = 342 WindowSizeClass.compute(WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), COMPACT) 343 ) 344 345 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 346 .isEqualTo(NavigationSuiteType.NavigationBar) 347 } 348 349 @Test 350 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_expandedWidth_mediumHeightnull351 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_expandedWidth_mediumHeight() { 352 val mockAdaptiveInfo = 353 createMockAdaptiveInfo( 354 windowSizeClass = 355 WindowSizeClass.compute( 356 WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), 357 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 358 ) 359 ) 360 361 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 362 .isEqualTo(NavigationSuiteType.NavigationRail) 363 } 364 365 @Test 366 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_expandedWidth_expandedHeightnull367 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_expandedWidth_expandedHeight() { 368 val mockAdaptiveInfo = 369 createMockAdaptiveInfo( 370 windowSizeClass = 371 WindowSizeClass.compute( 372 WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), 373 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 374 ) 375 ) 376 377 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 378 .isEqualTo(NavigationSuiteType.NavigationRail) 379 } 380 381 @Test 382 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_extraLargeWidth_compactHeightnull383 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_extraLargeWidth_compactHeight() { 384 val mockAdaptiveInfo = 385 createMockAdaptiveInfo( 386 windowSizeClass = 387 WindowSizeClass.compute(WIDTH_DP_EXTRA_LARGE_LOWER_BOUND.toFloat(), COMPACT) 388 ) 389 390 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 391 .isEqualTo(NavigationSuiteType.NavigationBar) 392 } 393 394 @Test 395 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_extraLargeWidth_mediumHeightnull396 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_extraLargeWidth_mediumHeight() { 397 val mockAdaptiveInfo = 398 createMockAdaptiveInfo( 399 windowSizeClass = 400 WindowSizeClass.compute( 401 WIDTH_DP_EXTRA_LARGE_LOWER_BOUND.toFloat(), 402 HEIGHT_DP_MEDIUM_LOWER_BOUND.toFloat() 403 ) 404 ) 405 406 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 407 .isEqualTo(NavigationSuiteType.NavigationRail) 408 } 409 410 @Test 411 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_extraLargeWidth_expandedHeightnull412 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_extraLargeWidth_expandedHeight() { 413 val mockAdaptiveInfo = 414 createMockAdaptiveInfo( 415 windowSizeClass = 416 WindowSizeClass.compute( 417 WIDTH_DP_EXTRA_LARGE_LOWER_BOUND.toFloat(), 418 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 419 ) 420 ) 421 422 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 423 .isEqualTo(NavigationSuiteType.NavigationRail) 424 } 425 426 @Test 427 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_tableTopnull428 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_tableTop() { 429 val mockAdaptiveInfo = 430 createMockAdaptiveInfo( 431 windowSizeClass = WindowSizeClass.compute(COMPACT, COMPACT), 432 isTableTop = true 433 ) 434 435 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 436 .isEqualTo(NavigationSuiteType.NavigationBar) 437 } 438 439 @Test 440 @Suppress("DEPRECATION") // WindowSizeClass#compute is deprecated navigationLayoutTypeTest_calculateFromAdaptiveInfo_tableTop_expandedWidthnull441 fun navigationLayoutTypeTest_calculateFromAdaptiveInfo_tableTop_expandedWidth() { 442 val mockAdaptiveInfo = 443 createMockAdaptiveInfo( 444 windowSizeClass = 445 WindowSizeClass.compute( 446 WIDTH_DP_EXPANDED_LOWER_BOUND.toFloat(), 447 HEIGHT_DP_EXPANDED_LOWER_BOUND.toFloat() 448 ), 449 isTableTop = true 450 ) 451 452 assertThat(NavigationSuiteScaffoldDefaults.calculateFromAdaptiveInfo(mockAdaptiveInfo)) 453 .isEqualTo(NavigationSuiteType.NavigationBar) 454 } 455 createMockAdaptiveInfonull456 private fun createMockAdaptiveInfo( 457 windowSizeClass: WindowSizeClass, 458 isTableTop: Boolean = false 459 ): WindowAdaptiveInfo { 460 return WindowAdaptiveInfo(windowSizeClass, Posture(isTabletop = isTableTop)) 461 } 462 } 463 464 private const val COMPACT = 400f 465