Archie
11/05/2021, 3:58 PMArchie
11/05/2021, 4:02 PMArchie
11/05/2021, 4:02 PMArchie
11/05/2021, 4:03 PMcommonArchie
11/05/2021, 4:03 PMcommonGenericScreen(
   ...
   title: @Composable () -> Unit, // a composable function to make it flexible
   ...
)Archie
11/05/2021, 4:03 PMcommonNavGraphfun GenericNavGraph(
   ...
   title: @Composable () -> Unit,
) {
   NavGraph(
      ...
   ) {
      composable("route") {
         GenericScreen(
            ...
            title = title
            ...
         )
      }
   }
}Archie
11/05/2021, 4:03 PMfun GenericNavGraph(
   ...
   title: @Composable () -> Unit,
   anotherBranding: @Composable () -> Unit,
   anotherOne: @Composable () -> Unit,
   nextOne: @Composable () -> Unit,
   ...
) {
   NavGraph(
      ...
   ) {
      composable("route") {
         GenericScreen(
            ...
            title = title
            ...
         )
      }
   }
   ....
}Archie
11/05/2021, 4:03 PMabstract class Branding {
    @Composable
    abstract fun Title()
    .... 
}NavGraphfun GenericNavGraph(
   ...
   branding: Branding = rememberBranding()
   ...
) {
   composable("route") {
         GenericScreen(
            ...
            title = branding.Title,
            ...
        )
   }
   ...
}Archie
11/05/2021, 4:12 PMjim
11/05/2021, 4:34 PMArchie
11/05/2021, 4:39 PM