Skip to content

Commit

Permalink
Clear chat notification
Browse files Browse the repository at this point in the history
  • Loading branch information
tien-awair committed May 24, 2022
1 parent d845cb3 commit 44ff132
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonN
return new IntentBuilder(context, cls, channelUrl, title).build();
}

private String url;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(SendBirdUIKit.isDarkMode() ? R.style.SendBird_Dark : R.style.SendBird);
setContentView(R.layout.sb_activity);

String url = getIntent().getStringExtra(StringSet.KEY_CHANNEL_URL);
url = getIntent().getStringExtra(StringSet.KEY_CHANNEL_URL);
String title = getIntent().getStringExtra(StringSet.KEY_HEADER_TITLE);
if (TextUtils.isEmpty(url)) {
ContextUtils.toastError(this, R.string.sb_text_error_get_channel);
Expand All @@ -80,6 +82,14 @@ protected void onCreate(Bundle savedInstanceState) {
AudioManager.getInstance().attachLifecycle(getLifecycle());
}

@Override
protected void onResume() {
Intent intent = new Intent(StringSet.KEY_ACTION_CLEAR_CHAT_NOTIFICATION);
intent.putExtra(StringSet.KEY_CHANNEL_URL, url);
sendBroadcast(intent);
super.onResume();
}

@Override
protected void onDestroy() {
AudioManager.getInstance().detachLifecycle(getLifecycle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class StringSet {
public final static String KEY_USER_ID = "KEY_USER_ID";
public final static String KEY_ACTION_OPEN_USER_PROFILE = "KEY_ACTION_OPEN_USER_PROFILE";
public final static String KEY_ACTION_OPEN_GROUP_PROFILE = "KEY_ACTION_OPEN_GROUP_PROFILE";
public final static String KEY_ACTION_CLEAR_CHAT_NOTIFICATION = "KEY_ACTION_CLEAR_CHAT_NOTIFICATION";

public final static String sb_uikit = "sb_uikit";
public final static String audio = "audio";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void onReconnectFailed() {
super();
this.userListQuery = SendBird.createApplicationUserListQuery();
this.userListQuery.setLimit(USER_LIST_LIMIT);
// this.userListQuery.setNicknameStartsWithFilter("Nguyen Dzung");
this.userListQuery.setNicknameStartsWithFilter("Nguyen Dzung");
this.customUserListQueryHandler = customUserListQueryHandler == null ? SendBirdUIKit.getCustomUserListQueryHandler() : customUserListQueryHandler;
}

Expand Down

0 comments on commit 44ff132

Please sign in to comment.