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

Update baseline profiles #65

Merged
merged 2 commits into from
Jun 29, 2024
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 @@ -13,21 +13,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:OptIn(ExperimentalComposeUiApi::class)

package com.github.skydoves.colorpickercomposedemo

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.darkColors
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTagsAsResourceId

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
MaterialTheme(colors = darkColors()) {
MainScreen()
Box(
modifier = Modifier
.fillMaxSize()
.semantics { testTagsAsResourceId = true },
) {
MainScreen()
}
}
}
}
Expand Down
13,681 changes: 13,681 additions & 0 deletions app/src/androidRelease/generated/baselineProfiles/baseline-prof.txt

Large diffs are not rendered by default.

13,681 changes: 13,681 additions & 0 deletions app/src/androidRelease/generated/baselineProfiles/startup-prof.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ fun MainScreen() {
topBar = { MainToolBar() },
) { innerPadding ->
NavHost(
navController,
modifier = Modifier.padding(innerPadding),
navController = navController,
startDestination = Screen.ImageColorPicker.route,
Modifier.padding(innerPadding),
) {
composable(Screen.ImageColorPicker.route) {
ImageColorPickerScreen()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand Down Expand Up @@ -62,6 +63,7 @@ fun ImageColorPickerScreen() {

ImageColorPicker(
modifier = Modifier
.testTag("ImageColorPicker")
.fillMaxWidth()
.height(200.dp)
.padding(10.dp),
Expand All @@ -78,6 +80,7 @@ fun ImageColorPickerScreen() {

AlphaSlider(
modifier = Modifier
.testTag("ImageColorPicker_AlphaSlider")
.fillMaxWidth()
.padding(10.dp)
.height(35.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ class BaselineProfileGenerator {
}

private fun UiDevice.testColorPickerDemoScenario(): Boolean {
waitForObject(By.res("HSV")).click()
waitForObject(By.res("ImageColorPicker")).click()

waitForIdle()

return wait(Until.hasObject(By.res("HSV_AlphaSlider")), 5_000)
return wait(Until.hasObject(By.res("ImageColorPicker_AlphaSlider")), 5_000)
}

private fun UiDevice.waitForObject(selector: BySelector, timeout: Long = 5_000): UiObject2 {
Expand Down
11 changes: 9 additions & 2 deletions colorpicker-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@ android {
lint {
abortOnError = false
}
}

dependencies {
baselineProfile(project(":benchmark"))
}

baselineProfile {
baselineProfileOutputDir = "../../src/androidMain"
baselineProfile {
baselineProfileOutputDir = "../../src/androidMain"
filter {
include("com.github.skydoves.colorpicker.compose.**")
}
}

Expand Down
229 changes: 229 additions & 0 deletions colorpicker-compose/src/androidMain/baseline-prof.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ android.defaults.buildfeatures.shaders=false
android.nonTransitiveRClass=true

# MPP
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
Expand Down
Loading