File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed 
compose/snippets/src/main/java/com/example/compose/snippets/layouts Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ import androidx.compose.runtime.mutableStateOf
2828import  androidx.compose.runtime.remember 
2929import  androidx.compose.runtime.setValue 
3030import  androidx.compose.ui.unit.dp 
31- import  androidx.window.core.layout.WindowHeightSizeClass 
3231import  androidx.window.core.layout.WindowSizeClass 
3332
3433/* 
@@ -51,10 +50,10 @@ import androidx.window.core.layout.WindowSizeClass
5150fun  MyApp (
5251    windowSizeClass :  WindowSizeClass  = currentWindowAdaptiveInfo().windowSizeClass
5352) {
54-     //  Perform logic on the size class to decide  whether to show the top app bar.
55-     val  showTopAppBar =  windowSizeClass.windowHeightSizeClass  !=   WindowHeightSizeClass . COMPACT 
53+     //  Decide  whether to show the top app bar based on window size class .
54+     val  showTopAppBar =  windowSizeClass.isHeightAtLeastBreakpoint( WindowSizeClass . HEIGHT_DP_MEDIUM_LOWER_BOUND ) 
5655
57-     //  MyScreen knows nothing about window sizes, and performs  logic based on a Boolean  flag.
56+     //  MyScreen logic is  based on the showTopAppBar boolean  flag.
5857    MyScreen (
5958        showTopAppBar =  showTopAppBar,
6059        /*  ... */ 
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ androidx-navigation = "2.8.5"
1818androidx-paging  = " 3.3.5" 
1919androidx-test  = " 1.6.1" 
2020androidx-test-espresso  = " 3.6.1" 
21- androidx-window  = " 1.3.0 " 
21+ androidx-window  = " 1.4.0-alpha05 " 
2222androidxHiltNavigationCompose  = " 1.2.0" 
2323coil  = " 2.7.0" 
2424#  @keep
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments