Skip to content

Commit

Permalink
remove unnecessary default title & content
Browse files Browse the repository at this point in the history
  • Loading branch information
isradeleon committed Apr 25, 2022
1 parent c5feaaa commit 3d9b70f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions notify/src/main/java/com/application/isradeleon/notify/Notify.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public interface ChannelData {
private String channelName;
private String channelDescription;

private String title = "Notify",
content = "Notification test";
private CharSequence title = "", content = "";

private int id, smallIcon, oreoImportance, importance, color = -1;
private Object largeIcon, picture = null;
Expand Down Expand Up @@ -193,15 +192,13 @@ public void show(){
notificationManager.notify(id, builder.build());
}

public Notify setTitle(@NonNull String title) {
if (!title.isEmpty())
this.title = title;
public Notify setTitle(@NonNull CharSequence title) {
this.title = title;
return this;
}

public Notify setContent(@NonNull String content) {
if (!content.isEmpty())
this.content = content;
public Notify setContent(@NonNull CharSequence content) {
this.content = content;
return this;
}

Expand Down Expand Up @@ -298,13 +295,13 @@ public Notify setLargeIcon(@NonNull String largeIconUrl) {
return this;
}

public Notify setPicture(@DrawableRes int bigPicture) {
this.picture = bigPicture;
public Notify setPicture(@DrawableRes int pictureRes) {
this.picture = pictureRes;
return this;
}

public Notify setPicture(@NonNull String bigPictureUrl) {
this.picture = bigPictureUrl;
public Notify setPicture(@NonNull String pictureUrl) {
this.picture = pictureUrl;
return this;
}

Expand Down

0 comments on commit 3d9b70f

Please sign in to comment.