Skip to content

Migrate Create a group of notifications snippets - #1130

Open
hamen wants to merge 2 commits into
android:mainfrom
hamen:hamen/notification-group-snippets
Open

hamen wants to merge 2 commits into
android:mainfrom
hamen:hamen/notification-group-snippets

Conversation

@hamen

@hamen hamen commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Migrates the hardcoded Kotlin snippets from the Create a group of notifications guide to GitHub-hosted snippet files in :compose:snippets.

Summary of Changes

  • Added compose/snippets/src/main/java/com/example/compose/snippets/notifications/Group.kt containing:
    • android_views_notifications_group_notification
    • android_views_notifications_group_summary
  • Added compile-driven drawable resources (new_mail.xml, ic_notify_email_status.xml, and ic_notify_summary_status.xml) under compose/snippets/src/main/res/drawable/.
  • Verified with ./gradlew :compose:snippets:spotlessApply :compose:snippets:compileDebugKotlin :compose:snippets:spotlessCheck.

@hamen
hamen marked this pull request as ready for review September 22, 2026 17:15
@snippet-bot

snippet-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

* limitations under the License.
*/

package com.example.example.snippet.views.notifications

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move Group.kt (and its drawable resources) from :views into compose/snippets/src/main/java/com/example/compose/snippets/notifications/Group.kt (package com.example.compose.snippets.notifications)? and update the markdown page.

Since all other UI toolkit-agnostic notification snippets (NotificationsSnippets.kt, TimeSensitive.kt in PR #1079, and NotificationNavigation.kt in PR #1129) live under :compose in compose/snippets/src/main/java/com/example/compose/snippets/notifications/.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5b5b102: moved Group.kt and the 3 drawable resources from :views to compose/snippets/src/main/java/com/example/compose/snippets/notifications/Group.kt (package com.example.compose.snippets.notifications) and updated group.md.


private const val CHANNEL_ID = "channelId"

private class MainActivity : ComponentActivity() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting (spotlessApply): Lines 40–46, 57–69, and 71–86 use 8-space continuation indents on NotificationCompat.Builder and InboxStyle() chains. Please run ./gradlew :compose:snippets:spotlessApply so the chains use standard 4-space continuation indentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5b5b102: formatted the NotificationCompat.Builder and InboxStyle() chains with 4-space continuation indentation and verified via ./gradlew :compose:snippets:spotlessApply :compose:snippets:spotlessCheck.

See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you sync this with Material's mark_as_unread asset?

Looks like it starts with the exact first 26 characters of Material's mark_as_unread (24dp) (M18.83,7h-2.6L10.5,4 4,7.4), then hallucinates the remaining path (...M10.5,6.23l5.15,2.7L10.5,11.64...M18,17H6v-6.03l4.5,2.36 4.5,-2.36V17h3z), which does not exist in Material Icons and draws a stray vertical line at x=15.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5b5b102: synced ic_notify_summary_status.xml with Material's official 24dp mark_as_unread vector path.

… formatting, and sync mark_as_unread vector asset
@hamen
hamen requested a review from a team as a code owner September 24, 2026 16:47
@hamen
hamen requested a review from AjeshRPai September 24, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants