Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate SmallTopAppBar to TopAppBar #104

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ package io.getstream.whatsappclone.ui
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.material.TopAppBar
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SmallTopAppBar
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -35,7 +34,7 @@ import io.getstream.whatsappclone.designsystem.theme.WhatsAppCloneComposeTheme

@Composable
fun WhatsAppTopBar() {
SmallTopAppBar(
TopAppBar(
modifier = Modifier.fillMaxWidth(),
title = {
Text(
Expand All @@ -61,9 +60,7 @@ fun WhatsAppTopBar() {
contentDescription = null
)
},
colors = TopAppBarDefaults.smallTopAppBarColors(
containerColor = MaterialTheme.colorScheme.primary
)
backgroundColor = MaterialTheme.colorScheme.primary
)
}

Expand Down
7 changes: 0 additions & 7 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ android {
}

targetProjectPath = ":app"
experimentalProperties["android.experimental.self-instrumenting"] = true
}

dependencies {
Expand All @@ -55,9 +54,3 @@ dependencies {
implementation(libs.androidx.benchmark.macro)
implementation(libs.androidx.profileinstaller)
}

androidComponents {
beforeVariants(selector().all()) {
it.enabled = it.buildType == "benchmark"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@

package io.getstream.whatsappclone.benchmark

import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.benchmark.macro.junit4.BaselineProfileRule
import org.junit.Rule
import org.junit.Test

/**
* Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`.
*/
@ExperimentalBaselineProfilesApi
@RequiresApi(Build.VERSION_CODES.P)
class BaselineProfileGenerator {
@get:Rule
val baselineProfileRule = BaselineProfileRule()

@Test
fun startup() =
baselineProfileRule.collectBaselineProfile(
baselineProfileRule.collect(
packageName = "io.getstream.whatsappclone"
) {
pressHome()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ import io.getstream.chat.android.client.models.Channel
@Immutable
sealed interface UiState {
data class Success(val data: Extensive) : UiState
object Loading : UiState
object Error : UiState
data object Loading : UiState
data object Error : UiState
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun WhatsAppCallHistoryTopBar(
contentDescription = null
)
},
contentColor = MaterialTheme.colorScheme.primary
backgroundColor = MaterialTheme.colorScheme.primary
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.TopAppBar
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SmallTopAppBar
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand All @@ -46,7 +45,7 @@ fun WhatsAppMessageTopBar(
messageUiState: WhatsAppMessageUiState,
onBackClick: () -> Unit
) {
SmallTopAppBar(
TopAppBar(
modifier = Modifier.fillMaxWidth(),
navigationIcon = {
Icon(
Expand Down Expand Up @@ -89,9 +88,7 @@ fun WhatsAppMessageTopBar(
contentDescription = null
)
},
colors = TopAppBarDefaults.smallTopAppBarColors(
containerColor = MaterialTheme.colorScheme.primary
)
backgroundColor = MaterialTheme.colorScheme.primary
)
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ androidDesugarJdkLibs = "1.1.5"
androidGradlePlugin = "8.1.2"
androidxActivity = "1.8.0"
androidxAppCompat = "1.6.1"
androidxCompose = "1.5.3"
androidxCompose = "1.5.4"
androidxComposeCompiler = "1.5.3"
androidxComposeMaterial3 = "1.0.0-alpha13"
androidxComposeConstraintLayout = "1.0.1"
androidxComposeNavigation = "2.5.3"
androidxCore = "1.12.0"
androidxHiltNavigationCompose = "1.0.0"
androidxLifecycle = "2.6.2"
androidxMacroBenchmark = "1.1.1"
androidxMacroBenchmark = "1.2.0"
androidxNavigation = "2.5.0"
androidxProfileinstaller = "1.3.1"
androidxStartup = "1.1.1"
Expand Down