Change-Id: I04c00490e97e0c41f5cc285df6a62014e6b12e47feature/list-detail-pane-scaffold
@ -0,0 +1,26 @@
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
registries: "*"
|
||||
labels: [ "version update" ]
|
||||
groups:
|
||||
kotlin-ksp-compose:
|
||||
patterns:
|
||||
- "org.jetbrains.kotlin:*"
|
||||
- "org.jetbrains.kotlin.jvm"
|
||||
- "com.google.devtools.ksp"
|
||||
- "androidx.compose.compiler:compiler"
|
||||
open-pull-requests-limit: 10
|
||||
registries:
|
||||
maven-google:
|
||||
type: "maven-repository"
|
||||
url: "https://maven.google.com"
|
||||
replaces-base: true
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base", "group:all", ":dependencyDashboard", "schedule:daily"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchPackageNames": ["org.objenesis:objenesis"],
|
||||
"allowedVersions": "<=2.6"
|
||||
},
|
||||
{
|
||||
"matchPackageNames": ["com.google.protobuf"],
|
||||
"allowedVersions": "<=0.8.19"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
androidx.activity:activity-compose:1.8.0
|
||||
androidx.activity:activity-ktx:1.8.0
|
||||
androidx.activity:activity:1.8.0
|
||||
androidx.annotation:annotation-experimental:1.3.1
|
||||
androidx.annotation:annotation-jvm:1.7.0
|
||||
androidx.annotation:annotation:1.7.0
|
||||
androidx.appcompat:appcompat-resources:1.6.1
|
||||
androidx.arch.core:core-common:2.2.0
|
||||
androidx.arch.core:core-runtime:2.2.0
|
||||
androidx.autofill:autofill:1.0.0
|
||||
androidx.browser:browser:1.6.0
|
||||
androidx.collection:collection-jvm:1.3.0
|
||||
androidx.collection:collection:1.3.0
|
||||
androidx.compose.animation:animation-android:1.5.4
|
||||
androidx.compose.animation:animation-core-android:1.5.4
|
||||
androidx.compose.animation:animation-core:1.5.4
|
||||
androidx.compose.animation:animation:1.5.4
|
||||
androidx.compose.foundation:foundation-android:1.5.4
|
||||
androidx.compose.foundation:foundation-layout-android:1.5.4
|
||||
androidx.compose.foundation:foundation-layout:1.5.4
|
||||
androidx.compose.foundation:foundation:1.5.4
|
||||
androidx.compose.material3:material3:1.1.2
|
||||
androidx.compose.material:material-icons-core-android:1.5.4
|
||||
androidx.compose.material:material-icons-core:1.5.4
|
||||
androidx.compose.material:material-icons-extended-android:1.5.4
|
||||
androidx.compose.material:material-icons-extended:1.5.4
|
||||
androidx.compose.material:material-ripple-android:1.5.4
|
||||
androidx.compose.material:material-ripple:1.5.4
|
||||
androidx.compose.runtime:runtime-android:1.5.4
|
||||
androidx.compose.runtime:runtime-saveable-android:1.5.4
|
||||
androidx.compose.runtime:runtime-saveable:1.5.4
|
||||
androidx.compose.runtime:runtime:1.5.4
|
||||
androidx.compose.ui:ui-android:1.5.4
|
||||
androidx.compose.ui:ui-geometry-android:1.5.4
|
||||
androidx.compose.ui:ui-geometry:1.5.4
|
||||
androidx.compose.ui:ui-graphics-android:1.5.4
|
||||
androidx.compose.ui:ui-graphics:1.5.4
|
||||
androidx.compose.ui:ui-text-android:1.5.4
|
||||
androidx.compose.ui:ui-text:1.5.4
|
||||
androidx.compose.ui:ui-tooling-preview-android:1.5.4
|
||||
androidx.compose.ui:ui-tooling-preview:1.5.4
|
||||
androidx.compose.ui:ui-unit-android:1.5.4
|
||||
androidx.compose.ui:ui-unit:1.5.4
|
||||
androidx.compose.ui:ui-util-android:1.5.4
|
||||
androidx.compose.ui:ui-util:1.5.4
|
||||
androidx.compose.ui:ui:1.5.4
|
||||
androidx.compose:compose-bom:2023.10.01
|
||||
androidx.concurrent:concurrent-futures:1.1.0
|
||||
androidx.core:core-ktx:1.12.0
|
||||
androidx.core:core:1.12.0
|
||||
androidx.customview:customview-poolingcontainer:1.0.0
|
||||
androidx.customview:customview:1.0.0
|
||||
androidx.emoji2:emoji2:1.4.0
|
||||
androidx.exifinterface:exifinterface:1.3.6
|
||||
androidx.fragment:fragment:1.5.1
|
||||
androidx.interpolator:interpolator:1.0.0
|
||||
androidx.lifecycle:lifecycle-common-java8:2.6.2
|
||||
androidx.lifecycle:lifecycle-common:2.6.2
|
||||
androidx.lifecycle:lifecycle-livedata-core:2.6.2
|
||||
androidx.lifecycle:lifecycle-livedata:2.6.2
|
||||
androidx.lifecycle:lifecycle-process:2.6.2
|
||||
androidx.lifecycle:lifecycle-runtime-ktx:2.6.2
|
||||
androidx.lifecycle:lifecycle-runtime:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel:2.6.2
|
||||
androidx.loader:loader:1.0.0
|
||||
androidx.metrics:metrics-performance:1.0.0-alpha04
|
||||
androidx.profileinstaller:profileinstaller:1.3.1
|
||||
androidx.savedstate:savedstate-ktx:1.2.1
|
||||
androidx.savedstate:savedstate:1.2.1
|
||||
androidx.startup:startup-runtime:1.1.1
|
||||
androidx.tracing:tracing:1.0.0
|
||||
androidx.vectordrawable:vectordrawable-animated:1.1.0
|
||||
androidx.vectordrawable:vectordrawable:1.1.0
|
||||
androidx.versionedparcelable:versionedparcelable:1.1.1
|
||||
androidx.viewpager:viewpager:1.0.0
|
||||
com.google.accompanist:accompanist-drawablepainter:0.32.0
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger-lint-aar:2.50
|
||||
com.google.dagger:dagger:2.50
|
||||
com.google.dagger:hilt-android:2.50
|
||||
com.google.dagger:hilt-core:2.50
|
||||
com.google.guava:listenablefuture:1.0
|
||||
com.squareup.okhttp3:okhttp:4.12.0
|
||||
com.squareup.okio:okio-jvm:3.6.0
|
||||
com.squareup.okio:okio:3.6.0
|
||||
io.coil-kt:coil-base:2.5.0
|
||||
io.coil-kt:coil-compose-base:2.5.0
|
||||
io.coil-kt:coil-compose:2.5.0
|
||||
io.coil-kt:coil:2.5.0
|
||||
javax.inject:javax.inject:1
|
||||
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.21
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib:1.9.21
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.5.0
|
||||
org.jetbrains.kotlinx:kotlinx-datetime:0.5.0
|
||||
org.jetbrains:annotations:23.0.0
|
@ -0,0 +1,205 @@
|
||||
androidx.activity:activity-compose:1.8.0
|
||||
androidx.activity:activity-ktx:1.8.0
|
||||
androidx.activity:activity:1.8.0
|
||||
androidx.annotation:annotation-experimental:1.3.1
|
||||
androidx.annotation:annotation-jvm:1.7.0
|
||||
androidx.annotation:annotation:1.7.0
|
||||
androidx.appcompat:appcompat-resources:1.6.1
|
||||
androidx.appcompat:appcompat:1.6.1
|
||||
androidx.arch.core:core-common:2.2.0
|
||||
androidx.arch.core:core-runtime:2.2.0
|
||||
androidx.autofill:autofill:1.0.0
|
||||
androidx.browser:browser:1.6.0
|
||||
androidx.collection:collection-jvm:1.3.0
|
||||
androidx.collection:collection-ktx:1.3.0
|
||||
androidx.collection:collection:1.3.0
|
||||
androidx.compose.animation:animation-android:1.5.4
|
||||
androidx.compose.animation:animation-core-android:1.5.4
|
||||
androidx.compose.animation:animation-core:1.5.4
|
||||
androidx.compose.animation:animation:1.5.4
|
||||
androidx.compose.foundation:foundation-android:1.5.4
|
||||
androidx.compose.foundation:foundation-layout-android:1.5.4
|
||||
androidx.compose.foundation:foundation-layout:1.5.4
|
||||
androidx.compose.foundation:foundation:1.5.4
|
||||
androidx.compose.material3:material3-window-size-class:1.1.2
|
||||
androidx.compose.material3:material3:1.1.2
|
||||
androidx.compose.material:material-icons-core-android:1.5.4
|
||||
androidx.compose.material:material-icons-core:1.5.4
|
||||
androidx.compose.material:material-icons-extended-android:1.5.4
|
||||
androidx.compose.material:material-icons-extended:1.5.4
|
||||
androidx.compose.material:material-ripple-android:1.5.4
|
||||
androidx.compose.material:material-ripple:1.5.4
|
||||
androidx.compose.runtime:runtime-android:1.5.4
|
||||
androidx.compose.runtime:runtime-saveable-android:1.5.4
|
||||
androidx.compose.runtime:runtime-saveable:1.5.4
|
||||
androidx.compose.runtime:runtime:1.5.4
|
||||
androidx.compose.ui:ui-android:1.5.4
|
||||
androidx.compose.ui:ui-geometry-android:1.5.4
|
||||
androidx.compose.ui:ui-geometry:1.5.4
|
||||
androidx.compose.ui:ui-graphics-android:1.5.4
|
||||
androidx.compose.ui:ui-graphics:1.5.4
|
||||
androidx.compose.ui:ui-text-android:1.5.4
|
||||
androidx.compose.ui:ui-text:1.5.4
|
||||
androidx.compose.ui:ui-tooling-preview-android:1.5.4
|
||||
androidx.compose.ui:ui-tooling-preview:1.5.4
|
||||
androidx.compose.ui:ui-unit-android:1.5.4
|
||||
androidx.compose.ui:ui-unit:1.5.4
|
||||
androidx.compose.ui:ui-util-android:1.5.4
|
||||
androidx.compose.ui:ui-util:1.5.4
|
||||
androidx.compose.ui:ui:1.5.4
|
||||
androidx.compose:compose-bom:2023.10.01
|
||||
androidx.concurrent:concurrent-futures:1.1.0
|
||||
androidx.core:core-ktx:1.12.0
|
||||
androidx.core:core-splashscreen:1.0.1
|
||||
androidx.core:core:1.12.0
|
||||
androidx.cursoradapter:cursoradapter:1.0.0
|
||||
androidx.customview:customview-poolingcontainer:1.0.0
|
||||
androidx.customview:customview:1.0.0
|
||||
androidx.datastore:datastore-core:1.0.0
|
||||
androidx.datastore:datastore-preferences-core:1.0.0
|
||||
androidx.datastore:datastore-preferences:1.0.0
|
||||
androidx.datastore:datastore:1.0.0
|
||||
androidx.documentfile:documentfile:1.0.0
|
||||
androidx.drawerlayout:drawerlayout:1.0.0
|
||||
androidx.emoji2:emoji2-views-helper:1.4.0
|
||||
androidx.emoji2:emoji2:1.4.0
|
||||
androidx.exifinterface:exifinterface:1.3.6
|
||||
androidx.fragment:fragment:1.5.1
|
||||
androidx.hilt:hilt-common:1.1.0
|
||||
androidx.hilt:hilt-navigation-compose:1.0.0
|
||||
androidx.hilt:hilt-navigation:1.0.0
|
||||
androidx.hilt:hilt-work:1.1.0
|
||||
androidx.interpolator:interpolator:1.0.0
|
||||
androidx.legacy:legacy-support-core-utils:1.0.0
|
||||
androidx.lifecycle:lifecycle-common-java8:2.6.2
|
||||
androidx.lifecycle:lifecycle-common:2.6.2
|
||||
androidx.lifecycle:lifecycle-livedata-core:2.6.2
|
||||
androidx.lifecycle:lifecycle-livedata:2.6.2
|
||||
androidx.lifecycle:lifecycle-process:2.6.2
|
||||
androidx.lifecycle:lifecycle-runtime-compose:2.6.2
|
||||
androidx.lifecycle:lifecycle-runtime-ktx:2.6.2
|
||||
androidx.lifecycle:lifecycle-runtime:2.6.2
|
||||
androidx.lifecycle:lifecycle-service:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2
|
||||
androidx.lifecycle:lifecycle-viewmodel:2.6.2
|
||||
androidx.loader:loader:1.0.0
|
||||
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
|
||||
androidx.metrics:metrics-performance:1.0.0-alpha04
|
||||
androidx.navigation:navigation-common-ktx:2.7.4
|
||||
androidx.navigation:navigation-common:2.7.4
|
||||
androidx.navigation:navigation-compose:2.7.4
|
||||
androidx.navigation:navigation-runtime-ktx:2.7.4
|
||||
androidx.navigation:navigation-runtime:2.7.4
|
||||
androidx.print:print:1.0.0
|
||||
androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta05
|
||||
androidx.privacysandbox.ads:ads-adservices:1.0.0-beta05
|
||||
androidx.profileinstaller:profileinstaller:1.3.1
|
||||
androidx.resourceinspection:resourceinspection-annotation:1.0.1
|
||||
androidx.room:room-common:2.6.1
|
||||
androidx.room:room-ktx:2.6.1
|
||||
androidx.room:room-runtime:2.6.1
|
||||
androidx.savedstate:savedstate-ktx:1.2.1
|
||||
androidx.savedstate:savedstate:1.2.1
|
||||
androidx.sqlite:sqlite-framework:2.4.0
|
||||
androidx.sqlite:sqlite:2.4.0
|
||||
androidx.startup:startup-runtime:1.1.1
|
||||
androidx.tracing:tracing-ktx:1.1.0
|
||||
androidx.tracing:tracing:1.1.0
|
||||
androidx.vectordrawable:vectordrawable-animated:1.1.0
|
||||
androidx.vectordrawable:vectordrawable:1.1.0
|
||||
androidx.versionedparcelable:versionedparcelable:1.1.1
|
||||
androidx.viewpager:viewpager:1.0.0
|
||||
androidx.window:window:1.0.0
|
||||
androidx.work:work-runtime-ktx:2.9.0
|
||||
androidx.work:work-runtime:2.9.0
|
||||
com.caverock:androidsvg-aar:1.4
|
||||
com.google.accompanist:accompanist-drawablepainter:0.32.0
|
||||
com.google.accompanist:accompanist-permissions:0.32.0
|
||||
com.google.android.datatransport:transport-api:3.0.0
|
||||
com.google.android.datatransport:transport-backend-cct:3.1.9
|
||||
com.google.android.datatransport:transport-runtime:3.1.9
|
||||
com.google.android.gms:play-services-ads-identifier:18.0.0
|
||||
com.google.android.gms:play-services-base:18.0.1
|
||||
com.google.android.gms:play-services-basement:18.1.0
|
||||
com.google.android.gms:play-services-cloud-messaging:17.0.1
|
||||
com.google.android.gms:play-services-measurement-api:21.4.0
|
||||
com.google.android.gms:play-services-measurement-base:21.4.0
|
||||
com.google.android.gms:play-services-measurement-impl:21.4.0
|
||||
com.google.android.gms:play-services-measurement-sdk-api:21.4.0
|
||||
com.google.android.gms:play-services-measurement-sdk:21.4.0
|
||||
com.google.android.gms:play-services-measurement:21.4.0
|
||||
com.google.android.gms:play-services-oss-licenses:17.0.1
|
||||
com.google.android.gms:play-services-stats:17.0.2
|
||||
com.google.android.gms:play-services-tasks:18.0.2
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger-lint-aar:2.50
|
||||
com.google.dagger:dagger:2.50
|
||||
com.google.dagger:hilt-android:2.50
|
||||
com.google.dagger:hilt-core:2.50
|
||||
com.google.errorprone:error_prone_annotations:2.11.0
|
||||
com.google.firebase:firebase-abt:21.1.1
|
||||
com.google.firebase:firebase-analytics-ktx:21.4.0
|
||||
com.google.firebase:firebase-analytics:21.4.0
|
||||
com.google.firebase:firebase-annotations:16.2.0
|
||||
com.google.firebase:firebase-bom:32.4.0
|
||||
com.google.firebase:firebase-common-ktx:20.4.2
|
||||
com.google.firebase:firebase-common:20.4.2
|
||||
com.google.firebase:firebase-components:17.1.5
|
||||
com.google.firebase:firebase-config:21.5.0
|
||||
com.google.firebase:firebase-crashlytics-ktx:18.5.0
|
||||
com.google.firebase:firebase-crashlytics:18.5.0
|
||||
com.google.firebase:firebase-datatransport:18.1.8
|
||||
com.google.firebase:firebase-encoders-json:18.0.1
|
||||
com.google.firebase:firebase-encoders-proto:16.0.0
|
||||
com.google.firebase:firebase-encoders:17.0.0
|
||||
com.google.firebase:firebase-iid-interop:17.1.0
|
||||
com.google.firebase:firebase-installations-interop:17.1.1
|
||||
com.google.firebase:firebase-installations:17.2.0
|
||||
com.google.firebase:firebase-measurement-connector:19.0.0
|
||||
com.google.firebase:firebase-messaging-ktx:23.3.0
|
||||
com.google.firebase:firebase-messaging:23.3.0
|
||||
com.google.firebase:firebase-perf-ktx:20.5.0
|
||||
com.google.firebase:firebase-perf:20.5.0
|
||||
com.google.firebase:firebase-sessions:1.1.0
|
||||
com.google.firebase:protolite-well-known-types:18.0.0
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:31.1-android
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.protobuf:protobuf-javalite:3.24.4
|
||||
com.google.protobuf:protobuf-kotlin-lite:3.24.4
|
||||
com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0
|
||||
com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||
com.squareup.okhttp3:okhttp:4.12.0
|
||||
com.squareup.okio:okio-jvm:3.6.0
|
||||
com.squareup.okio:okio:3.6.0
|
||||
com.squareup.retrofit2:retrofit:2.9.0
|
||||
io.coil-kt:coil-base:2.5.0
|
||||
io.coil-kt:coil-compose-base:2.5.0
|
||||
io.coil-kt:coil-compose:2.5.0
|
||||
io.coil-kt:coil-svg:2.5.0
|
||||
io.coil-kt:coil:2.5.0
|
||||
io.github.aakira:napier-android:1.4.1
|
||||
io.github.aakira:napier:1.4.1
|
||||
javax.inject:javax.inject:1
|
||||
org.checkerframework:checker-qual:3.12.0
|
||||
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.21
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib:1.9.21
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3
|
||||
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.5.0
|
||||
org.jetbrains.kotlinx:kotlinx-datetime:0.5.0
|
||||
org.jetbrains.kotlinx:kotlinx-serialization-bom:1.6.0
|
||||
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.6.0
|
||||
org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.0
|
||||
org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.6.0
|
||||
org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0
|
||||
org.jetbrains:annotations:23.0.0
|
@ -0,0 +1,268 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.samples.apps.nowinandroid.ui
|
||||
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
|
||||
import androidx.compose.material3.windowsizeclass.WindowSizeClass
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithTag
|
||||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.google.accompanist.testharness.TestHarness
|
||||
import com.google.samples.apps.nowinandroid.core.data.repository.CompositeUserNewsResourceRepository
|
||||
import com.google.samples.apps.nowinandroid.core.data.util.NetworkMonitor
|
||||
import com.google.samples.apps.nowinandroid.core.rules.GrantPostNotificationsPermissionRule
|
||||
import com.google.samples.apps.nowinandroid.core.testing.repository.TestNewsRepository
|
||||
import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository
|
||||
import com.google.samples.apps.nowinandroid.uitesthiltmanifest.HiltComponentActivity
|
||||
import dagger.hilt.android.testing.BindValue
|
||||
import dagger.hilt.android.testing.HiltAndroidRule
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
* Tests that the navigation UI is rendered correctly on different screen sizes.
|
||||
*/
|
||||
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
|
||||
@HiltAndroidTest
|
||||
class NavigationUiTest {
|
||||
|
||||
/**
|
||||
* Manages the components' state and is used to perform injection on your test
|
||||
*/
|
||||
@get:Rule(order = 0)
|
||||
val hiltRule = HiltAndroidRule(this)
|
||||
|
||||
/**
|
||||
* Create a temporary folder used to create a Data Store file. This guarantees that
|
||||
* the file is removed in between each test, preventing a crash.
|
||||
*/
|
||||
@BindValue
|
||||
@get:Rule(order = 1)
|
||||
val tmpFolder: TemporaryFolder = TemporaryFolder.builder().assureDeletion().build()
|
||||
|
||||
/**
|
||||
* Grant [android.Manifest.permission.POST_NOTIFICATIONS] permission.
|
||||
*/
|
||||
@get:Rule(order = 2)
|
||||
val postNotificationsPermission = GrantPostNotificationsPermissionRule()
|
||||
|
||||
/**
|
||||
* Use a test activity to set the content on.
|
||||
*/
|
||||
@get:Rule(order = 3)
|
||||
val composeTestRule = createAndroidComposeRule<HiltComponentActivity>()
|
||||
|
||||
val userNewsResourceRepository = CompositeUserNewsResourceRepository(
|
||||
newsRepository = TestNewsRepository(),
|
||||
userDataRepository = TestUserDataRepository(),
|
||||
)
|
||||
|
||||
@Inject
|
||||
lateinit var networkMonitor: NetworkMonitor
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
hiltRule.inject()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun compactWidth_compactHeight_showsNavigationBar() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(400.dp, 400.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun mediumWidth_compactHeight_showsNavigationRail() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(610.dp, 400.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun expandedWidth_compactHeight_showsNavigationRail() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(900.dp, 400.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun compactWidth_mediumHeight_showsNavigationBar() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(400.dp, 500.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun mediumWidth_mediumHeight_showsNavigationRail() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(610.dp, 500.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun expandedWidth_mediumHeight_showsNavigationRail() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(900.dp, 500.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun compactWidth_expandedHeight_showsNavigationBar() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(400.dp, 1000.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun mediumWidth_expandedHeight_showsNavigationRail() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(610.dp, 1000.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertDoesNotExist()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun expandedWidth_expandedHeight_showsNavigationRail() {
|
||||
composeTestRule.setContent {
|
||||
TestHarness(size = DpSize(900.dp, 1000.dp)) {
|
||||
BoxWithConstraints {
|
||||
NiaApp(
|
||||
windowSizeClass = WindowSizeClass.calculateFromSize(
|
||||
DpSize(maxWidth, maxHeight),
|
||||
),
|
||||
networkMonitor = networkMonitor,
|
||||
userNewsResourceRepository = userNewsResourceRepository,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
composeTestRule.onNodeWithTag("NiaNavRail").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithTag("NiaBottomBar").assertDoesNotExist()
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.samples.apps.nowinandroid.util
|
||||
|
||||
import android.util.Log
|
||||
import androidx.profileinstaller.ProfileVerifier
|
||||
import com.google.samples.apps.nowinandroid.core.network.di.ApplicationScope
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.guava.await
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
* Logs the app's Baseline Profile Compilation Status using [ProfileVerifier].
|
||||
*
|
||||
* When delivering through Google Play, the baseline profile is compiled during installation.
|
||||
* In this case you will see the correct state logged without any further action necessary.
|
||||
* To verify baseline profile installation locally, you need to manually trigger baseline
|
||||
* profile installation.
|
||||
*
|
||||
* For immediate compilation, call:
|
||||
* ```bash
|
||||
* adb shell cmd package compile -f -m speed-profile com.example.macrobenchmark.target
|
||||
* ```
|
||||
* You can also trigger background optimizations:
|
||||
* ```bash
|
||||
* adb shell pm bg-dexopt-job
|
||||
* ```
|
||||
* Both jobs run asynchronously and might take some time complete.
|
||||
*
|
||||
* To see quick turnaround of the ProfileVerifier, we recommend using `speed-profile`.
|
||||
* If you don't do either of these steps, you might only see the profile status reported as
|
||||
* "enqueued for compilation" when running the sample locally.
|
||||
*
|
||||
* @see androidx.profileinstaller.ProfileVerifier.CompilationStatus.ResultCode
|
||||
*/
|
||||
class ProfileVerifierLogger @Inject constructor(
|
||||
@ApplicationScope private val scope: CoroutineScope,
|
||||
) {
|
||||
companion object {
|
||||
private const val TAG = "ProfileInstaller"
|
||||
}
|
||||
|
||||
operator fun invoke() = scope.launch {
|
||||
val status = ProfileVerifier.getCompilationStatusAsync().await()
|
||||
Log.d(TAG, "Status code: ${status.profileInstallResultCode}")
|
||||
Log.d(
|
||||
TAG,
|
||||
when {
|
||||
status.isCompiledWithProfile -> "App compiled with profile"
|
||||
status.hasProfileEnqueuedForCompilation() -> "Profile enqueued for compilation"
|
||||
else -> "Profile not compiled nor enqueued"
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 233 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 275 KiB |
Before Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 673 B |