diff --git a/app/release/app-release.apk b/app/release/app-release.apk new file mode 100644 index 0000000..6c1dc0c Binary files /dev/null and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..fd373b0 --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.mitchelbv.thuis_c", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-release.apk" + } + ], + "elementType": "File" +} \ No newline at end of file diff --git a/app/src/main/java/com/mitchelbv/thuis_c/ThuisDestinations.kt b/app/src/main/java/com/mitchelbv/thuis_c/ThuisDestinations.kt index 60a8153..6009bbc 100644 --- a/app/src/main/java/com/mitchelbv/thuis_c/ThuisDestinations.kt +++ b/app/src/main/java/com/mitchelbv/thuis_c/ThuisDestinations.kt @@ -3,12 +3,14 @@ package com.mitchelbv.thuis_c import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.DateRange import androidx.compose.material.icons.filled.Home +import androidx.compose.material.icons.filled.List import androidx.compose.material.icons.filled.ShoppingCart import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.vector.ImageVector import com.mitchelbv.thuis_c.ui.card.CardsScreen import com.mitchelbv.thuis_c.ui.feyenoord.FeyenoordScreen import com.mitchelbv.thuis_c.ui.home.HomeScreen +import com.mitchelbv.thuis_c.ui.recipe.RecipeScreen interface ThuisDestination { val route: String @@ -34,4 +36,10 @@ object Card : ThuisDestination { override val screen: @Composable () -> Unit = { CardsScreen() } } -val destinations = listOf(Home, FeyenoordMatches) \ No newline at end of file +object Recipe : ThuisDestination { + override val icon = Icons.Filled.List + override val route = "recipe" + override val screen: @Composable () -> Unit = { RecipeScreen() } +} + +val destinations = listOf(Home, Recipe, FeyenoordMatches) \ No newline at end of file diff --git a/app/src/main/java/com/mitchelbv/thuis_c/ui/home/Home.kt b/app/src/main/java/com/mitchelbv/thuis_c/ui/home/Home.kt index 4bb0c72..1bb1a1b 100644 --- a/app/src/main/java/com/mitchelbv/thuis_c/ui/home/Home.kt +++ b/app/src/main/java/com/mitchelbv/thuis_c/ui/home/Home.kt @@ -1,9 +1,23 @@ package com.mitchelbv.thuis_c.ui.home +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.tooling.preview.Preview +import com.mitchelbv.thuis_c.ui.theme.Typography @Composable fun HomeScreen() { - return Text(text = "Hello!") + Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center) { + Text("De thuis app!", style = Typography.body1) + + } +} + +@Preview(showBackground = true) +@Composable +fun HomeScreenPreview() { + HomeScreen() } \ No newline at end of file diff --git a/app/src/main/java/com/mitchelbv/thuis_c/ui/recipe/RecipeView.kt b/app/src/main/java/com/mitchelbv/thuis_c/ui/recipe/RecipeView.kt new file mode 100644 index 0000000..9e065f9 --- /dev/null +++ b/app/src/main/java/com/mitchelbv/thuis_c/ui/recipe/RecipeView.kt @@ -0,0 +1,43 @@ +package com.mitchelbv.thuis_c.ui.recipe + +import android.annotation.SuppressLint +import android.graphics.Bitmap +import android.util.Log +import android.view.ViewGroup +import android.webkit.WebView +import android.webkit.WebViewClient +import androidx.activity.compose.BackHandler +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.runtime.* +import androidx.compose.ui.Modifier +import androidx.compose.ui.viewinterop.AndroidView + +@SuppressLint("SetJavaScriptEnabled") +@Composable +fun RecipeScreen() { + var backEnabled by remember { mutableStateOf(true)} + var webView: WebView? = null + AndroidView(modifier = Modifier.fillMaxSize(), + factory = { context -> + WebView(context).apply { + layoutParams = ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT + ) + webViewClient = object : WebViewClient() { + override fun onPageFinished(view: WebView, url: String?) { + super.onPageFinished(view, url) + backEnabled = view.canGoBack() + } + } + settings.javaScriptEnabled = true + settings.domStorageEnabled = true + loadUrl("https://rs.mitchelbv.nl/") + webView = this + } + }, update = { webView = it} + ) + BackHandler(enabled = backEnabled) { + webView?.goBack() + } +} \ No newline at end of file