Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'jetchat_alpha08' into dev_jetchat_androidview
Change-Id: I6c81d6ff4ab2e77f13dcce488ab208db30eb90db
  • Loading branch information
JoseAlcerreca committed Nov 30, 2020
commit c524526163a2abf78bbab1188fd1f98df8fa4d1e
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotEnabled
import androidx.compose.ui.test.hasAnyAncestor
import androidx.compose.ui.test.hasInputMethodsSupport
import androidx.compose.ui.test.hasLabel
import androidx.compose.ui.test.hasSetTextAction
import androidx.compose.ui.test.junit4.createAndroidComposeRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
package com.example.compose.jetchat.components

import androidx.annotation.DrawableRes
import androidx.compose.foundation.AmbientContentColor
import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
Expand All @@ -32,21 +30,24 @@ import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.preferredWidth
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.AmbientContentAlpha
import androidx.compose.material.AmbientContentColor
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Providers
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.imageResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.ui.tooling.preview.Preview
import com.example.compose.jetchat.R
import com.example.compose.jetchat.data.colleagueProfile
import com.example.compose.jetchat.data.meProfile
Expand Down Expand Up @@ -79,7 +80,7 @@ private fun DrawerHeader() {
}
@Composable
private fun DrawerItemHeader(text: String) {
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Text(text, style = MaterialTheme.typography.caption, modifier = Modifier.padding(16.dp))
}
}
Expand All @@ -101,14 +102,14 @@ private fun ChatItem(text: String, selected: Boolean, onChatClicked: () -> Unit)
.clickable(onClick = onChatClicked),
verticalAlignment = CenterVertically
) {
val mediumEmphasisOnSurface = AmbientEmphasisLevels.current.medium
.applyEmphasis(MaterialTheme.colors.onSurface)
val mediumEmphasisOnSurface =
MaterialTheme.colors.onSurface.copy(alpha = ContentAlpha.medium)
Icon(
vectorResource(id = R.drawable.ic_jetchat),
tint = if (selected) MaterialTheme.colors.primary else mediumEmphasisOnSurface,
modifier = Modifier.padding(8.dp)
)
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Text(
text,
style = MaterialTheme.typography.body2,
Expand All @@ -130,7 +131,7 @@ private fun ProfileItem(text: String, @DrawableRes profilePic: Int?, onProfileCl
.clickable(onClick = onProfileClicked),
verticalAlignment = CenterVertically
) {
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
val widthPaddingModifier = Modifier.preferredWidth(24.dp).padding(8.dp)
if (profilePic != null) {
Image(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ConversationFragment : Fragment() {
savedInstanceState: Bundle?
): View {
return ComposeView(context = requireContext()).apply {
ComposeView(requireContext()).setContent {
setContent {
Providers(BackPressedDispatcherAmbient provides requireActivity()) {
JetchatTheme {
ConversationContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ object Libs {
const val materialIconsExtended = "androidx.compose.material:material-icons-extended:$version"
const val runtime = "androidx.compose.runtime:runtime:$version"
const val runtimeLivedata = "androidx.compose.runtime:runtime-livedata:$version"
const val tooling = "androidx.ui:ui-tooling:$version"
const val test = "androidx.compose.test:test-core:$version"
const val uiTest = "androidx.ui:ui-test:$version"
const val tooling = "androidx.compose.ui:ui-tooling:$version"
const val test = "androidx.compose.ui:ui-test:$version"
const val uiTest = "androidx.compose.ui:ui-test-junit4:$version"
const val uiUtil = "androidx.compose.ui:ui-util:${version}"
const val viewBinding = "androidx.compose.ui:ui-viewbinding:$version"
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.