ui/material2/src/androidMain/kotlin/OpenSourceLicensesActivity.kt
changeset 57 5e249499bb3e
parent 39 b14d574cc2b1
child 87 d00b099d8ef3
equal deleted inserted replaced
56:555ffbecea10 57:5e249499bb3e
    22 package com.geekorum.aboutoss.ui.material
    22 package com.geekorum.aboutoss.ui.material
    23 
    23 
    24 import android.os.Bundle
    24 import android.os.Bundle
    25 import androidx.activity.compose.setContent
    25 import androidx.activity.compose.setContent
    26 import androidx.activity.viewModels
    26 import androidx.activity.viewModels
       
    27 import androidx.compose.foundation.isSystemInDarkTheme
    27 import androidx.compose.material.MaterialTheme
    28 import androidx.compose.material.MaterialTheme
       
    29 import androidx.compose.material.darkColors
       
    30 import androidx.compose.material.lightColors
    28 import androidx.compose.runtime.Composable
    31 import androidx.compose.runtime.Composable
    29 import com.geekorum.aboutoss.core.gms.GmsLicenseInfoRepository
    32 import com.geekorum.aboutoss.core.gms.GmsLicenseInfoRepository
    30 import com.geekorum.aboutoss.ui.common.BaseOpensourceLicenseActivity
    33 import com.geekorum.aboutoss.ui.common.BaseOpensourceLicenseActivity
    31 import com.geekorum.aboutoss.ui.common.Factory
    34 import com.geekorum.aboutoss.ui.common.Factory
    32 import com.geekorum.aboutoss.ui.common.OpenSourceLicensesViewModel
    35 import com.geekorum.aboutoss.ui.common.OpenSourceLicensesViewModel
    72         /**
    75         /**
    73          * The composable Theme function to set the theme of the UI in [OpenSourceLicensesActivity]
    76          * The composable Theme function to set the theme of the UI in [OpenSourceLicensesActivity]
    74          * Default to base material theme [MaterialTheme]
    77          * Default to base material theme [MaterialTheme]
    75          */
    78          */
    76         var themeProvider: @Composable (@Composable () -> Unit) -> Unit = { content ->
    79         var themeProvider: @Composable (@Composable () -> Unit) -> Unit = { content ->
    77             MaterialTheme(content = content)
    80             val colors = if (isSystemInDarkTheme()) darkColors() else lightColors()
       
    81             MaterialTheme(colors = colors, content = content)
    78         }
    82         }
    79     }
    83     }
    80 }
    84 }
    81 
    85