This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Composable | |
| private fun SharedTransitionScope.GalleryScreen( | |
| state: PhotosUiState, | |
| onAction: (PhotosAction) -> Unit, | |
| onBackPress: () -> Unit, | |
| onNavigateToDetails: (String, List<String?>) -> Unit, | |
| onTopBarScrollOffsetChanged: (Float) -> Unit | |
| ) { | |
| val cellsList = remember(state.gridItemCount) { | |
| listOf( | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | -> generic fun to collect in a lifecycle aware manner | |
| @Composable | |
| fun <T : Any> SingleEventEffect( | |
| sideEffectFlow: Flow<T>, | |
| lifeCycleState: Lifecycle.State = Lifecycle.State.STARTED, | |
| collector: (T) -> Unit | |
| ) { | |
| val lifecycleOwner = LocalLifecycleOwner.current | |
| LaunchedEffect(sideEffectFlow) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | -keep class com.google.gson.internal.** { *; } | |
| -keep class com.google.gson.reflect.** { *; } | |
| -keep class com.google.gson.TypeAdapterFactory { *; } | |
| -keep class com.google.gson.TypeAdapter { *; } | |
| -keep class com.google.gson.reflect.TypeToken { *; } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ------------------------------- for collecting multiple flows in a lifecycle aware manner use repeatOnLifeCycle as it will cancel the collection when the app is in the STOP state and when i resume or start again it starts emition | |
| ------------------------ | |
| viewLifecycleOwner.lifecycleScope.launch { | |
| viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { | |
| launch { | |
| flow1.collect { /* Process the value. */ } | |
| } | |
| launch { | |
| flow2.collect { /* Process the value. */ } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1.switch statemnt java constant expression required fix -> android.nonFinalResIds=false | |
| 2.materialcard etc material require material theme :-> instead of change whole apps theme only add this to that material component ->android:theme="@style/Theme.MaterialComponents.Light" | |
| 3.ndk interfaces not resolved? -> buildFeatures.aidl = true | |
| 4.kaptExecutionFailed -> just update kapt deps like in hilt or room | |
| 5.Use dropUnlessResumed{ //navigate etc } in compose to avoid multi-opening screens | |
| 6.Cannot find a Java installation on your machine matching this tasks requirements:-> comment kotlin{jvmToolChain()} | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Extension function to convert SDP dimension to pixels | |
| fun Context.sdpToPx(sdpResourceId: Int): Float { | |
| return TypedValue.applyDimension( | |
| TypedValue.COMPLEX_UNIT_PX, | |
| resources.getDimension(sdpResourceId), | |
| resources.displayMetrics | |
| ) | |
| } | |
| fun Context.sdpToDp(sdpResourceId: Int): Float { |