Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[New Library] Android NotificationChannel extensions #12

Open
6 tasks
Tracked by #20
EdricChan03 opened this issue Aug 11, 2023 · 0 comments
Open
6 tasks
Tracked by #20

[New Library] Android NotificationChannel extensions #12

EdricChan03 opened this issue Aug 11, 2023 · 0 comments
Labels
api request Request for a new API enhancement New feature or request library request Request for a new library

Comments

@EdricChan03
Copy link
Owner

EdricChan03 commented Aug 11, 2023

I've noticed that the NotificationChannel class has some rather... interesting naming conventions for getters/setters of boolean properties:

/**
 * Sets whether notifications posted to this channel should display notification lights,
 * on devices that support that feature.
 *
 * Only modifiable before the channel is submitted to
 * {@link NotificationManager#createNotificationChannel(NotificationChannel)}.
 */
public void enableLights(boolean lights) {
    this.mLights = lights;
}

/**
 * Returns whether notifications posted to this channel trigger notification lights.
 */
public boolean shouldShowLights() {
    return mLights;
}

As a result, no synthetic Kotlin mutable properties are generated, resulting in having to use the Java getter/setter methods respectively.

Proposed extensions

(API names are currently tentative, the names will change as further experimentation is done)

Additional tasks

  • Add notice that the properties can't be modified once they have been submitted (perhaps a Kotlin opt-in annotation, something like ImmutableAfterCreation)
@EdricChan03 EdricChan03 added enhancement New feature or request library request Request for a new library api request Request for a new API labels Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api request Request for a new API enhancement New feature or request library request Request for a new library
Projects
Status: 🏗 In progress
Development

No branches or pull requests

1 participant