diff --git a/uikit/src/main/java/com/sendbird/uikit/activities/ChannelActivity.java b/uikit/src/main/java/com/sendbird/uikit/activities/ChannelActivity.java index 41e545a5..0c45a62a 100644 --- a/uikit/src/main/java/com/sendbird/uikit/activities/ChannelActivity.java +++ b/uikit/src/main/java/com/sendbird/uikit/activities/ChannelActivity.java @@ -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); @@ -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()); diff --git a/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.java b/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.java index f0468056..c00f063d 100644 --- a/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.java +++ b/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.java @@ -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"; diff --git a/uikit/src/main/java/com/sendbird/uikit/vm/SelectableUserInfoListViewModel.java b/uikit/src/main/java/com/sendbird/uikit/vm/SelectableUserInfoListViewModel.java index ab2e34ba..96128dcb 100644 --- a/uikit/src/main/java/com/sendbird/uikit/vm/SelectableUserInfoListViewModel.java +++ b/uikit/src/main/java/com/sendbird/uikit/vm/SelectableUserInfoListViewModel.java @@ -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; }