Skip to content

Commit

Permalink
Added 3.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-shin committed May 26, 2023
1 parent 7744616 commit a416cc9
Show file tree
Hide file tree
Showing 53 changed files with 1,036 additions and 220 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
### v3.5.6 (May 26, 2023) with Chat SDK `v4.8.3`
* UIKit common
* Improved voice recognition
* Channel Notification
* Added interfaces to set custom theme resource on all Activities

### v3.5.5 (May 19, 2023) with Chat SDK `v4.8.1`
* Improved stability

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ org.gradle.jvmargs=-Xmx1536m
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

UIKIT_VERSION = 3.5.5
UIKIT_VERSION = 3.5.6
UIKIT_VERSION_CODE = 1

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Sendbird
api 'com.sendbird.sdk:sendbird-chat:4.8.1'
api 'com.sendbird.sdk:sendbird-chat:4.8.3'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

Expand Down Expand Up @@ -46,15 +48,46 @@ public static Intent newIntent(@NonNull Context context, @NonNull String channel
*/
@NonNull
public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonNull Class<? extends BannedUserListActivity> cls, @NonNull String channelUrl) {
return newIntentFromCustomActivity(context, cls, channelUrl, SendbirdUIKit.getDefaultThemeMode().getResId());
}

/**
* Create an intent for a {@link BannedUserListActivity}.
*
* @param context A Context of the application package implementing this class.
* @param channelUrl the url of the channel will be implemented.
* @param themeResId the resource identifier for custom theme.
* @return BannedUserListActivity Intent.
* since 3.5.6
*/
@NonNull
public static Intent newIntent(@NonNull Context context, @NonNull String channelUrl, @StyleRes int themeResId) {
return newIntentFromCustomActivity(context, BannedUserListActivity.class, channelUrl, themeResId);
}

/**
* Create an intent for a custom activity. The custom activity must inherit {@link BannedUserListActivity}.
*
* @param context A Context of the application package implementing this class.
* @param cls The activity class that is to be used for the intent.
* @param channelUrl the url of the channel will be implemented.
* @param themeResId the resource identifier for custom theme.
* @return Returns a newly created Intent that can be used to launch the activity.
* since 3.5.6
*/
@NonNull
public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonNull Class<? extends BannedUserListActivity> cls, @NonNull String channelUrl, @StyleRes int themeResId) {
Intent intent = new Intent(context, cls);
intent.putExtra(StringSet.KEY_CHANNEL_URL, channelUrl);
intent.putExtra(StringSet.KEY_THEME_RES_ID, themeResId);
return intent;
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(SendbirdUIKit.isDarkMode() ? R.style.AppTheme_Dark_Sendbird : R.style.AppTheme_Sendbird);
int themeResId = getIntent().getIntExtra(StringSet.KEY_THEME_RES_ID, SendbirdUIKit.getDefaultThemeMode().getResId());
setTheme(themeResId);
setContentView(R.layout.sb_activity);

Fragment fragment = createFragment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
Expand Down Expand Up @@ -65,7 +66,8 @@ public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonN
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(SendbirdUIKit.isDarkMode() ? R.style.AppTheme_Dark_Sendbird : R.style.AppTheme_Sendbird);
int themeResId = getIntent().getIntExtra(StringSet.KEY_THEME_RES_ID, SendbirdUIKit.getDefaultThemeMode().getResId());
setTheme(themeResId);
setContentView(R.layout.sb_activity);

Fragment fragment = createFragment();
Expand Down Expand Up @@ -117,8 +119,12 @@ public static class IntentBuilder {
@NonNull
private final String channelUrl;
private long startingPoint = Long.MAX_VALUE;
@Nullable
private Class<? extends ChannelActivity> customClass = ChannelActivity.class;

@NonNull
private final Class<? extends ChannelActivity> customClass;

@StyleRes
private final int themeResId;

/**
* Create an intent for a {@link ChannelActivity}.
Expand All @@ -128,8 +134,7 @@ public static class IntentBuilder {
* since 2.1.0
*/
public IntentBuilder(@NonNull Context context, @NonNull String channelUrl) {
this.context = context;
this.channelUrl = channelUrl;
this(context, ChannelActivity.class, channelUrl);
}

/**
Expand All @@ -141,9 +146,23 @@ public IntentBuilder(@NonNull Context context, @NonNull String channelUrl) {
* since 2.1.0
*/
public IntentBuilder(@NonNull Context context, @NonNull Class<? extends ChannelActivity> customClass, @NonNull String channelUrl) {
this(context, customClass, channelUrl, SendbirdUIKit.getDefaultThemeMode().getResId());
}

/**
* Create an intent for a {@link ChannelActivity}.
*
* @param context A Context of the application package implementing this class.
* @param customClass The activity class that is to be used for the intent.
* @param channelUrl The url of the channel will be implemented.
* @param themeResId the resource identifier for custom theme.
* since 3.5.6
*/
public IntentBuilder(@NonNull Context context, @NonNull Class<? extends ChannelActivity> customClass, @NonNull String channelUrl, @StyleRes int themeResId) {
this.context = context;
this.channelUrl = channelUrl;
this.customClass = customClass;
this.themeResId = themeResId;
}

/**
Expand All @@ -170,6 +189,7 @@ public Intent build() {
Intent intent = new Intent(context, customClass);
intent.putExtra(StringSet.KEY_CHANNEL_URL, channelUrl);
intent.putExtra(StringSet.KEY_STARTING_POINT, startingPoint);
intent.putExtra(StringSet.KEY_THEME_RES_ID, themeResId);
return intent;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
Expand All @@ -28,7 +29,22 @@ public class ChannelListActivity extends AppCompatActivity {
*/
@NonNull
public static Intent newIntent(@NonNull Context context) {
return new Intent(context, ChannelListActivity.class);
return newIntent(context, SendbirdUIKit.getDefaultThemeMode().getResId());
}

/**
* Create an intent for a {@link ChannelListActivity}.
*
* @param context A Context of the application package implementing this class.
* @param themeResId the resource identifier for custom theme.
* @return ChannelListActivity Intent.
* since 3.5.6
*/
@NonNull
public static Intent newIntent(@NonNull Context context, @StyleRes int themeResId) {
Intent intent = new Intent(context, ChannelListActivity.class);
intent.putExtra(StringSet.KEY_THEME_RES_ID, themeResId);
return intent;
}

/**
Expand All @@ -44,6 +60,21 @@ public static Intent newRedirectToChannelIntent(@NonNull Context context, @NonNu
return newIntentFromCustomActivity(context, ChannelListActivity.class, channelUrl);
}

/**
* Create an intent for a {@link ChannelListActivity}.
* This intent will redirect to {@link ChannelActivity} if channel url is valid.
*
* @param context A Context of the application package implementing this class.
* @param channelUrl the url of the channel will be implemented.
* @param themeResId the resource identifier for custom theme.
* @return ChannelListActivity Intent
* since 3.5.6
*/
@NonNull
public static Intent newRedirectToChannelIntent(@NonNull Context context, @NonNull String channelUrl, @StyleRes int themeResId) {
return newIntentFromCustomActivity(context, ChannelListActivity.class, channelUrl, themeResId);
}

/**
* Create an intent for a custom activity. The custom activity must inherit {@link ChannelListActivity}.
*
Expand All @@ -55,15 +86,32 @@ public static Intent newRedirectToChannelIntent(@NonNull Context context, @NonNu
*/
@NonNull
public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonNull Class<? extends ChannelListActivity> cls, @NonNull String channelUrl) {
return newIntentFromCustomActivity(context, cls, channelUrl, SendbirdUIKit.getDefaultThemeMode().getResId());
}

/**
* Create an intent for a custom activity. The custom activity must inherit {@link ChannelListActivity}.
*
* @param context A Context of the application package implementing this class.
* @param cls The activity class that is to be used for the intent.
* @param channelUrl the url of the channel will be implemented.
* @param themeResId the resource identifier for custom theme.
* @return Returns a newly created Intent that can be used to launch the activity.
* since 3.5.6
*/
@NonNull
public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonNull Class<? extends ChannelListActivity> cls, @NonNull String channelUrl, @StyleRes int themeResId) {
Intent intent = new Intent(context, cls);
intent.putExtra(StringSet.KEY_CHANNEL_URL, channelUrl);
intent.putExtra(StringSet.KEY_THEME_RES_ID, themeResId);
return intent;
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(SendbirdUIKit.isDarkMode() ? R.style.AppTheme_Dark_Sendbird : R.style.AppTheme_Sendbird);
int themeResId = getIntent().getIntExtra(StringSet.KEY_THEME_RES_ID, SendbirdUIKit.getDefaultThemeMode().getResId());
setTheme(themeResId);
setContentView(R.layout.sb_activity);

Fragment fragment = createFragment();
Expand Down
Loading

0 comments on commit a416cc9

Please sign in to comment.