-
-
Save LeonidIvankin/b4ea2806486dc441ff8004d2acae49b5 to your computer and use it in GitHub Desktop.
This file contains 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
package com.leonidivankin.draftandroid.articles.refactoring | |
import android.os.Bundle | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.platform.ComposeView | |
import androidx.compose.ui.unit.dp | |
import com.leonidivankin.draftandroid.R | |
class LegacyActivityInternal : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
title = "LegacyActivity, internal" | |
setContentView(R.layout.external_part) | |
findViewById<ComposeView>(R.id.composeViewInternalPart).setContent { | |
InternalPart() | |
} | |
} | |
} | |
@Composable | |
private fun InternalPart() { | |
Box( | |
Modifier | |
.fillMaxSize() | |
.background(color = Color(0xFF4CAF50)) | |
.padding(32.dp) | |
) { | |
Box( | |
Modifier | |
.fillMaxSize() | |
.background(color = Color(0xFFFF9800)) | |
.padding(32.dp) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment