Skip to content

Commit

Permalink
Add material theme component (#103)
Browse files Browse the repository at this point in the history
* Add material theme component

* bump

* Add git info

* revert
  • Loading branch information
trevor-e authored Nov 1, 2023
1 parent c07b8d4 commit 5471c5d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions snapshots/sample/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ plugins {

emerge {
apiToken.set(System.getenv("EMERGE_API_TOKEN"))

vcs {
gitHub {
repoName.set("emerge-android")
repoOwner.set("EmergeTools")
}
}
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import com.emergetools.snapshots.sample.ui.theme.SnapshotsSampleTheme

@Preview(uiMode = UI_MODE_NIGHT_YES)
@Preview(uiMode = UI_MODE_NIGHT_NO)
Expand All @@ -38,3 +40,22 @@ fun ThemedComponent() {
)
}
}

@Preview(uiMode = UI_MODE_NIGHT_YES)
@Preview(uiMode = UI_MODE_NIGHT_NO)
@Composable
fun MaterialThemedComponent() {
SnapshotsSampleTheme {
Box(
modifier = Modifier
.fillMaxSize()
.background(color = MaterialTheme.colorScheme.background)
) {
Text(
text = "This is a themed component",
color = MaterialTheme.colorScheme.primary,
modifier = Modifier.align(Alignment.Center)
)
}
}
}

0 comments on commit 5471c5d

Please sign in to comment.