Skip to content

Commit

Permalink
Added 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rimdoo committed Apr 28, 2021
1 parent 7338f90 commit 80358c9
Show file tree
Hide file tree
Showing 31 changed files with 594 additions and 125 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Change Log
### v2.1.3 (April 27, 2021) with Core SDK `v3.0.163`
* Targeted Android 11 (API 30).
* Supported Scoped storage.
* The `requestLegacyExternalStorage` attribute has been deleted.
* Used `Media Store API`.
* Improved stability.

### v2.1.2 (April 13, 2021) with Core SDK `v3.0.161`
* Added `showInputRightButtonAlways()` in `ChannelFragment.Builder`, `OpenChannelFragment.Builder`.
* From this version, it is not available on `jcenter`. This version can only be available from Sendbird's maven repository: `maven { url "https://repo.sendbird.com/public/maven" }`.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enablerD8=true

UIKIT_VERSION = 2.1.2
UIKIT_VERSION = 2.1.3
UIKIT_VERSION_CODE = 1

8 changes: 5 additions & 3 deletions uikit-custom-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.sendbird.uikit.customsample"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -35,8 +36,9 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(":uikit")
// implementation "com.sendbird.sdk:uikit:2.1.2"
// implementation "com.sendbird.sdk:uikit:2.1.3"

implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.google.firebase:firebase-messaging:21.0.0'

implementation 'androidx.appcompat:appcompat:1.2.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.sendbird.uikit.customsample;


import android.app.Application;

import androidx.annotation.NonNull;
import androidx.multidex.MultiDexApplication;

import com.sendbird.android.ApplicationUserListQuery;
import com.sendbird.android.FileMessageParams;
Expand All @@ -26,7 +25,7 @@
import java.util.ArrayList;
import java.util.List;

public class BaseApplication extends Application {
public class BaseApplication extends MultiDexApplication {

private static final String APP_ID = "2D7B4CDB-932F-4082-9B09-A1153792DC8D";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -48,7 +49,7 @@
import static android.app.Activity.RESULT_OK;

public class SettingsFragment extends Fragment {
private final String[] REQUIRED_PERMISSIONS = {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
private String[] REQUIRED_PERMISSIONS;

private static final int STORAGE_PERMISSIONS_REQUEST_CODE = 1001;
private static final int PERMISSION_SETTINGS_REQUEST_ID = 2000;
Expand Down Expand Up @@ -182,6 +183,15 @@ private void initPage(@NonNull View view) {
return;
}

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE};
} else {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE};
}

boolean useDoNotDisturb = true;
if (getArguments() != null) {
useDoNotDisturb = getArguments().getBoolean(StringSet.SETTINGS_USE_DO_NOT_DISTURB, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.Editable;
Expand Down Expand Up @@ -44,7 +45,7 @@


public class CreateCommunityActivity extends AppCompatActivity {
private final String[] REQUIRED_PERMISSIONS = {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
private String[] REQUIRED_PERMISSIONS;

private static final int STORAGE_PERMISSIONS_REQUEST_CODE = 1001;
private static final int PERMISSION_SETTINGS_REQUEST_ID = 2000;
Expand Down Expand Up @@ -90,6 +91,15 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
public void afterTextChanged(Editable s) {}
});
binding.clearButton.setOnClickListener(v -> binding.etTitle.setText(""));

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE};
} else {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE};
}
}

private void createCommunityChannel() {
Expand Down
10 changes: 6 additions & 4 deletions uikit-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 30
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.sendbird.uikit.sample"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
Expand All @@ -32,8 +33,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":uikit")
// implementation "com.sendbird.sdk:uikit:2.1.2"
// implementation "com.sendbird.sdk:uikit:2.1.3"

implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation 'com.google.android.material:material:1.2.1'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sendbird.uikit_messaging_android;


import android.app.Application;
import androidx.multidex.MultiDexApplication;

import com.sendbird.uikit.SendBirdUIKit;
import com.sendbird.uikit.adapter.SendBirdUIKitAdapter;
Expand All @@ -10,7 +9,7 @@
import com.sendbird.uikit_messaging_android.utils.PreferenceUtils;
import com.sendbird.uikit_messaging_android.utils.PushUtils;

public class BaseApplication extends Application {
public class BaseApplication extends MultiDexApplication {

private static final String APP_ID = "2D7B4CDB-932F-4082-9B09-A1153792DC8D";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -50,7 +51,7 @@
import static android.app.Activity.RESULT_OK;

public class SettingsFragment extends Fragment {
private final String[] REQUIRED_PERMISSIONS = {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
private String[] REQUIRED_PERMISSIONS;

private static final int STORAGE_PERMISSIONS_REQUEST_CODE = 1001;
private static final int PERMISSION_SETTINGS_REQUEST_ID = 2000;
Expand Down Expand Up @@ -184,6 +185,15 @@ private void initPage() {
return;
}

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE};
} else {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE};
}

boolean useHeader = true;
boolean useDoNotDisturb = true;
if (getArguments() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.Editable;
Expand Down Expand Up @@ -45,7 +46,7 @@
import java.util.Locale;

public class CreateCommunityActivity extends AppCompatActivity {
private final String[] REQUIRED_PERMISSIONS = {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
private String[] REQUIRED_PERMISSIONS;

private static final int STORAGE_PERMISSIONS_REQUEST_CODE = 1001;
private static final int PERMISSION_SETTINGS_REQUEST_ID = 2000;
Expand Down Expand Up @@ -92,6 +93,15 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
public void afterTextChanged(Editable s) {}
});
binding.clearButton.setOnClickListener(v -> binding.etTitle.setText(""));

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE};
} else {
REQUIRED_PERMISSIONS = new String[]{Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE};
}
}

private void createCommunityChannel() {
Expand Down
8 changes: 4 additions & 4 deletions uikit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 30
buildToolsVersion "29.0.3"

version = UIKIT_VERSION
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 30
versionCode Integer.parseInt(UIKIT_VERSION_CODE)
versionName UIKIT_VERSION
}
Expand Down Expand Up @@ -57,7 +57,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Sendbird
api 'com.sendbird.sdk:sendbird-android-sdk:3.0.161'
api 'com.sendbird.sdk:sendbird-android-sdk:3.0.163'

implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
Expand Down
18 changes: 6 additions & 12 deletions uikit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sendbird.uikit">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.INTERNET" />

<application android:requestLegacyExternalStorage="true">
<application>
<activity
android:name=".activities.InviteChannelActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
Expand Down Expand Up @@ -70,15 +74,5 @@
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateUnchanged"
/>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/sb_file_paths" />
</provider>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.sendbird.android.BannedUserListQuery;
import com.sendbird.android.GroupChannel;
import com.sendbird.android.Member;
import com.sendbird.android.User;
import com.sendbird.uikit.R;
import com.sendbird.uikit.SendBirdUIKit;
Expand All @@ -34,6 +35,7 @@ public class BannedListFragment extends UserTypeListFragment {
@Override
protected void onConfigure() {
super.onConfigure();
if (channel.getMyRole() != Member.Role.OPERATOR) finish();
if (customQueryHandler == null) {
setCustomQueryHandler(new BannedMembersQueryHandler(channel));
}
Expand All @@ -50,6 +52,11 @@ protected void onActionItemClicked(View view, int position, User user) {
items, (v, p, key) -> unbanUser(user.getUserId())).showSingle(getFragmentManager());
}

@Override
protected void onOperatorDismissed() {
finish();
}

private void unbanUser(@NonNull String userId) {
loadingDialogHandler.shouldShowLoadingDialog();
channel.unbanUserWithUserId(userId, e -> {
Expand Down
Loading

0 comments on commit 80358c9

Please sign in to comment.