Skip to content

Commit

Permalink
Move Text into the material package and add BasicText
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreckYe committed Dec 9, 2022
1 parent 2cea7ae commit 8539226
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package com.huanshankeji.compose
import androidx.compose.runtime.Composable

@Composable
expect fun Text(text: String)
expect fun BasicText(text: String)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.huanshankeji.compose

import androidx.compose.runtime.Composable
import org.jetbrains.compose.web.dom.Text

@Composable
actual fun BasicText(text: String) =
Text(text)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package com.huanshankeji.compose
import androidx.compose.runtime.Composable

@Composable
actual fun Text(text: String) =
org.jetbrains.compose.web.dom.Text(text)
actual fun BasicText(text: String) =
androidx.compose.foundation.text.BasicText(text)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.huanshankeji.compose.material

import androidx.compose.runtime.Composable

@Composable
expect fun Text(text: String)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.huanshankeji.compose.material

import androidx.compose.runtime.Composable
import com.huanshankeji.compose.BasicText

@Composable
actual fun Text(text: String) =
BasicText(text)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.huanshankeji.compose
package com.huanshankeji.compose.material

import androidx.compose.runtime.Composable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.huanshankeji.compose.material.demo

import androidx.compose.runtime.*
import com.huanshankeji.compose.Text
import com.huanshankeji.compose.BasicText
import com.huanshankeji.compose.layout.Box
import com.huanshankeji.compose.material.Button
import com.huanshankeji.compose.material.Card
import com.huanshankeji.compose.material.Text
import com.huanshankeji.compose.material.TopAppBarScaffold
import com.huanshankeji.compose.material.icon.MaterialIcons
import com.huanshankeji.compose.ui.unit.dpOrPx
Expand All @@ -24,6 +25,9 @@ fun App() {
padding(16.dpOrPx)
}
}) {
BasicText("basic text")
Text("Material text")

var count by remember { mutableStateOf(0) }
Button({ count++ }) {
Label(count.toString())
Expand Down

0 comments on commit 8539226

Please sign in to comment.