Code Monkey home page Code Monkey logo

nowinandroid's Introduction

Now in Android

Now in Android App

Learn how this app was designed and built in the design case study, architecture learning journey and modularization learning journey.

This is the repository for the Now in Android app. It is a work in progress 🚧.

Now in Android is a fully functional Android app built entirely with Kotlin and Jetpack Compose. It follows Android design and development best practices and is intended to be a useful reference for developers. As a running app, it's intended to help developers keep up-to-date with the world of Android development by providing regular news updates.

The app is currently in development. The prodRelease variant is available on the Play Store.

Features

Now in Android displays content from the Now in Android series. Users can browse for links to recent videos, articles and other content. Users can also follow topics they are interested in, and be notified when new content is published which matches interests they are following.

Screenshots

Screenshot showing For You screen, Interests screen and Topic detail screen

Development Environment

Now in Android uses the Gradle build system and can be imported directly into Android Studio (make sure you are using the latest stable version available here).

Change the run configuration to app.

image

The demoDebug and demoRelease build variants can be built and run (the prod variants use a backend server which is not currently publicly available).

image

Once you're up and running, you can refer to the learning journeys below to get a better understanding of which libraries and tools are being used, the reasoning behind the approaches to UI, testing, architecture and more, and how all of these different pieces of the project fit together to create a complete app.

Architecture

The Now in Android app follows the official architecture guidance and is described in detail in the architecture learning journey.

Modularization

The Now in Android app has been fully modularized and you can find the detailed guidance and description of the modularization strategy used in modularization learning journey.

Build

The app contains the usual debug and release build variants.

In addition, the benchmark variant of app is used to test startup performance and generate a baseline profile (see below for more information).

app-nia-catalog is a standalone app that displays the list of components that are stylized for Now in Android.

The app also uses product flavors to control where content for the app should be loaded from.

The demo flavor uses static local data to allow immediate building and exploring of the UI.

The prod flavor makes real network calls to a backend server, providing up-to-date content. At this time, there is not a public backend available.

For normal development use the demoDebug variant. For UI performance testing use the demoRelease variant.

Testing

To facilitate testing of components, Now in Android uses dependency injection with Hilt.

Most data layer components are defined as interfaces. Then, concrete implementations (with various dependencies) are bound to provide those interfaces to other components in the app. In tests, Now in Android notably does not use any mocking libraries. Instead, the production implementations can be replaced with test doubles using Hilt's testing APIs (or via manual constructor injection for ViewModel tests).

These test doubles implement the same interface as the production implementations and generally provide a simplified (but still realistic) implementation with additional testing hooks. This results in less brittle tests that may exercise more production code, instead of just verifying specific calls against mocks.

Examples:

  • In instrumentation tests, a temporary folder is used to store the user's preferences, which is wiped after each test. This allows using the real DataStore and exercising all related code, instead of mocking the flow of data updates.

  • There are Test implementations of each repository, which implement the normal, full repository interface and also provide test-only hooks. ViewModel tests use these Test repositories, and thus can use the test-only hooks to manipulate the state of the Test repository and verify the resulting behavior, instead of checking that specific repository methods were called.

To run the tests execute the following gradle tasks:

  • testDemoDebug run all local tests against the demoDebug variant.
  • connectedDemoDebugAndroidTest run all instrumented tests against the demoDebug variant.

Note: You should not run ./gradlew test or ./gradlew connectedAndroidTest as this will execute tests against all build variants which is both unecessary and will result in failures as only the demoDebug variant is supported. No other variants have any tests (although this might change in future).

Screenshot tests

A screenshot test takes a screenshot of a screen or a UI component within the app, and compares it with a previously recorded screenshot which is known to be rendered correctly.

For example, Now in Android has screenshot tests to verify that the navigation is displayed correctly on different screen sizes (known correct screenshots).

Now In Android uses Roborazzi to run screenshot tests of certain screens and UI components. When working with screenshot tests the following gradle tasks are useful:

  • verifyRoborazziDemoDebug run all screenshot tests, verifying the screenshots against the known correct screenshots.
  • recordRoborazziDemoDebug record new "known correct" screenshots. Use this command when you have made changes to the UI and manually verified that they are rendered correctly. Screenshots will be stored in modulename/src/test/screenshots.
  • compareRoborazziDemoDebug create comparison images between failed tests and the known correct images. These can also be found in modulename/src/test/screenshots.

Note: The known correct screenshots stored in this repository are recorded on CI using Linux. Other platforms may (and probably will) generate slightly different images, making the screenshot tests fail. When working on a non-Linux platform, a workaround to this is to run recordRoborazziDemoDebug on the main branch before starting work. After making changes, verifyRoborazziDemoDebug will identify only legitimate changes.

For more information about screenshot testing check out this talk.

UI

The app was designed using Material 3 guidelines. Learn more about the design process and obtain the design files in the Now in Android Material 3 Case Study (design assets also available as a PDF).

The Screens and UI elements are built entirely using Jetpack Compose.

The app has two themes:

  • Dynamic color - uses colors based on the user's current color theme (if supported)
  • Default theme - uses predefined colors when dynamic color is not supported

Each theme also supports dark mode.

The app uses adaptive layouts to support different screen sizes.

Find out more about the UI architecture here.

Performance

Benchmarks

Find all tests written using Macrobenchmark in the benchmarks module. This module also contains the test to generate the Baseline profile.

Baseline profiles

The baseline profile for this app is located at app/src/main/baseline-prof.txt. It contains rules that enable AOT compilation of the critical user path taken during app launch. For more information on baseline profiles, read this document.

Note

The baseline profile needs to be re-generated for release builds that touch code which changes app startup.

To generate the baseline profile, select the benchmark build variant and run the BaselineProfileGenerator benchmark test on an AOSP Android Emulator. Then copy the resulting baseline profile from the emulator to app/src/main/baseline-prof.txt.

Compose compiler metrics

Run the following command to get and analyse compose compiler metrics:

./gradlew assembleRelease -PenableComposeCompilerMetrics=true -PenableComposeCompilerReports=true

The reports files will be added to build/compose-reports. The metrics files will also be added to build/compose-metrics.

For more information on Compose compiler metrics, see this blog post.

License

Now in Android is distributed under the terms of the Apache License (Version 2.0). See the license for more information.

nowinandroid's People

Contributors

alexvanyo avatar angiesasmita avatar bentrengrove avatar calren avatar dependabot[bot] avatar dturner avatar jaehwa-noh avatar jdkoren avatar jolandaverhoef avatar josealcerreca avatar keyboardsurfer avatar kokoro-team avatar lihenggui avatar madroidmaq avatar magicalmeghan avatar mlykotom avatar mmoczkowski avatar qamarelsafadi avatar renovate-bot avatar renovate[bot] avatar rosejr avatar saeednoshadi89 avatar simona-anomis avatar simonmarquis avatar takagimeow avatar tjmtic avatar tunjid avatar wojtek-kalicinski avatar yenerm avatar zsmb13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nowinandroid's Issues

[Bug]: The unit test offlineFirstTopicsRepository_toggle_followed_topics_logic_delegates_to_nia_preferences() failed

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Windows environment
Running the unit test offlineFirstTopicsRepository_toggle_followed_topics_logic_delegates_to_nia_preferences() fails.
There is an exception thrown that is cached but the log of this exception causes crash because it's not mocked, the original exception is :

java.io.IOException: Unable to rename C:\xxxxx\Temp\junit2206256684596171052\user_preferences_test.pb.tmp.This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file.

The stacktrace :

androidx.datastore.core.SingleProcessDataStore.writeData$datastore_core(SingleProcessDataStore.kt:433)
androidx.datastore.core.SingleProcessDataStore.transformAndWrite(SingleProcessDataStore.kt:410)
androidx.datastore.core.SingleProcessDataStore.access$transformAndWrite(SingleProcessDataStore.kt:76)
androidx.datastore.core.SingleProcessDataStore$transformAndWrite$1.invokeSuspend(SingleProcessDataStore.kt)
\b\b\b(Coroutine boundary.\b(\b)
com.google.samples.apps.nowinandroid.core.datastore.NiaPreferences.toggleFollowedTopicId(NiaPreferences.kt:46)
com.google.samples.apps.nowinandroid.core.data.repository.OfflineFirstTopicsRepositoryTest$offlineFirstTopicsRepository_toggle_followed_topics_logic_delegates_to_nia_preferences$1.invokeSuspend(OfflineFirstTopicsRepositoryTest.kt:190)

I think the problem is because the test was executed under a Windows environment and the rename failed on that platform (SingleProcessDataStore.kt : 432) :

            if (!scratchFile.renameTo(file)) {
                throw IOException(
                    "Unable to rename $scratchFile." +
                        "This likely means that there are multiple instances of DataStore " +
                        "for this file. Ensure that you are only creating a single instance of " +
                        "datastore for this file."
                )
            }

Relevant logcat output

Method e in android.util.Log not mocked. See http://g.co/androidstudio/not-mocked for details.
java.lang.RuntimeException: Method e in android.util.Log not mocked. See http://g.co/androidstudio/not-mocked for details.
	at android.util.Log.e(Log.java)
	at com.google.samples.apps.nowinandroid.core.datastore.NiaPreferences.toggleFollowedTopicId(NiaPreferences.kt:59)
	at com.google.samples.apps.nowinandroid.core.datastore.NiaPreferences$toggleFollowedTopicId$1.invokeSuspend(NiaPreferences.kt)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Snapshot Test

I think having some Snapshot tests in this repository can be helpful in multiple ways. As this repository is going to be used as a "reference" for many developers.
Any opinion on this? Please share what you think. I can start by writing a few snapshot tests

It is hoped that an option will be added to this project to allow developers to first confirm whether they can use Google services[Bug]:

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

A bug happened!

It is hoped that an option will be added to this project to allow developers to first confirm whether they can use Google services. Here, the main consideration is that tens of millions of developers in China cannot load or view too many things when referring to the use of the app, such as confirming that users are in China. Do not jump to YouTube, you can go to WeChat or bilibili, and Chinese developers cannot log in using Google accounts.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: build-logic fails to build on Chipmunk since version catalogs feature is disabled

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Steps to repro:

  • Clone the repo, load into Android Studio, choose the app configuration, hit build

Expected outcome:

  • Project builds successfully

Actual outcome:

  • The build-logic module fails to build with the message:
Settings file '/Users/donturner/Code/workspace-android/nowinandroid/build-logic/settings.gradle.kts' line: 26

Using dependency catalogs requires the activation of the matching feature preview.
See the documentation at https://docs.gradle.org/7.1/userguide/platforms.html#sub:central-declaration-of-dependencies

Android Studio version information:

Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 18, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.4
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: wu.seal.tool.jsontokotlin (3.7.4), org.toml.lang (0.2.155.4114-212), org.intellij.plugins.markdown (212.5457.16), idea.plugin.protoeditor (212.5080.8), google-java-format (1.15.0.0), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46)

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: UI Jank in the 'For you' screen

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Whenever the InterestsSelection is visible in the 'For you' screen, scrolling back to the InterestsSelection always janks heavily. Even the side scrolling of TopicSelection janks.

screen.mp4

I'm observing this on Pixel 4a device.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FR]: Provide examples of consuming UI events exactly once

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Since this seems to have become the most up to date modern android development sample, I think it would be a great idea to have it include at least one example of how one-time UI events should be handled. I am referring to this section https://developer.android.com/topic/architecture/ui-layer/events#views_3 from the documentation, which pushes people away from LiveData, Channel and other such approaches. To further assist devs into taking this approach instead, this sample could serve as an example of how to this right in a fully fledged app.

Describe the solution

Particularly it'd be interesting to see handling one-time events like showing something to the screen once and then clearing the state as it's handled, or even more so, consuming events that require the app to navigate somewhere else. In my opinion these are two super common use cases while creating apps that would be great to exist inside the most up-to-date app example provided officially from Google.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FR]: Gradle properties are not passed down to included builds

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Discussion here. I noticed that the included build doesn't have a gradle.properties file, which means things like parallel execution, task output caching, etc, are not enabled for it since the global properties are not passed down to included builds.

In my testing on an M1 Pro machine, enabling these basic flags takes build times of the build-logic project from seconds down to milliseconds.

org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true

Describe the solution

Add a gradle.properties file to the build-logic project with some configs. I'd love to submit a PR once my Individual CLA is approved if you think this is worthwhile.

Additional context

Before After
image image

Code of Conduct

  • I agree to follow this project's Code of Conduct

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Warning

Renovate failed to look up the following dependencies: Failed to look up maven package nowinandroid.android.application:nowinandroid.android.application.gradle.plugin, Failed to look up maven package nowinandroid.android.application.compose:nowinandroid.android.application.compose.gradle.plugin, Failed to look up maven package nowinandroid.android.application.firebase:nowinandroid.android.application.firebase.gradle.plugin, Failed to look up maven package nowinandroid.android.application.flavors:nowinandroid.android.application.flavors.gradle.plugin, Failed to look up maven package nowinandroid.android.application.jacoco:nowinandroid.android.application.jacoco.gradle.plugin, Failed to look up maven package nowinandroid.android.feature:nowinandroid.android.feature.gradle.plugin, Failed to look up maven package nowinandroid.android.hilt:nowinandroid.android.hilt.gradle.plugin, Failed to look up maven package nowinandroid.android.library:nowinandroid.android.library.gradle.plugin, Failed to look up maven package nowinandroid.android.library.compose:nowinandroid.android.library.compose.gradle.plugin, Failed to look up maven package nowinandroid.android.library.jacoco:nowinandroid.android.library.jacoco.gradle.plugin, Failed to look up maven package nowinandroid.android.lint:nowinandroid.android.lint.gradle.plugin, Failed to look up maven package nowinandroid.android.room:nowinandroid.android.room.gradle.plugin, Failed to look up maven package nowinandroid.android.test:nowinandroid.android.test.gradle.plugin, Failed to look up maven package nowinandroid.jvm.library:nowinandroid.jvm.library.gradle.plugin.

Files affected: gradle/libs.versions.toml


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

  • Update all dependencies (actions/setup-java, gradle, androidx.work:work-testing, androidx.room:room-runtime, androidx.room:room-ktx, androidx.room:room-compiler, com.google.protobuf:protoc, com.google.protobuf:protobuf-kotlin-lite, com.android.tools.lint:lint-tests, com.android.tools.lint:lint-checks, com.android.tools.lint:lint-api, com.google.devtools.ksp, com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin, org.jetbrains.kotlinx:kotlinx-serialization-json, org.jetbrains.kotlinx:kotlinx-datetime, org.jetbrains.kotlin.plugin.serialization, org.jetbrains.kotlin.jvm, org.jetbrains.kotlin:kotlin-gradle-plugin, org.jetbrains.kotlin:kotlin-stdlib-jdk8, com.google.dagger.hilt.android, com.google.dagger:hilt-android-compiler, com.google.dagger:hilt-android-testing, com.google.dagger:hilt-android, com.google.firebase:firebase-bom, io.coil-kt:coil-svg, io.coil-kt:coil-compose, io.coil-kt:coil, androidx.work:work-runtime-ktx, androidx.window:window, androidx.tracing:tracing-ktx, com.diffplug.spotless:spotless-plugin-gradle, androidx.navigation:navigation-testing, androidx.navigation:navigation-compose, androidx.baselineprofile, androidx.benchmark:benchmark-macro-junit4, androidx.hilt:hilt-navigation-compose, androidx.compose.runtime:runtime-tracing, androidx.browser:browser, androidx.activity:activity-compose, com.android.tools:common, com.android.test, com.android.library, com.android.application, com.android.tools.build:gradle, com.android.tools:desugar_jdk_libs)

Detected dependencies

github-actions
.github/workflows/Build.yaml
  • actions/checkout v4
  • gradle/wrapper-validation-action v1
  • actions/setup-java v3
  • gradle/gradle-build-action v2
  • stefanzweifel/git-auto-commit-action v5
  • actions/upload-artifact v3
  • actions/upload-artifact v3
  • actions/upload-artifact v3
  • actions/checkout v4
  • actions/setup-java v3
  • gradle/gradle-build-action v2
  • reactivecircus/android-emulator-runner v2
  • actions/upload-artifact v3
.github/workflows/Release.yml
  • actions/checkout v4
  • gradle/wrapper-validation-action v1
  • actions/setup-java v3
  • actions/create-release v1
  • actions/upload-release-asset v1
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
app/build.gradle.kts
app-nia-catalog/build.gradle.kts
benchmarks/build.gradle.kts
build-logic/gradle.properties
build-logic/settings.gradle.kts
build-logic/convention/build.gradle.kts
core/analytics/build.gradle.kts
core/common/build.gradle.kts
core/data/build.gradle.kts
core/data-test/build.gradle.kts
core/database/build.gradle.kts
core/datastore/build.gradle.kts
core/datastore-proto/build.gradle.kts
core/datastore-test/build.gradle.kts
core/designsystem/build.gradle.kts
core/domain/build.gradle.kts
core/model/build.gradle.kts
core/network/build.gradle.kts
core/notifications/build.gradle.kts
core/testing/build.gradle.kts
core/ui/build.gradle.kts
feature/bookmarks/build.gradle.kts
feature/foryou/build.gradle.kts
feature/interests/build.gradle.kts
feature/search/build.gradle.kts
feature/settings/build.gradle.kts
feature/topic/build.gradle.kts
gradle/init.gradle.kts
  • com.diffplug.spotless:spotless-plugin-gradle 6.22.0
gradle/libs.versions.toml
  • com.google.accompanist:accompanist-permissions 0.32.0
  • com.google.accompanist:accompanist-testharness 0.32.0
  • com.android.tools:desugar_jdk_libs 2.0.3
  • androidx.activity:activity-compose 1.8.0
  • androidx.appcompat:appcompat 1.6.1
  • androidx.benchmark:benchmark-macro-junit4 1.2.0
  • androidx.browser:browser 1.6.0
  • androidx.compose:compose-bom 2023.10.01
  • androidx.compose.runtime:runtime-tracing 1.0.0-alpha03
  • androidx.core:core-ktx 1.12.0
  • androidx.core:core-splashscreen 1.0.1
  • androidx.datastore:datastore 1.0.0
  • androidx.hilt:hilt-navigation-compose 1.0.0
  • androidx.lifecycle:lifecycle-livedata-ktx 2.6.2
  • androidx.lifecycle:lifecycle-runtime-compose 2.6.2
  • androidx.lifecycle:lifecycle-viewmodel-compose 2.6.2
  • androidx.metrics:metrics-performance 1.0.0-alpha04
  • androidx.navigation:navigation-compose 2.7.4
  • androidx.navigation:navigation-testing 2.7.4
  • androidx.profileinstaller:profileinstaller 1.3.1
  • androidx.test:core 1.5.0
  • androidx.test.espresso:espresso-core 3.5.1
  • androidx.test.ext:junit-ktx 1.1.5
  • androidx.test:rules 1.5.0
  • androidx.test:runner 1.5.2
  • androidx.test.uiautomator:uiautomator 2.2.0
  • androidx.tracing:tracing-ktx 1.1.0
  • androidx.window:window 1.1.0
  • androidx.work:work-runtime-ktx 2.9.0-rc01
  • androidx.work:work-testing 2.9.0-rc01
  • io.coil-kt:coil 2.4.0
  • io.coil-kt:coil-compose 2.4.0
  • io.coil-kt:coil-svg 2.4.0
  • com.google.firebase:firebase-bom 32.4.0
  • com.google.firebase:perf-plugin 1.4.2
  • com.google.android.gms:play-services-oss-licenses 17.0.1
  • com.google.android.gms:oss-licenses-plugin 0.10.6
  • com.google.dagger:hilt-android 2.48.1
  • com.google.dagger:hilt-android-testing 2.48.1
  • com.google.dagger:hilt-android-compiler 2.48.1
  • androidx.hilt:hilt-compiler 1.1.0
  • androidx.hilt:hilt-work 1.1.0
  • junit:junit 4.13.2
  • org.jetbrains.kotlin:kotlin-stdlib-jdk8 1.9.10
  • org.jetbrains.kotlinx:kotlinx-coroutines-android 1.7.3
  • org.jetbrains.kotlinx:kotlinx-coroutines-guava 1.7.3
  • org.jetbrains.kotlinx:kotlinx-coroutines-test 1.7.3
  • org.jetbrains.kotlinx:kotlinx-datetime 0.4.1
  • org.jetbrains.kotlinx:kotlinx-serialization-json 1.6.0
  • com.android.tools.lint:lint-api 31.1.3
  • com.android.tools.lint:lint-checks 31.1.3
  • com.android.tools.lint:lint-tests 31.1.3
  • com.squareup.okhttp3:logging-interceptor 4.12.0
  • com.google.protobuf:protobuf-kotlin-lite 3.24.4
  • com.google.protobuf:protoc 3.24.4
  • com.squareup.retrofit2:retrofit 2.9.0
  • com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter 1.0.0
  • org.robolectric:robolectric 4.11.1
  • org.robolectric:shadows-framework 4.11.1
  • io.github.takahirom.roborazzi:roborazzi 1.6.0
  • androidx.room:room-compiler 2.6.0
  • androidx.room:room-ktx 2.6.0
  • androidx.room:room-runtime 2.6.0
  • app.cash.turbine:turbine 1.0.0
  • com.android.tools.build:gradle 8.1.3
  • com.android.tools:common 31.1.3
  • androidx.test.ext:junit 1.1.5
  • com.google.firebase:firebase-crashlytics-gradle 2.9.9
  • org.jetbrains.kotlin:kotlin-gradle-plugin 1.9.10
  • com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin 1.9.10-1.0.13
  • androidx.work:work-testing 2.8.1
  • com.android.application 8.1.3
  • com.android.library 8.1.3
  • com.android.test 8.1.3
  • androidx.baselineprofile 1.2.0
  • com.dropbox.dependency-guard 0.4.3
  • com.google.firebase.crashlytics 2.9.9
  • com.google.firebase.firebase-perf 1.4.2
  • com.google.gms.google-services 4.4.0
  • com.google.dagger.hilt.android 2.48.1
  • org.jetbrains.kotlin.jvm 1.9.10
  • org.jetbrains.kotlin.plugin.serialization 1.9.10
  • com.google.devtools.ksp 1.9.10-1.0.13
  • com.google.protobuf 0.9.4
  • io.github.takahirom.roborazzi 1.6.0
  • com.google.android.libraries.mapsplatform.secrets-gradle-plugin 2.0.1
  • nowinandroid.android.application unspecified
  • nowinandroid.android.application.compose unspecified
  • nowinandroid.android.application.firebase unspecified
  • nowinandroid.android.application.flavors unspecified
  • nowinandroid.android.application.jacoco unspecified
  • nowinandroid.android.feature unspecified
  • nowinandroid.android.hilt unspecified
  • nowinandroid.android.library unspecified
  • nowinandroid.android.library.compose unspecified
  • nowinandroid.android.library.jacoco unspecified
  • nowinandroid.android.lint unspecified
  • nowinandroid.android.room unspecified
  • nowinandroid.android.test unspecified
  • nowinandroid.jvm.library unspecified
lint/build.gradle.kts
sync/sync-test/build.gradle.kts
sync/work/build.gradle.kts
ui-test-hilt-manifest/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.4

  • Check this box to trigger a request for Renovate to run again on this repository

[Bug]: AuthorItem pressed effect feels too narrow

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Screenshot_20220513_001456

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

The `libs` error in the some build.gradle

I see an error with libs in some build.gradle files.

The error is obvious below files:
build.grdle.kts (:code-database)
build.grdle.kts (:code-datastore)
build.grdle.kts (:code-model)
build.grdle.kts (:code-navigation)

Screen Shot 2022-05-14 at 17 04 39

[FR]: Provide a graph of the module structure

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Especially for someone newer to multi-modular apps, looking at all the modules on the top level of the project can be daunting.

Describe the solution

It would be awesome if an always up-to-date graph of how the modules depend on each other could be shown in the README of this repository.

Additional context

I was recently reading the article "Jetpack Compose — Before and after" from Chris Banes and in that post, the section "The app" with the figure named "Graph of Tivi’s module structure. Generated using Jake Wharton’s handy Gradle task" is exactly what I am talking about. I hope you can refer to it for some inspiration.
This would give a visualization of how everything is structured in an instant without having to look at the gradle files of all modules.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FR]: Give the possibility to specify icon colors in the toolbar

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Not a big issue, just a suggestion for improvement :)

For the class com.google.samples.apps.nowinandroid.core.ui.component.NiaTopAppBar for navigationIcon and actionIcon we hardcode the tint color: tint = MaterialTheme.colorScheme.onSurface

So, if we would like to specify icon colors for example

TopAppBarDefaults.centerAlignedTopAppBarColors(
    actionIconContentColor = Color.White
)

it isn't applied since we override this tint color inside the Icon class.

Describe the solution

So, my suggestion is to remove the tint color from Icon and give the possibility to provide specific color outside using the colors parameter

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Crashes on app-nia-catalog

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

App crashes while scrolling on app-nia-catalog. The variant is debug

Relevant logcat output

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.google.samples.apps.niacatalog, PID: 26502
    java.lang.IllegalArgumentException: Inconsistency between the count of nodes tracked by the state (0) and the children count on the SubcomposeLayout (3). Are you trying to use the state of the disposed SubcomposeLayout?
        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.makeSureStateIsConsistent(SubcomposeLayout.kt:514)
        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:391)
        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$Scope.subcompose(SubcomposeLayout.kt:715)
        at androidx.compose.material3.TabRowKt$TabRow$2$1$1.invoke-0kLqBqw(TabRow.kt:151)
        at androidx.compose.material3.TabRowKt$TabRow$2$1$1.invoke(TabRow.kt:149)
        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(SubcomposeLayout.kt:581)
        at androidx.compose.ui.node.InnerPlaceable.measure-BRTryo0(InnerPlaceable.kt:44)
        at androidx.compose.foundation.layout.FillModifier.measure-3p2s80s(Size.kt:658)
        at androidx.compose.ui.node.ModifiedLayoutNode.measure-BRTryo0(ModifiedLayoutNode.kt:53)
        at androidx.compose.ui.node.LayoutNode$performMeasure$1.invoke(LayoutNode.kt:1388)
        at androidx.compose.ui.node.LayoutNode$performMeasure$1.invoke(LayoutNode.kt:1387)
        at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2063)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:112)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:66)
        at androidx.compose.ui.node.LayoutNode.performMeasure-BRTryo0$ui_release(LayoutNode.kt:1387)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.remeasure-BRTryo0(OuterMeasurablePlaceable.kt:94)
        at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release(LayoutNode.kt:1341)
        at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release$default(LayoutNode.kt:1337)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(MeasureAndLayoutDelegate.kt:187)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded(MeasureAndLayoutDelegate.kt:274)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.access$remeasureAndRelayoutIfNeeded(MeasureAndLayoutDelegate.kt:38)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout(MeasureAndLayoutDelegate.kt:208)
        at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout(AndroidComposeView.android.kt:740)
        at androidx.compose.ui.node.Owner$DefaultImpls.measureAndLayout$default(Owner.kt:196)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:937)
        at android.view.View.draw(View.java:22707)
        at android.view.View.updateDisplayListIfDirty(View.java:21579)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4512)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4485)
        at android.view.View.updateDisplayListIfDirty(View.java:21535)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4512)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4485)
        at android.view.View.updateDisplayListIfDirty(View.java:21535)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4512)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4485)
        at android.view.View.updateDisplayListIfDirty(View.java:21535)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4512)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4485)
        at android.view.View.updateDisplayListIfDirty(View.java:21535)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:534)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:540)
E/AndroidRuntime:     at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:616)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:4525)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4245)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3374)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2179)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8787)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
        at android.view.Choreographer.doCallbacks(Choreographer.java:845)
        at android.view.Choreographer.doFrame(Choreographer.java:780)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7870)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: I have a problem with compose runtime-savable library

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

I want to run the project but it has an issue in the runtime-savable library

Relevant logcat output

`Execution failed for task ':core-navigation:generateDebugRFile'.

Could not resolve all files for configuration ':core-navigation:debugCompileClasspath'.
Failed to transform runtime-saveable-1.0.1.aar (androidx.compose.runtime:runtime-saveable:1.0.1) to match attributes {artifactType=android-symbol-with-package-name, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
> Could not find runtime-saveable-1.0.1.aar (androidx.compose.runtime:runtime-saveable:1.0.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/compose/runtime/runtime-saveable/1.0.1/runtime-saveable-1.0.1.aar`

Code of Conduct

  • I agree to follow this project's Code of Conduct

Getting "Special characters are not allowed" while entering username with space at end in Register Screen[Bug]:

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

By clicking on the register with a username having space at the end I'm getting this message in Snackbar. I think the text is not trimmed on validation. I'm passing my opinion here that may not be correct. I'm thinking that how it would be if we auto remove the special characters (or) Spaces entered while typing by showing an info msg in Snackbar.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Align the bottom bar items to center in the landscape mode

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

A bug happened when the device is on the landscape mode, the bottom bar items are moved to the top.

alt text

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Extra recompositions

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

On Interests -> Topics screen

Actual:
If you select any item in list, all items on screen will call recomposition.

Expected:
Only changed items will call recomposition.

Can you explain what to do with this problem? Thanks

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: `NewsResourceCardExpanded` and `NewsResourceHeaderImage` do not share the same `RoundedCornerShape`

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

In the following screenshot, we can see the card bacground on the top-left and top-right corners "leaking" behind the header image.

Screenshot_20220512_232114

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: forYou's NewsFeed has no space at the bottom of the last item

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

The NewsFeed of forYou does not leave spaces at the bottom of the last item.
01

if spaces are added, the user's visual experience may be better.
02

Consider simply adding contentPadding = PaddingValues(bottom = 16.dp).
03

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Janky scroll in People tab on Pixel 5 device

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

I observe that there is junky scroll in People tab on Pixel 5 device. But it seems that Samsung S21 doesn't have this issue.

nowiascroll.mp4
nowiasmoothscroll.mp4

I don't believe that Pixel 5 can't handle just a list with pictures and text:)

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: mention core-designsystem module in the modularization journey docs

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Not necessarily a bug, but a docs "bug" if one can call it that.
The module core-designsystem is not mentioned in the modularization learning journey at the section where there is a list which should mention all of the app's design system.
On top of that it says that stuff like icons etc are part of core-ui but they are now moved into core-designsystem.
It would be a good idea to update that documentation page and be explicit about what you believe should live in a core-designsystem module and what in a core-ui one because as it stands it is a bit up to interpretation and can easily be confusing as I see it.

ps. I think it'd be a good idea to introduce a new Issue template for documentation problems because this does not fit a feature request nor a bug report imo.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Consolidate version catalog definition of kotlinxCoroutines and kotlinxCoroutinesTest

Right now, the version catalog has two independent entries for kotlinx.coroutines, kotlinxCoroutines and kotlinxCoroutinesTest.

Since the runtime and test libraries are published with the same versioning, we should just have a single kotlinxCoroutines entry and use that version for both. That would avoid the potential to have mismatching versions (for example, if #87 and #88 were to be merged separately)

[FR]: Create performance learning journey

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

We're adding performance inspection code to the app.
@JolandaVerhoef recommended creating a learning journey for this.

Describe the solution

Let's create a learning journey.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Filename Sanity]: NiAApp.kt vs ui/NiaApp.kt

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

In app/src/main/java/com/google/samples/apps/nowinandroid/ there is NiAApp.kt, whereas in ui/ there's NiaApp.kt.
Since one of the the app's goals is to "showcase best practices", maybe one of those files should be renamed? (hopefully not to the other's, but to a new unique name?)

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Button contrast issue in dark theme

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

In dark mode, the button's disabled state has wrong contrast:

Screenshot 2022-05-18 at 09 57 14

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Unresponsive `Interests` navigation button

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

When navigating to either a AuthorDestination or TopicDestination, the NavigationBar's NavigationBarItem corresponding to InterestsDestination becomes unselected and clicking on it does nothing.

It seems that the NavDestination's hierarchy is not properly configured.

device-2022-05-12-235958.mp4

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FR]: Support predictive back navigation

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Support Android 13 predictive back navigation

Describe the solution

Opt-in to predictive back navigation as specified here: https://developer.android.com/about/versions/13/features/predictive-back-gesture

Additional context

We are using the AndroidX APIs (via navigation-compose/BackHandler), so this should require no additional work except for enabling the feature.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Build Gradle is failing

What happened?

The project is not being built in the latest Android Studio stable version.

Relevant logcat output

e: C:\Users\ahmad\StudioProjects\nowinandroid\build-logic\convention\src\main\kotlin\nowinandroid.android.application.compose.gradle.kts: (23, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: C:\Users\ahmad\StudioProjects\nowinandroid\build-logic\convention\src\main\kotlin\nowinandroid.android.application.compose.gradle.kts: (23, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: C:\Users\ahmad\StudioProjects\nowinandroid\build-logic\convention\src\main\kotlin\nowinandroid.android.application.compose.gradle.kts: (24, 29): Type mismatch: inferred type is Nowinandroid_android_application_compose_gradle but CommonExtension<*, *, *, *> was expected

Code of Conduct

  • I agree to follow this project's Code of Conduct

runtime-savable library has an issue

I want to run the app but the project has an issue in the runtime-savable library, I get this error:

`Execution failed for task ':core-navigation:generateDebugRFile'.

Could not resolve all files for configuration ':core-navigation:debugCompileClasspath'.
Failed to transform runtime-saveable-1.0.1.aar (androidx.compose.runtime:runtime-saveable:1.0.1) to match attributes {artifactType=android-symbol-with-package-name, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
> Could not find runtime-saveable-1.0.1.aar (androidx.compose.runtime:runtime-saveable:1.0.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/compose/runtime/runtime-saveable/1.0.1/runtime-saveable-1.0.1.aar`

[Observation]: Release yml is incorrect in github actions, looks like copied from Jetpack samples

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

This is not a bug as of now but just some observation (review comment) on file in master branch

.github/workflows/Release.yml

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Build logic] Relying on Gradle script to generate plugins is slowing out the build

Summary

This project is using <plugin id>.build.gradle.kts in a module to let Gradle generate those convention plugins.
This process is really slow and explicitly and manually writing those plugins should be done instead.

Profiling

cf #38 for the before and after using
./gradlew clean && ./gradlew app:assDebug --profile --offline --rerun-tasks

generated plugins explicit plugins
Total Build Time 25.373s 11.205s
Startup 0.263s 0.265s
Settings and buildSrc 0.003s 0.003s
Loading Projects 0.009s 0.007s
Configuring Projects 12.724s 0.765s
Artifact Transforms 0.562s 0.064s
Task Execution 42.970s 34.711s

(On a bigger app at my previous company, the configuration was around 1 minute long with scripts vs a few seconds, unfortunately I don't have access to the benchmarks I made anymore)

Here's the profiles:
profile.zip

[Bug]: Consistent naming convention for NiANetwork and NiaPreferences etc

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Not a bug per se, and probably super picky :) , but be nice to have consistent naming convention e.g. for NiANetwork (big A) and NiaPreferences (little a)....only noticed this when reading https://github.com/android/nowinandroid/blob/main/docs/ArchitectureLearningJourney.md as I didn't realise initially what NiA stood for!

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Question]: Is the baseline profile functioning correctly ?

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

We are trying to add a baseline profile to our app and we saw that it is supposed to be working properly on this app.
However, after following the documentation on the Android documentation here, we had some questions as to measuring the profile: https://developer.android.com/topic/performance/baselineprofiles#measuring-baseline.

After building a release version of the NowInAndroid apk (with ./gradlew app:assembleProdRelease) on an Android API 30 emulator (root active) and sideloading the baseline profile by using the commands given in the docs :

# Check dexopt state
adb shell dumpsys package dexopt | grep -A 1 com.google.samples.apps.nowinandroid

Gave us the following result :

[com.google.samples.apps.nowinandroid]
    path: /data/app/~~52vBZMT5SXHA04XFrAYciA==/com.google.samples.apps.nowinandroid-lFMMjOCyE-gJpkk9Bmmn0Q==/base.apk
      arm64: [status=run-from-apk] [reason=unknown]

Our issue with this result is the status that is run-from-apk which, when reading the docs, should be speed-profile as one can read here : https://source.android.com/devices/tech/dalvik/configure#compilation_options.

Given the issue we tried several fixes without any success :

Further questions :

  • Why do we get this log when launching the app com.google.samples.apps.nowinandroid D/ProfileInstaller: Installing profile for com.google.samples.apps.nowinandroid ?
    Shouldn't the profile be installed when installing the app and not when launching it ?

  • Why isn't the latest Android Gradle plugin used in the app (7.3.0-beta02) ?

  • When trying to reset the compiled state by using this command that is in the docs : adb shell cmd package compile --reset com.google.samples.apps.nowinandroid we always get the following error Failure: package com.google.samples.apps.nowinandroid could not be compiled

  • How can we be sure that the baseline profile is working correctly ?

Many thanks for open sourcing this project. It really helps when looking for best practices and insights.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FR]: Add build workflow for app-nia-catalog

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

The current Build.yaml workflow is specific to building and testing the app module, however, there are more than 1 apps in the project.

Describe the solution

An additional build/test workflow should be added to also build/test app-nia-catalog

Additional context

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: `ForYouScreen` and `InterestsScreen` TopAppBar background color

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

ForYouScreen and InterestsScreen are not using the same background color:

ForYouScreen InterestsScreen Diff
image image 0atetime%-diff

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Can't Build the Project

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

I can't build the project. I'm on Android Studio Electric Eel, Gradle 7.4, Using Java 11. The build keeps failing with the following output

Relevant logcat output

> Task :build-logic:convention:compileKotlin
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.compose.gradle.kts: (23, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.compose.gradle.kts: (23, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.compose.gradle.kts: (24, 29): Type mismatch: inferred type is Nowinandroid_android_application_compose_gradle but CommonExtension<*, *, *, *> was expected
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (24, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (24, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (25, 28): Type mismatch: inferred type is Nowinandroid_android_application_gradle but CommonExtension<*, *, *, *> was expected
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (27, 5): Unresolved reference: defaultConfig
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (28, 9): Unresolved reference: targetSdk
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (24, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (24, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (25, 5): Unresolved reference: androidComponents
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (26, 25): Type mismatch: inferred type is Nowinandroid_android_application_jacoco_gradle but AndroidComponentsExtension<*, *, *> was expected
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.library.compose.gradle.kts: (23, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.library.compose.gradle.kts: (23, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Internal clean up]: NavController in NiaApp doesn't follow the SSOT principles

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

The navController state declared in NiaApp doesn't follow the single source of truth principles. There are 3 places where this state can be mutated: NiaApp, NiaTopLevelNavigation, and NiaNavHost.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Failed Build

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Can't seem to build this with following output

Relevant logcat output

Execution failed for task ':build-logic:convention:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':build-logic:convention:compileKotlin'
   > Could not resolve all files for configuration ':build-logic:convention:kotlinCompilerPluginClasspathMain'.
      > Could not find org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.5.31.
        Required by:
            project :build-logic:convention
      > Could not find org.jetbrains.kotlin:kotlin-sam-with-receiver:1.5.31.
        Required by:
            project :build-logic:convention

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Ripple effect on `NavigationBarItem` has been disabled on the app

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

It doesn't seem expected to remove this pressed/focus effect.
Should we open a PR to restore the default Ripple theme?

CompositionLocalProvider(LocalRippleTheme provides ClearRippleTheme) {

device-2022-05-14-150324.mp4

Note: It's working as expected on the app-nia-catalog.

device-2022-05-14-150345.mp4

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FR]: Add swipe gesture to Tabs in Interests screen

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

The Tabs in the Interests screen do not have swipe gestures to move between Topics and People screens. You have to click on the tabs every time to navigate between the two (which many people I am sure won't like, including me).

Describe the solution

There should be a swipe navigation available so that you could switch between the Topics and People screens easily without having to click on the Tabs. The swipe navigation could be implemented using a ViewPager or by manually adding gesture support through Modifier.swipeable.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: distorted buttons in nia-catalog

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Some buttons are distorted in nia-catalog by lack of space on the screen.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

I strongly hope that you can provide instant messaging demonstration in the nowinAndroid project.And provide relevant open source libraries.[FR]:

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Instant messaging is a very difficult function for Android developers. If Android developers want to develop similar functions, they often need to learn from scratch. If they go to the Internet to find communication protocol libraries that others have already developed, there are also many problems. For example, all kinds of open source instant messaging libraries on the Internet vary in quality, security and stability.

This kind of user needs have existed for a long time, and I believe that they already have relatively mature solutions, but these solutions are often not built for Android, and there are also various problems.

Describe the solution

I strongly hope that you can provide instant messaging demonstration in the nowinAndroid project. In addition, instant messaging is a very difficult function for Android developers. Android developers often need to learn from scratch if they want to develop similar functions. If you go to the Internet to find other people's developed communication protocol libraries, there are also many problems. For example, there are all kinds of open source instant messaging libraries on the Internet.
The quality varies, and the security and stability are not determined. I hope you can provide an open source, instant messaging library, such as retrofit's web request library, for app developers to use, making it easier to develop such functions. Of course, in order to make available to billions of users and developers in areas where Google mobile service is not available, please make these libraries available without relying on gms, just like retrofit libraries.
I even think you can work with square to build such a library, which will be of great benefit to future Android developers.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.