Skip to content

Commit

Permalink
Added 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rimdoo committed Nov 21, 2022
1 parent c920e28 commit f3c7800
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### v3.3.1 (Nov 21, 2022) with Core SDK `v4.1.3`
* Fixed message update issue when an app is built with Proguard on
* Improved stability

### v3.3.0 (Nov 10, 2022) with Core SDK `v4.1.1`
* Support thread type in GroupChannel
* Added `THREAD` in `ReplyType`
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.3.0
UIKIT_VERSION = 3.3.1
UIKIT_VERSION_CODE = 1
3 changes: 2 additions & 1 deletion uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Sendbird
api 'com.sendbird.sdk:sendbird-chat:4.1.1'
api 'com.sendbird.sdk:sendbird-chat:4.1.3'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
Expand All @@ -80,5 +80,6 @@ dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"


}

This file was deleted.

4 changes: 2 additions & 2 deletions uikit/src/main/java/com/sendbird/uikit/SendbirdUIKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public class SendbirdUIKit {
public enum LogLevel {
ALL(Log.VERBOSE), INFO(Log.INFO), WARN(Log.WARN), ERROR(Log.ERROR), NONE(Integer.MAX_VALUE);

int level;
final int level;

LogLevel(int level) {
this.level = level;
}

int getLevel() {
public int getLevel() {
return level;
}
}
Expand Down
22 changes: 21 additions & 1 deletion uikit/src/main/java/com/sendbird/uikit/utils/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public static String formatDateTime(@NonNull Context context, long timeInMillis)
return formatTime(context, timeInMillis);
} else if (isYesterday(timeInMillis)) {
return context.getString(R.string.sb_text_yesterday);
} else {
} else if (isThisYear(timeInMillis)) {
return formatDate2(timeInMillis);
} else {
return formatDate3(timeInMillis);
}
}

Expand Down Expand Up @@ -68,6 +70,17 @@ public static String formatDate2(long timeInMillis) {
return android.text.format.DateUtils.formatDateTime(null, timeInMillis, flags);
}

/**
* Formats timestamp to 'month/date/year' format (e.g. '12/19/2022').
*/
@NonNull
public static String formatDate3(long timeInMillis) {
int flags = android.text.format.DateUtils.FORMAT_SHOW_YEAR
| android.text.format.DateUtils.FORMAT_SHOW_DATE
| android.text.format.DateUtils.FORMAT_NUMERIC_DATE;
return android.text.format.DateUtils.formatDateTime(null, timeInMillis, flags);
}

/**
* Returns whether the given date is today, based on the user's current locale.
*/
Expand All @@ -87,6 +100,13 @@ public static boolean isYesterday(long timeInMillis) {
&& now.get(Calendar.DATE) == date.get(Calendar.DATE);
}

public static boolean isThisYear(long timeInMillis) {
Calendar now = Calendar.getInstance();
Calendar date = Calendar.getInstance();
date.setTimeInMillis(timeInMillis);
return now.get(Calendar.YEAR) == date.get(Calendar.YEAR);
}

@NonNull
public static String getDateString(long dateMillis) {
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());
Expand Down
2 changes: 1 addition & 1 deletion uikit/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<string name="sb_text_reply_to">Reply to %s</string>
<string name="sb_text_replied_to">%s replied to %s</string>
<string name="sb_text_error_original_message_not_found">Couldn\'t find the original message for this reply.</string>
<string name="sb_text_exceed_mention_limit_count">"You can have up to %d mentions per message."</string>
<string name="sb_text_exceed_mention_limit_count">You can have up to %d mentions per message.</string>
<string name="sb_text_number_of_reply">%d reply</string>
<string name="sb_text_number_of_replies">%d replies</string>
<string name="sb_text_max_number_of_replies">99+ replies</string>
Expand Down

0 comments on commit f3c7800

Please sign in to comment.