首次提交信息
This commit is contained in:
52
tuicore/build.gradle
Normal file
52
tuicore/build.gradle
Normal file
@@ -0,0 +1,52 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
}
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
namespace "com.tencent.qcloud.tuicore"
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 30
|
||||
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = false
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
res.srcDirs += "src/main/res-light"
|
||||
res.srcDirs += "src/main/res-lively"
|
||||
res.srcDirs += "src/main/res-serious"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api fileTree(include: ['*.jar', '*.aar'], dir: '../../../../tuikit/android/libs')
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||
api 'com.google.auto.service:auto-service-annotations:1.1.1'
|
||||
|
||||
def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect()
|
||||
println "all projects : {$projects}"
|
||||
if (projects.contains("imsdk-plus")) {
|
||||
api project(':imsdk-plus')
|
||||
} else {
|
||||
api rootProject.getProperties().containsKey("imSdk") ? rootProject.ext.imSdk : "com.tencent.imsdk:imsdk-plus:8.5.6864"
|
||||
}
|
||||
|
||||
}
|
||||
28
tuicore/src/main/AndroidManifest.xml
Normal file
28
tuicore/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name="com.tencent.qcloud.tuicore.permission.PermissionActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/CoreActivityTranslucent"
|
||||
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" />
|
||||
|
||||
<activity
|
||||
android:name="com.tencent.qcloud.tuicore.util.PermissionRequester$PermissionActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:multiprocess="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/CoreActivityTranslucent"
|
||||
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" />
|
||||
|
||||
<provider
|
||||
android:name="com.tencent.qcloud.tuicore.ServiceInitializer"
|
||||
android:authorities="${applicationId}.TUICore.Init"
|
||||
android:initOrder="99999"
|
||||
android:enabled="true"
|
||||
android:exported="false"/>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUINotification;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* Notification registration, removal and triggering
|
||||
*/
|
||||
class EventManager {
|
||||
private static final String TAG = EventManager.class.getSimpleName();
|
||||
|
||||
private static class EventManagerHolder {
|
||||
private static final EventManager eventManager = new EventManager();
|
||||
}
|
||||
|
||||
public static EventManager getInstance() {
|
||||
return EventManagerHolder.eventManager;
|
||||
}
|
||||
|
||||
private final Map<Pair<String, String>, List<ITUINotification>> eventMap = new ConcurrentHashMap<>();
|
||||
|
||||
private EventManager() {}
|
||||
|
||||
public void registerEvent(String key, String subKey, ITUINotification notification) {
|
||||
Log.i(TAG, "registerEvent : key : " + key + ", subKey : " + subKey + ", notification : " + notification);
|
||||
if (TextUtils.isEmpty(key) || TextUtils.isEmpty(subKey) || notification == null) {
|
||||
return;
|
||||
}
|
||||
Pair<String, String> keyPair = new Pair<>(key, subKey);
|
||||
List<ITUINotification> list = eventMap.get(keyPair);
|
||||
if (list == null) {
|
||||
list = new CopyOnWriteArrayList<>();
|
||||
eventMap.put(keyPair, list);
|
||||
}
|
||||
if (!list.contains(notification)) {
|
||||
list.add(notification);
|
||||
}
|
||||
}
|
||||
|
||||
public void unRegisterEvent(String key, String subKey, ITUINotification notification) {
|
||||
Log.i(TAG, "removeEvent : key : " + key + ", subKey : " + subKey + " notification : " + notification);
|
||||
if (TextUtils.isEmpty(key) || TextUtils.isEmpty(subKey) || notification == null) {
|
||||
return;
|
||||
}
|
||||
Pair<String, String> keyPair = new Pair<>(key, subKey);
|
||||
List<ITUINotification> list = eventMap.get(keyPair);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
list.remove(notification);
|
||||
}
|
||||
|
||||
public void unRegisterEvent(ITUINotification notification) {
|
||||
Log.i(TAG, "removeEvent : notification : " + notification);
|
||||
if (notification == null) {
|
||||
return;
|
||||
}
|
||||
for (Pair<String, String> key : eventMap.keySet()) {
|
||||
List<ITUINotification> value = eventMap.get(key);
|
||||
if (value == null) {
|
||||
continue;
|
||||
}
|
||||
for (ITUINotification item : value) {
|
||||
if (item == notification) {
|
||||
value.remove(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyEvent(String key, String subKey, Map<String, Object> param) {
|
||||
Log.d(TAG, "notifyEvent : key : " + key + ", subKey : " + subKey);
|
||||
if (TextUtils.isEmpty(key) || TextUtils.isEmpty(subKey)) {
|
||||
return;
|
||||
}
|
||||
Pair<String, String> keyPair = new Pair<>(key, subKey);
|
||||
List<ITUINotification> notificationList = eventMap.get(keyPair);
|
||||
if (notificationList != null) {
|
||||
for (ITUINotification notification : notificationList) {
|
||||
notification.onNotifyEvent(key, subKey, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIExtension;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIExtensionInfo;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* UI extension registration and acquisition
|
||||
*/
|
||||
class ExtensionManager {
|
||||
private static final String TAG = ExtensionManager.class.getSimpleName();
|
||||
|
||||
private static class ExtensionManagerHolder {
|
||||
private static final ExtensionManager extensionManager = new ExtensionManager();
|
||||
}
|
||||
|
||||
public static ExtensionManager getInstance() {
|
||||
return ExtensionManagerHolder.extensionManager;
|
||||
}
|
||||
|
||||
private final Map<String, List<ITUIExtension>> extensionHashMap = new ConcurrentHashMap<>();
|
||||
|
||||
private ExtensionManager() {}
|
||||
|
||||
public void registerExtension(String extensionID, ITUIExtension extension) {
|
||||
Log.i(TAG, "registerExtension extensionID : " + extensionID + ", extension : " + extension);
|
||||
if (TextUtils.isEmpty(extensionID) || extension == null) {
|
||||
return;
|
||||
}
|
||||
List<ITUIExtension> list = extensionHashMap.get(extensionID);
|
||||
if (list == null) {
|
||||
list = new CopyOnWriteArrayList<>();
|
||||
extensionHashMap.put(extensionID, list);
|
||||
}
|
||||
if (!list.contains(extension)) {
|
||||
list.add(extension);
|
||||
}
|
||||
}
|
||||
|
||||
public void unRegisterExtension(String extensionID, ITUIExtension extension) {
|
||||
Log.i(TAG, "removeExtension extensionID : " + extensionID + ", extension : " + extension);
|
||||
if (TextUtils.isEmpty(extensionID) || extension == null) {
|
||||
return;
|
||||
}
|
||||
List<ITUIExtension> list = extensionHashMap.get(extensionID);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
list.remove(extension);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Map<String, Object> getExtensionInfo(String key, Map<String, Object> param) {
|
||||
Log.d(TAG, "getExtensionInfo key : " + key);
|
||||
if (TextUtils.isEmpty(key)) {
|
||||
return null;
|
||||
}
|
||||
List<ITUIExtension> list = extensionHashMap.get(key);
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
for (ITUIExtension extension : list) {
|
||||
return extension.onGetExtensionInfo(key, param);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<TUIExtensionInfo> getExtensionList(String extensionID, Map<String, Object> param) {
|
||||
Log.d(TAG, "getExtensionInfoList extensionID : " + extensionID);
|
||||
List<TUIExtensionInfo> extensionInfoList = new ArrayList<>();
|
||||
if (TextUtils.isEmpty(extensionID)) {
|
||||
return extensionInfoList;
|
||||
}
|
||||
List<ITUIExtension> ituiExtensionList = extensionHashMap.get(extensionID);
|
||||
if (ituiExtensionList == null || ituiExtensionList.isEmpty()) {
|
||||
return extensionInfoList;
|
||||
}
|
||||
for (ITUIExtension ituiExtension : ituiExtensionList) {
|
||||
List<TUIExtensionInfo> extensionInfo = ituiExtension.onGetExtension(extensionID, param);
|
||||
if (extensionInfo != null) {
|
||||
extensionInfoList.addAll(extensionInfo);
|
||||
}
|
||||
}
|
||||
return extensionInfoList;
|
||||
}
|
||||
|
||||
public void raiseExtension(String extensionID, View parentView, Map<String, Object> param) {
|
||||
Log.d(TAG, "raiseExtension extensionID : " + extensionID);
|
||||
if (TextUtils.isEmpty(extensionID)) {
|
||||
return;
|
||||
}
|
||||
List<ITUIExtension> list = extensionHashMap.get(extensionID);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isResponded = false;
|
||||
for (ITUIExtension extension : list) {
|
||||
isResponded = extension.onRaiseExtension(extensionID, parentView, param);
|
||||
if (isResponded) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIObjectFactory;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Object register and create
|
||||
*/
|
||||
class ObjectManager {
|
||||
private static final String TAG = ObjectManager.class.getSimpleName();
|
||||
|
||||
private static class ObjectManagerHolder {
|
||||
private static final ObjectManager serviceManager = new ObjectManager();
|
||||
}
|
||||
|
||||
public static ObjectManager getInstance() {
|
||||
return ObjectManagerHolder.serviceManager;
|
||||
}
|
||||
|
||||
private final Map<String, ITUIObjectFactory> objectFactoryMap = new ConcurrentHashMap<>();
|
||||
|
||||
private ObjectManager() {}
|
||||
|
||||
public void registerObjectFactory(String factoryName, ITUIObjectFactory objectFactory) {
|
||||
Log.i(TAG, "registerObjectFactory : " + factoryName + " " + objectFactory);
|
||||
if (TextUtils.isEmpty(factoryName) || objectFactory == null) {
|
||||
return;
|
||||
}
|
||||
objectFactoryMap.put(factoryName, objectFactory);
|
||||
}
|
||||
|
||||
public void unregisterObjectFactory(String factoryName) {
|
||||
Log.i(TAG, "unregisterObjectFactory : " + factoryName);
|
||||
if (TextUtils.isEmpty(factoryName)) {
|
||||
return;
|
||||
}
|
||||
objectFactoryMap.remove(factoryName);
|
||||
}
|
||||
|
||||
public Object createObject(String factoryName, String objectName, Map<String, Object> param) {
|
||||
Log.d(TAG, "createObject : " + factoryName + " objectName : " + objectName);
|
||||
if (TextUtils.isEmpty(factoryName)) {
|
||||
return null;
|
||||
}
|
||||
ITUIObjectFactory objectFactory = objectFactoryMap.get(factoryName);
|
||||
if (objectFactory != null) {
|
||||
return objectFactory.onCreateObject(objectName, param);
|
||||
} else {
|
||||
Log.w(TAG, "can't find objectFactory : " + factoryName);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.tencent.qcloud.tuicore.annotations.TUIInitializerDependency;
|
||||
import com.tencent.qcloud.tuicore.annotations.TUIInitializerID;
|
||||
import com.tencent.qcloud.tuicore.annotations.TUIInitializerPriority;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIInitializer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Queue;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* If each module needs to be initialized, it needs to implement the init method of this class
|
||||
* and register it in the form of ContentProvider in the Manifest file.
|
||||
*/
|
||||
public class ServiceInitializer extends ContentProvider {
|
||||
private static final String TAG = "ServiceInitializer";
|
||||
|
||||
/**
|
||||
* @param context applicationContext
|
||||
*/
|
||||
public void init(Context context) {}
|
||||
|
||||
/**
|
||||
* LightTheme id
|
||||
*/
|
||||
public int getLightThemeResId() {
|
||||
return R.style.TUIBaseLightTheme;
|
||||
}
|
||||
|
||||
/**
|
||||
* LivelyTheme id
|
||||
*/
|
||||
public int getLivelyThemeResId() {
|
||||
return R.style.TUIBaseLivelyTheme;
|
||||
}
|
||||
|
||||
/**
|
||||
* SeriousTheme id
|
||||
*/
|
||||
public int getSeriousThemeResId() {
|
||||
return R.style.TUIBaseSeriousTheme;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// The following methods do not need to be overridden //
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private static Context appContext;
|
||||
private static boolean hasInitComponents = false;
|
||||
|
||||
public static Context getAppContext() {
|
||||
return appContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
if (appContext == null) {
|
||||
appContext = getContext().getApplicationContext();
|
||||
}
|
||||
|
||||
TUILogin.init(appContext);
|
||||
TUIRouter.init(appContext);
|
||||
TUIConfig.init(appContext);
|
||||
TUIThemeManager.addLightTheme(getLightThemeResId());
|
||||
TUIThemeManager.addLivelyTheme(getLivelyThemeResId());
|
||||
TUIThemeManager.addSeriousTheme(getSeriousThemeResId());
|
||||
TUIThemeManager.setTheme(appContext);
|
||||
if (!hasInitComponents) {
|
||||
hasInitComponents = true;
|
||||
initComponents();
|
||||
}
|
||||
init(appContext);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
ServiceLoader<TUIInitializer> initializers = ServiceLoader.load(TUIInitializer.class);
|
||||
Map<String, TUIInitializer> initializerMap = new HashMap<>();
|
||||
for (TUIInitializer initializer : initializers) {
|
||||
String initializerID = getInitializerID(initializer);
|
||||
initializerMap.put(initializerID, initializer);
|
||||
}
|
||||
|
||||
List<TUIInitializer> initializerList = getSortedInitializerList(initializerMap);
|
||||
StringBuilder sequence = new StringBuilder();
|
||||
for (TUIInitializer initializer : initializerList) {
|
||||
sequence.append(getInitializerID(initializer)).append(" ");
|
||||
}
|
||||
Log.i(TAG, "initialization sequence : " + sequence);
|
||||
for (TUIInitializer initializer : initializerList) {
|
||||
String initializerID = getInitializerID(initializer);
|
||||
Log.i(TAG, "start init " + initializerID);
|
||||
initializer.init(appContext);
|
||||
Log.i(TAG, "init " + initializerID + " finished");
|
||||
}
|
||||
}
|
||||
|
||||
private List<TUIInitializer> getSortedInitializerList(Map<String, TUIInitializer> initializerMap) {
|
||||
Map<TUIInitializer, DependencyNode> dependencyNodeMap = new HashMap<>();
|
||||
// build dependency map
|
||||
for (TUIInitializer initializer : initializerMap.values()) {
|
||||
dependencyNodeMap.put(initializer, new DependencyNode(initializer));
|
||||
}
|
||||
for (Map.Entry<String, TUIInitializer> initializerEntry : initializerMap.entrySet()) {
|
||||
TUIInitializerDependency annotationDependency = initializerEntry.getValue().getClass().getAnnotation(TUIInitializerDependency.class);
|
||||
TUIInitializerPriority annotationPriority = initializerEntry.getValue().getClass().getAnnotation(TUIInitializerPriority.class);
|
||||
DependencyNode dependencyNode = dependencyNodeMap.get(initializerEntry.getValue());
|
||||
int priority = 0;
|
||||
if (annotationPriority != null) {
|
||||
priority = annotationPriority.value();
|
||||
}
|
||||
dependencyNode.priority = priority;
|
||||
if (annotationDependency == null) {
|
||||
continue;
|
||||
}
|
||||
String[] dependencies = annotationDependency.value();
|
||||
if (dependencies == null || dependencies.length == 0) {
|
||||
continue;
|
||||
}
|
||||
for (String dependencyID : dependencies) {
|
||||
if (TextUtils.isEmpty(dependencyID)) {
|
||||
continue;
|
||||
}
|
||||
if (initializerMap.containsKey(dependencyID)) {
|
||||
DependencyNode beDependencyNode = dependencyNodeMap.get(initializerMap.get(dependencyID));
|
||||
dependencyNode.addDependency(beDependencyNode);
|
||||
beDependencyNode.addBeDependency(dependencyNode);
|
||||
} else {
|
||||
Log.w(TAG, initializerEntry.getKey() + " depends on " + dependencyID + ", but " + dependencyID + " is not found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
// sort by dependency count and priority
|
||||
List<DependencyNode> dependencyNodeList = new ArrayList<>(dependencyNodeMap.values());
|
||||
Comparator<DependencyNode> comparator = (o1, o2) -> {
|
||||
if (o1.dependencyCount() == o2.dependencyCount()) {
|
||||
return o2.priority - o1.priority;
|
||||
}
|
||||
return o1.dependencyCount() - o2.dependencyCount();
|
||||
};
|
||||
Collections.sort(dependencyNodeList, comparator);
|
||||
// get the initialization sequence and check
|
||||
ArrayList<TUIInitializer> sortedInitializerList = new ArrayList<>();
|
||||
while (true) {
|
||||
if (dependencyNodeList.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
DependencyNode dependencyNode = dependencyNodeList.get(0);
|
||||
if (dependencyNode != null && dependencyNode.dependencyCount() == 0) {
|
||||
Set<DependencyNode> beDependencyNodes = dependencyNode.getBeDependencySet();
|
||||
for (DependencyNode beDependencyNode : beDependencyNodes) {
|
||||
beDependencyNode.removeDependency(dependencyNode);
|
||||
}
|
||||
dependencyNode.removeBeDependencies(beDependencyNodes);
|
||||
sortedInitializerList.add(dependencyNode.initializer);
|
||||
dependencyNodeList.remove(0);
|
||||
Collections.sort(dependencyNodeList, comparator);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dependencyNodeList.size() != 0) {
|
||||
throw new IllegalStateException("FATAL! TUIInitializer has circular dependency:\n" + dumpCircularDependency(dependencyNodeList));
|
||||
}
|
||||
return sortedInitializerList;
|
||||
}
|
||||
|
||||
private String getInitializerID(TUIInitializer initializer) {
|
||||
String initializerID;
|
||||
TUIInitializerID annotationID = initializer.getClass().getAnnotation(TUIInitializerID.class);
|
||||
if (annotationID == null || TextUtils.isEmpty(annotationID.value())) {
|
||||
initializerID = initializer.getClass().getSimpleName();
|
||||
} else {
|
||||
initializerID = annotationID.value();
|
||||
}
|
||||
return initializerID;
|
||||
}
|
||||
|
||||
private String dumpCircularDependency(List<DependencyNode> dependencyNodes) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("[");
|
||||
for (DependencyNode dependencyNode : dependencyNodes) {
|
||||
builder.append(dependencyNode.initializer.getClass().getSimpleName());
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private static class DependencyNode {
|
||||
TUIInitializer initializer;
|
||||
int priority;
|
||||
|
||||
Set<DependencyNode> dependencySet = new HashSet<>();
|
||||
Set<DependencyNode> beDependencySet = new HashSet<>();
|
||||
|
||||
DependencyNode(TUIInitializer initializer) {
|
||||
this.initializer = initializer;
|
||||
}
|
||||
|
||||
void addDependency(DependencyNode dependencyNode) {
|
||||
dependencySet.add(dependencyNode);
|
||||
}
|
||||
|
||||
void removeDependency(DependencyNode dependencyNode) {
|
||||
dependencySet.remove(dependencyNode);
|
||||
}
|
||||
|
||||
void addBeDependency(DependencyNode dependencyNode) {
|
||||
beDependencySet.add(dependencyNode);
|
||||
}
|
||||
|
||||
void removeBeDependency(DependencyNode dependencyNode) {
|
||||
beDependencySet.remove(dependencyNode);
|
||||
}
|
||||
|
||||
void removeBeDependencies(Set<DependencyNode> dependencyNode) {
|
||||
beDependencySet.removeAll(dependencyNode);
|
||||
}
|
||||
|
||||
public Set<DependencyNode> getBeDependencySet() {
|
||||
return beDependencySet;
|
||||
}
|
||||
|
||||
public Set<DependencyNode> getDependencySet() {
|
||||
return dependencySet;
|
||||
}
|
||||
|
||||
int dependencyCount() {
|
||||
if (dependencySet != null) {
|
||||
return dependencySet.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int beDependencyCount() {
|
||||
if (beDependencySet != null) {
|
||||
return beDependencySet.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Cursor query(
|
||||
@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getType(@NonNull Uri uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIService;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIServiceCallback;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Service register and call
|
||||
*/
|
||||
class ServiceManager {
|
||||
private static final String TAG = ServiceManager.class.getSimpleName();
|
||||
|
||||
private static class ServiceManagerHolder {
|
||||
private static final ServiceManager serviceManager = new ServiceManager();
|
||||
}
|
||||
|
||||
public static ServiceManager getInstance() {
|
||||
return ServiceManagerHolder.serviceManager;
|
||||
}
|
||||
|
||||
private final Map<String, ITUIService> serviceMap = new ConcurrentHashMap<>();
|
||||
|
||||
private ServiceManager() {}
|
||||
|
||||
public void registerService(String serviceName, ITUIService service) {
|
||||
Log.i(TAG, "registerService : " + serviceName + " " + service);
|
||||
if (TextUtils.isEmpty(serviceName) || service == null) {
|
||||
return;
|
||||
}
|
||||
serviceMap.put(serviceName, service);
|
||||
}
|
||||
|
||||
public void unregisterService(String serviceName) {
|
||||
Log.i(TAG, "unregisterService : " + serviceName);
|
||||
if (TextUtils.isEmpty(serviceName)) {
|
||||
return;
|
||||
}
|
||||
serviceMap.remove(serviceName);
|
||||
}
|
||||
|
||||
public ITUIService getService(String serviceName) {
|
||||
Log.d(TAG, "getService : " + serviceName);
|
||||
if (TextUtils.isEmpty(serviceName)) {
|
||||
return null;
|
||||
}
|
||||
return serviceMap.get(serviceName);
|
||||
}
|
||||
|
||||
public Object callService(String serviceName, String method, Map<String, Object> param) {
|
||||
Log.d(TAG, "callService : " + serviceName + " method : " + method);
|
||||
ITUIService service = serviceMap.get(serviceName);
|
||||
if (service != null) {
|
||||
return service.onCall(method, param);
|
||||
} else {
|
||||
Log.w(TAG, "can't find service : " + serviceName);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object callService(String serviceName, String method, Map<String, Object> param, TUIServiceCallback callback) {
|
||||
Log.d(TAG, "callService : " + serviceName + " method : " + method);
|
||||
ITUIService service = serviceMap.get(serviceName);
|
||||
if (service != null) {
|
||||
return service.onCall(method, param, callback);
|
||||
} else {
|
||||
Log.w(TAG, "can't find service : " + serviceName);
|
||||
if (callback != null) {
|
||||
callback.onServiceCallback(-1, "can't find service : " + serviceName, new Bundle());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
380
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIConfig.java
Normal file
380
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIConfig.java
Normal file
@@ -0,0 +1,380 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* TUI configuration, such as file path configuration, user information
|
||||
*/
|
||||
public class TUIConfig {
|
||||
private static Context appContext;
|
||||
|
||||
private static String appDir = "";
|
||||
private static String selfFaceUrl = "";
|
||||
private static String selfNickName = "";
|
||||
private static int selfAllowType = 0;
|
||||
private static long selfBirthDay = 0L;
|
||||
private static String selfSignature = "";
|
||||
private static int gender;
|
||||
|
||||
public static final String TUICORE_SETTINGS_SP_NAME = "TUICoreSettings";
|
||||
|
||||
public static final String RECORD_DIR_SUFFIX = "/record/";
|
||||
private static final String RECORD_DOWNLOAD_DIR_SUFFIX = "/record/download/";
|
||||
public static final String VIDEO_BASE_DIR_SUFFIX = "/video/";
|
||||
private static final String VIDEO_DOWNLOAD_DIR_SUFFIX = "/video/download/";
|
||||
public static final String IMAGE_BASE_DIR_SUFFIX = "/image/";
|
||||
private static final String IMAGE_DOWNLOAD_DIR_SUFFIX = "/image/download/";
|
||||
private static final String MEDIA_DIR_SUFFIX = "/media/";
|
||||
private static final String FILE_DOWNLOAD_DIR_SUFFIX = "/file/download/";
|
||||
private static final String CRASH_LOG_DIR_SUFFIX = "/crash/";
|
||||
|
||||
private static boolean initialized = false;
|
||||
private static boolean enableGroupGridAvatar = true;
|
||||
private static int defaultAvatarImage;
|
||||
private static int defaultGroupAvatarImage;
|
||||
|
||||
public static final int TUI_HOST_TYPE_IMAPP = 0;
|
||||
public static final int TUI_HOST_TYPE_RTCUBE = 1;
|
||||
// 0,im app; 1,rtcube app
|
||||
private static int tuiHostType = TUI_HOST_TYPE_IMAPP;
|
||||
private static Map<String, Object> customDataMap = new HashMap<>();
|
||||
|
||||
public static void init(Context context) {
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
TUIConfig.appContext = context;
|
||||
initPath();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
public static String getDefaultAppDir() {
|
||||
if (TextUtils.isEmpty(appDir)) {
|
||||
Context context = null;
|
||||
if (appContext != null) {
|
||||
context = appContext;
|
||||
} else if (TUIRouter.getContext() != null) {
|
||||
context = TUIRouter.getContext();
|
||||
} else if (TUILogin.getAppContext() != null) {
|
||||
context = TUILogin.getAppContext();
|
||||
}
|
||||
if (context != null) {
|
||||
appDir = context.getFilesDir().getAbsolutePath();
|
||||
}
|
||||
}
|
||||
return appDir;
|
||||
}
|
||||
|
||||
public static void setDefaultAppDir(String appDir) {
|
||||
TUIConfig.appDir = appDir;
|
||||
}
|
||||
|
||||
public static String getRecordDir() {
|
||||
return getDefaultAppDir() + RECORD_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getRecordDownloadDir() {
|
||||
return getDefaultAppDir() + RECORD_DOWNLOAD_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getVideoBaseDir() {
|
||||
return getDefaultAppDir() + VIDEO_BASE_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getVideoDownloadDir() {
|
||||
return getDefaultAppDir() + VIDEO_DOWNLOAD_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getImageBaseDir() {
|
||||
return getDefaultAppDir() + IMAGE_BASE_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getImageDownloadDir() {
|
||||
return getDefaultAppDir() + IMAGE_DOWNLOAD_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getMediaDir() {
|
||||
return getDefaultAppDir() + MEDIA_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getFileDownloadDir() {
|
||||
return getDefaultAppDir() + FILE_DOWNLOAD_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getCrashLogDir() {
|
||||
return getDefaultAppDir() + CRASH_LOG_DIR_SUFFIX;
|
||||
}
|
||||
|
||||
public static String getSelfFaceUrl() {
|
||||
return selfFaceUrl;
|
||||
}
|
||||
|
||||
public static void setSelfFaceUrl(String selfFaceUrl) {
|
||||
TUIConfig.selfFaceUrl = selfFaceUrl;
|
||||
}
|
||||
|
||||
public static String getSelfNickName() {
|
||||
return selfNickName;
|
||||
}
|
||||
|
||||
public static void setSelfNickName(String selfNickName) {
|
||||
TUIConfig.selfNickName = selfNickName;
|
||||
}
|
||||
|
||||
public static int getSelfAllowType() {
|
||||
return selfAllowType;
|
||||
}
|
||||
|
||||
public static void setSelfAllowType(int selfAllowType) {
|
||||
TUIConfig.selfAllowType = selfAllowType;
|
||||
}
|
||||
|
||||
public static long getSelfBirthDay() {
|
||||
return selfBirthDay;
|
||||
}
|
||||
|
||||
public static void setSelfBirthDay(long selfBirthDay) {
|
||||
TUIConfig.selfBirthDay = selfBirthDay;
|
||||
}
|
||||
|
||||
public static String getSelfSignature() {
|
||||
return selfSignature;
|
||||
}
|
||||
|
||||
public static void setSelfSignature(String selfSignature) {
|
||||
TUIConfig.selfSignature = selfSignature;
|
||||
}
|
||||
|
||||
public static void setGender(int gender) {
|
||||
TUIConfig.gender = gender;
|
||||
}
|
||||
|
||||
public static int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public static void setTUIHostType(int type) {
|
||||
TUIConfig.tuiHostType = type;
|
||||
}
|
||||
|
||||
public static int getTUIHostType() {
|
||||
return tuiHostType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether to display the avatar in the nine-square grid style in the group conversation, the default is true
|
||||
*/
|
||||
public static boolean isEnableGroupGridAvatar() {
|
||||
return enableGroupGridAvatar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether to display the avatar in the nine-square grid style in group conversations
|
||||
*/
|
||||
public static void setEnableGroupGridAvatar(boolean enableGroupGridAvatar) {
|
||||
TUIConfig.enableGroupGridAvatar = enableGroupGridAvatar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default avatar for c2c conversation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static int getDefaultAvatarImage() {
|
||||
return defaultAvatarImage;
|
||||
}
|
||||
|
||||
/**
|
||||
*Set the default avatar for c2c conversation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static void setDefaultAvatarImage(int defaultAvatarImage) {
|
||||
TUIConfig.defaultAvatarImage = defaultAvatarImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default avatar for group conversation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static int getDefaultGroupAvatarImage() {
|
||||
return defaultGroupAvatarImage;
|
||||
}
|
||||
|
||||
/**
|
||||
*Set the default avatar for group conversation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static void setDefaultGroupAvatarImage(int defaultGroupAvatarImage) {
|
||||
TUIConfig.defaultGroupAvatarImage = defaultGroupAvatarImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom data
|
||||
*/
|
||||
public static void setCustomData(String key, Object value) {
|
||||
TUIConfig.customDataMap.put(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom data
|
||||
*/
|
||||
public static Object getCustomData(String key) {
|
||||
return TUIConfig.customDataMap.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set login user information
|
||||
*/
|
||||
public static void setSelfInfo(V2TIMUserFullInfo userFullInfo) {
|
||||
TUIConfig.selfFaceUrl = userFullInfo.getFaceUrl();
|
||||
TUIConfig.selfNickName = userFullInfo.getNickName();
|
||||
TUIConfig.selfAllowType = userFullInfo.getAllowType();
|
||||
TUIConfig.selfBirthDay = userFullInfo.getBirthday();
|
||||
TUIConfig.selfSignature = userFullInfo.getSelfSignature();
|
||||
TUIConfig.gender = userFullInfo.getGender();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear login user information
|
||||
*/
|
||||
public static void clearSelfInfo() {
|
||||
TUIConfig.selfFaceUrl = "";
|
||||
TUIConfig.selfNickName = "";
|
||||
TUIConfig.selfAllowType = 0;
|
||||
TUIConfig.selfBirthDay = 0L;
|
||||
TUIConfig.selfSignature = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* init file path
|
||||
*/
|
||||
public static void initPath() {
|
||||
File f = new File(getMediaDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getRecordDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getRecordDownloadDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getVideoDownloadDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getImageDownloadDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getImageBaseDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getVideoBaseDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getFileDownloadDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
f = new File(getCrashLogDir());
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
public static Context getAppContext() {
|
||||
return appContext;
|
||||
}
|
||||
|
||||
public static void setSceneOptimizParams(final String scene) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
String packageName = "";
|
||||
if (getAppContext() != null) {
|
||||
packageName = getAppContext().getPackageName();
|
||||
}
|
||||
|
||||
URL url = new URL("https://demos.trtc.tencent-cloud.com/prod/base/v1/events/stat");
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(5000);
|
||||
conn.setReadTimeout(5000);
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setUseCaches(false);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/json");
|
||||
|
||||
String sdkAPPId = TUILogin.getSdkAppId() + "";
|
||||
JSONObject msgObject = new JSONObject();
|
||||
msgObject.put("sdkappid", sdkAPPId);
|
||||
msgObject.put("bundleId", "");
|
||||
msgObject.put("component", scene);
|
||||
msgObject.put("package", packageName);
|
||||
|
||||
String userId = TUILogin.getUserId();
|
||||
JSONObject bodyObject = new JSONObject();
|
||||
bodyObject.put("userId", userId);
|
||||
bodyObject.put("event", "useScenario");
|
||||
bodyObject.put("msg", msgObject);
|
||||
String paramStr = String.valueOf(bodyObject);
|
||||
|
||||
OutputStream out = conn.getOutputStream();
|
||||
out.write(paramStr.getBytes());
|
||||
out.flush();
|
||||
out.close();
|
||||
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
|
||||
InputStream is = conn.getInputStream();
|
||||
ByteArrayOutputStream message = new ByteArrayOutputStream();
|
||||
int len = 0;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
message.write(buffer, 0, len);
|
||||
}
|
||||
String msg = new String(message.toByteArray());
|
||||
Log.d("setSceneOptimizParams", "msg:" + msg);
|
||||
is.close();
|
||||
message.close();
|
||||
conn.disconnect();
|
||||
} else {
|
||||
Log.d("setSceneOptimizParams", "ResponseCode:" + conn.getResponseCode());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("TUICore", "setSceneOptimizParams exception");
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
1078
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIConstants.java
Normal file
1078
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIConstants.java
Normal file
File diff suppressed because it is too large
Load Diff
232
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUICore.java
Normal file
232
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUICore.java
Normal file
@@ -0,0 +1,232 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.activity.result.ActivityResult;
|
||||
import androidx.activity.result.ActivityResultCallback;
|
||||
import androidx.activity.result.ActivityResultCaller;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIExtension;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUINotification;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIObjectFactory;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIService;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIExtensionInfo;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIServiceCallback;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* TUI Plugin core class, mainly responsible for data transfer between TUI plugins, notification broadcast, function extension, etc.
|
||||
*/
|
||||
public class TUICore {
|
||||
private static final String TAG = TUICore.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* Register Service
|
||||
* @param serviceName service name
|
||||
* @param service service object
|
||||
*/
|
||||
public static void registerService(String serviceName, ITUIService service) {
|
||||
ServiceManager.getInstance().registerService(serviceName, service);
|
||||
}
|
||||
|
||||
/**
|
||||
* unregister Service
|
||||
*
|
||||
* @param serviceName service name
|
||||
*/
|
||||
public static void unregisterService(String serviceName) {
|
||||
ServiceManager.getInstance().unregisterService(serviceName);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Service
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @return service
|
||||
*/
|
||||
public static ITUIService getService(String serviceName) {
|
||||
return ServiceManager.getInstance().getService(serviceName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call Service
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @param method method name
|
||||
* @param param pass parameters
|
||||
* @return object
|
||||
*/
|
||||
public static Object callService(String serviceName, String method, Map<String, Object> param) {
|
||||
return ServiceManager.getInstance().callService(serviceName, method, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call service asynchronously
|
||||
*
|
||||
* @param serviceName service name
|
||||
* @param method method name
|
||||
* @param param pass parameters
|
||||
* @return object
|
||||
*/
|
||||
public static Object callService(String serviceName, String method, Map<String, Object> param, TUIServiceCallback callback) {
|
||||
return ServiceManager.getInstance().callService(serviceName, method, param, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* start Activity
|
||||
* @param activityName activity name,such as "TUIGroupChatActivity"
|
||||
* @param param pass parameters
|
||||
*/
|
||||
public static void startActivity(String activityName, Bundle param) {
|
||||
startActivity(null, activityName, param, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* start Activity
|
||||
* @param starter Initiator, either {@link Context} or {@link Fragment}
|
||||
* @param activityName activity name,such as "TUIGroupChatActivity"
|
||||
* @param param pass parameters
|
||||
*/
|
||||
public static void startActivity(@Nullable Object starter, String activityName, Bundle param) {
|
||||
startActivity(starter, activityName, param, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* start Activity
|
||||
* @param starter Initiator, either {@link Context} or {@link Fragment}
|
||||
* @param activityName activity name,such as "TUIGroupChatActivity"
|
||||
* @param param pass parameters
|
||||
* @param requestCode The request value passed to the Activity, used to return the result in the initiator's
|
||||
* onActivityResult method when the Activity ends, greater than or equal to 0 is valid.
|
||||
* @note The method has been deprecated:use {@link #startActivityForResult}
|
||||
*/
|
||||
@Deprecated
|
||||
public static void startActivity(@Nullable Object starter, String activityName, Bundle param, int requestCode) {
|
||||
TUIRouter.startActivity(starter, activityName, param, requestCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the activity and get the result asynchronously
|
||||
* @param caller {@link androidx.activity.result.ActivityResultCaller}
|
||||
* @param activityName activity name,such as "TUIGroupChatActivity"
|
||||
* @param param pass parameters
|
||||
* @param resultCallback the result callback
|
||||
*/
|
||||
public static void startActivityForResult(
|
||||
@Nullable ActivityResultCaller caller, String activityName, Bundle param, ActivityResultCallback<ActivityResult> resultCallback) {
|
||||
TUIRouter.startActivityForResult(caller, activityName, param, resultCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the activity and get the result asynchronously
|
||||
* @param caller {@link androidx.activity.result.ActivityResultCaller}
|
||||
* @param activityClazz activity's Class Object
|
||||
* @param param pass parameters
|
||||
* @param resultCallback the result callback
|
||||
*/
|
||||
public static void startActivityForResult(
|
||||
@Nullable ActivityResultCaller caller, Class<? extends Activity> activityClazz, Bundle param, ActivityResultCallback<ActivityResult> resultCallback) {
|
||||
TUIRouter.startActivityForResult(caller, activityClazz, param, resultCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the activity and get the result asynchronously
|
||||
* @param caller {@link androidx.activity.result.ActivityResultCaller}
|
||||
* @param intent the intent
|
||||
* @param resultCallback the result callback
|
||||
*/
|
||||
public static void startActivityForResult(@Nullable ActivityResultCaller caller, Intent intent, ActivityResultCallback<ActivityResult> resultCallback) {
|
||||
TUIRouter.startActivityForResult(caller, intent, resultCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register event
|
||||
*/
|
||||
public static void registerEvent(String key, String subKey, ITUINotification notification) {
|
||||
EventManager.getInstance().registerEvent(key, subKey, notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister event
|
||||
*/
|
||||
public static void unRegisterEvent(String key, String subKey, ITUINotification notification) {
|
||||
EventManager.getInstance().unRegisterEvent(key, subKey, notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all notifications for the specified notification object
|
||||
*/
|
||||
public static void unRegisterEvent(ITUINotification notification) {
|
||||
EventManager.getInstance().unRegisterEvent(notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify event
|
||||
*/
|
||||
public static void notifyEvent(String key, String subKey, Map<String, Object> param) {
|
||||
EventManager.getInstance().notifyEvent(key, subKey, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register extension
|
||||
*/
|
||||
public static void registerExtension(String extensionID, ITUIExtension extension) {
|
||||
ExtensionManager.getInstance().registerExtension(extensionID, extension);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister extension
|
||||
*/
|
||||
public static void unRegisterExtension(String key, ITUIExtension extension) {
|
||||
ExtensionManager.getInstance().unRegisterExtension(key, extension);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Extension
|
||||
* @note The method has been deprecated:use {@link #getExtensionList}
|
||||
*/
|
||||
@Deprecated
|
||||
public static Map<String, Object> getExtensionInfo(String key, Map<String, Object> param) {
|
||||
return ExtensionManager.getInstance().getExtensionInfo(key, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Extension list
|
||||
*/
|
||||
public static List<TUIExtensionInfo> getExtensionList(String extensionID, Map<String, Object> param) {
|
||||
return ExtensionManager.getInstance().getExtensionList(extensionID, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* invoke Extension
|
||||
*/
|
||||
public static void raiseExtension(String key, View parentView, Map<String, Object> param) {
|
||||
ExtensionManager.getInstance().raiseExtension(key, parentView, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register object factory
|
||||
*/
|
||||
public static void registerObjectFactory(String factoryName, ITUIObjectFactory objectFactory) {
|
||||
ObjectManager.getInstance().registerObjectFactory(factoryName, objectFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister object factory
|
||||
*/
|
||||
public static void unregisterObjectFactory(String factoryName) {
|
||||
ObjectManager.getInstance().unregisterObjectFactory(factoryName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create object and get
|
||||
*/
|
||||
public static Object createObject(String objectFactory, String objectName, Map<String, Object> param) {
|
||||
return ObjectManager.getInstance().createObject(objectFactory, objectName, param);
|
||||
}
|
||||
}
|
||||
544
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUILogin.java
Normal file
544
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUILogin.java
Normal file
@@ -0,0 +1,544 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import static com.tencent.imsdk.v2.V2TIMManager.V2TIM_STATUS_LOGINED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMLogListener;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSDKConfig;
|
||||
import com.tencent.imsdk.v2.V2TIMSDKListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMValueCallback;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUILogListener;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUILoginConfig;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUILoginListener;
|
||||
import com.tencent.qcloud.tuicore.util.ErrorMessageConverter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* Login logic for IM and TRTC
|
||||
*/
|
||||
public class TUILogin {
|
||||
private static final String TAG = TUILogin.class.getSimpleName();
|
||||
|
||||
private static class TUILoginHolder {
|
||||
private static final TUILogin loginInstance = new TUILogin();
|
||||
}
|
||||
|
||||
public static TUILogin getInstance() {
|
||||
return TUILoginHolder.loginInstance;
|
||||
}
|
||||
|
||||
private static Context appContext;
|
||||
|
||||
private int sdkAppId = 0;
|
||||
private String userId;
|
||||
private String userSig;
|
||||
private boolean hasLoginSuccess = false;
|
||||
private int currentBusinessScene = TUIBusinessScene.NONE;
|
||||
|
||||
private final List<TUILoginListener> listenerList = new CopyOnWriteArrayList<>();
|
||||
|
||||
private TUILogin() {}
|
||||
|
||||
private final V2TIMSDKListener imSdkListener = new V2TIMSDKListener() {
|
||||
@Override
|
||||
public void onConnecting() {
|
||||
for (TUILoginListener listener : listenerList) {
|
||||
listener.onConnecting();
|
||||
}
|
||||
TUICore.notifyEvent(TUIConstants.NetworkConnection.EVENT_CONNECTION_STATE_CHANGED, TUIConstants.NetworkConnection.EVENT_SUB_KEY_CONNECTING, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
for (TUILoginListener listener : listenerList) {
|
||||
listener.onConnectSuccess();
|
||||
}
|
||||
TUICore.notifyEvent(
|
||||
TUIConstants.NetworkConnection.EVENT_CONNECTION_STATE_CHANGED, TUIConstants.NetworkConnection.EVENT_SUB_KEY_CONNECT_SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectFailed(int code, String error) {
|
||||
for (TUILoginListener listener : listenerList) {
|
||||
listener.onConnectFailed(code, error);
|
||||
}
|
||||
TUICore.notifyEvent(
|
||||
TUIConstants.NetworkConnection.EVENT_CONNECTION_STATE_CHANGED, TUIConstants.NetworkConnection.EVENT_SUB_KEY_CONNECT_FAILED, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
for (TUILoginListener listener : listenerList) {
|
||||
listener.onKickedOffline();
|
||||
}
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_KICKED_OFFLINE, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserSigExpired() {
|
||||
for (TUILoginListener listener : listenerList) {
|
||||
listener.onUserSigExpired();
|
||||
}
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_SIG_EXPIRED, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfInfoUpdated(V2TIMUserFullInfo info) {
|
||||
TUIConfig.setSelfInfo(info);
|
||||
notifyUserInfoChanged(info);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* IMSDK login
|
||||
*
|
||||
* @param context The context of the application, generally is ApplicationContext
|
||||
* @param sdkAppId Assigned when you register your app with Tencent Cloud
|
||||
* @param userId User ID
|
||||
* @param userSig Obtained from the business server
|
||||
* @param callback login callback
|
||||
*/
|
||||
public static void login(@NonNull Context context, int sdkAppId, String userId, String userSig, TUICallback callback) {
|
||||
getInstance().internalLogin(context, sdkAppId, userId, userSig, null, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* IMSDK login
|
||||
*
|
||||
* @param context The context of the application, generally is ApplicationContext
|
||||
* @param sdkAppId Assigned when you register your app with Tencent Cloud
|
||||
* @param userId User ID
|
||||
* @param userSig Obtained from the business server
|
||||
* @param config log related configs
|
||||
* @param callback login callback
|
||||
*/
|
||||
public static void login(@NonNull Context context, int sdkAppId, String userId, String userSig, TUILoginConfig config, TUICallback callback) {
|
||||
getInstance().internalLogin(context, sdkAppId, userId, userSig, config, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* User Login
|
||||
*
|
||||
* @param userId User ID
|
||||
* @param userSig Obtained from the business server
|
||||
* @param callback login callback
|
||||
*/
|
||||
@Deprecated
|
||||
public static void login(@NonNull String userId, @NonNull String userSig, @Nullable V2TIMCallback callback) {
|
||||
getInstance().userId = userId;
|
||||
getInstance().userSig = userSig;
|
||||
if (TextUtils.equals(userId, V2TIMManager.getInstance().getLoginUser()) && !TextUtils.isEmpty(userId)) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess();
|
||||
}
|
||||
getUserInfo(userId);
|
||||
return;
|
||||
}
|
||||
|
||||
V2TIMManager.getInstance().login(userId, userSig, new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
getInstance().hasLoginSuccess = true;
|
||||
if (callback != null) {
|
||||
callback.onSuccess();
|
||||
}
|
||||
getUserInfo(userId);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_LOGIN_SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
if (callback != null) {
|
||||
callback.onError(code, ErrorMessageConverter.convertIMError(code, desc));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IMSDK logout
|
||||
* @param callback logout callback
|
||||
*/
|
||||
public static void logout(TUICallback callback) {
|
||||
getInstance().internalLogout(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* User Logout
|
||||
*
|
||||
* @param callback Logout callback
|
||||
*/
|
||||
@Deprecated
|
||||
public static void logout(@Nullable V2TIMCallback callback) {
|
||||
V2TIMManager.getInstance().logout(new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
getInstance().userId = null;
|
||||
getInstance().userSig = null;
|
||||
if (callback != null) {
|
||||
callback.onSuccess();
|
||||
}
|
||||
TUIConfig.clearSelfInfo();
|
||||
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_LOGOUT_SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
if (callback != null) {
|
||||
callback.onError(code, ErrorMessageConverter.convertIMError(code, desc));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void addLoginListener(TUILoginListener listener) {
|
||||
getInstance().internalAddLoginListener(listener);
|
||||
}
|
||||
|
||||
public static void removeLoginListener(TUILoginListener listener) {
|
||||
getInstance().internalRemoveLoginListener(listener);
|
||||
}
|
||||
|
||||
private void internalLogin(Context context, final int sdkAppId, final String userId, final String userSig, TUILoginConfig config, TUICallback callback) {
|
||||
Log.i(TAG, "internalLogin");
|
||||
if (this.sdkAppId != 0 && sdkAppId != this.sdkAppId) {
|
||||
logout((TUICallback) null);
|
||||
}
|
||||
this.appContext = context.getApplicationContext();
|
||||
this.sdkAppId = sdkAppId;
|
||||
currentBusinessScene = TUIBusinessScene.NONE;
|
||||
V2TIMManager.getInstance().addIMSDKListener(imSdkListener);
|
||||
// Notify init event
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_IMSDK_INIT_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_START_INIT, null);
|
||||
// User operation initialization, the privacy agreement has been read by default
|
||||
|
||||
V2TIMSDKConfig v2TIMSDKConfig = null;
|
||||
if (config != null) {
|
||||
v2TIMSDKConfig = new V2TIMSDKConfig();
|
||||
v2TIMSDKConfig.setLogLevel(config.getLogLevel());
|
||||
TUILogListener logListener = config.getLogListener();
|
||||
if (logListener != null) {
|
||||
v2TIMSDKConfig.setLogListener(new V2TIMLogListener() {
|
||||
@Override
|
||||
public void onLog(int logLevel, String logContent) {
|
||||
logListener.onLog(logLevel, logContent);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
boolean initSuccess = V2TIMManager.getInstance().initSDK(context, sdkAppId, v2TIMSDKConfig);
|
||||
if (initSuccess) {
|
||||
this.userId = userId;
|
||||
this.userSig = userSig;
|
||||
|
||||
// Notify init success event
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_IMSDK_INIT_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_INIT_SUCCESS, null);
|
||||
|
||||
V2TIMManager.getInstance().callExperimentalAPI("getLoginAccountType", null,
|
||||
new V2TIMValueCallback<Object>() {
|
||||
@Override
|
||||
public void onSuccess(Object data) {
|
||||
int accountType = (int) data;
|
||||
internalLoginImpl(accountType, userId, userSig, config, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.e(TAG, "getLoginAccountType error:" + code + ", desc:" + desc);
|
||||
internalLoginImpl(TUIConstants.TUILogin.ACCOUNT_TYPE_UNKOWN, userId, userSig, config, callback);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.i(TAG, "internalLogin initSDK failed");
|
||||
TUICallback.onError(callback, -1, "init failed");
|
||||
}
|
||||
}
|
||||
|
||||
private void internalLoginImpl(final int accountType, final String userId, final String userSig,
|
||||
TUILoginConfig config, TUICallback callback) {
|
||||
if (TextUtils.equals(userId, V2TIMManager.getInstance().getLoginUser())
|
||||
&& !TextUtils.isEmpty(userId) && accountType == TUIConstants.TUILogin.ACCOUNT_TYPE_IM) {
|
||||
Log.i(TAG, "internalLogin already login");
|
||||
hasLoginSuccess = true;
|
||||
getUserInfo(userId);
|
||||
TUICallback.onSuccess(callback);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_LOGIN_SUCCESS, null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (config != null && config.isInitLocalStorageOnly()) {
|
||||
V2TIMManager.getInstance().callExperimentalAPI("initLocalStorage", userId, new V2TIMValueCallback<Object>() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
getUserInfo(userId);
|
||||
TUICallback.onSuccess(callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.e(TAG, "initLocalStorage error:" + code + ", desc:" + desc);
|
||||
TUICallback.onError(callback, code, ErrorMessageConverter.convertIMError(code, desc));
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
V2TIMManager.getInstance().login(userId, userSig, new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.i(TAG, "internalLogin login onSuccess");
|
||||
hasLoginSuccess = true;
|
||||
getUserInfo(userId);
|
||||
TUICallback.onSuccess(callback);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_LOGIN_SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.i(TAG, "internalLogin login onError code=" + code + " desc=" + desc);
|
||||
TUICallback.onError(callback, code, ErrorMessageConverter.convertIMError(code, desc));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void internalLogout(TUICallback callback) {
|
||||
Log.i(TAG, "internalLogout");
|
||||
// Notify unit event
|
||||
currentBusinessScene = TUIBusinessScene.NONE;
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_IMSDK_INIT_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_START_UNINIT, null);
|
||||
V2TIMManager.getInstance().logout(new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.i(TAG, "internalLogout onSuccess");
|
||||
sdkAppId = 0;
|
||||
userId = null;
|
||||
userSig = null;
|
||||
V2TIMManager.getInstance().unInitSDK();
|
||||
TUIConfig.clearSelfInfo();
|
||||
TUICallback.onSuccess(callback);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_LOGOUT_SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.i(TAG, "internalLogout onError code=" + code + " desc=" + desc);
|
||||
TUICallback.onError(callback, code, desc);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void internalAddLoginListener(TUILoginListener listener) {
|
||||
Log.i(TAG, "addLoginListener listener : " + listener);
|
||||
if (listener == null) {
|
||||
return;
|
||||
}
|
||||
if (!listenerList.contains(listener)) {
|
||||
listenerList.add(listener);
|
||||
}
|
||||
}
|
||||
|
||||
private void internalRemoveLoginListener(TUILoginListener listener) {
|
||||
Log.i(TAG, "removeLoginListener listener : " + listener);
|
||||
if (listener == null) {
|
||||
return;
|
||||
}
|
||||
listenerList.remove(listener);
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
appContext = context.getApplicationContext();
|
||||
}
|
||||
|
||||
/**
|
||||
* IMSDK init
|
||||
*
|
||||
* @param context The context of the application, generally is ApplicationContext
|
||||
* @param sdkAppId Assigned when you register your app with Tencent Cloud
|
||||
* @param config The related configuration items of IMSDK, generally use the default,
|
||||
* and need special configuration, please refer to the API documentation
|
||||
* @param listener Listener of IMSDK init
|
||||
* @return true:init success;false:init failed
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean init(@NonNull Context context, int sdkAppId, @Nullable V2TIMSDKConfig config, @Nullable V2TIMSDKListener listener) {
|
||||
if (getInstance().sdkAppId != 0 && sdkAppId != getInstance().sdkAppId) {
|
||||
logout((V2TIMCallback) null);
|
||||
unInit();
|
||||
}
|
||||
getInstance().appContext = context.getApplicationContext();
|
||||
getInstance().sdkAppId = sdkAppId;
|
||||
V2TIMManager.getInstance().addIMSDKListener(new V2TIMSDKListener() {
|
||||
@Override
|
||||
public void onConnecting() {
|
||||
if (listener != null) {
|
||||
listener.onConnecting();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
if (listener != null) {
|
||||
listener.onConnectSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectFailed(int code, String error) {
|
||||
if (listener != null) {
|
||||
listener.onConnectFailed(code, ErrorMessageConverter.convertIMError(code, error));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
if (listener != null) {
|
||||
listener.onKickedOffline();
|
||||
}
|
||||
setCurrentBusinessScene(TUIBusinessScene.NONE);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_KICKED_OFFLINE, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserSigExpired() {
|
||||
if (listener != null) {
|
||||
listener.onUserSigExpired();
|
||||
}
|
||||
setCurrentBusinessScene(TUIBusinessScene.NONE);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_SIG_EXPIRED, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfInfoUpdated(V2TIMUserFullInfo info) {
|
||||
if (listener != null) {
|
||||
listener.onSelfInfoUpdated(info);
|
||||
}
|
||||
|
||||
TUIConfig.setSelfInfo(info);
|
||||
notifyUserInfoChanged(info);
|
||||
}
|
||||
});
|
||||
|
||||
boolean initResult = V2TIMManager.getInstance().initSDK(context, sdkAppId, config);
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_IMSDK_INIT_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_START_INIT, null);
|
||||
return initResult;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void unInit() {
|
||||
getInstance().sdkAppId = 0;
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_IMSDK_INIT_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_START_UNINIT, null);
|
||||
|
||||
V2TIMManager.getInstance().unInitSDK();
|
||||
TUIConfig.clearSelfInfo();
|
||||
}
|
||||
|
||||
private static void getUserInfo(String userId) {
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
userIdList.add(userId);
|
||||
V2TIMManager.getInstance().getUsersInfo(userIdList, new V2TIMValueCallback<List<V2TIMUserFullInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(List<V2TIMUserFullInfo> v2TIMUserFullInfos) {
|
||||
if (v2TIMUserFullInfos.isEmpty()) {
|
||||
Log.e(TAG, "get logined userInfo failed. list is empty");
|
||||
return;
|
||||
}
|
||||
V2TIMUserFullInfo userFullInfo = v2TIMUserFullInfos.get(0);
|
||||
TUIConfig.setSelfInfo(userFullInfo);
|
||||
notifyUserInfoChanged(userFullInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.e(TAG, "get logined userInfo failed. code : " + code + " desc : " + ErrorMessageConverter.convertIMError(code, desc));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void notifyUserInfoChanged(V2TIMUserFullInfo userFullInfo) {
|
||||
HashMap<String, Object> param = new HashMap<>();
|
||||
param.put(TUIConstants.TUILogin.SELF_ID, userFullInfo.getUserID());
|
||||
param.put(TUIConstants.TUILogin.SELF_SIGNATURE, userFullInfo.getSelfSignature());
|
||||
param.put(TUIConstants.TUILogin.SELF_NICK_NAME, userFullInfo.getNickName());
|
||||
param.put(TUIConstants.TUILogin.SELF_FACE_URL, userFullInfo.getFaceUrl());
|
||||
param.put(TUIConstants.TUILogin.SELF_BIRTHDAY, userFullInfo.getBirthday());
|
||||
param.put(TUIConstants.TUILogin.SELF_ROLE, userFullInfo.getRole());
|
||||
param.put(TUIConstants.TUILogin.SELF_GENDER, userFullInfo.getGender());
|
||||
param.put(TUIConstants.TUILogin.SELF_LEVEL, userFullInfo.getLevel());
|
||||
param.put(TUIConstants.TUILogin.SELF_ALLOW_TYPE, userFullInfo.getAllowType());
|
||||
TUICore.notifyEvent(TUIConstants.TUILogin.EVENT_LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY_USER_INFO_UPDATED, param);
|
||||
}
|
||||
|
||||
public static int getSdkAppId() {
|
||||
return getInstance().sdkAppId;
|
||||
}
|
||||
|
||||
public static String getUserId() {
|
||||
return getInstance().userId;
|
||||
}
|
||||
|
||||
public static String getUserSig() {
|
||||
return getInstance().userSig;
|
||||
}
|
||||
|
||||
public static String getNickName() {
|
||||
return TUIConfig.getSelfNickName();
|
||||
}
|
||||
|
||||
public static String getFaceUrl() {
|
||||
return TUIConfig.getSelfFaceUrl();
|
||||
}
|
||||
|
||||
public static Context getAppContext() {
|
||||
return getInstance().appContext;
|
||||
}
|
||||
|
||||
public static boolean isUserLogined() {
|
||||
return getInstance().hasLoginSuccess && V2TIMManager.getInstance().getLoginStatus() == V2TIM_STATUS_LOGINED;
|
||||
}
|
||||
|
||||
public static String getLoginUser() {
|
||||
if (!TextUtils.isEmpty(V2TIMManager.getInstance().getLoginUser())) {
|
||||
return V2TIMManager.getInstance().getLoginUser();
|
||||
} else {
|
||||
return getInstance().userId;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TUIBusinessScene {
|
||||
public static final int NONE = 0;
|
||||
public static final int IN_RECORDING = 1;
|
||||
public static final int IN_CALLING_ROOM = 2;
|
||||
public static final int IN_MEETING_ROOM = 3;
|
||||
public static final int IN_LIVING_ROOM = 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* No-thread-safe
|
||||
* @param scene
|
||||
*/
|
||||
public static void setCurrentBusinessScene(int scene) {
|
||||
getInstance().currentBusinessScene = scene;
|
||||
}
|
||||
|
||||
public static int getCurrentBusinessScene() {
|
||||
return getInstance().currentBusinessScene;
|
||||
}
|
||||
}
|
||||
523
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIRouter.java
Normal file
523
tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIRouter.java
Normal file
@@ -0,0 +1,523 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import androidx.activity.result.ActivityResult;
|
||||
import androidx.activity.result.ActivityResultCallback;
|
||||
import androidx.activity.result.ActivityResultCaller;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/**
|
||||
* For Activity routing jump, only used inside TUICore, not exposed to the outside
|
||||
*/
|
||||
class TUIRouter {
|
||||
private static final String TAG = TUIRouter.class.getSimpleName();
|
||||
|
||||
private static final TUIRouter router = new TUIRouter();
|
||||
|
||||
public static TUIRouter getInstance() {
|
||||
return router;
|
||||
}
|
||||
|
||||
private static final Map<String, String> routerMap = new HashMap<>();
|
||||
|
||||
private static final Map<ActivityResultCaller, ActivityResultLauncher<Pair<Intent, ActivityResultCallback<ActivityResult>>>> activityResultLauncherMap =
|
||||
new WeakHashMap<>();
|
||||
|
||||
@SuppressLint("StaticFieldLeak") private static Context context;
|
||||
|
||||
private static boolean initialized = false;
|
||||
|
||||
private TUIRouter() {}
|
||||
|
||||
public static synchronized void init(Context context) {
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
TUIRouter.context = context;
|
||||
if (context == null) {
|
||||
Log.e(TAG, "init failed, context is null.");
|
||||
return;
|
||||
}
|
||||
initRouter(context);
|
||||
initActivityResultLauncher(context);
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
static class RouterActivityResultContract
|
||||
extends ActivityResultContract<Pair<Intent, ActivityResultCallback<ActivityResult>>, Pair<ActivityResult, ActivityResultCallback<ActivityResult>>> {
|
||||
private ActivityResultCallback<ActivityResult> callback;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Intent createIntent(@NonNull Context context, Pair<Intent, ActivityResultCallback<ActivityResult>> input) {
|
||||
callback = input.second;
|
||||
return input.first;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<ActivityResult, ActivityResultCallback<ActivityResult>> parseResult(int resultCode, @Nullable Intent intent) {
|
||||
Pair<ActivityResult, ActivityResultCallback<ActivityResult>> pair = Pair.create(new ActivityResult(resultCode, intent), callback);
|
||||
callback = null;
|
||||
return pair;
|
||||
}
|
||||
}
|
||||
|
||||
static class RouterActivityResultCallback implements ActivityResultCallback<Pair<ActivityResult, ActivityResultCallback<ActivityResult>>> {
|
||||
@Override
|
||||
public void onActivityResult(Pair<ActivityResult, ActivityResultCallback<ActivityResult>> resultCallbackPair) {
|
||||
if (resultCallbackPair.second != null) {
|
||||
resultCallbackPair.second.onActivityResult(resultCallbackPair.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void initActivityResultLauncher(Context context) {
|
||||
if (context instanceof Application) {
|
||||
((Application) context).registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
if (activity instanceof ActivityResultCaller) {
|
||||
registerForActivityResult((ActivityResultCaller) activity);
|
||||
if (activity instanceof FragmentActivity) {
|
||||
((FragmentActivity) activity)
|
||||
.getSupportFragmentManager()
|
||||
.registerFragmentLifecycleCallbacks(new FragmentManager.FragmentLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onFragmentCreated(
|
||||
@NonNull FragmentManager fragmentManager, @NonNull Fragment fragment, @Nullable Bundle savedInstanceState) {
|
||||
registerForActivityResult(fragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentDestroyed(@NonNull FragmentManager fm, @NonNull Fragment fragment) {
|
||||
clearLauncher(fragment);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void registerForActivityResult(ActivityResultCaller resultCaller) {
|
||||
ActivityResultLauncher<Pair<Intent, ActivityResultCallback<ActivityResult>>> activityFragmentResultLauncher =
|
||||
resultCaller.registerForActivityResult(new RouterActivityResultContract(), new RouterActivityResultCallback());
|
||||
activityResultLauncherMap.put(resultCaller, activityFragmentResultLauncher);
|
||||
}
|
||||
|
||||
private void clearLauncher(ActivityResultCaller resultCaller) {
|
||||
activityResultLauncherMap.remove(resultCaller);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||
if (activity instanceof ActivityResultCaller) {
|
||||
clearLauncher((ActivityResultCaller) activity);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public Navigation setDestination(String path) {
|
||||
Navigation navigation = new Navigation();
|
||||
navigation.setDestination(path);
|
||||
return navigation;
|
||||
}
|
||||
|
||||
public Navigation setDestination(Class<? extends Activity> activityClazz) {
|
||||
Navigation navigation = new Navigation();
|
||||
navigation.setDestination(activityClazz);
|
||||
return navigation;
|
||||
}
|
||||
|
||||
static class Navigation {
|
||||
String destination;
|
||||
Bundle options;
|
||||
Intent intent = new Intent();
|
||||
|
||||
public Navigation setOptions(Bundle options) {
|
||||
this.options = options;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, boolean value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, byte value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, char value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, short value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, int value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, long value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, float value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, double value) {
|
||||
intent.putExtra(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, String value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, CharSequence value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, Parcelable value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, Parcelable[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, Serializable value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, boolean[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, byte[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, short[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, char[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, int[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, long[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, float[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, double[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, String[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, CharSequence[] value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtra(String key, Bundle value) {
|
||||
if (value != null) {
|
||||
intent.putExtra(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtras(Bundle bundle) {
|
||||
if (bundle != null) {
|
||||
intent.putExtras(bundle);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation putExtras(Intent src) {
|
||||
if (src != null) {
|
||||
intent.putExtras(src);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation setDestination(String path) {
|
||||
destination = routerMap.get(path);
|
||||
if (destination == null) {
|
||||
Log.e(TAG, "destination is null.");
|
||||
return this;
|
||||
}
|
||||
intent.setComponent(new ComponentName(TUIRouter.context, destination));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation setDestination(Class<? extends Activity> activityClazz) {
|
||||
intent.setComponent(new ComponentName(TUIRouter.context, activityClazz));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Navigation setIntent(Intent intent) {
|
||||
this.intent = intent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Intent getIntent() {
|
||||
return this.intent;
|
||||
}
|
||||
|
||||
public void navigate() {
|
||||
navigate((Context) null);
|
||||
}
|
||||
|
||||
public void navigate(Context context) {
|
||||
navigate(context, -1);
|
||||
}
|
||||
|
||||
public void navigate(Fragment fragment) {
|
||||
navigate(fragment, -1);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void navigate(Fragment fragment, int requestCode) {
|
||||
if (!initialized) {
|
||||
Log.e(TAG, "have not initialized.");
|
||||
return;
|
||||
}
|
||||
if (intent == null) {
|
||||
Log.e(TAG, "intent is null.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (fragment != null) {
|
||||
if (requestCode >= 0) {
|
||||
fragment.startActivityForResult(intent, requestCode);
|
||||
} else {
|
||||
fragment.startActivity(intent, options);
|
||||
}
|
||||
} else {
|
||||
startActivity(null, requestCode);
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void navigate(ActivityResultCaller caller, ActivityResultCallback<ActivityResult> callback) {
|
||||
if (!initialized) {
|
||||
Log.e(TAG, "have not initialized.");
|
||||
return;
|
||||
}
|
||||
if (intent == null) {
|
||||
Log.e(TAG, "intent is null.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
ActivityResultLauncher<Pair<Intent, ActivityResultCallback<ActivityResult>>> launcher = activityResultLauncherMap.get(caller);
|
||||
if (launcher != null) {
|
||||
launcher.launch(Pair.create(intent, callback));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "start activity failed, " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void navigate(Context context, int requestCode) {
|
||||
if (!initialized) {
|
||||
Log.e(TAG, "have not initialized.");
|
||||
return;
|
||||
}
|
||||
if (intent == null) {
|
||||
Log.e(TAG, "intent is null.");
|
||||
return;
|
||||
}
|
||||
Context startContext = context;
|
||||
if (context == null) {
|
||||
startContext = TUIRouter.context;
|
||||
}
|
||||
startActivity(startContext, requestCode);
|
||||
}
|
||||
|
||||
private void startActivity(Context context, int requestCode) {
|
||||
if (context == null) {
|
||||
Log.e(TAG, "StartActivity failed, context is null.Please init");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (context instanceof Activity && requestCode >= 0) {
|
||||
ActivityCompat.startActivityForResult((Activity) context, intent, requestCode, options);
|
||||
} else {
|
||||
if (!(context instanceof Activity)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
ActivityCompat.startActivity(context, intent, options);
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void startActivityForResult(
|
||||
@Nullable ActivityResultCaller caller, String activityName, Bundle param, ActivityResultCallback<ActivityResult> resultCallback) {
|
||||
Navigation navigation = TUIRouter.getInstance().setDestination(activityName).putExtras(param);
|
||||
navigation.navigate(caller, resultCallback);
|
||||
}
|
||||
|
||||
public static void startActivityForResult(
|
||||
@Nullable ActivityResultCaller caller, Class<? extends Activity> activityClazz, Bundle param, ActivityResultCallback<ActivityResult> resultCallback) {
|
||||
Navigation navigation = TUIRouter.getInstance().setDestination(activityClazz).putExtras(param);
|
||||
navigation.navigate(caller, resultCallback);
|
||||
}
|
||||
|
||||
public static void startActivityForResult(@Nullable ActivityResultCaller caller, Intent intent, ActivityResultCallback<ActivityResult> resultCallback) {
|
||||
Navigation navigation = new Navigation();
|
||||
navigation.setIntent(intent);
|
||||
navigation.navigate(caller, resultCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* use {@link #startActivityForResult}
|
||||
*/
|
||||
@Deprecated
|
||||
public static void startActivity(@Nullable Object starter, String activityName, Bundle param, int requestCode) {
|
||||
TUIRouter.Navigation navigation = TUIRouter.getInstance().setDestination(activityName).putExtras(param);
|
||||
if (starter instanceof Fragment) {
|
||||
navigation.navigate((Fragment) starter, requestCode);
|
||||
} else if (starter instanceof Context) {
|
||||
navigation.navigate((Context) starter, requestCode);
|
||||
} else {
|
||||
navigation.navigate((Context) null, requestCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initRouter(Context context) {
|
||||
ActivityInfo[] activityInfos = null;
|
||||
List<String> activityNames = new ArrayList<>();
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
try {
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES);
|
||||
activityInfos = packageInfo.activities;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (activityInfos != null) {
|
||||
for (ActivityInfo activityInfo : activityInfos) {
|
||||
activityNames.add(activityInfo.name);
|
||||
}
|
||||
}
|
||||
for (String activityName : activityNames) {
|
||||
String[] splitStr = activityName.split("\\.");
|
||||
routerMap.put(splitStr[splitStr.length - 1], activityName);
|
||||
}
|
||||
}
|
||||
|
||||
public static Context getContext() {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
package com.tencent.qcloud.tuicore;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.tencent.qcloud.tuicore.util.SPUtils;
|
||||
import com.tencent.qcloud.tuicore.util.TUIBuild;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Static skinning, language
|
||||
*/
|
||||
public class TUIThemeManager {
|
||||
private static final String TAG = TUIThemeManager.class.getSimpleName();
|
||||
|
||||
private static final String SP_THEME_AND_LANGUAGE_NAME = "TUIThemeAndLanguage";
|
||||
private static final String SP_KEY_LANGUAGE = "language";
|
||||
private static final String SP_KEY_THEME = "theme";
|
||||
private static final String SP_KEY_ENABLE_CHANGE_LANGUAGE = "enable_change_language";
|
||||
|
||||
public static final int THEME_LIGHT = 0; // default
|
||||
public static final int THEME_LIVELY = 1;
|
||||
public static final int THEME_SERIOUS = 2;
|
||||
|
||||
public static final String LANGUAGE_ZH_CN = "zh";
|
||||
public static final String LANGUAGE_ZH_HK = "zh-traditional";
|
||||
public static final String LANGUAGE_EN = "en";
|
||||
public static final String LANGUAGE_AR = "ar";
|
||||
|
||||
private static final class ThemeManagerHolder {
|
||||
private static final TUIThemeManager instance = new TUIThemeManager();
|
||||
}
|
||||
|
||||
public static TUIThemeManager getInstance() {
|
||||
return ThemeManagerHolder.instance;
|
||||
}
|
||||
|
||||
private boolean isInit = false;
|
||||
|
||||
private final Map<Integer, List<Integer>> themeResIDMap = new HashMap<>();
|
||||
private final Map<String, Locale> languageMap = new HashMap<>();
|
||||
|
||||
private int currentThemeID = THEME_LIGHT;
|
||||
private String currentLanguage = "";
|
||||
private Locale defaultLocale = null;
|
||||
private boolean enableLanguageSwitch = false;
|
||||
|
||||
private TUIThemeManager() {
|
||||
languageMap.put(LANGUAGE_ZH_CN, Locale.CHINESE);
|
||||
languageMap.put(LANGUAGE_ZH_HK, Locale.TRADITIONAL_CHINESE);
|
||||
languageMap.put(LANGUAGE_EN, Locale.ENGLISH);
|
||||
languageMap.put(LANGUAGE_AR, new Locale("ar"));
|
||||
}
|
||||
|
||||
public static void setTheme(Context context) {
|
||||
getInstance().setThemeInternal(context);
|
||||
}
|
||||
|
||||
public static void setEnableLanguageSwitch(boolean enableLanguageSwitch) {
|
||||
getInstance().enableLanguageSwitch = enableLanguageSwitch;
|
||||
SPUtils spUtils = SPUtils.getInstance(SP_THEME_AND_LANGUAGE_NAME);
|
||||
spUtils.put(SP_KEY_ENABLE_CHANGE_LANGUAGE, enableLanguageSwitch);
|
||||
}
|
||||
|
||||
private void setThemeInternal(Context context) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Context appContext = context.getApplicationContext();
|
||||
if (!isInit) {
|
||||
isInit = true;
|
||||
SPUtils spUtils = SPUtils.getInstance(SP_THEME_AND_LANGUAGE_NAME);
|
||||
enableLanguageSwitch = spUtils.getBoolean(SP_KEY_ENABLE_CHANGE_LANGUAGE, false);
|
||||
|
||||
if (appContext instanceof Application) {
|
||||
((Application) appContext).registerActivityLifecycleCallbacks(new ThemeAndLanguageCallback());
|
||||
}
|
||||
|
||||
notifySetLanguageEvent();
|
||||
Locale defaultLocale = getLocale(appContext);
|
||||
currentLanguage = spUtils.getString(SP_KEY_LANGUAGE, defaultLocale.getLanguage());
|
||||
currentThemeID = spUtils.getInt(SP_KEY_THEME, THEME_LIGHT);
|
||||
|
||||
// The language only needs to be initialized once
|
||||
applyLanguage(appContext);
|
||||
}
|
||||
// The theme needs to be updated multiple times
|
||||
applyTheme(appContext);
|
||||
}
|
||||
|
||||
private static String currentProcessName = "";
|
||||
|
||||
public static String getProcessName() {
|
||||
if (!TextUtils.isEmpty(currentProcessName)) {
|
||||
return currentProcessName;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
currentProcessName = Application.getProcessName();
|
||||
return currentProcessName;
|
||||
}
|
||||
|
||||
try {
|
||||
final Method declaredMethod = Class.forName("android.app.ActivityThread", false, Application.class.getClassLoader())
|
||||
.getDeclaredMethod("currentProcessName", (Class<?>[]) new Class[0]);
|
||||
declaredMethod.setAccessible(true);
|
||||
final Object invoke = declaredMethod.invoke(null, new Object[0]);
|
||||
if (invoke instanceof String) {
|
||||
currentProcessName = (String) invoke;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return currentProcessName;
|
||||
}
|
||||
|
||||
private void notifySetLanguageEvent() {
|
||||
TUICore.notifyEvent(TUIConstants.TUICore.LANGUAGE_EVENT, TUIConstants.TUICore.LANGUAGE_EVENT_SUB_KEY, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Solve the problem that WebView on Android 7 and above causes failure to switch languages.
|
||||
* Solve the problem of using WebView Crash for multiple processes above Android 9.
|
||||
*/
|
||||
public static void setWebViewLanguage(Context appContext) {
|
||||
try {
|
||||
Log.i(TAG, "setWebViewLanguage");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
WebView.setDataDirectorySuffix(getProcessName());
|
||||
}
|
||||
new WebView(appContext).destroy();
|
||||
} catch (Throwable throwable) {
|
||||
Log.e("TUIThemeManager", "init language settings failed, " + throwable.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaultLocale(Locale defaultLocale) {
|
||||
this.defaultLocale = defaultLocale;
|
||||
}
|
||||
|
||||
public static void addTheme(int themeID, int resID) {
|
||||
if (resID == 0) {
|
||||
Log.e(TAG, "addTheme failed, theme resID is zero");
|
||||
return;
|
||||
}
|
||||
Log.i(TAG, "addTheme themeID=" + themeID + " resID=" + resID);
|
||||
List<Integer> themeResIDList = getInstance().themeResIDMap.get(themeID);
|
||||
if (themeResIDList == null) {
|
||||
themeResIDList = new ArrayList<>();
|
||||
getInstance().themeResIDMap.put(themeID, themeResIDList);
|
||||
}
|
||||
if (themeResIDList.contains(resID)) {
|
||||
return;
|
||||
}
|
||||
themeResIDList.add(resID);
|
||||
TUIThemeManager.getInstance().applyTheme(ServiceInitializer.getAppContext());
|
||||
}
|
||||
|
||||
public static void addLightTheme(int resId) {
|
||||
addTheme(THEME_LIGHT, resId);
|
||||
}
|
||||
|
||||
public static void addLivelyTheme(int resId) {
|
||||
addTheme(THEME_LIVELY, resId);
|
||||
}
|
||||
|
||||
public static void addSeriousTheme(int resId) {
|
||||
addTheme(THEME_SERIOUS, resId);
|
||||
}
|
||||
|
||||
public int getCurrentTheme() {
|
||||
return currentThemeID;
|
||||
}
|
||||
|
||||
private void mergeTheme(Resources.Theme theme) {
|
||||
if (theme == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Integer> currentThemeResIDList = themeResIDMap.get(currentThemeID);
|
||||
if (currentThemeResIDList == null) {
|
||||
return;
|
||||
}
|
||||
for (Integer resId : currentThemeResIDList) {
|
||||
theme.applyStyle(resId, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addLanguage(String language, Locale locale) {
|
||||
Log.i(TAG, "addLanguage language=" + language + " locale=" + locale);
|
||||
getInstance().languageMap.put(language, locale);
|
||||
}
|
||||
|
||||
public void changeLanguage(Context context, String language) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.equals(language, currentLanguage)) {
|
||||
return;
|
||||
}
|
||||
setEnableLanguageSwitch(true);
|
||||
currentLanguage = language;
|
||||
SPUtils spUtils = SPUtils.getInstance(SP_THEME_AND_LANGUAGE_NAME);
|
||||
spUtils.put(SP_KEY_LANGUAGE, language, true);
|
||||
|
||||
applyLanguage(context.getApplicationContext());
|
||||
applyLanguage(context);
|
||||
|
||||
TUICore.notifyEvent(TUIConstants.TUICore.LANGUAGE_EVENT, TUIConstants.TUICore.LANGUAGE_CHANGED_EVENT_SUB_KEY, null);
|
||||
}
|
||||
|
||||
public void applyLanguage(Context context) {
|
||||
if (!enableLanguageSwitch) {
|
||||
return;
|
||||
}
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
Locale locale = languageMap.get(currentLanguage);
|
||||
if (locale == null) {
|
||||
if (defaultLocale != null) {
|
||||
locale = defaultLocale;
|
||||
} else {
|
||||
locale = getLocale(context);
|
||||
}
|
||||
}
|
||||
|
||||
Resources resources = context.getResources();
|
||||
Configuration configuration = resources.getConfiguration();
|
||||
configuration.locale = locale;
|
||||
configuration.setLocale(locale);
|
||||
resources.updateConfiguration(configuration, null);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
context = context.createConfigurationContext(configuration);
|
||||
context.getResources().updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
}
|
||||
}
|
||||
|
||||
public String getCurrentLanguage() {
|
||||
return currentLanguage;
|
||||
}
|
||||
|
||||
public Locale getLocale(Context context) {
|
||||
Locale locale;
|
||||
|
||||
if (TUIBuild.getVersionInt() < Build.VERSION_CODES.N) {
|
||||
locale = context.getResources().getConfiguration().locale;
|
||||
} else {
|
||||
locale = context.getResources().getConfiguration().getLocales().get(0);
|
||||
}
|
||||
return locale;
|
||||
}
|
||||
|
||||
public void changeTheme(Context context, int themeId) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (themeId == currentThemeID) {
|
||||
return;
|
||||
}
|
||||
currentThemeID = themeId;
|
||||
|
||||
SPUtils spUtils = SPUtils.getInstance(SP_THEME_AND_LANGUAGE_NAME);
|
||||
spUtils.put(SP_KEY_THEME, themeId, true);
|
||||
|
||||
applyTheme(context.getApplicationContext());
|
||||
applyTheme(context);
|
||||
}
|
||||
|
||||
private void applyTheme(Context context) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
Resources.Theme theme = context.getTheme();
|
||||
if (theme == null) {
|
||||
context.setTheme(R.style.TUIBaseTheme);
|
||||
theme = context.getTheme();
|
||||
}
|
||||
mergeTheme(theme);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resources for skinning
|
||||
*
|
||||
* @param context context
|
||||
* @param attrId custom attribute
|
||||
* @return resources for skinning
|
||||
*/
|
||||
public static int getAttrResId(Context context, int attrId) {
|
||||
if (context == null || attrId == 0) {
|
||||
return 0;
|
||||
}
|
||||
TypedValue typedValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(attrId, typedValue, true);
|
||||
return typedValue.resourceId;
|
||||
}
|
||||
|
||||
static class ThemeAndLanguageCallback implements Application.ActivityLifecycleCallbacks {
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
TUIThemeManager.getInstance().applyTheme(activity);
|
||||
TUIThemeManager.getInstance().applyLanguage(activity);
|
||||
TUIThemeManager.getInstance().applyLanguage(activity.getApplicationContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.qcloud.tuicore.annotations;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target(TYPE)
|
||||
public @interface TUIInitializerDependency {
|
||||
String[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.qcloud.tuicore.annotations;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target(TYPE)
|
||||
public @interface TUIInitializerID {
|
||||
String value() default "";
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.qcloud.tuicore.annotations;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target(TYPE)
|
||||
public @interface TUIInitializerPriority {
|
||||
int value() default 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ITUIExtension {
|
||||
@Deprecated
|
||||
default Map<String, Object> onGetExtensionInfo(String key, Map<String, Object> param) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
default boolean onRaiseExtension(String extensionID, View parentView, Map<String, Object> param) {
|
||||
return false;
|
||||
}
|
||||
|
||||
default List<TUIExtensionInfo> onGetExtension(String extensionID, Map<String, Object> param) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ITUINotification {
|
||||
void onNotifyEvent(String key, String subKey, Map<String, Object> param);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ITUIObjectFactory {
|
||||
Object onCreateObject(String objectName, Map<String, Object> param);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ITUIService {
|
||||
default Object onCall(String method, Map<String, Object> param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
default Object onCall(String method, Map<String, Object> param, TUIServiceCallback callback) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
public abstract class TUICallback {
|
||||
public abstract void onSuccess();
|
||||
|
||||
public static void onSuccess(TUICallback callback) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void onError(int errorCode, String errorMessage);
|
||||
|
||||
public static void onError(TUICallback callback, int errorCode, String errorMessage) {
|
||||
if (callback != null) {
|
||||
callback.onError(errorCode, errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class TUIExtensionEventListener {
|
||||
public void onClicked(Map<String, Object> param) {}
|
||||
|
||||
public void onLongPressed(Map<String, Object> param) {}
|
||||
|
||||
public void onTouched(Map<String, Object> param) {}
|
||||
|
||||
public void onSwiped(int direction, Map<String, Object> param) {}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TUIExtensionInfo implements Comparable<TUIExtensionInfo> {
|
||||
private int weight;
|
||||
private String text;
|
||||
private Object icon;
|
||||
|
||||
private Map<String, Object> data;
|
||||
|
||||
private TUIExtensionEventListener extensionListener;
|
||||
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public Object getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(Object icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public Map<String, Object> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Map<String, Object> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void setExtensionListener(TUIExtensionEventListener extensionListener) {
|
||||
this.extensionListener = extensionListener;
|
||||
}
|
||||
|
||||
public TUIExtensionEventListener getExtensionListener() {
|
||||
return extensionListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TUIExtensionInfo o) {
|
||||
return o.getWeight() - this.weight;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public interface TUIInitializer {
|
||||
void init(Context applicationContext);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
public abstract class TUILogListener {
|
||||
public void onLog(int logLevel, String logContent) {}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
public class TUILoginConfig {
|
||||
/**
|
||||
* ## Do not output any SDK logs
|
||||
*/
|
||||
public static final int TUI_LOG_NONE = 0;
|
||||
/**
|
||||
* ## Output logs at the DEBUG, INFO, WARNING, and ERROR levels
|
||||
*/
|
||||
public static final int TUI_LOG_DEBUG = 3;
|
||||
/**
|
||||
* ## Output logs at the INFO, WARNING, and ERROR levels
|
||||
*/
|
||||
public static final int TUI_LOG_INFO = 4;
|
||||
/**
|
||||
* ## Output logs at the WARNING and ERROR levels
|
||||
*/
|
||||
public static final int TUI_LOG_WARN = 5;
|
||||
/**
|
||||
* ## Output logs at the ERROR level
|
||||
*/
|
||||
public static final int TUI_LOG_ERROR = 6;
|
||||
|
||||
// Log level
|
||||
private int logLevel = TUI_LOG_INFO;
|
||||
|
||||
// Log callback
|
||||
private TUILogListener tuiLogListener;
|
||||
|
||||
private boolean initLocalStorageOnly = false;
|
||||
|
||||
/**
|
||||
* Configuration class constructor
|
||||
*/
|
||||
public TUILoginConfig() {}
|
||||
|
||||
/**
|
||||
* Set the write log level. This operation must be performed before IM SDK initialization. Otherwise, the setting does not take effect.
|
||||
*
|
||||
* @param logLevel Log level
|
||||
*/
|
||||
public void setLogLevel(int logLevel) {
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
|
||||
public int getLogLevel() {
|
||||
return this.logLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current log callback listener
|
||||
*/
|
||||
public TUILogListener getLogListener() {
|
||||
return tuiLogListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current log callback listener. This operation must be performed before IM SDK initialization.
|
||||
* @note The callback is in the main thread. Log callbacks can be quite frequent, so be careful not to synchronize too many time-consuming tasks in the
|
||||
* callback, which may block the main thread.
|
||||
*/
|
||||
public void setLogListener(TUILogListener logListener) {
|
||||
this.tuiLogListener = logListener;
|
||||
}
|
||||
|
||||
public boolean isInitLocalStorageOnly() {
|
||||
return initLocalStorageOnly;
|
||||
}
|
||||
|
||||
public void setInitLocalStorageOnly(boolean initLocalStorageOnly) {
|
||||
this.initLocalStorageOnly = initLocalStorageOnly;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
public abstract class TUILoginListener {
|
||||
/**
|
||||
* The SDK is connecting to the CVM instance
|
||||
*/
|
||||
public void onConnecting() {}
|
||||
|
||||
/**
|
||||
* The SDK is successfully connected to the CVM instance
|
||||
*/
|
||||
public void onConnectSuccess() {}
|
||||
|
||||
/**
|
||||
* The SDK failed to connect to the CVM instance
|
||||
*/
|
||||
public void onConnectFailed(int code, String error) {}
|
||||
|
||||
/**
|
||||
* The current user is kicked offline: the SDK notifies the user on the UI, and the user can choose to call the login() function of V2TIMManager to log in
|
||||
* again.
|
||||
*/
|
||||
public void onKickedOffline() {}
|
||||
|
||||
/**
|
||||
* The ticket expires when the user is online: the user needs to generate a new userSig and call the login() function of V2TIMManager to log in again.
|
||||
*/
|
||||
public void onUserSigExpired() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public abstract class TUIServiceCallback {
|
||||
public abstract void onServiceCallback(int errorCode, String errorMessage, Bundle bundle);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tencent.qcloud.tuicore.interfaces;
|
||||
|
||||
public abstract class TUIValueCallback<T> {
|
||||
public abstract void onSuccess(T object);
|
||||
|
||||
public static <T> void onSuccess(TUIValueCallback<T> callback, T result) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(result);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void onError(int errorCode, String errorMessage);
|
||||
|
||||
public static <T> void onError(TUIValueCallback<T> callback, int errorCode, String errorMessage) {
|
||||
if (callback != null) {
|
||||
callback.onError(errorCode, errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public void onProgress(long current, long total) {}
|
||||
|
||||
public static <T> void onProgress(TUIValueCallback<T> callback, long current, long total) {
|
||||
if (callback != null) {
|
||||
callback.onProgress(current, total);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.tencent.qcloud.tuicore.permission;
|
||||
|
||||
import static com.tencent.qcloud.tuicore.permission.PermissionRequester.PERMISSION_NOTIFY_EVENT_KEY;
|
||||
import static com.tencent.qcloud.tuicore.permission.PermissionRequester.PERMISSION_NOTIFY_EVENT_SUB_KEY;
|
||||
import static com.tencent.qcloud.tuicore.permission.PermissionRequester.PERMISSION_RESULT;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.tencent.qcloud.tuicore.R;
|
||||
import com.tencent.qcloud.tuicore.TUICore;
|
||||
import com.tencent.qcloud.tuicore.util.TUIBuild;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public class PermissionActivity extends Activity {
|
||||
private static final String TAG = "PermissionActivity";
|
||||
private static final int PERMISSION_REQUEST_CODE = 100;
|
||||
|
||||
private TextView mRationaleTitleTv;
|
||||
private TextView mRationaleDescriptionTv;
|
||||
private ImageView mPermissionIconIv;
|
||||
private PermissionRequester.RequestData mRequestData;
|
||||
|
||||
private PermissionRequester.Result mResult = PermissionRequester.Result.Denied;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mRequestData = getPermissionRequest();
|
||||
if (mRequestData == null || mRequestData.isPermissionsExistEmpty()) {
|
||||
Log.e(TAG, "onCreate mRequestData exist empty permission");
|
||||
finishWithResult(PermissionRequester.Result.Denied);
|
||||
return;
|
||||
}
|
||||
Log.i(TAG, "onCreate : " + mRequestData.toString());
|
||||
if (TUIBuild.getVersionInt() < Build.VERSION_CODES.M) {
|
||||
finishWithResult(PermissionRequester.Result.Granted);
|
||||
return;
|
||||
}
|
||||
|
||||
makeBackGroundTransparent();
|
||||
initView();
|
||||
showPermissionRationale();
|
||||
|
||||
requestPermissions(mRequestData.getPermissions(), PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
hidePermissionRationale();
|
||||
if (isAllPermissionsGranted(grantResults)) {
|
||||
finishWithResult(PermissionRequester.Result.Granted);
|
||||
return;
|
||||
}
|
||||
showSettingsTip();
|
||||
}
|
||||
|
||||
private void showSettingsTip() {
|
||||
if (mRequestData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
View tipLayout = LayoutInflater.from(this).inflate(R.layout.permission_tip_layout, null);
|
||||
TextView tipsTv = tipLayout.findViewById(R.id.tips);
|
||||
TextView positiveBtn = tipLayout.findViewById(R.id.positive_btn);
|
||||
TextView negativeBtn = tipLayout.findViewById(R.id.negative_btn);
|
||||
tipsTv.setText(mRequestData.getSettingsTip());
|
||||
|
||||
Dialog permissionTipDialog = new AlertDialog.Builder(this).setView(tipLayout).setCancelable(false).create();
|
||||
|
||||
positiveBtn.setOnClickListener(v -> {
|
||||
permissionTipDialog.dismiss();
|
||||
launchAppDetailsSettings();
|
||||
finishWithResult(PermissionRequester.Result.Requesting);
|
||||
});
|
||||
|
||||
negativeBtn.setOnClickListener(v -> {
|
||||
permissionTipDialog.dismiss();
|
||||
finishWithResult(PermissionRequester.Result.Denied);
|
||||
});
|
||||
permissionTipDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
|
||||
permissionTipDialog.dismiss();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
Window dialogWindow = permissionTipDialog.getWindow();
|
||||
dialogWindow.setBackgroundDrawable(new ColorDrawable());
|
||||
WindowManager.LayoutParams layoutParams = dialogWindow.getAttributes();
|
||||
layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
dialogWindow.setAttributes(layoutParams);
|
||||
permissionTipDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the application's details settings.
|
||||
*/
|
||||
private void launchAppDetailsSettings() {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size() <= 0) {
|
||||
Log.e(TAG, "launchAppDetailsSettings can not find system settings");
|
||||
return;
|
||||
}
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void finishWithResult(PermissionRequester.Result result) {
|
||||
Log.i(TAG, "finishWithResult : " + result);
|
||||
mResult = result;
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Map<String, Object> result = new HashMap<>(1);
|
||||
result.put(PERMISSION_RESULT, mResult);
|
||||
TUICore.notifyEvent(PERMISSION_NOTIFY_EVENT_KEY, PERMISSION_NOTIFY_EVENT_SUB_KEY, result);
|
||||
}
|
||||
|
||||
private PermissionRequester.RequestData getPermissionRequest() {
|
||||
Intent intent = getIntent();
|
||||
if (intent == null) {
|
||||
return null;
|
||||
}
|
||||
return intent.getParcelableExtra(PermissionRequester.PERMISSION_REQUEST_KEY);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void makeBackGroundTransparent() {
|
||||
if (TUIBuild.getVersionInt() >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
getWindow().setNavigationBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
setContentView(R.layout.permission_activity_layout);
|
||||
mRationaleTitleTv = findViewById(R.id.permission_reason_title);
|
||||
mRationaleDescriptionTv = findViewById(R.id.permission_reason);
|
||||
mPermissionIconIv = findViewById(R.id.permission_icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* ,,。
|
||||
*
|
||||
* Security compliance requires that when applying for permission, the reason for applying for permission must be
|
||||
* displayed.
|
||||
*/
|
||||
private void showPermissionRationale() {
|
||||
if (mRequestData == null) {
|
||||
return;
|
||||
}
|
||||
mRationaleTitleTv.setText(mRequestData.getTitle());
|
||||
mRationaleDescriptionTv.setText(mRequestData.getDescription());
|
||||
mPermissionIconIv.setBackgroundResource(mRequestData.getPermissionIconId());
|
||||
|
||||
mRationaleTitleTv.setVisibility(View.VISIBLE);
|
||||
mRationaleDescriptionTv.setVisibility(View.VISIBLE);
|
||||
mPermissionIconIv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void hidePermissionRationale() {
|
||||
mRationaleTitleTv.setVisibility(View.INVISIBLE);
|
||||
mRationaleDescriptionTv.setVisibility(View.INVISIBLE);
|
||||
mPermissionIconIv.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
private boolean isAllPermissionsGranted(@NonNull int[] grantResults) {
|
||||
for (int result : grantResults) {
|
||||
if (result != PackageManager.PERMISSION_GRANTED) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.tencent.qcloud.tuicore.permission;
|
||||
|
||||
public abstract class PermissionCallback {
|
||||
public abstract void onGranted();
|
||||
|
||||
public void onRequesting() {}
|
||||
|
||||
public void onDenied() {}
|
||||
}
|
||||
@@ -0,0 +1,536 @@
|
||||
package com.tencent.qcloud.tuicore.permission;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AppOpsManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.Size;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.tencent.qcloud.tuicore.R;
|
||||
import com.tencent.qcloud.tuicore.TUIConfig;
|
||||
import com.tencent.qcloud.tuicore.TUICore;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUINotification;
|
||||
import com.tencent.qcloud.tuicore.util.TUIBuild;
|
||||
import com.tencent.qcloud.tuicore.util.ToastUtil;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class PermissionRequester {
|
||||
private static final String TAG = "PermissionRequester";
|
||||
|
||||
public static final String PERMISSION_NOTIFY_EVENT_KEY = "PERMISSION_NOTIFY_EVENT_KEY";
|
||||
public static final String PERMISSION_NOTIFY_EVENT_SUB_KEY = "PERMISSION_NOTIFY_EVENT_SUB_KEY";
|
||||
public static final String PERMISSION_RESULT = "PERMISSION_RESULT";
|
||||
public static final String PERMISSION_REQUEST_KEY = "PERMISSION_REQUEST_KEY";
|
||||
private static final Object sLock = new Object();
|
||||
|
||||
private static AtomicBoolean sIsRequesting = new AtomicBoolean(false);
|
||||
|
||||
private PermissionCallback mPermissionCallback;
|
||||
private String[] mPermissions;
|
||||
private String mTitle;
|
||||
private String mDescription;
|
||||
private String mSettingsTip;
|
||||
private ITUINotification mPermissionNotification;
|
||||
|
||||
public enum Result { Granted, Denied, Requesting }
|
||||
|
||||
public static final String FLOAT_PERMISSION = "PermissionOverlayWindows";
|
||||
public static final String BG_START_PERMISSION = "PermissionStartActivityFromBackground";
|
||||
|
||||
private List<String> mDirectPermissionList = new ArrayList<>();
|
||||
private List<String> mIndirectPermissionList = new ArrayList<>();
|
||||
|
||||
private PermissionRequester(String... permissions) {
|
||||
mPermissions = permissions;
|
||||
for (String permission : mPermissions) {
|
||||
if (FLOAT_PERMISSION.equals(permission) || BG_START_PERMISSION.equals(permission)) {
|
||||
mIndirectPermissionList.add(permission);
|
||||
} else {
|
||||
mDirectPermissionList.add(permission);
|
||||
}
|
||||
}
|
||||
|
||||
mPermissionNotification = (key, subKey, param) -> {
|
||||
if (param == null) {
|
||||
return;
|
||||
}
|
||||
Object result = param.get(PERMISSION_RESULT);
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
notifyPermissionRequestResult((Result) result);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance of PermissionRequester, where the parameters are the specific permissions that need to be
|
||||
* applied for, and one or more permissions can be passed in.
|
||||
*
|
||||
* @param permissions The name of the permission that needs to be applied for.
|
||||
* @return An instance of PermissionRequester.
|
||||
*/
|
||||
public static PermissionRequester newInstance(@NonNull @Size(min = 1) String... permissions) {
|
||||
return new PermissionRequester(permissions);
|
||||
}
|
||||
|
||||
/**
|
||||
* The title of the reason: security compliance requirements, when requesting permission, you
|
||||
* must explain to the user why you need to apply for the permission;
|
||||
*
|
||||
* @param title The title of the reason;
|
||||
* @return An instance of PermissionRequester.
|
||||
*/
|
||||
public PermissionRequester title(@NonNull String title) {
|
||||
mTitle = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The text of the reason: security compliance requirements, when requesting permission,
|
||||
* explain to the user why the permission is required;
|
||||
*
|
||||
* @param description The text of the reason;
|
||||
* @return An instance of PermissionRequester.
|
||||
*/
|
||||
public PermissionRequester description(@NonNull String description) {
|
||||
mDescription = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Explain to the user what permissions need to be opened after entering the Settings to
|
||||
* ensure the normal operation of the function;
|
||||
*
|
||||
* @param settingsTip Prompt user what to do in settings;
|
||||
* @return An instance of PermissionRequester.
|
||||
*/
|
||||
public PermissionRequester settingsTip(@NonNull String settingsTip) {
|
||||
mSettingsTip = settingsTip;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the callback used to get the permission application result.
|
||||
*
|
||||
* @param callback callback for permission application;
|
||||
* @return An instance of PermissionRequester.
|
||||
*/
|
||||
public PermissionRequester callback(@NonNull PermissionCallback callback) {
|
||||
mPermissionCallback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start requesting permission.
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
public void request() {
|
||||
Log.i(TAG, "request, directPermissionList: " + mDirectPermissionList
|
||||
+ " ,indirectPermissionList: " + mIndirectPermissionList);
|
||||
if (mDirectPermissionList != null && mDirectPermissionList.size() > 0) {
|
||||
requestDirectPermission(mDirectPermissionList.toArray(new String[0]));
|
||||
}
|
||||
if (mIndirectPermissionList != null && mIndirectPermissionList.size() > 0) {
|
||||
startAppDetailsSettingsByBrand();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void requestDirectPermission(String[] permissions) {
|
||||
synchronized (sLock) {
|
||||
if (sIsRequesting.get()) {
|
||||
Log.e(TAG, "can not request during requesting");
|
||||
if (mPermissionCallback != null) {
|
||||
mPermissionCallback.onDenied();
|
||||
}
|
||||
return;
|
||||
}
|
||||
sIsRequesting.set(true);
|
||||
}
|
||||
|
||||
TUICore.registerEvent(PERMISSION_NOTIFY_EVENT_KEY, PERMISSION_NOTIFY_EVENT_SUB_KEY, mPermissionNotification);
|
||||
if (TUIBuild.getVersionInt() < Build.VERSION_CODES.M) {
|
||||
Log.i(TAG, "current version is lower than 23");
|
||||
notifyPermissionRequestResult(Result.Granted);
|
||||
return;
|
||||
}
|
||||
String[] unauthorizedPermissions = findUnauthorizedPermissions(permissions);
|
||||
if (unauthorizedPermissions.length <= 0) {
|
||||
notifyPermissionRequestResult(Result.Granted);
|
||||
return;
|
||||
}
|
||||
RequestData realRequest = new RequestData(mTitle, mDescription, mSettingsTip, unauthorizedPermissions);
|
||||
startPermissionActivity(realRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not support check float permission(or background permission) with microphone(or camera\bluetooth) together
|
||||
*/
|
||||
public boolean has() {
|
||||
if (mIndirectPermissionList.contains(BG_START_PERMISSION)) {
|
||||
return hasFloatPermission() && hasBgStartPermission();
|
||||
} else if (mIndirectPermissionList.contains(FLOAT_PERMISSION)) {
|
||||
return hasFloatPermission();
|
||||
}
|
||||
|
||||
for (String permission : mDirectPermissionList) {
|
||||
if (!has(permission)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean has(final String permission) {
|
||||
return TUIBuild.getVersionInt() < Build.VERSION_CODES.M
|
||||
|| PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(TUIConfig.getAppContext(), permission);
|
||||
}
|
||||
|
||||
private void notifyPermissionRequestResult(Result result) {
|
||||
TUICore.unRegisterEvent(PERMISSION_NOTIFY_EVENT_KEY, PERMISSION_NOTIFY_EVENT_SUB_KEY, mPermissionNotification);
|
||||
sIsRequesting.set(false);
|
||||
if (mPermissionCallback == null) {
|
||||
return;
|
||||
}
|
||||
if (Result.Granted.equals(result)) {
|
||||
mPermissionCallback.onGranted();
|
||||
} else if (Result.Requesting.equals(result)) {
|
||||
mPermissionCallback.onRequesting();
|
||||
} else {
|
||||
mPermissionCallback.onDenied();
|
||||
}
|
||||
mPermissionCallback = null;
|
||||
}
|
||||
|
||||
private String[] findUnauthorizedPermissions(String[] permissions) {
|
||||
Context appContext = TUIConfig.getAppContext();
|
||||
if (appContext == null) {
|
||||
Log.e(TAG, "findUnauthorizedPermissions appContext is null");
|
||||
return permissions;
|
||||
}
|
||||
List<String> unauthorizedList = new LinkedList<>();
|
||||
for (String permission : permissions) {
|
||||
if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(appContext, permission)) {
|
||||
unauthorizedList.add(permission);
|
||||
}
|
||||
}
|
||||
return unauthorizedList.toArray(new String[0]);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
private void startPermissionActivity(RequestData request) {
|
||||
Context context = TUIConfig.getAppContext();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(context, PermissionActivity.class);
|
||||
intent.putExtra(PERMISSION_REQUEST_KEY, request);
|
||||
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
static class RequestData implements Parcelable {
|
||||
private final String[] mPermissions;
|
||||
private final String mTitle;
|
||||
private final String mDescription;
|
||||
private final String mSettingsTip;
|
||||
private int mPermissionIconId;
|
||||
|
||||
public RequestData(@NonNull String title, @NonNull String description, @NonNull String settingsTip, @NonNull String... perms) {
|
||||
mTitle = title;
|
||||
mDescription = description;
|
||||
mSettingsTip = settingsTip;
|
||||
mPermissions = perms.clone();
|
||||
}
|
||||
|
||||
protected RequestData(Parcel in) {
|
||||
mPermissions = in.createStringArray();
|
||||
mTitle = in.readString();
|
||||
mDescription = in.readString();
|
||||
mSettingsTip = in.readString();
|
||||
mPermissionIconId = in.readInt();
|
||||
}
|
||||
|
||||
public static final Creator<RequestData> CREATOR = new Creator<RequestData>() {
|
||||
@Override
|
||||
public RequestData createFromParcel(Parcel in) {
|
||||
return new RequestData(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestData[] newArray(int size) {
|
||||
return new RequestData[size];
|
||||
}
|
||||
};
|
||||
|
||||
public boolean isPermissionsExistEmpty() {
|
||||
if (mPermissions == null || mPermissions.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
for (String permission : mPermissions) {
|
||||
if (TextUtils.isEmpty(permission)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String[] getPermissions() {
|
||||
return mPermissions.clone();
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return mDescription;
|
||||
}
|
||||
|
||||
public String getSettingsTip() {
|
||||
return mSettingsTip;
|
||||
}
|
||||
|
||||
public int getPermissionIconId() {
|
||||
return mPermissionIconId;
|
||||
}
|
||||
|
||||
public void setPermissionIconId(int permissionIconId) {
|
||||
mPermissionIconId = permissionIconId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PermissionRequest{"
|
||||
+ "mPermissions=" + Arrays.toString(mPermissions) + ", mTitle=" + mTitle + ", mDescription='" + mDescription + ", mSettingsTip='" + mSettingsTip
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeStringArray(mPermissions);
|
||||
dest.writeString(mTitle);
|
||||
dest.writeString(mDescription);
|
||||
dest.writeString(mSettingsTip);
|
||||
dest.writeInt(mPermissionIconId);
|
||||
}
|
||||
}
|
||||
|
||||
private void startAppDetailsSettingsByBrand() {
|
||||
if (TUIBuild.isBrandVivo()) {
|
||||
startVivoPermissionSettings(TUIConfig.getAppContext());
|
||||
} else if (TUIBuild.isBrandHuawei()) {
|
||||
startHuaweiPermissionSettings(TUIConfig.getAppContext());
|
||||
} else if (TUIBuild.isBrandXiaoMi()) {
|
||||
startXiaomiPermissionSettings(TUIConfig.getAppContext());
|
||||
} else {
|
||||
startCommonSettings(TUIConfig.getAppContext());
|
||||
}
|
||||
}
|
||||
|
||||
private void startCommonSettings(Context context) {
|
||||
try {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
|
||||
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void startVivoPermissionSettings(Context context) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName("com.vivo.permissionmanager",
|
||||
"com.vivo.permissionmanager.activity.SoftPermissionDetailActivity");
|
||||
intent.setAction("secure.intent.action.softPermissionDetail");
|
||||
intent.putExtra("packagename", context.getPackageName());
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
ToastUtil.toastShortMessage(context.getResources().getString(R.string.core_float_permission_hint));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "startVivoPermissionSettings: open common settings");
|
||||
startCommonSettings(context);
|
||||
}
|
||||
}
|
||||
|
||||
private void startHuaweiPermissionSettings(Context context) {
|
||||
if (!TUIBuild.isHarmonyOS()) {
|
||||
Log.i(TAG, "The device is not Harmony or cannot get system operator");
|
||||
startCommonSettings(context);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("packageName", context.getPackageName());
|
||||
ComponentName comp = new ComponentName("com.huawei.systemmanager",
|
||||
"com.huawei.permissionmanager.ui.MainActivity");
|
||||
intent.setComponent(comp);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
|
||||
ToastUtil.toastShortMessage(context.getResources().getString(R.string.core_float_permission_hint));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "startHuaweiPermissionSettings: open common settings");
|
||||
startCommonSettings(context);
|
||||
}
|
||||
}
|
||||
|
||||
private void startXiaomiPermissionSettings(Context context) {
|
||||
if (!TUIBuild.isMiuiOptimization()) {
|
||||
Log.i(TAG, "The device do not open miuiOptimization or cannot get miui property");
|
||||
startCommonSettings(context);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR");
|
||||
intent.setClassName("com.miui.securitycenter",
|
||||
"com.miui.permcenter.permissions.PermissionsEditorActivity");
|
||||
intent.putExtra("extra_pkgname", context.getPackageName());
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
|
||||
ToastUtil.toastShortMessage(context.getResources().getString(R.string.core_float_permission_hint));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "startXiaomiPermissionSettings: open common settings");
|
||||
startCommonSettings(context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. For most phone, floating permissions and background permission are the same.
|
||||
* 2. If the xiaomi phone has turned off MIUI optimization. When requesting float or background
|
||||
* pop-ups permission, it will start Settings.canDrawOverlays which cannot support open background pop-ups
|
||||
* permission. You need manually enable the background pop-ups permission in the system application Settings.
|
||||
*/
|
||||
private boolean hasBgStartPermission() {
|
||||
if (TUIBuild.isBrandHuawei() && TUIBuild.isHarmonyOS()) {
|
||||
return isHarmonyBgStartPermissionAllowed(TUIConfig.getAppContext());
|
||||
} else if (TUIBuild.isBrandVivo()) {
|
||||
return isVivoBgStartPermissionAllowed(TUIConfig.getAppContext());
|
||||
} else if (TUIBuild.isBrandXiaoMi() && TUIBuild.isMiuiOptimization()) {
|
||||
return isXiaomiBgStartPermissionAllowed(TUIConfig.getAppContext());
|
||||
}
|
||||
|
||||
return hasFloatPermission();
|
||||
}
|
||||
|
||||
private boolean hasFloatPermission() {
|
||||
try {
|
||||
Context context = TUIConfig.getAppContext();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return Settings.canDrawOverlays(context);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
AppOpsManager manager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
|
||||
if (manager == null) {
|
||||
return false;
|
||||
}
|
||||
Method method = AppOpsManager.class.getMethod("checkOp", int.class, int.class, String.class);
|
||||
int result = (Integer) method.invoke(manager, 24, Binder.getCallingUid(), context.getPackageName());
|
||||
Log.i(TAG, "hasFloatPermission, result: " + (AppOpsManager.MODE_ALLOWED == result));
|
||||
return AppOpsManager.MODE_ALLOWED == result;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isHarmonyBgStartPermissionAllowed(Context context) {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
AppOpsManager manager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
|
||||
if (manager == null) {
|
||||
return false;
|
||||
}
|
||||
Class<?> clz = Class.forName("com.huawei.android.app.AppOpsManagerEx");
|
||||
Method method = clz.getDeclaredMethod("checkHwOpNoThrow", AppOpsManager.class, int.class, int.class,
|
||||
String.class);
|
||||
int result = (int) method.invoke(clz.newInstance(), new Object[]{manager, 100000,
|
||||
android.os.Process.myUid(), context.getPackageName()});
|
||||
Log.i(TAG, "isHarmonyBgStartPermissionAllowed, result: " + (result == 0));
|
||||
return result == 0;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isVivoBgStartPermissionAllowed(Context context) {
|
||||
try {
|
||||
Uri uri = Uri.parse("content://com.vivo.permissionmanager.provider.permission/start_bg_activity");
|
||||
Cursor cursor = context.getContentResolver().query(uri, null, "pkgname = ?",
|
||||
new String[]{context.getPackageName()}, null);
|
||||
if (cursor == null) {
|
||||
return false;
|
||||
}
|
||||
if (cursor.moveToFirst()) {
|
||||
int result = cursor.getInt(cursor.getColumnIndex("currentstate"));
|
||||
cursor.close();
|
||||
Log.i(TAG, "isVivoBgStartPermissionAllowed, result: " + (0 == result));
|
||||
return 0 == result;
|
||||
} else {
|
||||
cursor.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isXiaomiBgStartPermissionAllowed(Context context) {
|
||||
try {
|
||||
AppOpsManager appOpsManager = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||
appOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
|
||||
}
|
||||
if (appOpsManager == null) {
|
||||
return false;
|
||||
}
|
||||
int op = 10021;
|
||||
Method method = appOpsManager.getClass().getMethod("checkOpNoThrow",
|
||||
new Class[]{int.class, int.class, String.class});
|
||||
method.setAccessible(true);
|
||||
int result = (int) method.invoke(appOpsManager, op, android.os.Process.myUid(), context.getPackageName());
|
||||
Log.i(TAG, "isXiaomiBgStartPermissionAllowed, result: " + (AppOpsManager.MODE_ALLOWED == result));
|
||||
return AppOpsManager.MODE_ALLOWED == result;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.tencent.qcloud.tuicore.push;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.tencent.imsdk.v2.V2TIMConversation;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
public class OfflinePushExtBusinessInfo implements Serializable {
|
||||
// The following are example fields that can be used based on the explanation; they are already used in TUIKitDemo.
|
||||
|
||||
public int version = 1;
|
||||
public int chatType = V2TIMConversation.V2TIM_C2C;
|
||||
public int action = OfflinePushExtInfo.REDIRECT_ACTION_CHAT;
|
||||
public String sender = "";
|
||||
public String nickname = "";
|
||||
public String faceUrl = "";
|
||||
public String content = "";
|
||||
public long sendTime = 0;
|
||||
|
||||
// custom data
|
||||
public byte[] customData;
|
||||
|
||||
|
||||
/**
|
||||
* Set the identifier for the chat type of the sent offline message.
|
||||
*
|
||||
* @param chatType 1,one-on-one chat;2,group chat
|
||||
*/
|
||||
public void setChatType(int chatType) {
|
||||
this.chatType = chatType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the chat type of the offline message from the sender.
|
||||
*
|
||||
* @return 1,one-on-one chat;2,group chat
|
||||
*/
|
||||
public int getChatType() {
|
||||
return this.chatType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the identifier for the type of the sent offline message
|
||||
*
|
||||
* @param action REDIRECT_ACTION_CHAT = 1,chat; REDIRECT_ACTION_CALL = 2, call
|
||||
*/
|
||||
public void setChatAction(int action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of the offline message from the sender
|
||||
*
|
||||
* @return REDIRECT_ACTION_CHAT = 1,chat; REDIRECT_ACTION_CALL = 2, call
|
||||
*/
|
||||
public int getChatAction() {
|
||||
return this.action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the identifier for the sender ID of the offline message
|
||||
*
|
||||
* @param senderId userID/groupID
|
||||
*/
|
||||
public void setSenderId(String senderId) {
|
||||
this.sender = senderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sender ID of the offline message
|
||||
*
|
||||
* @return userID/groupID
|
||||
*/
|
||||
public String getSenderId() {
|
||||
return this.sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the identifier for the sender nickname of the offline message.
|
||||
*
|
||||
* @param nickName sender nickname
|
||||
*/
|
||||
public void setSenderNickName(String nickName) {
|
||||
this.nickname = nickName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sender nickname of the offline message.
|
||||
*
|
||||
* @return sender nickname
|
||||
*/
|
||||
public String getSenderNickName() {
|
||||
return this.nickname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the display fields of the offline message
|
||||
*
|
||||
* @param desc description
|
||||
*/
|
||||
public void setDesc(String desc) {
|
||||
this.content = desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the display fields of the offline message
|
||||
*
|
||||
* @return description
|
||||
*/
|
||||
public String getDesc() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the version number of the offline message
|
||||
*
|
||||
* @param version version number
|
||||
*/
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the version number of the offline message
|
||||
*
|
||||
* @return version number
|
||||
*/
|
||||
public int getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the face Url of the offline message
|
||||
*
|
||||
* @param faceUrl face Url
|
||||
*/
|
||||
public void setFaceUrl(String faceUrl) {
|
||||
this.faceUrl = faceUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the face Url of the offline message
|
||||
*
|
||||
* @return face Url
|
||||
*/
|
||||
public String getFaceUrl() {
|
||||
return this.faceUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sending time of the offline message
|
||||
*
|
||||
* @param sendTime sending time
|
||||
*/
|
||||
public void setSendTime(long sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sending time of the offline message
|
||||
*
|
||||
* @return sending time
|
||||
*/
|
||||
public long getSendTime() {
|
||||
return this.sendTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set custom data (will be fully transmitted to the receiving end).
|
||||
*
|
||||
* @param customData custom data
|
||||
*/
|
||||
public void setCustomData(byte[] customData) {
|
||||
this.customData = customData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom data
|
||||
*
|
||||
* @return custom data
|
||||
*/
|
||||
public byte[] getCustomData() {
|
||||
return this.customData;
|
||||
}
|
||||
|
||||
String getCustomDataString() {
|
||||
String customString = "";
|
||||
if (customData != null && customData.length > 0) {
|
||||
try {
|
||||
customString = new String(customData, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Log.e("entity", "getCustomData e = " + e);
|
||||
}
|
||||
}
|
||||
return customString;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OfflinePushExtBusinessInfo{"
|
||||
+ "version=" + version + ", chatType='" + chatType + '\'' + ", action=" + action + ", sender=" + sender + ", nickname=" + nickname
|
||||
+ ", faceUrl=" + faceUrl + ", content=" + content + ", sendTime=" + sendTime + ", customData=" + getCustomDataString() + '}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.tencent.qcloud.tuicore.push;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class OfflinePushExtConfigInfo implements Serializable {
|
||||
public static final int FCM_PUSH_TYPE_DATA = 0;
|
||||
public static final int FCM_PUSH_TYPE_NOTIFICATION = 1;
|
||||
|
||||
public static final int FCM_NOTIFICATION_TYPE_TIMPUSH = 0;
|
||||
public static final int FCM_NOTIFICATION_TYPE_PASS_THROUGH = 1;
|
||||
|
||||
private int fcmPushType = -1;
|
||||
private int fcmNotificationType = -1;
|
||||
|
||||
/**
|
||||
* Console configures the certificate for data mode, and the message field can be set to switch to this mode with higher priority.
|
||||
*
|
||||
* @param fcmPushType 0, data; 1, notification
|
||||
*/
|
||||
public void setFCMPushType(int fcmPushType) {
|
||||
this.fcmPushType = fcmPushType;
|
||||
}
|
||||
|
||||
/**
|
||||
* In FCM channel's data mode, whether to display the notification message through the plugin or handle it in the
|
||||
* business implementation after transparent transmission.
|
||||
*
|
||||
* @param fcmNotificationType 0, TIMPush implementation; 1, business implementation after transparent transmission
|
||||
*/
|
||||
public void setFCMNotificationType(int fcmNotificationType) {
|
||||
this.fcmNotificationType = fcmNotificationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* In FCM channel's data mode, whether to retrieve the notification message through the plugin or handle it in the
|
||||
* business implementation after transparent transmission.
|
||||
*
|
||||
* @return 0, TIMPush implementation; 1, business implementation after transparent transmission
|
||||
*/
|
||||
public int getFCMNotificationType() {
|
||||
return this.fcmNotificationType;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OfflinePushExtConfigInfo{"
|
||||
+ "fcmPushType=" + fcmPushType + ", fcmNotificationType='" + fcmNotificationType + '}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.tencent.qcloud.tuicore.push;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* ## The transparent transmission field of offline push messages can be set through the V2TIMOfflinePushInfo.setExt(ext)
|
||||
* method.When users receive push notifications and click on them, they can retrieve the transparent transmission field
|
||||
* within the startup interface.
|
||||
* OfflinePushExtInfo is the JavaBean corresponding to the ext parameter of the transparent transmission.
|
||||
*
|
||||
*
|
||||
* @note usage:
|
||||
* OfflinePushExtInfo offlinePushExtInfo = new OfflinePushExtInfo();
|
||||
*
|
||||
* - Set:
|
||||
* V2TIMOfflinePushInfo v2TIMOfflinePushInfo = new V2TIMOfflinePushInfo();
|
||||
* v2TIMOfflinePushInfo.setExt(new Gson().toJson(offlinePushExtInfo).getBytes());
|
||||
*
|
||||
* - Get:
|
||||
* String ext = intent.getStringExtra("ext");
|
||||
* try {
|
||||
* offlinePushExtInfo = new Gson().fromJson(ext, OfflinePushExtInfo.class);
|
||||
* } catch (Exception e) {
|
||||
*
|
||||
* }
|
||||
*
|
||||
*
|
||||
* @note OfflinePushExtInfo JSON format:
|
||||
* {
|
||||
* "entity":"xxxxxx",
|
||||
* "timPushFeatures":"xxxxxxx"
|
||||
* }
|
||||
*
|
||||
*/
|
||||
|
||||
public class OfflinePushExtInfo implements Serializable {
|
||||
public static final int REDIRECT_ACTION_CHAT = 1;
|
||||
public static final int REDIRECT_ACTION_CALL = 2;
|
||||
|
||||
private OfflinePushExtBusinessInfo entity = new OfflinePushExtBusinessInfo();
|
||||
private OfflinePushExtConfigInfo timPushFeatures = new OfflinePushExtConfigInfo();
|
||||
|
||||
/**
|
||||
* ## Universal feature function entry
|
||||
*
|
||||
* @return Universal feature function class instance
|
||||
*/
|
||||
public OfflinePushExtBusinessInfo getBusinessInfo() {
|
||||
return this.entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set universal feature function class instance
|
||||
*
|
||||
*/
|
||||
public void setBusinessInfo(OfflinePushExtBusinessInfo entity) {
|
||||
if (null == entity) {
|
||||
entity = new OfflinePushExtBusinessInfo();
|
||||
}
|
||||
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* ## Feature function entry supported by TIMPush
|
||||
*
|
||||
* @return Class instance of feature function supported by TIMPush
|
||||
*/
|
||||
public OfflinePushExtConfigInfo getConfigInfo() {
|
||||
return this.timPushFeatures;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
public class BackgroundTasks {
|
||||
private static final BackgroundTasks instance = new BackgroundTasks();
|
||||
private final Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
public static BackgroundTasks getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private BackgroundTasks() {}
|
||||
|
||||
public void runOnUiThread(Runnable runnable) {
|
||||
handler.post(runnable);
|
||||
}
|
||||
|
||||
public boolean postDelayed(Runnable r, long delayMillis) {
|
||||
return handler.postDelayed(r, delayMillis);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.content.Context;
|
||||
import com.tencent.qcloud.tuicore.R;
|
||||
import com.tencent.qcloud.tuicore.TUIConfig;
|
||||
import com.tencent.qcloud.tuicore.TUIThemeManager;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class DateTimeUtil {
|
||||
private static final long minute = 60 * 1000;
|
||||
private static final long hour = 60 * minute;
|
||||
private static final long day = 24 * hour;
|
||||
private static final long week = 7 * day;
|
||||
private static final long month = 31 * day;
|
||||
private static final long year = 12 * month;
|
||||
|
||||
/**
|
||||
* return format text for time
|
||||
* you can see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html
|
||||
* today:HH:MM
|
||||
* this week:Sunday, Friday ..
|
||||
* this year:MM/DD
|
||||
* before this year:YYYY/MM/DD
|
||||
* @param date current time
|
||||
* @return format text
|
||||
*/
|
||||
public static String getTimeFormatText(Date date) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
Context context = TUIConfig.getAppContext();
|
||||
Locale locale;
|
||||
if (context == null) {
|
||||
locale = Locale.getDefault();
|
||||
} else {
|
||||
locale = TUIThemeManager.getInstance().getLocale(context);
|
||||
}
|
||||
String timeText;
|
||||
Calendar dayStartCalendar = Calendar.getInstance();
|
||||
dayStartCalendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
dayStartCalendar.set(Calendar.MINUTE, 0);
|
||||
dayStartCalendar.set(Calendar.SECOND, 0);
|
||||
dayStartCalendar.set(Calendar.MILLISECOND, 0);
|
||||
Calendar weekStartCalendar = Calendar.getInstance();
|
||||
weekStartCalendar.setFirstDayOfWeek(Calendar.SUNDAY);
|
||||
weekStartCalendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
|
||||
weekStartCalendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
weekStartCalendar.set(Calendar.MINUTE, 0);
|
||||
weekStartCalendar.set(Calendar.SECOND, 0);
|
||||
weekStartCalendar.set(Calendar.MILLISECOND, 0);
|
||||
Calendar yearStartCalendar = Calendar.getInstance();
|
||||
yearStartCalendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
yearStartCalendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
yearStartCalendar.set(Calendar.MINUTE, 0);
|
||||
yearStartCalendar.set(Calendar.SECOND, 0);
|
||||
yearStartCalendar.set(Calendar.MILLISECOND, 0);
|
||||
long dayStartTimeInMillis = dayStartCalendar.getTimeInMillis();
|
||||
long weekStartTimeInMillis = weekStartCalendar.getTimeInMillis();
|
||||
long yearStartTimeInMillis = yearStartCalendar.getTimeInMillis();
|
||||
long outTimeMillis = date.getTime();
|
||||
if (outTimeMillis < yearStartTimeInMillis) {
|
||||
timeText = String.format(Locale.US, "%tD", date);
|
||||
} else if (outTimeMillis < weekStartTimeInMillis) {
|
||||
timeText = String.format(Locale.US, "%1$tm/%1$td", date);
|
||||
} else if (outTimeMillis < dayStartTimeInMillis) {
|
||||
timeText = String.format(locale, "%tA", date);
|
||||
} else {
|
||||
timeText = String.format(Locale.US, "%tR", date);
|
||||
}
|
||||
return timeText;
|
||||
}
|
||||
|
||||
/**
|
||||
* HH:MM
|
||||
* @param date current time
|
||||
* @return format text e.g. "12:12"
|
||||
*/
|
||||
public static String getHMTimeString(Date date) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
Context context = TUIConfig.getAppContext();
|
||||
Locale locale;
|
||||
if (context == null) {
|
||||
locale = Locale.getDefault();
|
||||
} else {
|
||||
locale = TUIThemeManager.getInstance().getLocale(context);
|
||||
}
|
||||
return String.format(locale, "%tR", date);
|
||||
}
|
||||
|
||||
public static String formatSeconds(long seconds) {
|
||||
Context context = TUIConfig.getAppContext();
|
||||
String timeStr = seconds + context.getString(R.string.date_second_short);
|
||||
if (seconds > 60) {
|
||||
long second = seconds % 60;
|
||||
long min = seconds / 60;
|
||||
timeStr = min + context.getString(R.string.date_minute_short) + second + context.getString(R.string.date_second_short);
|
||||
if (min > 60) {
|
||||
min = (seconds / 60) % 60;
|
||||
long hour = (seconds / 60) / 60;
|
||||
timeStr = hour + context.getString(R.string.date_hour_short) + min + context.getString(R.string.date_minute_short) + second
|
||||
+ context.getString(R.string.date_second_short);
|
||||
if (hour % 24 == 0) {
|
||||
long day = (((seconds / 60) / 60) / 24);
|
||||
timeStr = day + context.getString(R.string.date_day_short);
|
||||
} else if (hour > 24) {
|
||||
hour = ((seconds / 60) / 60) % 24;
|
||||
long day = (((seconds / 60) / 60) / 24);
|
||||
timeStr = day + context.getString(R.string.date_day_short) + hour + context.getString(R.string.date_hour_short) + min
|
||||
+ context.getString(R.string.date_minute_short) + second + context.getString(R.string.date_second_short);
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeStr;
|
||||
}
|
||||
|
||||
public static String formatSecondsTo00(int timeSeconds) {
|
||||
int second = timeSeconds % 60;
|
||||
int minuteTemp = timeSeconds / 60;
|
||||
if (minuteTemp > 0) {
|
||||
int minute = minuteTemp % 60;
|
||||
int hour = minuteTemp / 60;
|
||||
if (hour > 0) {
|
||||
return (hour >= 10 ? (hour + "") : ("0" + hour)) + ":" + (minute >= 10 ? (minute + "") : ("0" + minute)) + ":"
|
||||
+ (second >= 10 ? (second + "") : ("0" + second));
|
||||
} else {
|
||||
return (minute >= 10 ? (minute + "") : ("0" + minute)) + ":" + (second >= 10 ? (second + "") : ("0" + second));
|
||||
}
|
||||
} else {
|
||||
return "00:" + (second >= 10 ? (second + "") : ("0" + second));
|
||||
}
|
||||
}
|
||||
|
||||
public static long getStringToDate(String dateString, String pattern) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
|
||||
Date date = new Date();
|
||||
try {
|
||||
date = dateFormat.parse(dateString);
|
||||
} catch (ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return date.getTime();
|
||||
}
|
||||
|
||||
public static String getTimeStringFromDate(Date date, String pattern) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
|
||||
return simpleDateFormat.format(date);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,430 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import com.tencent.imsdk.BaseConstants;
|
||||
import com.tencent.qcloud.tuicore.R;
|
||||
import com.tencent.qcloud.tuicore.TUIConfig;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ErrorMessageConverter {
|
||||
public static final Map<Integer, Integer> ERROR_CODE_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IM SDK error codes
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Common error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_IN_PROGESS, R.string.TUIKitErrorInProcess);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_INVALID_PARAMETERS, R.string.TUIKitErrorInvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_IO_OPERATION_FAILED, R.string.TUIKitErrorIOOperateFaild);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_INVALID_JSON, R.string.TUIKitErrorInvalidJson);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_OUT_OF_MEMORY, R.string.TUIKitErrorOutOfMemory);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PARSE_RESPONSE_FAILED, R.string.TUIKitErrorParseResponseFaild);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SERIALIZE_REQ_FAILED, R.string.TUIKitErrorSerializeReqFaild);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NOT_INITIALIZED, R.string.TUIKitErrorSDKNotInit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOADMSG_FAILED, R.string.TUIKitErrorLoadMsgFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_DATABASE_OPERATE_FAILED, R.string.TUIKitErrorDatabaseOperateFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_CROSS_THREAD, R.string.TUIKitErrorCrossThread);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_TINYID_EMPTY, R.string.TUIKitErrorTinyIdEmpty);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_INVALID_IDENTIFIER, R.string.TUIKitErrorInvalidIdentifier);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_FILE_NOT_FOUND, R.string.TUIKitErrorFileNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_FILE_TOO_LARGE, R.string.TUIKitErrorFileTooLarge);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_FILE_SIZE_EMPTY, R.string.TUIKitErrorEmptyFile);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_COMM_FILE_OPEN_FAILED, R.string.TUIKitErrorFileOpenFailed);
|
||||
|
||||
|
||||
// Account error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NOT_LOGGED_IN, R.string.TUIKitErrorNotLogin);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_NO_PREVIOUS_LOGIN, R.string.TUIKitErrorNoPreviousLogin);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_USER_SIG_EXPIRED, R.string.TUIKitErrorUserSigExpired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_KICKED_OFF_BY_OTHER, R.string.TUIKitErrorLoginKickedOffByOther);
|
||||
// errorCodeMap.put(BaseConstants.ERR_LOGIN_IN_PROCESS:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_LOGOUT_IN_PROCESS:
|
||||
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_ACCOUNT_TLS_INIT_FAILED, R.string.TUIKitErrorTLSSDKInit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_ACCOUNT_TLS_NOT_INITIALIZED, R.string.TUIKitErrorTLSSDKUninit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_ACCOUNT_TLS_TRANSPKG_ERROR, R.string.TUIKitErrorTLSSDKTRANSPackageFormat);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_ACCOUNT_TLS_DECRYPT_FAILED, R.string.TUIKitErrorTLSDecrypt);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_ACCOUNT_TLS_REQUEST_FAILED, R.string.TUIKitErrorTLSSDKRequest);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_ACCOUNT_TLS_REQUEST_TIMEOUT, R.string.TUIKitErrorTLSSDKRequestTimeout);
|
||||
|
||||
|
||||
// Message error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_INVALID_CONVERSATION, R.string.TUIKitErrorInvalidConveration);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FILE_TRANS_AUTH_FAILED, R.string.TUIKitErrorFileTransAuthFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FILE_TRANS_NO_SERVER, R.string.TUIKitErrorFileTransNoServer);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FILE_TRANS_UPLOAD_FAILED, R.string.TUIKitErrorFileTransUploadFailed);
|
||||
// errorCodeMap.put(BaseConstants.ERR_IMAGE_UPLOAD_FAILED_NOTIMAGE:
|
||||
// return TUIKitLocalizableString(R.string.TUIKitErrorFileTransUploadFailedNotImage);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FILE_TRANS_DOWNLOAD_FAILED, R.string.TUIKitErrorFileTransDownloadFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_HTTP_REQ_FAILED, R.string.TUIKitErrorHTTPRequestFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_INVALID_MSG_ELEM, R.string.TUIKitErrorInvalidMsgElem);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_INVALID_SDK_OBJECT, R.string.TUIKitErrorInvalidSDKObject);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_MSG_BODY_SIZE_LIMIT, R.string.TUIKitSDKMsgBodySizeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_MSG_KEY_REQ_DIFFER_RSP, R.string.TUIKitErrorSDKMsgKeyReqDifferRsp);
|
||||
|
||||
|
||||
// Group error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVALID_ID, R.string.TUIKitErrorSDKGroupInvalidID);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVALID_NAME, R.string.TUIKitErrorSDKGroupInvalidName);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVALID_INTRODUCTION, R.string.TUIKitErrorSDKGroupInvalidIntroduction);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVALID_NOTIFICATION, R.string.TUIKitErrorSDKGroupInvalidNotification);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVALID_FACE_URL, R.string.TUIKitErrorSDKGroupInvalidFaceURL);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVALID_NAME_CARD, R.string.TUIKitErrorSDKGroupInvalidNameCard);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_MEMBER_COUNT_LIMIT, R.string.TUIKitErrorSDKGroupMemberCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_JOIN_PRIVATE_GROUP_DENY, R.string.TUIKitErrorSDKGroupJoinPrivateGroupDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVITE_SUPER_DENY, R.string.TUIKitErrorSDKGroupInviteSuperDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_GROUP_INVITE_NO_MEMBER, R.string.TUIKitErrorSDKGroupInviteNoMember);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_PINNED_MESSAGE_COUNT_LIMIT, R.string.TUIKitErrorSDKGroupPinnedMessageCountLimit);
|
||||
|
||||
|
||||
// Relationship chain error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_FRIENDSHIP_INVALID_PROFILE_KEY, R.string.TUIKitErrorSDKFriendShipInvalidProfileKey);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_FRIENDSHIP_INVALID_ADD_REMARK, R.string.TUIKitErrorSDKFriendshipInvalidAddRemark);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_FRIENDSHIP_INVALID_ADD_WORDING, R.string.TUIKitErrorSDKFriendshipInvalidAddWording);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_FRIENDSHIP_INVALID_ADD_SOURCE, R.string.TUIKitErrorSDKFriendshipInvalidAddSource);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_FRIENDSHIP_FRIEND_GROUP_EMPTY, R.string.TUIKitErrorSDKFriendshipFriendGroupEmpty);
|
||||
|
||||
|
||||
// Network error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_ENCODE_FAILED, R.string.TUIKitErrorSDKNetEncodeFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_DECODE_FAILED, R.string.TUIKitErrorSDKNetDecodeFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_AUTH_INVALID, R.string.TUIKitErrorSDKNetAuthInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_COMPRESS_FAILED, R.string.TUIKitErrorSDKNetCompressFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_UNCOMPRESS_FAILED, R.string.TUIKitErrorSDKNetUncompressFaile);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_FREQ_LIMIT, R.string.TUIKitErrorSDKNetFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_REQ_COUNT_LIMIT, R.string.TUIKitErrorSDKnetReqCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_DISCONNECT, R.string.TUIKitErrorSDKNetDisconnect);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_ALLREADY_CONN, R.string.TUIKitErrorSDKNetAllreadyConn);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_CONN_TIMEOUT, R.string.TUIKitErrorSDKNetConnTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_CONN_REFUSE, R.string.TUIKitErrorSDKNetConnRefuse);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_NET_UNREACH, R.string.TUIKitErrorSDKNetNetUnreach);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_SOCKET_NO_BUFF, R.string.TUIKitErrorSDKNetSocketNoBuff);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_RESET_BY_PEER, R.string.TUIKitERRORSDKNetResetByPeer);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_SOCKET_INVALID, R.string.TUIKitErrorSDKNetSOcketInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_HOST_GETADDRINFO_FAILED, R.string.TUIKitErrorSDKNetHostGetAddressFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_CONNECT_RESET, R.string.TUIKitErrorSDKNetConnectReset);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_WAIT_INQUEUE_TIMEOUT, R.string.TUIKitErrorSDKNetWaitInQueueTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_WAIT_SEND_TIMEOUT, R.string.TUIKitErrorSDKNetWaitSendTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_WAIT_ACK_TIMEOUT, R.string.TUIKitErrorSDKNetWaitAckTimeut);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_WAIT_SEND_REMAINING_TIMEOUT, R.string.TUIKitErrorSDKWaitSendRemainingTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_PKG_SIZE_LIMIT, R.string.TUIKitErrorSDKNetPKGSizeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_WAIT_SEND_TIMEOUT_NO_NETWORK, R.string.TUIKitErrorSDKNetWaitSendTimeoutNoNetwork);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_WAIT_ACK_TIMEOUT_NO_NETWORK, R.string.TUIKitErrorSDKNetWaitAckTimeoutNoNetwork);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_NET_SEND_REMAINING_TIMEOUT_NO_NETWORK, R.string.TUIKitErrorSDKNetRemainingTimeoutNoNetwork);
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Server error codes
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Access layer error codes for network
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_CONNECT_LIMIT, R.string.TUIKitErrorSDKSVRSSOConnectLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_VCODE, R.string.TUIKitErrorSDKSVRSSOVCode);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_D2_EXPIRED, R.string.TUIKitErrorSVRSSOD2Expired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_A2_UP_INVALID, R.string.TUIKitErrorSVRA2UpInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_A2_DOWN_INVALID, R.string.TUIKitErrorSVRA2DownInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_EMPTY_KEY, R.string.TUIKitErrorSVRSSOEmpeyKey);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_UIN_INVALID, R.string.TUIKitErrorSVRSSOUinInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_VCODE_TIMEOUT, R.string.TUIKitErrorSVRSSOVCodeTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_NO_IMEI_AND_A2, R.string.TUIKitErrorSVRSSONoImeiAndA2);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_COOKIE_INVALID, R.string.TUIKitErrorSVRSSOCookieInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_DOWN_TIP, R.string.TUIKitErrorSVRSSODownTips);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_DISCONNECT, R.string.TUIKitErrorSVRSSODisconnect);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_IDENTIFIER_INVALID, R.string.TUIKitErrorSVRSSOIdentifierInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_CLIENT_CLOSE, R.string.TUIKitErrorSVRSSOClientClose);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_MSFSDK_QUIT, R.string.TUIKitErrorSVRSSOMSFSDKQuit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_D2KEY_WRONG, R.string.TUIKitErrorSVRSSOD2KeyWrong);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_UNSURPPORT, R.string.TUIKitErrorSVRSSOUnsupport);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_PREPAID_ARREARS, R.string.TUIKitErrorSVRSSOPrepaidArrears);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_PACKET_WRONG, R.string.TUIKitErrorSVRSSOPacketWrong);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_APPID_BLACK_LIST, R.string.TUIKitErrorSVRSSOAppidBlackList);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_CMD_BLACK_LIST, R.string.TUIKitErrorSVRSSOCmdBlackList);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_APPID_WITHOUT_USING, R.string.TUIKitErrorSVRSSOAppidWithoutUsing);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_FREQ_LIMIT, R.string.TUIKitErrorSVRSSOFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_SSO_OVERLOAD, R.string.TUIKitErrorSVRSSOOverload);
|
||||
|
||||
|
||||
// Resource file error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_NOT_FOUND, R.string.TUIKitErrorSVRResNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_ACCESS_DENY, R.string.TUIKitErrorSVRResAccessDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_SIZE_LIMIT, R.string.TUIKitErrorSVRResSizeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_SEND_CANCEL, R.string.TUIKitErrorSVRResSendCancel);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_READ_FAILED, R.string.TUIKitErrorSVRResReadFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_TRANSFER_TIMEOUT, R.string.TUIKitErrorSVRResTransferTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_INVALID_PARAMETERS, R.string.TUIKitErrorSVRResInvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_INVALID_FILE_MD5, R.string.TUIKitErrorSVRResInvalidFileMd5);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_RES_INVALID_PART_MD5, R.string.TUIKitErrorSVRResInvalidPartMd5);
|
||||
|
||||
|
||||
// Common backend error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_HTTP_URL, R.string.TUIKitErrorSVRCommonInvalidHttpUrl);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_REQ_JSON_PARSE_FAILED, R.string.TUIKitErrorSVRCommomReqJsonParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_ACCOUNT, R.string.TUIKitErrorSVRCommonInvalidAccount);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_ACCOUNT_EX, R.string.TUIKitErrorSVRCommonInvalidAccount);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_SDKAPPID, R.string.TUIKitErrorSVRCommonInvalidSdkappid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_REST_FREQ_LIMIT, R.string.TUIKitErrorSVRCommonRestFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_REQUEST_TIMEOUT, R.string.TUIKitErrorSVRCommonRequestTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_RES, R.string.TUIKitErrorSVRCommonInvalidRes);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_ID_NOT_ADMIN, R.string.TUIKitErrorSVRCommonIDNotAdmin);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_SDKAPPID_FREQ_LIMIT, R.string.TUIKitErrorSVRCommonSdkappidFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_SDKAPPID_MISS, R.string.TUIKitErrorSVRCommonSdkappidMiss);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_RSP_JSON_PARSE_FAILED, R.string.TUIKitErrorSVRCommonRspJsonParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_EXCHANGE_ACCOUNT_TIMEUT, R.string.TUIKitErrorSVRCommonExchangeAccountTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_ID_FORMAT, R.string.TUIKitErrorSVRCommonInvalidIdFormat);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_SDKAPPID_FORBIDDEN, R.string.TUIKitErrorSVRCommonSDkappidForbidden);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_REQ_FORBIDDEN, R.string.TUIKitErrorSVRCommonReqForbidden);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_REQ_FREQ_LIMIT, R.string.TUIKitErrorSVRCommonReqFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_REQ_FREQ_LIMIT_EX, R.string.TUIKitErrorSVRCommonReqFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_INVALID_SERVICE, R.string.TUIKitErrorSVRCommonInvalidService);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_SENSITIVE_TEXT, R.string.TUIKitErrorSVRCommonSensitiveText);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_COMM_BODY_SIZE_LIMIT, R.string.TUIKitErrorSVRCommonBodySizeLimit);
|
||||
|
||||
|
||||
// Account error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_EXPIRED, R.string.TUIKitErrorSVRAccountUserSigExpired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_EMPTY, R.string.TUIKitErrorSVRAccountUserSigEmpty);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_CHECK_FAILED, R.string.TUIKitErrorSVRAccountUserSigCheckFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_CHECK_FAILED_EX, R.string.TUIKitErrorSVRAccountUserSigCheckFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_MISMATCH_PUBLICKEY, R.string.TUIKitErrorSVRAccountUserSigMismatchPublicKey);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_MISMATCH_ID, R.string.TUIKitErrorSVRAccountUserSigMismatchId);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_MISMATCH_SDKAPPID, R.string.TUIKitErrorSVRAccountUserSigMismatchSdkAppid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USERSIG_PUBLICKEY_NOT_FOUND, R.string.TUIKitErrorSVRAccountUserSigPublicKeyNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_SDKAPPID_NOT_FOUND, R.string.TUIKitErrorSVRAccountUserSigSdkAppidNotFount);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_INVALID_USERSIG, R.string.TUIKitErrorSVRAccountInvalidUserSig);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_NOT_FOUND, R.string.TUIKitErrorSVRAccountNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_SEC_RSTR, R.string.TUIKitErrorSVRAccountSecRstr);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_INTERNAL_TIMEOUT, R.string.TUIKitErrorSVRAccountInternalTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_INVALID_COUNT, R.string.TUIKitErrorSVRAccountInvalidCount);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_INVALID_PARAMETERS, R.string.TUIkitErrorSVRAccountINvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_ADMIN_REQUIRED, R.string.TUIKitErrorSVRAccountAdminRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_LOW_SDK_VERSION, R.string.TUIKitErrorSVRAccountLowSDKVersion);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_FREQ_LIMIT, R.string.TUIKitErrorSVRAccountFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_BLACKLIST, R.string.TUIKitErrorSVRAccountBlackList);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_COUNT_LIMIT, R.string.TUIKitErrorSVRAccountCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_INTERNAL_ERROR, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_ACCOUNT_USER_STATUS_DISABLED, R.string.TUIKitErrorEnableUserStatusOnConsole);
|
||||
|
||||
|
||||
// Profile error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_INVALID_PARAMETERS, R.string.TUIKitErrorSVRProfileInvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_ACCOUNT_MISS, R.string.TUIKitErrorSVRProfileAccountMiss);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_ACCOUNT_NOT_FOUND, R.string.TUIKitErrorSVRProfileAccountNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_ADMIN_REQUIRED, R.string.TUIKitErrorSVRProfileAdminRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_SENSITIVE_TEXT, R.string.TUIKitErrorSVRProfileSensitiveText);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_INTERNAL_ERROR, R.string.TUIKitErrorSVRProfileInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_READ_PERMISSION_REQUIRED, R.string.TUIKitErrorSVRProfileReadWritePermissionRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_WRITE_PERMISSION_REQUIRED, R.string.TUIKitErrorSVRProfileReadWritePermissionRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_TAG_NOT_FOUND, R.string.TUIKitErrorSVRProfileTagNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_SIZE_LIMIT, R.string.TUIKitErrorSVRProfileSizeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_VALUE_ERROR, R.string.TUIKitErrorSVRProfileValueError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_PROFILE_INVALID_VALUE_FORMAT, R.string.TUIKitErrorSVRProfileInvalidValueFormat);
|
||||
|
||||
|
||||
// Relationship chain error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_INVALID_PARAMETERS, R.string.TUIKitErrorSVRFriendshipInvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_INVALID_SDKAPPID, R.string.TUIKitErrorSVRFriendshipInvalidSdkAppid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ACCOUNT_NOT_FOUND, R.string.TUIKitErrorSVRFriendshipAccountNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ADMIN_REQUIRED, R.string.TUIKitErrorSVRFriendshipAdminRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_SENSITIVE_TEXT, R.string.TUIKitErrorSVRFriendshipSensitiveText);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_INTERNAL_ERROR, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_NET_TIMEOUT, R.string.TUIKitErrorSVRFriendshipNetTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_WRITE_CONFLICT, R.string.TUIKitErrorSVRFriendshipWriteConflict);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ADD_FRIEND_DENY, R.string.TUIKitErrorSVRFriendshipAddFriendDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_COUNT_LIMIT, R.string.TUIkitErrorSVRFriendshipCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_GROUP_COUNT_LIMIT, R.string.TUIKitErrorSVRFriendshipGroupCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_PENDENCY_LIMIT, R.string.TUIKitErrorSVRFriendshipPendencyLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_BLACKLIST_LIMIT, R.string.TUIKitErrorSVRFriendshipBlacklistLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_PEER_FRIEND_LIMIT, R.string.TUIKitErrorSVRFriendshipPeerFriendLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ALREADY_FRIENDS, R.string.TUIKitErrorSVRFriendshipAlreadyFriends);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_IN_SELF_BLACKLIST, R.string.TUIKitErrorSVRFriendshipInSelfBlacklist);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ALLOW_TYPE_DENY_ANY, R.string.TUIKitErrorSVRFriendshipAllowTypeDenyAny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_IN_PEER_BLACKLIST, R.string.TUIKitErrorSVRFriendshipInPeerBlackList);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ALLOW_TYPE_NEED_CONFIRM, R.string.TUIKitErrorSVRFriendshipAllowTypeNeedConfirm);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ADD_FRIEND_SEC_RSTR, R.string.TUIKitErrorSVRFriendshipAddFriendSecRstr);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_PENDENCY_NOT_FOUND, R.string.TUIKitErrorSVRFriendshipPendencyNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_DEL_FRIEND_SEC_RSTR, R.string.TUIKitErrorSVRFriendshipDelFriendSecRstr);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_FRIENDSHIP_ACCOUNT_NOT_FOUND_EX, R.string.TUIKirErrorSVRFriendAccountNotFoundEx);
|
||||
|
||||
|
||||
// Error codes for recent contacts
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_CONV_ACCOUNT_NOT_FOUND, R.string.TUIKirErrorSVRFriendAccountNotFoundEx);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_CONV_INVALID_PARAMETERS, R.string.TUIKitErrorSVRFriendshipInvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_CONV_ADMIN_REQUIRED, R.string.TUIKitErrorSVRFriendshipAdminRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_CONV_INTERNAL_ERROR, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_CONV_NET_TIMEOUT, R.string.TUIKitErrorSVRFriendshipNetTimeout);
|
||||
|
||||
|
||||
// Message error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_PKG_PARSE_FAILED, R.string.TUIKitErrorSVRMsgPkgParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INTERNAL_AUTH_FAILED, R.string.TUIKitErrorSVRMsgInternalAuthFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_ID, R.string.TUIKitErrorSVRMsgInvalidId);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_NET_ERROR, R.string.TUIKitErrorSVRMsgNetError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INTERNAL_ERROR1, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_PUSH_DENY, R.string.TUIKitErrorSVRMsgPushDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_IN_PEER_BLACKLIST, R.string.TUIKitErrorSVRMsgInPeerBlackList);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_BOTH_NOT_FRIEND, R.string.TUIKitErrorSVRMsgBothNotFriend);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_NOT_PEER_FRIEND, R.string.TUIKitErrorSVRMsgNotPeerFriend);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_NOT_SELF_FRIEND, R.string.TUIkitErrorSVRMsgNotSelfFriend);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_SHUTUP_DENY, R.string.TUIKitErrorSVRMsgShutupDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_REVOKE_TIME_LIMIT, R.string.TUIKitErrorSVRMsgRevokeTimeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_DEL_RAMBLE_INTERNAL_ERROR, R.string.TUIKitErrorSVRMsgDelRambleInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_JSON_PARSE_FAILED, R.string.TUIKitErrorSVRMsgJsonParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_JSON_BODY_FORMAT, R.string.TUIKitErrorSVRMsgInvalidJsonBodyFormat);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_TO_ACCOUNT, R.string.TUIKitErrorSVRMsgInvalidToAccount);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_RAND, R.string.TUIKitErrorSVRMsgInvalidRand);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_TIMESTAMP, R.string.TUIKitErrorSVRMsgInvalidTimestamp);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_BODY_NOT_ARRAY, R.string.TUIKitErrorSVRMsgBodyNotArray);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_ADMIN_REQUIRED, R.string.TUIKitErrorSVRAccountAdminRequired);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_JSON_FORMAT, R.string.TUIKitErrorSVRMsgInvalidJsonFormat);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_TO_ACCOUNT_COUNT_LIMIT, R.string.TUIKitErrorSVRMsgToAccountCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_TO_ACCOUNT_NOT_FOUND, R.string.TUIKitErrorSVRMsgToAccountNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_TIME_LIMIT, R.string.TUIKitErrorSVRMsgTimeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_SYNCOTHERMACHINE, R.string.TUIKitErrorSVRMsgInvalidSyncOtherMachine);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INVALID_MSGLIFETIME, R.string.TUIkitErrorSVRMsgInvalidMsgLifeTime);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_ACCOUNT_NOT_FOUND, R.string.TUIKirErrorSVRFriendAccountNotFoundEx);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INTERNAL_ERROR2, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INTERNAL_ERROR3, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INTERNAL_ERROR4, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_INTERNAL_ERROR5, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_BODY_SIZE_LIMIT, R.string.TUIKitErrorSVRMsgBodySizeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_MSG_LONGPOLLING_COUNT_LIMIT, R.string.TUIKitErrorSVRmsgLongPollingCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_INTERFACE_NOT_SUPPORT, R.string.TUIKitErrorUnsupporInterface);
|
||||
|
||||
|
||||
// Group error codes
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_INTERNAL_ERROR, R.string.TUIKitErrorSVRAccountInternalError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_API_NAME_ERROR, R.string.TUIKitErrorSVRGroupApiNameError);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_INVALID_PARAMETERS, R.string.TUIKitErrorSVRResInvalidParameters);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_ACOUNT_COUNT_LIMIT, R.string.TUIKitErrorSVRGroupAccountCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_FREQ_LIMIT, R.string.TUIkitErrorSVRGroupFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_PERMISSION_DENY, R.string.TUIKitErrorSVRGroupPermissionDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_INVALID_REQ, R.string.TUIKitErrorSVRGroupInvalidReq);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_SUPER_NOT_ALLOW_QUIT, R.string.TUIKitErrorSVRGroupSuperNotAllowQuit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_NOT_FOUND, R.string.TUIKitErrorSVRGroupNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_JSON_PARSE_FAILED, R.string.TUIKitErrorSVRGroupJsonParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_INVALID_ID, R.string.TUIKitErrorSVRGroupInvalidId);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_ALLREADY_MEMBER, R.string.TUIKitErrorSVRGroupAllreadyMember);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_FULL_MEMBER_COUNT, R.string.TUIKitErrorSVRGroupFullMemberCount);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_INVALID_GROUPID, R.string.TUIKitErrorSVRGroupInvalidGroupId);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY, R.string.TUIKitErrorSVRGroupRejectFromThirdParty);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_SHUTUP_DENY, R.string.TUIKitErrorSVRGroupShutDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_RSP_SIZE_LIMIT, R.string.TUIKitErrorSVRGroupRspSizeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_ACCOUNT_NOT_FOUND, R.string.TUIKitErrorSVRGroupAccountNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_GROUPID_IN_USED, R.string.TUIKitErrorSVRGroupGroupIdInUse);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_SEND_MSG_FREQ_LIMIT, R.string.TUIKitErrorSVRGroupSendMsgFreqLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_REQ_ALLREADY_BEEN_PROCESSED, R.string.TUIKitErrorSVRGroupReqAllreadyBeenProcessed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_GROUPID_IN_USED_FOR_SUPER, R.string.TUIKitErrorSVRGroupGroupIdUserdForSuper);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_SDKAPPID_DENY, R.string.TUIKitErrorSVRGroupSDkAppidDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_REVOKE_MSG_NOT_FOUND, R.string.TUIKitErrorSVRGroupRevokeMsgNotFound);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_REVOKE_MSG_TIME_LIMIT, R.string.TUIKitErrorSVRGroupRevokeMsgTimeLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_REVOKE_MSG_DENY, R.string.TUIKitErrorSVRGroupRevokeMsgDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_NOT_ALLOW_REVOKE_MSG, R.string.TUIKitErrorSVRGroupNotAllowRevokeMsg);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_REMOVE_MSG_DENY, R.string.TUIKitErrorSVRGroupRemoveMsgDeny);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_NOT_ALLOW_REMOVE_MSG, R.string.TUIKitErrorSVRGroupNotAllowRemoveMsg);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_AVCHATROOM_COUNT_LIMIT, R.string.TUIKitErrorSVRGroupAvchatRoomCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_COUNT_LIMIT, R.string.TUIKitErrorSVRGroupCountLimit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SVR_GROUP_MEMBER_COUNT_LIMIT, R.string.TUIKitErrorSVRGroupMemberCountLimit);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IM SDK V3 error codes,to be abandoned
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_NO_SUCC_RESULT, R.string.TUIKitErrorSVRNoSuccessResult);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_TO_USER_INVALID, R.string.TUIKitErrorSVRToUserInvalid);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_INIT_CORE_FAIL, R.string.TUIKitErrorSVRInitCoreFail);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_EXPIRED_SESSION_NODE, R.string.TUIKitErrorExpiredSessionNode);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGGED_OUT_BEFORE_LOGIN_FINISHED, R.string.TUIKitErrorLoggedOutBeforeLoginFinished);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_TLSSDK_NOT_INITIALIZED, R.string.TUIKitErrorTLSSDKNotInitialized);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_TLSSDK_USER_NOT_FOUND, R.string.TUIKitErrorTLSSDKUserNotFound);
|
||||
// errorCodeMap.put(BaseConstants.ERR_BIND_FAIL_UNKNOWN:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_BIND_FAIL_NO_SSOTICKET:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_BIND_FAIL_REPEATD_BIND:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_BIND_FAIL_TINYID_NULL:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_BIND_FAIL_GUID_NULL:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_BIND_FAIL_UNPACK_REGPACK_FAILED:
|
||||
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_BIND_FAIL_REG_TIMEOUT, R.string.TUIKitErrorBindFaildRegTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_BIND_FAIL_ISBINDING, R.string.TUIKitErrorBindFaildIsBinding);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_UNKNOWN, R.string.TUIKitErrorPacketFailUnknown);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_REQ_NO_NET, R.string.TUIKitErrorPacketFailReqNoNet);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_RESP_NO_NET, R.string.TUIKitErrorPacketFailRespNoNet);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_REQ_NO_AUTH, R.string.TUIKitErrorPacketFailReqNoAuth);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_SSO_ERR, R.string.TUIKitErrorPacketFailSSOErr);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_REQ_TIMEOUT, R.string.TUIKitErrorSVRRequestTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_PACKET_FAIL_RESP_TIMEOUT, R.string.TUIKitErrorPacketFailRespTimeout);
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_PACKET_FAIL_REQ_ON_RESEND:
|
||||
// errorCodeMap.put(BaseConstants.ERR_PACKET_FAIL_RESP_NO_RESEND:
|
||||
// errorCodeMap.put(BaseConstants.ERR_PACKET_FAIL_FLOW_SAVE_FILTERED:
|
||||
// errorCodeMap.put(BaseConstants.ERR_PACKET_FAIL_REQ_OVER_LOAD:
|
||||
// errorCodeMap.put(BaseConstants.ERR_PACKET_FAIL_LOGIC_ERR:
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FRIENDSHIP_PROXY_NOT_SYNCED, R.string.TUIKitErrorFriendshipProxySyncing);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FRIENDSHIP_PROXY_SYNCING, R.string.TUIKitErrorFriendshipProxySyncing);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FRIENDSHIP_PROXY_SYNCED_FAIL, R.string.TUIKitErrorFriendshipProxySyncedFail);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_FRIENDSHIP_PROXY_LOCAL_CHECK_ERR, R.string.TUIKitErrorFriendshipProxyLocalCheckErr);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_GROUP_INVALID_FIELD, R.string.TUIKitErrorGroupInvalidField);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_GROUP_STORAGE_DISABLED, R.string.TUIKitErrorGroupStoreageDisabled);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOADGRPINFO_FAILED, R.string.TUIKitErrorLoadGrpInfoFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_NO_NET_ON_REQ, R.string.TUIKitErrorReqNoNetOnReq);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_NO_NET_ON_RSP, R.string.TUIKitErrorReqNoNetOnResp);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SERIVCE_NOT_READY, R.string.TUIKitErrorServiceNotReady);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_AUTH_FAILED, R.string.TUIKitErrorLoginAuthFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_NEVER_CONNECT_AFTER_LAUNCH, R.string.TUIKitErrorNeverConnectAfterLaunch);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_FAILED, R.string.TUIKitErrorReqFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_INVALID_REQ, R.string.TUIKitErrorReqInvaidReq);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_OVERLOADED, R.string.TUIKitErrorReqOnverLoaded);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_KICK_OFF, R.string.TUIKitErrorReqKickOff);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_SERVICE_SUSPEND, R.string.TUIKitErrorReqServiceSuspend);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_INVALID_SIGN, R.string.TUIKitErrorReqInvalidSign);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_INVALID_COOKIE, R.string.TUIKitErrorReqInvalidCookie);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_TLS_RSP_PARSE_FAILED, R.string.TUIKitErrorLoginTlsRspParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_OPENMSG_TIMEOUT, R.string.TUIKitErrorLoginOpenMsgTimeout);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_OPENMSG_RSP_PARSE_FAILED, R.string.TUIKitErrorLoginOpenMsgRspParseFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_TLS_DECRYPT_FAILED, R.string.TUIKitErrorLoginTslDecryptFailed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_WIFI_NEED_AUTH, R.string.TUIKitErrorWifiNeedAuth);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_USER_CANCELED, R.string.TUIKitErrorUserCanceled);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REVOKE_TIME_LIMIT_EXCEED, R.string.TUIkitErrorRevokeTimeLimitExceed);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LACK_UGC_EXT, R.string.TUIKitErrorLackUGExt);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_AUTOLOGIN_NEED_USERSIG, R.string.TUIKitErrorAutoLoginNeedUserSig);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_QAL_NO_SHORT_CONN_AVAILABLE, R.string.TUIKitErrorQALNoShortConneAvailable);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQ_CONTENT_ATTACK, R.string.TUIKitErrorReqContentAttach);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_LOGIN_SIG_EXPIRE, R.string.TUIKitErrorLoginSigExpire);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_SDK_HAD_INITIALIZED, R.string.TUIKitErrorSDKHadInit);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_OPENBDH_BASE, R.string.TUIKitErrorOpenBDHBase);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_NO_NET_ONREQ, R.string.TUIKitErrorRequestNoNetOnReq);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_NO_NET_ONRSP, R.string.TUIKitErrorRequestNoNetOnRsp);
|
||||
// errorCodeMap.put(BaseConstants.ERR_REQUEST_FAILED:
|
||||
|
||||
// errorCodeMap.put(BaseConstants.ERR_REQUEST_INVALID_REQ:
|
||||
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_OVERLOADED, R.string.TUIKitErrorRequestOnverLoaded);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_KICK_OFF, R.string.TUIKitErrorReqKickOff);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_SERVICE_SUSPEND, R.string.TUIKitErrorReqServiceSuspend);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_INVALID_SIGN, R.string.TUIKitErrorReqInvalidSign);
|
||||
ERROR_CODE_MAP.put(BaseConstants.ERR_REQUEST_INVALID_COOKIE, R.string.TUIKitErrorReqInvalidCookie);
|
||||
}
|
||||
|
||||
public static String convertIMError(int code, String msg) {
|
||||
Integer errorStringId = ERROR_CODE_MAP.get(code);
|
||||
if (errorStringId != null) {
|
||||
return getLocalizedString(errorStringId);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
private static String getLocalizedString(int errStringId) {
|
||||
return TUIConfig.getAppContext().getString(errStringId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,611 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.StringDef;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.tencent.qcloud.tuicore.R;
|
||||
import com.tencent.qcloud.tuicore.TUIConfig;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public final class PermissionRequester {
|
||||
private static final List<String> PERMISSIONS = getPermissions();
|
||||
|
||||
private static PermissionRequester instance;
|
||||
private static Context applicationContext;
|
||||
private SimpleCallback mSimpleCallback;
|
||||
private FullCallback mFullCallback;
|
||||
private PermissionDialogCallback mDialogCallback;
|
||||
private Set<String> mPermissions;
|
||||
private List<String> mPermissionsRequest;
|
||||
private String mCurrentRequestPermission;
|
||||
private List<String> mPermissionsGranted;
|
||||
private List<String> mPermissionsDenied;
|
||||
|
||||
private static boolean isRequesting = false;
|
||||
|
||||
private String mReason;
|
||||
private String mReasonTitle;
|
||||
private String mDeniedAlert;
|
||||
private int mIconId;
|
||||
|
||||
private static final Map<String, PermissionRequestContent> permissionRequestContentMap = new HashMap<>();
|
||||
|
||||
public static class PermissionRequestContent {
|
||||
int iconResId;
|
||||
String reasonTitle;
|
||||
String reason;
|
||||
String deniedAlert;
|
||||
|
||||
public void setReasonTitle(String reasonTitle) {
|
||||
this.reasonTitle = reasonTitle;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public void setIconResId(int iconResId) {
|
||||
this.iconResId = iconResId;
|
||||
}
|
||||
|
||||
public void setDeniedAlert(String deniedAlert) {
|
||||
this.deniedAlert = deniedAlert;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setPermissionRequestContent(String permission, PermissionRequestContent content) {
|
||||
permissionRequestContentMap.put(permission, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the permissions used in application.
|
||||
*
|
||||
* @return the permissions used in application
|
||||
*/
|
||||
public static List<String> getPermissions() {
|
||||
return getPermissions(getApplicationContext().getPackageName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the permissions used in application.
|
||||
*
|
||||
* @param packageName The name of the package.
|
||||
* @return the permissions used in application
|
||||
*/
|
||||
public static List<String> getPermissions(final String packageName) {
|
||||
PackageManager pm = getApplicationContext().getPackageManager();
|
||||
try {
|
||||
String[] permissions = pm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS).requestedPermissions;
|
||||
if (permissions == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return Arrays.asList(permissions);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isGranted(final String... permissions) {
|
||||
for (String permission : permissions) {
|
||||
if (!isGranted(permission)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isGranted(final String permission) {
|
||||
return TUIBuild.getVersionInt() < Build.VERSION_CODES.M
|
||||
|| PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(getApplicationContext(), permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the application's details settings.
|
||||
*/
|
||||
public static void launchAppDetailsSettings() {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
intent.setData(Uri.parse("package:" + getApplicationContext().getPackageName()));
|
||||
if (!isIntentAvailable(intent)) {
|
||||
return;
|
||||
}
|
||||
getApplicationContext().startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the permissions.
|
||||
*
|
||||
* @param permission The permissions.
|
||||
* @return the single {@link PermissionRequester} instance
|
||||
*/
|
||||
public static PermissionRequester permission(@PermissionConstants.Permission final String permission) {
|
||||
return new PermissionRequester(permission);
|
||||
}
|
||||
|
||||
private static boolean isIntentAvailable(final Intent intent) {
|
||||
return getApplicationContext().getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0;
|
||||
}
|
||||
|
||||
private PermissionRequester(final String permission) {
|
||||
mPermissions = new LinkedHashSet<>();
|
||||
mCurrentRequestPermission = permission;
|
||||
for (String aPermission : PermissionConstants.getPermissions(permission)) {
|
||||
if (PERMISSIONS.contains(aPermission)) {
|
||||
mPermissions.add(aPermission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the simple call back.
|
||||
*
|
||||
* @param callback the simple call back
|
||||
* @return the single {@link PermissionRequester} instance
|
||||
*/
|
||||
public PermissionRequester callback(final SimpleCallback callback) {
|
||||
mSimpleCallback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the full call back.
|
||||
*
|
||||
* @param callback the full call back
|
||||
* @return the single {@link PermissionRequester} instance
|
||||
*/
|
||||
public PermissionRequester callback(final FullCallback callback) {
|
||||
mFullCallback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PermissionRequester reason(String reason) {
|
||||
mReason = reason;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PermissionRequester reasonTitle(String reasonTitle) {
|
||||
mReasonTitle = reasonTitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PermissionRequester deniedAlert(String deniedAlert) {
|
||||
mDeniedAlert = deniedAlert;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PermissionRequester reasonIcon(int iconId) {
|
||||
mIconId = iconId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PermissionRequester permissionDialogCallback(PermissionDialogCallback callback) {
|
||||
mDialogCallback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void request() {
|
||||
if (isRequesting) {
|
||||
return;
|
||||
}
|
||||
isRequesting = true;
|
||||
instance = this;
|
||||
mPermissionsGranted = new ArrayList<>();
|
||||
mPermissionsRequest = new ArrayList<>();
|
||||
if (TUIBuild.getVersionInt() < Build.VERSION_CODES.M) {
|
||||
mPermissionsGranted.addAll(mPermissions);
|
||||
isRequesting = false;
|
||||
requestCallback();
|
||||
mDialogCallback = null;
|
||||
} else {
|
||||
for (String permission : mPermissions) {
|
||||
if (isGranted(permission)) {
|
||||
mPermissionsGranted.add(permission);
|
||||
} else {
|
||||
mPermissionsRequest.add(permission);
|
||||
}
|
||||
}
|
||||
if (mPermissionsRequest.isEmpty()) {
|
||||
isRequesting = false;
|
||||
requestCallback();
|
||||
mDialogCallback = null;
|
||||
} else {
|
||||
startPermissionActivity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
private void startPermissionActivity() {
|
||||
mPermissionsDenied = new ArrayList<>();
|
||||
Context context = getApplicationContext();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(context, PermissionActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
private void getPermissionsStatus() {
|
||||
for (String permission : mPermissionsRequest) {
|
||||
if (isGranted(permission)) {
|
||||
mPermissionsGranted.add(permission);
|
||||
} else {
|
||||
mPermissionsDenied.add(permission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void requestCallback() {
|
||||
if (mSimpleCallback != null) {
|
||||
if (mPermissionsRequest.size() == 0 || mPermissions.size() == mPermissionsGranted.size()) {
|
||||
mSimpleCallback.onGranted();
|
||||
} else {
|
||||
if (!mPermissionsDenied.isEmpty()) {
|
||||
mSimpleCallback.onDenied();
|
||||
}
|
||||
}
|
||||
mSimpleCallback = null;
|
||||
}
|
||||
if (mFullCallback != null) {
|
||||
if (mPermissionsRequest.size() == 0 || mPermissions.size() == mPermissionsGranted.size()) {
|
||||
mFullCallback.onGranted(mPermissionsGranted);
|
||||
} else {
|
||||
if (!mPermissionsDenied.isEmpty()) {
|
||||
mFullCallback.onDenied(mPermissionsDenied);
|
||||
}
|
||||
}
|
||||
mFullCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void onRequestPermissionsResult(final Activity activity) {
|
||||
getPermissionsStatus();
|
||||
if (!mPermissionsDenied.isEmpty()) {
|
||||
showPermissionDialog(activity, new PermissionDialogCallback() {
|
||||
@Override
|
||||
public void onApproved() {
|
||||
if (mDialogCallback != null) {
|
||||
mDialogCallback.onApproved();
|
||||
}
|
||||
mDialogCallback = null;
|
||||
launchAppDetailsSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefused() {
|
||||
if (mDialogCallback != null) {
|
||||
mDialogCallback.onRefused();
|
||||
}
|
||||
mDialogCallback = null;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isRequesting = false;
|
||||
mDialogCallback = null;
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
requestCallback();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public static class PermissionActivity extends Activity {
|
||||
private View mContentView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (TUIBuild.getVersionInt() >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
getWindow().setNavigationBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
ActionBar actionBar = getActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.hide();
|
||||
}
|
||||
|
||||
requestPermission();
|
||||
}
|
||||
|
||||
private void requestPermission() {
|
||||
if (instance.mPermissionsRequest != null) {
|
||||
int size = instance.mPermissionsRequest.size();
|
||||
if (size <= 0) {
|
||||
instance.onRequestPermissionsResult(this);
|
||||
} else {
|
||||
fillContentView();
|
||||
requestPermissions(instance.mPermissionsRequest.toArray(new String[size]), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fillContentView() {
|
||||
PermissionRequestContent info = permissionRequestContentMap.get(instance.mCurrentRequestPermission);
|
||||
int iconResId = instance.mIconId;
|
||||
String reasonTitle = instance.mReasonTitle;
|
||||
String reason = instance.mReason;
|
||||
if (info != null) {
|
||||
if (info.iconResId != 0) {
|
||||
iconResId = info.iconResId;
|
||||
}
|
||||
if (!TextUtils.isEmpty(info.reasonTitle)) {
|
||||
reasonTitle = info.reasonTitle;
|
||||
}
|
||||
if (!TextUtils.isEmpty(info.reason)) {
|
||||
reason = info.reason;
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(reason)) {
|
||||
return;
|
||||
}
|
||||
setContentView(R.layout.permission_activity_layout);
|
||||
mContentView = findViewById(R.id.tuicore_permission_layout);
|
||||
TextView permissionReasonTitle = findViewById(R.id.permission_reason_title);
|
||||
TextView permissionReason = findViewById(R.id.permission_reason);
|
||||
ImageView permissionIcon = findViewById(R.id.permission_icon);
|
||||
permissionReasonTitle.setText(reasonTitle);
|
||||
permissionReason.setText(reason);
|
||||
if (iconResId != 0) {
|
||||
permissionIcon.setBackgroundResource(iconResId);
|
||||
}
|
||||
}
|
||||
|
||||
private void hideContentView() {
|
||||
if (mContentView != null) {
|
||||
mContentView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
if (instance.mPermissionsRequest != null) {
|
||||
hideContentView();
|
||||
instance.onRequestPermissionsResult(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
isRequesting = false;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// interface
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public interface SimpleCallback {
|
||||
void onGranted();
|
||||
|
||||
void onDenied();
|
||||
}
|
||||
|
||||
public interface FullCallback {
|
||||
void onGranted(List<String> permissionsGranted);
|
||||
|
||||
void onDenied(List<String> permissionsDenied);
|
||||
}
|
||||
|
||||
public static final class PermissionConstants {
|
||||
public static final String CALENDAR = Manifest.permission_group.CALENDAR;
|
||||
public static final String CAMERA = Manifest.permission_group.CAMERA;
|
||||
public static final String CONTACTS = Manifest.permission_group.CONTACTS;
|
||||
public static final String LOCATION = Manifest.permission_group.LOCATION;
|
||||
public static final String MICROPHONE = Manifest.permission_group.MICROPHONE;
|
||||
public static final String PHONE = Manifest.permission_group.PHONE;
|
||||
public static final String SENSORS = Manifest.permission_group.SENSORS;
|
||||
public static final String SMS = Manifest.permission_group.SMS;
|
||||
public static final String STORAGE = Manifest.permission_group.STORAGE;
|
||||
|
||||
private static final String[] GROUP_CALENDAR = {Manifest.permission.READ_CALENDAR, Manifest.permission.WRITE_CALENDAR};
|
||||
private static final String[] GROUP_CAMERA = {Manifest.permission.CAMERA};
|
||||
private static final String[] GROUP_CONTACTS = {
|
||||
Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS, Manifest.permission.GET_ACCOUNTS};
|
||||
private static final String[] GROUP_LOCATION = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
|
||||
private static final String[] GROUP_MICROPHONE = {Manifest.permission.RECORD_AUDIO};
|
||||
private static final String[] GROUP_PHONE = {Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_PHONE_NUMBERS,
|
||||
Manifest.permission.CALL_PHONE, Manifest.permission.READ_CALL_LOG, Manifest.permission.WRITE_CALL_LOG, Manifest.permission.ADD_VOICEMAIL,
|
||||
Manifest.permission.USE_SIP, Manifest.permission.PROCESS_OUTGOING_CALLS, Manifest.permission.ANSWER_PHONE_CALLS};
|
||||
private static final String[] GROUP_PHONE_BELOW_O = {Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_PHONE_NUMBERS,
|
||||
Manifest.permission.CALL_PHONE, Manifest.permission.READ_CALL_LOG, Manifest.permission.WRITE_CALL_LOG, Manifest.permission.ADD_VOICEMAIL,
|
||||
Manifest.permission.USE_SIP, Manifest.permission.PROCESS_OUTGOING_CALLS};
|
||||
private static final String[] GROUP_SENSORS = {Manifest.permission.BODY_SENSORS};
|
||||
private static final String[] GROUP_SMS = {
|
||||
Manifest.permission.SEND_SMS,
|
||||
Manifest.permission.RECEIVE_SMS,
|
||||
Manifest.permission.READ_SMS,
|
||||
Manifest.permission.RECEIVE_WAP_PUSH,
|
||||
Manifest.permission.RECEIVE_MMS,
|
||||
};
|
||||
private static final String[] GROUP_STORAGE = {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
};
|
||||
|
||||
@StringDef({
|
||||
CALENDAR,
|
||||
CAMERA,
|
||||
CONTACTS,
|
||||
LOCATION,
|
||||
MICROPHONE,
|
||||
PHONE,
|
||||
SENSORS,
|
||||
SMS,
|
||||
STORAGE,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Permission {}
|
||||
|
||||
public static String[] getPermissions(@Permission final String permission) {
|
||||
switch (permission) {
|
||||
case CALENDAR:
|
||||
return GROUP_CALENDAR;
|
||||
case CAMERA:
|
||||
return GROUP_CAMERA;
|
||||
case CONTACTS:
|
||||
return GROUP_CONTACTS;
|
||||
case LOCATION:
|
||||
return GROUP_LOCATION;
|
||||
case MICROPHONE:
|
||||
return GROUP_MICROPHONE;
|
||||
case PHONE:
|
||||
if (TUIBuild.getVersionInt() < Build.VERSION_CODES.O) {
|
||||
return GROUP_PHONE_BELOW_O;
|
||||
} else {
|
||||
return GROUP_PHONE;
|
||||
}
|
||||
case SENSORS:
|
||||
return GROUP_SENSORS;
|
||||
case SMS:
|
||||
return GROUP_SMS;
|
||||
case STORAGE:
|
||||
return GROUP_STORAGE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return new String[] {permission};
|
||||
}
|
||||
}
|
||||
|
||||
private static Context getApplicationContext() {
|
||||
if (applicationContext == null) {
|
||||
applicationContext = TUIConfig.getAppContext();
|
||||
}
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
public void showPermissionDialog(Activity activity, PermissionDialogCallback callback) {
|
||||
PermissionRequestContent info = permissionRequestContentMap.get(instance.mCurrentRequestPermission);
|
||||
String deniedAlert = mDeniedAlert;
|
||||
if (info != null) {
|
||||
if (!TextUtils.isEmpty(info.deniedAlert)) {
|
||||
deniedAlert = info.deniedAlert;
|
||||
}
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(deniedAlert)) {
|
||||
deniedAlert = mReason;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(deniedAlert)) {
|
||||
isRequesting = false;
|
||||
activity.finish();
|
||||
callback.onRefused();
|
||||
return;
|
||||
}
|
||||
|
||||
activity.setContentView(R.layout.permission_activity_layout);
|
||||
|
||||
View itemPop = LayoutInflater.from(activity).inflate(R.layout.permission_tip_layout, null);
|
||||
TextView tipsTv = itemPop.findViewById(R.id.tips);
|
||||
TextView positiveBtn = itemPop.findViewById(R.id.positive_btn);
|
||||
TextView negativeBtn = itemPop.findViewById(R.id.negative_btn);
|
||||
tipsTv.setText(deniedAlert);
|
||||
|
||||
Dialog permissionTipDialog = new AlertDialog.Builder(activity)
|
||||
.setView(itemPop)
|
||||
.setCancelable(false)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
isRequesting = false;
|
||||
}
|
||||
})
|
||||
.create();
|
||||
|
||||
positiveBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
isRequesting = false;
|
||||
permissionTipDialog.cancel();
|
||||
activity.finish();
|
||||
callback.onApproved();
|
||||
}
|
||||
});
|
||||
|
||||
negativeBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
isRequesting = false;
|
||||
permissionTipDialog.cancel();
|
||||
activity.finish();
|
||||
callback.onRefused();
|
||||
}
|
||||
});
|
||||
permissionTipDialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
isRequesting = false;
|
||||
permissionTipDialog.cancel();
|
||||
activity.finish();
|
||||
callback.onRefused();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
permissionTipDialog.show();
|
||||
Window dialogWindow = permissionTipDialog.getWindow();
|
||||
dialogWindow.setBackgroundDrawable(new ColorDrawable());
|
||||
WindowManager.LayoutParams layoutParams = dialogWindow.getAttributes();
|
||||
layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
dialogWindow.setAttributes(layoutParams);
|
||||
}
|
||||
|
||||
public interface PermissionDialogCallback {
|
||||
void onApproved();
|
||||
|
||||
void onRefused();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.tencent.qcloud.tuicore.ServiceInitializer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class SPUtils {
|
||||
public static final String DEFAULT_DATABASE = "tuikit";
|
||||
private static final Map<String, SPUtils> SP_UTILS_MAP = new HashMap<>();
|
||||
|
||||
private final SharedPreferences mSharedPreferences;
|
||||
|
||||
public static SPUtils getInstance() {
|
||||
return getInstance(DEFAULT_DATABASE, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static SPUtils getInstance(final int mode) {
|
||||
return getInstance(DEFAULT_DATABASE, mode);
|
||||
}
|
||||
|
||||
public static SPUtils getInstance(String spName) {
|
||||
return getInstance(spName, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static SPUtils getInstance(String spName, final int mode) {
|
||||
if (isSpace(spName)) {
|
||||
spName = DEFAULT_DATABASE;
|
||||
}
|
||||
SPUtils spUtils = SP_UTILS_MAP.get(spName);
|
||||
if (spUtils == null) {
|
||||
synchronized (SPUtils.class) {
|
||||
spUtils = SP_UTILS_MAP.get(spName);
|
||||
if (spUtils == null) {
|
||||
spUtils = new SPUtils(spName, mode);
|
||||
SP_UTILS_MAP.put(spName, spUtils);
|
||||
}
|
||||
}
|
||||
}
|
||||
return spUtils;
|
||||
}
|
||||
|
||||
private SPUtils(final String spName, final int mode) {
|
||||
mSharedPreferences = getApplicationContext().getSharedPreferences(spName, mode);
|
||||
}
|
||||
|
||||
private Context getApplicationContext() {
|
||||
return ServiceInitializer.getAppContext();
|
||||
}
|
||||
|
||||
public String getString(@NonNull final String key) {
|
||||
return getString(key, "");
|
||||
}
|
||||
|
||||
public String getString(@NonNull final String key, final String defaultValue) {
|
||||
return mSharedPreferences.getString(key, defaultValue);
|
||||
}
|
||||
|
||||
// String
|
||||
public void put(@NonNull final String key, final String value) {
|
||||
put(key, value, false);
|
||||
}
|
||||
|
||||
public void put(@NonNull final String key, final String value, final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().putString(key, value).commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().putString(key, value).apply();
|
||||
}
|
||||
}
|
||||
|
||||
// boolean
|
||||
public void put(@NonNull final String key, final boolean value) {
|
||||
put(key, value, false);
|
||||
}
|
||||
|
||||
public void put(@NonNull final String key, final boolean value, final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().putBoolean(key, value).commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().putBoolean(key, value).apply();
|
||||
}
|
||||
}
|
||||
|
||||
// int
|
||||
public void put(@NonNull final String key, final int value) {
|
||||
put(key, value, false);
|
||||
}
|
||||
|
||||
public void put(@NonNull final String key, final int value, final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().putInt(key, value).commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().putInt(key, value).apply();
|
||||
}
|
||||
}
|
||||
|
||||
// float
|
||||
public void put(@NonNull final String key, final float value) {
|
||||
put(key, value, false);
|
||||
}
|
||||
|
||||
public void put(@NonNull final String key, final float value, final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().putFloat(key, value).commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().putFloat(key, value).apply();
|
||||
}
|
||||
}
|
||||
|
||||
// long
|
||||
public void put(@NonNull final String key, final long value) {
|
||||
put(key, value, false);
|
||||
}
|
||||
|
||||
public void put(@NonNull final String key, final long value, final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().putLong(key, value).commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().putLong(key, value).apply();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getBoolean(@NonNull final String key) {
|
||||
return getBoolean(key, false);
|
||||
}
|
||||
|
||||
public boolean getBoolean(@NonNull final String key, final boolean defaultValue) {
|
||||
return mSharedPreferences.getBoolean(key, defaultValue);
|
||||
}
|
||||
|
||||
public int getInt(@NonNull final String key) {
|
||||
return getInt(key, -1);
|
||||
}
|
||||
|
||||
public int getInt(@NonNull final String key, final int defaultValue) {
|
||||
return mSharedPreferences.getInt(key, defaultValue);
|
||||
}
|
||||
|
||||
public float getFloat(@NonNull final String key) {
|
||||
return getFloat(key, -1f);
|
||||
}
|
||||
|
||||
public float getFloat(@NonNull final String key, final float defaultValue) {
|
||||
return mSharedPreferences.getFloat(key, defaultValue);
|
||||
}
|
||||
|
||||
public long getLong(@NonNull final String key) {
|
||||
return getLong(key, -1L);
|
||||
}
|
||||
|
||||
public long getLong(@NonNull final String key, final long defaultValue) {
|
||||
return mSharedPreferences.getLong(key, defaultValue);
|
||||
}
|
||||
|
||||
public boolean contains(@NonNull final String key) {
|
||||
return mSharedPreferences.contains(key);
|
||||
}
|
||||
|
||||
public void remove(@NonNull final String key) {
|
||||
remove(key, false);
|
||||
}
|
||||
|
||||
public void remove(@NonNull final String key, final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().remove(key).commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().remove(key).apply();
|
||||
}
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
clear(false);
|
||||
}
|
||||
|
||||
public void clear(final boolean isCommit) {
|
||||
if (isCommit) {
|
||||
mSharedPreferences.edit().clear().commit();
|
||||
} else {
|
||||
mSharedPreferences.edit().clear().apply();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isSpace(final String s) {
|
||||
if (s == null) {
|
||||
return true;
|
||||
}
|
||||
for (int i = 0, len = s.length(); i < len; ++i) {
|
||||
if (!Character.isWhitespace(s.charAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManager;
|
||||
import com.tencent.qcloud.tuicore.TUIConfig;
|
||||
|
||||
public class ScreenUtil {
|
||||
private static final String TAG = ScreenUtil.class.getSimpleName();
|
||||
|
||||
public static int getScreenHeight(Context context) {
|
||||
DisplayMetrics metric = new DisplayMetrics();
|
||||
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
wm.getDefaultDisplay().getMetrics(metric);
|
||||
return metric.heightPixels;
|
||||
}
|
||||
|
||||
public static int getScreenWidth(Context context) {
|
||||
DisplayMetrics metric = new DisplayMetrics();
|
||||
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
wm.getDefaultDisplay().getMetrics(metric);
|
||||
return metric.widthPixels;
|
||||
}
|
||||
|
||||
public static int getPxByDp(float dp) {
|
||||
float scale = TUIConfig.getAppContext().getResources().getDisplayMetrics().density;
|
||||
return (int) (dp * scale + 0.5f);
|
||||
}
|
||||
|
||||
public static int getRealScreenHeight(Context context) {
|
||||
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display display = wm.getDefaultDisplay();
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
display.getRealMetrics(dm);
|
||||
return dm.heightPixels;
|
||||
}
|
||||
|
||||
public static int getRealScreenWidth(Context context) {
|
||||
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display display = wm.getDefaultDisplay();
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
display.getRealMetrics(dm);
|
||||
return dm.widthPixels;
|
||||
}
|
||||
|
||||
public static int getNavigationBarHeight(Context context) {
|
||||
int resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
return context.getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int[] scaledSize(int containerWidth, int containerHeight, int realWidth, int realHeight) {
|
||||
Log.i(TAG,
|
||||
"scaledSize containerWidth: " + containerWidth + " containerHeight: " + containerHeight + " realWidth: " + realWidth
|
||||
+ " realHeight: " + realHeight);
|
||||
float deviceRate = (float) containerWidth / (float) containerHeight;
|
||||
float rate = (float) realWidth / (float) realHeight;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
if (rate < deviceRate) {
|
||||
height = containerHeight;
|
||||
width = (int) (containerHeight * rate);
|
||||
} else {
|
||||
width = containerWidth;
|
||||
height = (int) (containerWidth / rate);
|
||||
}
|
||||
return new int[] {width, height};
|
||||
}
|
||||
|
||||
public static int dip2px(float dpValue) {
|
||||
final float scale = TUIConfig.getAppContext().getResources().getDisplayMetrics().density;
|
||||
return (int) (dpValue * scale + 0.5f);
|
||||
}
|
||||
|
||||
public static float dp2px(float dpValue, DisplayMetrics displayMetrics) {
|
||||
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, displayMetrics);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public final class TUIBuild {
|
||||
private static final String TAG = "TUIBuild";
|
||||
|
||||
private static String MODEL = ""; // Build.MODEL;
|
||||
private static String BRAND = ""; // Build.BRAND;
|
||||
private static String DEVICE = ""; // Build.DEVICE;
|
||||
private static String MANUFACTURER = ""; // Build.MANUFACTURER;
|
||||
private static String HARDWARE = ""; // Build.HARDWARE;
|
||||
private static String VERSION = ""; // Build.VERSION.RELEASE;
|
||||
private static String BOARD = ""; // Build.BOARD;
|
||||
private static String VERSION_INCREMENTAL = ""; // Build.VERSION.INCREMENTAL
|
||||
private static int VERSION_INT = 0; // Build.VERSION.SDK_INT;
|
||||
|
||||
public static void setModel(final String model) {
|
||||
synchronized (TUIBuild.class) {
|
||||
MODEL = model;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getModel() {
|
||||
if (MODEL == null || MODEL.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (MODEL == null || MODEL.isEmpty()) {
|
||||
MODEL = Build.MODEL;
|
||||
Log.i(TAG, "get MODEL by Build.MODEL :" + MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
return MODEL;
|
||||
}
|
||||
|
||||
public static void setBrand(final String brand) {
|
||||
synchronized (TUIBuild.class) {
|
||||
BRAND = brand;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getBrand() {
|
||||
if (BRAND == null || BRAND.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (BRAND == null || BRAND.isEmpty()) {
|
||||
BRAND = Build.BRAND;
|
||||
Log.i(TAG, "get BRAND by Build.BRAND :" + BRAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return BRAND;
|
||||
}
|
||||
|
||||
public static void setDevice(final String device) {
|
||||
synchronized (TUIBuild.class) {
|
||||
DEVICE = device;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDevice() {
|
||||
if (DEVICE == null || DEVICE.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (DEVICE == null || DEVICE.isEmpty()) {
|
||||
DEVICE = Build.DEVICE;
|
||||
Log.i(TAG, "get DEVICE by Build.DEVICE :" + DEVICE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return DEVICE;
|
||||
}
|
||||
|
||||
public static void setManufacturer(final String manufacturer) {
|
||||
synchronized (TUIBuild.class) {
|
||||
MANUFACTURER = manufacturer;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getManufacturer() {
|
||||
if (MANUFACTURER == null || MANUFACTURER.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (MANUFACTURER == null || MANUFACTURER.isEmpty()) {
|
||||
MANUFACTURER = Build.MANUFACTURER;
|
||||
Log.i(TAG, "get MANUFACTURER by Build.MANUFACTURER :" + MANUFACTURER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return MANUFACTURER;
|
||||
}
|
||||
|
||||
public static void setHardware(final String hardware) {
|
||||
synchronized (TUIBuild.class) {
|
||||
HARDWARE = hardware;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getHardware() {
|
||||
if (HARDWARE == null || HARDWARE.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (HARDWARE == null || HARDWARE.isEmpty()) {
|
||||
HARDWARE = Build.HARDWARE;
|
||||
Log.i(TAG, "get HARDWARE by Build.HARDWARE :" + HARDWARE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HARDWARE;
|
||||
}
|
||||
|
||||
public static void setVersion(final String version) {
|
||||
synchronized (TUIBuild.class) {
|
||||
VERSION = version;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
if (VERSION == null || VERSION.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (VERSION == null || VERSION.isEmpty()) {
|
||||
VERSION = Build.VERSION.RELEASE;
|
||||
Log.i(TAG, "get VERSION by Build.VERSION.RELEASE :" + VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
public static void setVersionInt(final int versionInt) {
|
||||
synchronized (TUIBuild.class) {
|
||||
VERSION_INT = versionInt;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getVersionInt() {
|
||||
if (VERSION_INT == 0) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (VERSION_INT == 0) {
|
||||
VERSION_INT = Build.VERSION.SDK_INT;
|
||||
Log.i(TAG, "get VERSION_INT by Build.VERSION.SDK_INT :" + VERSION_INT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return VERSION_INT;
|
||||
}
|
||||
|
||||
public static void setVersionIncremental(final String versionIncremental) {
|
||||
synchronized (TUIBuild.class) {
|
||||
VERSION_INCREMENTAL = versionIncremental;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getVersionIncremental() {
|
||||
if (VERSION_INCREMENTAL == null || VERSION_INCREMENTAL.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (VERSION_INCREMENTAL == null || VERSION_INCREMENTAL.isEmpty()) {
|
||||
VERSION_INCREMENTAL = Build.VERSION.INCREMENTAL;
|
||||
Log.i(TAG, "get VERSION_INCREMENTAL by Build.VERSION.INCREMENTAL :" + VERSION_INCREMENTAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
return VERSION_INCREMENTAL;
|
||||
}
|
||||
|
||||
public static void setBoard(final String board) {
|
||||
synchronized (TUIBuild.class) {
|
||||
BOARD = board;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getBoard() {
|
||||
if (BOARD == null || BOARD.isEmpty()) {
|
||||
synchronized (TUIBuild.class) {
|
||||
if (BOARD == null || BOARD.isEmpty()) {
|
||||
BOARD = Build.BOARD;
|
||||
Log.i(TAG, "get BOARD by Build.BOARD :" + BOARD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return BOARD;
|
||||
}
|
||||
|
||||
public static boolean isBrandXiaoMi() {
|
||||
return "xiaomi".equalsIgnoreCase(getBrand()) || "xiaomi".equalsIgnoreCase(getManufacturer());
|
||||
}
|
||||
|
||||
public static boolean isBrandHuawei() {
|
||||
return "huawei".equalsIgnoreCase(getBrand()) || "huawei".equalsIgnoreCase(getManufacturer())
|
||||
|| "honor".equalsIgnoreCase(getBrand());
|
||||
}
|
||||
|
||||
public static boolean isBrandMeizu() {
|
||||
return "meizu".equalsIgnoreCase(getBrand()) || "meizu".equalsIgnoreCase(getManufacturer())
|
||||
|| "22c4185e".equalsIgnoreCase(getBrand());
|
||||
}
|
||||
|
||||
public static boolean isBrandOppo() {
|
||||
return "oppo".equalsIgnoreCase(getBrand()) || "realme".equalsIgnoreCase(getBrand())
|
||||
|| "oneplus".equalsIgnoreCase(getBrand())
|
||||
|| "oppo".equalsIgnoreCase(getManufacturer()) || "realme".equalsIgnoreCase(getManufacturer())
|
||||
|| "oneplus".equalsIgnoreCase(getManufacturer());
|
||||
}
|
||||
|
||||
public static boolean isBrandVivo() {
|
||||
return "vivo".equalsIgnoreCase(getBrand()) || "vivo".equalsIgnoreCase(getManufacturer());
|
||||
}
|
||||
|
||||
public static boolean isBrandHonor() {
|
||||
return "honor".equalsIgnoreCase(getBrand()) && "honor".equalsIgnoreCase(getManufacturer());
|
||||
}
|
||||
|
||||
public static boolean isHarmonyOS() {
|
||||
try {
|
||||
Class clz = Class.forName("com.huawei.system.BuildEx");
|
||||
Method method = clz.getMethod("getOsBrand");
|
||||
return "harmony".equals(method.invoke(clz));
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "the phone not support the harmonyOS");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isMiuiOptimization() {
|
||||
String miuiOptimization = "";
|
||||
try {
|
||||
Class systemProperties = Class.forName("android.os.systemProperties");
|
||||
Method get = systemProperties.getDeclaredMethod("get", String.class, String.class);
|
||||
miuiOptimization = (String) get.invoke(systemProperties, "persist.sys.miuiOptimization", "");
|
||||
//The user has not adjusted the MIUI-optimization switch (default) | user open MIUI-optimization
|
||||
return TextUtils.isEmpty(miuiOptimization) | "true".equals(miuiOptimization);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "the phone not support the miui optimization");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.tencent.qcloud.tuicore.util;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import com.tencent.qcloud.tuicore.ServiceInitializer;
|
||||
|
||||
public class ToastUtil {
|
||||
private static final Handler handler = new Handler(Looper.getMainLooper());
|
||||
private static Toast toast;
|
||||
private static boolean enableToast = true;
|
||||
|
||||
/**
|
||||
* Whether to allow default pop-up prompts inside TUIKit
|
||||
*/
|
||||
public static void setEnableToast(boolean enableToast) {
|
||||
ToastUtil.enableToast = enableToast;
|
||||
}
|
||||
|
||||
public static void toastLongMessage(final String message) {
|
||||
toastMessage(message, true, Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
public static void toastLongMessageCenter(final String message) {
|
||||
toastMessage(message, true, Gravity.CENTER);
|
||||
}
|
||||
|
||||
public static void toastShortMessage(final String message) {
|
||||
toastMessage(message, false, Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
public static void toastShortMessageCenter(final String message) {
|
||||
toastMessage(message, false, Gravity.CENTER);
|
||||
}
|
||||
|
||||
public static void show(final String message, boolean isLong, int gravity) {
|
||||
toastMessage(message, isLong, gravity);
|
||||
}
|
||||
|
||||
private static void toastMessage(final String message, boolean isLong, int gravity) {
|
||||
if (!enableToast) {
|
||||
return;
|
||||
}
|
||||
handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (toast != null) {
|
||||
toast.cancel();
|
||||
toast = null;
|
||||
}
|
||||
toast = Toast.makeText(ServiceInitializer.getAppContext(), message, isLong ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
|
||||
toast.setGravity(gravity, 0, 0);
|
||||
View view = toast.getView();
|
||||
if (view != null) {
|
||||
TextView textView = view.findViewById(android.R.id.message);
|
||||
if (textView != null) {
|
||||
textView.setGravity(Gravity.CENTER);
|
||||
}
|
||||
}
|
||||
if (TUIBuild.getVersionInt() >= Build.VERSION_CODES.R) {
|
||||
toast.addCallback(new Toast.Callback() {
|
||||
@Override
|
||||
public void onToastHidden() {
|
||||
super.onToastHidden();
|
||||
toast = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
26
tuicore/src/main/res-light/values/light_colors.xml
Normal file
26
tuicore/src/main/res-light/values/light_colors.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="core_light_bg_title_text_color_light">#FF000000</color>
|
||||
<color name="core_light_bg_primary_text_color_light">#FF444444</color>
|
||||
<color name="core_light_bg_secondary_text_color_light">#FF888888</color>
|
||||
<color name="core_light_bg_secondary2_text_color_light">#FF999999</color>
|
||||
<color name="core_light_bg_disable_text_color_light">#FFBBBBBB</color>
|
||||
<color name="core_dark_bg_primary_text_color_light">#FFFFFFFF</color>
|
||||
|
||||
<color name="core_primary_bg_color_light">#FFFFFFFF</color>
|
||||
<color name="core_bg_color_light">#FFF2F3F5</color>
|
||||
<color name="core_primary_color_light">#FF147AFF</color>
|
||||
<color name="core_error_tip_color_light">#FFFF584C</color>
|
||||
<color name="core_success_tip_color_light">#FF26CB3E</color>
|
||||
<color name="core_bubble_bg_color_light">#FFDCEAFD</color>
|
||||
<color name="core_divide_color_light">#FFE5E5E5</color>
|
||||
<color name="core_border_color_light">#FFDDDDDD</color>
|
||||
<color name="core_header_start_color_light">#FFEBF0F6</color>
|
||||
<color name="core_header_end_color_light">#FFEBF0F6</color>
|
||||
<color name="core_header_text_color_light">#FF000000</color>
|
||||
|
||||
<color name="core_btn_normal_color_light">#FF147AFF</color>
|
||||
<color name="core_btn_pressed_color_light">#FF0064E7</color>
|
||||
<color name="core_btn_disable_color_light">#4D147AFF</color>
|
||||
|
||||
</resources>
|
||||
28
tuicore/src/main/res-light/values/light_styles.xml
Normal file
28
tuicore/src/main/res-light/values/light_styles.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="TUIBaseLightTheme" parent="@style/TUIBaseTheme">
|
||||
<item name="core_light_bg_title_text_color">@color/core_light_bg_title_text_color_light</item>
|
||||
<item name="core_light_bg_primary_text_color">@color/core_light_bg_primary_text_color_light</item>
|
||||
<item name="core_light_bg_secondary_text_color">@color/core_light_bg_secondary_text_color_light</item>
|
||||
<item name="core_light_bg_secondary2_text_color">@color/core_light_bg_secondary2_text_color_light</item>
|
||||
<item name="core_light_bg_disable_text_color">@color/core_light_bg_disable_text_color_light</item>
|
||||
<item name="core_dark_bg_primary_text_color">@color/core_dark_bg_primary_text_color_light</item>
|
||||
<item name="core_primary_bg_color">@color/core_primary_bg_color_light</item>
|
||||
<item name="core_bg_color">@color/core_bg_color_light</item>
|
||||
<item name="core_primary_color">@color/core_primary_color_light</item>
|
||||
<item name="core_error_tip_color">@color/core_error_tip_color_light</item>
|
||||
<item name="core_success_tip_color">@color/core_success_tip_color_light</item>
|
||||
<item name="core_bubble_bg_color">@color/core_bubble_bg_color_light</item>
|
||||
<item name="core_divide_color">@color/core_divide_color_light</item>
|
||||
<item name="core_border_color">@color/core_border_color_light</item>
|
||||
<item name="core_header_start_color">@color/core_header_start_color_light</item>
|
||||
<item name="core_header_end_color">@color/core_header_end_color_light</item>
|
||||
<item name="core_header_text_color">@color/core_header_text_color_light</item>
|
||||
<item name="core_btn_normal_color">@color/core_btn_normal_color_light</item>
|
||||
<item name="core_btn_pressed_color">@color/core_btn_pressed_color_light</item>
|
||||
<item name="core_btn_disable_color">@color/core_btn_disable_color_light</item>
|
||||
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
26
tuicore/src/main/res-lively/values/lively_colors.xml
Normal file
26
tuicore/src/main/res-lively/values/lively_colors.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="core_light_bg_title_text_color_lively">#FF000000</color>
|
||||
<color name="core_light_bg_primary_text_color_lively">#FF444444</color>
|
||||
<color name="core_light_bg_secondary_text_color_lively">#FF888888</color>
|
||||
<color name="core_light_bg_secondary2_text_color_lively">#FF999999</color>
|
||||
<color name="core_light_bg_disable_text_color_lively">#FFBBBBBB</color>
|
||||
<color name="core_dark_bg_primary_text_color_lively">#FFFFFFFF</color>
|
||||
|
||||
<color name="core_primary_bg_color_lively">#FFFFFFFF</color>
|
||||
<color name="core_bg_color_lively">#FFF2F3F5</color>
|
||||
<color name="core_primary_color_lively">#FFFF8E82</color>
|
||||
<color name="core_error_tip_color_lively">#FFFF584C</color>
|
||||
<color name="core_success_tip_color_lively">#FF26CB3E</color>
|
||||
<color name="core_bubble_bg_color_lively">#FF9D85</color>
|
||||
<color name="core_divide_color_lively">#FFE5E5E5</color>
|
||||
<color name="core_border_color_lively">#FFDDDDDD</color>
|
||||
<color name="core_header_start_color_lively">#FFFF7B7B</color>
|
||||
<color name="core_header_end_color_lively">#FFFFA88B</color>
|
||||
<color name="core_header_text_color_lively">#FFFFFFFF</color>
|
||||
|
||||
<color name="core_btn_normal_color_lively">#FFFF8E82</color>
|
||||
<color name="core_btn_pressed_color_lively">#FFF86657</color>
|
||||
<color name="core_btn_disable_color_lively">#4DFF8E82</color>
|
||||
|
||||
</resources>
|
||||
27
tuicore/src/main/res-lively/values/lively_styles.xml
Normal file
27
tuicore/src/main/res-lively/values/lively_styles.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="TUIBaseLivelyTheme" parent="@style/TUIBaseTheme">
|
||||
<item name="core_light_bg_title_text_color">@color/core_light_bg_title_text_color_lively</item>
|
||||
<item name="core_light_bg_primary_text_color">@color/core_light_bg_primary_text_color_lively</item>
|
||||
<item name="core_light_bg_secondary_text_color">@color/core_light_bg_secondary_text_color_lively</item>
|
||||
<item name="core_light_bg_secondary2_text_color">@color/core_light_bg_secondary2_text_color_lively</item>
|
||||
<item name="core_light_bg_disable_text_color">@color/core_light_bg_disable_text_color_lively</item>
|
||||
<item name="core_dark_bg_primary_text_color">@color/core_dark_bg_primary_text_color_lively</item>
|
||||
<item name="core_primary_bg_color">@color/core_primary_bg_color_lively</item>
|
||||
<item name="core_bg_color">@color/core_bg_color_lively</item>
|
||||
<item name="core_primary_color">@color/core_primary_color_lively</item>
|
||||
<item name="core_error_tip_color">@color/core_error_tip_color_lively</item>
|
||||
<item name="core_success_tip_color">@color/core_success_tip_color_lively</item>
|
||||
<item name="core_bubble_bg_color">@color/core_bubble_bg_color_lively</item>
|
||||
<item name="core_divide_color">@color/core_divide_color_lively</item>
|
||||
<item name="core_border_color">@color/core_border_color_lively</item>
|
||||
<item name="core_header_start_color">@color/core_header_start_color_lively</item>
|
||||
<item name="core_header_end_color">@color/core_header_end_color_lively</item>
|
||||
<item name="core_header_text_color">@color/core_header_text_color_lively</item>
|
||||
<item name="core_btn_normal_color">@color/core_btn_normal_color_lively</item>
|
||||
<item name="core_btn_pressed_color">@color/core_btn_pressed_color_lively</item>
|
||||
<item name="core_btn_disable_color">@color/core_btn_disable_color_lively</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
26
tuicore/src/main/res-serious/values/serious_colors.xml
Normal file
26
tuicore/src/main/res-serious/values/serious_colors.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="core_light_bg_title_text_color_serious">#FF000000</color>
|
||||
<color name="core_light_bg_primary_text_color_serious">#FF444444</color>
|
||||
<color name="core_light_bg_secondary_text_color_serious">#FF888888</color>
|
||||
<color name="core_light_bg_secondary2_text_color_serious">#FF999999</color>
|
||||
<color name="core_light_bg_disable_text_color_serious">#FFBBBBBB</color>
|
||||
<color name="core_dark_bg_primary_text_color_serious">#FFFFFFFF</color>
|
||||
|
||||
<color name="core_primary_bg_color_serious">#FFFFFFFF</color>
|
||||
<color name="core_bg_color_serious">#FFF2F3F5</color>
|
||||
<color name="core_primary_color_serious">#FF0052FF</color>
|
||||
<color name="core_error_tip_color_serious">#FFFF584C</color>
|
||||
<color name="core_success_tip_color_serious">#FF26CB3E</color>
|
||||
<color name="core_bubble_bg_color_serious">#FF4F87FF</color>
|
||||
<color name="core_divide_color_serious">#FFE5E5E5</color>
|
||||
<color name="core_border_color_serious">#FFDDDDDD</color>
|
||||
<color name="core_header_start_color_serious">#FF6395FF</color>
|
||||
<color name="core_header_end_color_serious">#FF0052FF</color>
|
||||
<color name="core_header_text_color_serious">#FFFFFFFF</color>
|
||||
|
||||
<color name="core_btn_normal_color_serious">#FF0052FF</color>
|
||||
<color name="core_btn_pressed_color_serious">#FF0049E4</color>
|
||||
<color name="core_btn_disable_color_serious">#4D0052FF</color>
|
||||
|
||||
</resources>
|
||||
28
tuicore/src/main/res-serious/values/serious_styles.xml
Normal file
28
tuicore/src/main/res-serious/values/serious_styles.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="TUIBaseSeriousTheme" parent="@style/TUIBaseTheme">
|
||||
|
||||
<item name="core_light_bg_title_text_color">@color/core_light_bg_title_text_color_serious</item>
|
||||
<item name="core_light_bg_primary_text_color">@color/core_light_bg_primary_text_color_serious</item>
|
||||
<item name="core_light_bg_secondary_text_color">@color/core_light_bg_secondary_text_color_serious</item>
|
||||
<item name="core_light_bg_secondary2_text_color">@color/core_light_bg_secondary2_text_color_serious</item>
|
||||
<item name="core_light_bg_disable_text_color">@color/core_light_bg_disable_text_color_serious</item>
|
||||
<item name="core_dark_bg_primary_text_color">@color/core_dark_bg_primary_text_color_serious</item>
|
||||
<item name="core_primary_bg_color">@color/core_primary_bg_color_serious</item>
|
||||
<item name="core_bg_color">@color/core_bg_color_serious</item>
|
||||
<item name="core_primary_color">@color/core_primary_color_serious</item>
|
||||
<item name="core_error_tip_color">@color/core_error_tip_color_serious</item>
|
||||
<item name="core_success_tip_color">@color/core_success_tip_color_serious</item>
|
||||
<item name="core_bubble_bg_color">@color/core_bubble_bg_color_serious</item>
|
||||
<item name="core_divide_color">@color/core_divide_color_serious</item>
|
||||
<item name="core_border_color">@color/core_border_color_serious</item>
|
||||
<item name="core_header_start_color">@color/core_header_start_color_serious</item>
|
||||
<item name="core_header_end_color">@color/core_header_end_color_serious</item>
|
||||
<item name="core_header_text_color">@color/core_header_text_color_serious</item>
|
||||
<item name="core_btn_normal_color">@color/core_btn_normal_color_serious</item>
|
||||
<item name="core_btn_pressed_color">@color/core_btn_pressed_color_serious</item>
|
||||
<item name="core_btn_disable_color">@color/core_btn_disable_color_serious</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
11
tuicore/src/main/res/drawable/core_list_divider.xml
Normal file
11
tuicore/src/main/res/drawable/core_list_divider.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid
|
||||
android:color="#E5E5E5"/>
|
||||
|
||||
<size
|
||||
android:height="0.5dp"/>
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:radius="7.68dp"/>
|
||||
</shape>
|
||||
37
tuicore/src/main/res/layout/permission_activity_layout.xml
Normal file
37
tuicore/src/main/res/layout/permission_activity_layout.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tuicore_permission_layout"
|
||||
android:orientation="vertical"
|
||||
android:background="#BF000000"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="60dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/permission_icon"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permission_reason_title"
|
||||
android:textSize="17.28sp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permission_reason"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textSize="17sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#BFFFFFFF"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
80
tuicore/src/main/res/layout/permission_tip_layout.xml
Normal file
80
tuicore/src/main/res/layout/permission_tip_layout.xml
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/core_permission_dialog_bg"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips_title"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:text="@string/core_permission_dialog_title"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textSize="15sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#888888"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:background="#EEEEEE"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/negative_btn"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:textSize="15.55sp"
|
||||
android:text="@string/cancel"
|
||||
android:layout_weight="0.5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:background="#EEEEEE"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/positive_btn"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="@string/core_permission_dialog_positive_setting_text"
|
||||
android:textSize="15.55sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_weight="0.5"
|
||||
android:textColor="?attr/core_primary_color"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
300
tuicore/src/main/res/values-ar/im_error_msg.xml
Normal file
300
tuicore/src/main/res/values-ar/im_error_msg.xml
Normal file
@@ -0,0 +1,300 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="TUIKitErrorInProcess">جاري التنفيذ</string>
|
||||
<string name="TUIKitErrorInvalidParameters">معلمات غير صالحة</string>
|
||||
<string name="TUIKitErrorIOOperateFaild">خطأ في عملية IO المحلية</string>
|
||||
<string name="TUIKitErrorInvalidJson">تنسيق JSON غير صالح</string>
|
||||
<string name="TUIKitErrorOutOfMemory">نفاد الذاكرة</string>
|
||||
<string name="TUIKitErrorParseResponseFaild">فشل تحليل PB</string>
|
||||
<string name="TUIKitErrorSerializeReqFaild">فشل تسلسل PB</string>
|
||||
<string name="TUIKitErrorSDKNotInit">IM SDK غير مبدل</string>
|
||||
<string name="TUIKitErrorLoadMsgFailed">فشل تحميل قاعدة بيانات محلية</string>
|
||||
<string name="TUIKitErrorDatabaseOperateFailed">فشل عملية قاعدة البيانات المحلية</string>
|
||||
<string name="TUIKitErrorCrossThread">خطأ عبر الخطوط</string>
|
||||
<string name="TUIKitErrorTinyIdEmpty">معلومات المستخدم فارغة</string>
|
||||
<string name="TUIKitErrorInvalidIdentifier">معرف غير صالح</string>
|
||||
<string name="TUIKitErrorFileNotFound">الملف غير موجود</string>
|
||||
<string name="TUIKitErrorFileTooLarge">حجم الملف يتجاوز الحد المسموح به</string>
|
||||
<string name="TUIKitErrorEmptyFile">ملف فارغ</string>
|
||||
<string name="TUIKitErrorFileOpenFailed">فشل فتح الملف</string>
|
||||
<string name="TUIKitErrorNotLogin">IM SDK غير مسجل الدخول</string>
|
||||
<string name="TUIKitErrorNoPreviousLogin">لم يتم تسجيل الدخول لهذا المستخدم من قبل</string>
|
||||
<string name="TUIKitErrorUserSigExpired">انتهت صلاحية UserSig</string>
|
||||
<string name="TUIKitErrorLoginKickedOffByOther">تم تسجيل الدخول من جهاز آخر باستخدام نفس الحساب</string>
|
||||
<string name="TUIKitErrorTLSSDKInit">فشل تهيئة TLS SDK</string>
|
||||
<string name="TUIKitErrorTLSSDKUninit">TLS SDK غير مبدل</string>
|
||||
<string name="TUIKitErrorTLSSDKTRANSPackageFormat">تنسيق حزمة TLS SDK TRANS غير صالح</string>
|
||||
<string name="TUIKitErrorTLSDecrypt">فشل فك تشفير TLS SDK</string>
|
||||
<string name="TUIKitErrorTLSSDKRequest">فشل طلب TLS SDK</string>
|
||||
<string name="TUIKitErrorTLSSDKRequestTimeout">انتهت مهلة طلب TLS SDK</string>
|
||||
<string name="TUIKitErrorInvalidConveration">المحادثة غير صالحة</string>
|
||||
<string name="TUIKitErrorFileTransAuthFailed">فشل مصادقة نقل الملفات</string>
|
||||
<string name="TUIKitErrorFileTransNoServer">فشل الحصول على قائمة الخوادم لنقل الملفات</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailed">فشل تحميل نقل الملفات، يرجى التحقق من اتصال الشبكة</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailedNotImage">فشل تحميل نقل الملفات، يرجى التحقق من أن الصورة المراد تحميلها يمكن فتحها بشكل صحيح</string>
|
||||
<string name="TUIKitErrorFileTransDownloadFailed">فشل تنزيل نقل الملفات، يرجى التحقق من الشبكة أو مدى صلاحية الملف أو الصوت</string>
|
||||
<string name="TUIKitErrorHTTPRequestFailed">فشل طلب HTTP</string>
|
||||
<string name="TUIKitErrorInvalidMsgElem">رسالة IM SDK غير صالحة</string>
|
||||
<string name="TUIKitErrorInvalidSDKObject">كائن غير صالح</string>
|
||||
<string name="TUIKitSDKMsgBodySizeLimit">تجاوز حد طول الرسالة</string>
|
||||
<string name="TUIKitErrorSDKMsgKeyReqDifferRsp">مفتاح الرسالة غير صحيح</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidID">معرف المجموعة غير صالح، يجب أن يكون معرف المجموعة المخصص قابلًا للطباعة باستخدام ASCII (0x20-0x7e) ويصل إلى 48 بايتًا ، ولا يمكن أن يبدأ البادئة بـ @TGS#</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidName">اسم المجموعة غير صالح، يصل طول اسم المجموعة إلى 30 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidIntroduction">مقدمة المجموعة غير صالحة، يصل طول مقدمة المجموعة إلى 240 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNotification">إشعار المجموعة غير صالح، يصل طول إشعار المجموعة إلى 300 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidFaceURL">عنوان URL لصورة رمز المجموعة غير صالح، يصل طول عنوان URL لصورة رمز المجموعة إلى 100 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNameCard">بطاقة اسم المجموعة غير صالحة، يصل طول بطاقة اسم المجموعة إلى 50 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKGroupMemberCountLimit">تجاوز حد أعضاء المجموعة</string>
|
||||
<string name="TUIKitErrorSDKGroupJoinPrivateGroupDeny">لا يسمح بالانضمام إلى مجموعة خاصة</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteSuperDeny">لا يسمح بدعوة أعضاء يحملون دور مالك المجموعة</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteNoMember">غير مسموح بدعوة 0 أعضاء</string>
|
||||
<string name="TUIKitErrorSDKGroupPinnedMessageCountLimit">الرسائل المثبتة فوق الحد</string>
|
||||
|
||||
<string name="TUIKitErrorSDKFriendShipInvalidProfileKey">مفتاح الملف الشخصي غير صالح</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddRemark">حقل الملاحظات غير صالح، يصل طول حقل الملاحظات إلى 96 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddWording">حقل شرح طلب الصداقة غير صالح، يصل طول حقل شرح طلب الصداقة إلى 120 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddSource">حقل مصدر الصداقة غير صالح، يجب أن يبدأ المصدر بـ "AddSource_Type_"</string>
|
||||
<string name="TUIKitErrorSDKFriendshipFriendGroupEmpty">حقل مجموعة الأصدقاء غير صالح، يجب أن يكون حقل مجموعة الأصدقاء غير فارغ ويصل طول اسم كل مجموعة إلى 30 بايتًا</string>
|
||||
<string name="TUIKitErrorSDKNetEncodeFailed">فشل تشفير الاتصال بالشبكة</string>
|
||||
<string name="TUIKitErrorSDKNetDecodeFailed">فشل فك تشفير الاتصال بالشبكة</string>
|
||||
<string name="TUIKitErrorSDKNetAuthInvalid">فشل التوثيق في الاتصال بالشبكة</string>
|
||||
<string name="TUIKitErrorSDKNetCompressFailed">فشل ضغط البيانات</string>
|
||||
<string name="TUIKitErrorSDKNetUncompressFaile">فشل فك ضغط البيانات</string>
|
||||
<string name="TUIKitErrorSDKNetFreqLimit">تم تقييد معدل الاستدعاءات، يمكن القيام بأقصى 5 طلبات في الثانية الواحدة</string>
|
||||
<string name="TUIKitErrorSDKnetReqCountLimit">تم ملء قائمة الطلبات، تجاوز الحد الأقصى لعدد الطلبات المتزامنة، يمكن القيام بأقصى 1000 طلب في نفس الوقت.</string>
|
||||
<string name="TUIKitErrorSDKNetDisconnect">تم فصل الاتصال بالشبكة، لم يتم إنشاء اتصال، أو تم الكشف عن عدم وجود شبكة أثناء إنشاء اتصال socket.</string>
|
||||
<string name="TUIKitErrorSDKNetAllreadyConn">تم إنشاء اتصال بالفعل، يرجى عدم إنشاء اتصال مرة أخرى</string>
|
||||
<string name="TUIKitErrorSDKNetConnTimeout">انتهت مهلة إنشاء الاتصال بالشبكة، يرجى المحاولة مرة أخرى بعد استعادة الشبكة.</string>
|
||||
<string name="TUIKitErrorSDKNetConnRefuse">تم رفض الاتصال بالشبكة، تم رفض الخدمة من قبل الخادم بسبب الطلب المتكرر.</string>
|
||||
<string name="TUIKitErrorSDKNetNetUnreach">لا يمكن الوصول إلى الشبكة، يرجى المحاولة مرة أخرى بعد استعادة الشبكة.</string>
|
||||
<string name="TUIKitErrorSDKNetSocketNoBuff">لا يوجد مساحة مخزن مؤقت كافية في النظام لإكمال الاستدعاء، النظام مشغول جدًا، خطأ داخلي.</string>
|
||||
<string name="TUIKitERRORSDKNetResetByPeer">أعاد الطرف الآخر إعداد الاتصال</string>
|
||||
<string name="TUIKitErrorSDKNetSOcketInvalid">مأخذ socket غير صالح</string>
|
||||
<string name="TUIKitErrorSDKNetHostGetAddressFailed">فشل تحليل عنوان IP</string>
|
||||
<string name="TUIKitErrorSDKNetConnectReset">تم إعادة تعيين الاتصال بالشبكة إلى العقدة الوسيطة أو الخادم</string>
|
||||
<string name="TUIKitErrorSDKNetWaitInQueueTimeout">انتهت مهلة الطلب المنتظر للانضمام إلى قائمة الإرسال</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeout">تم إدخال الطلب في قائمة الإرسال المعلقة، وقت الانتظار لدخول مخزن النظام للشبكة قد انتهى</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeut">تم إدخال الطلب في مخزن النظام للشبكة، وقت الانتظار للحصول على رد من الخادم قد انتهى</string>
|
||||
<string name="TUIKitErrorSDKWaitSendRemainingTimeout">لقد دخلت حزمة الطلب في قائمة الانتظار المراد إرسالها، وتم إرسال جزء من البيانات. تحدث مهلة أثناء انتظار إرسال الجزء المتبقي. قد يكون عرض النطاق الترددي للوصلة الصاعدة غير كاف. يرجى التحقق مما إذا كانت الشبكة سلسة. عندما حدث خطأ في رد الاتصال، وتم اكتشاف وجود اتصال بالإنترنت. خطأ داخلي</string>
|
||||
<string name="TUIKitErrorSDKNetPKGSizeLimit">طول حزمة الطلب أكبر من الحد الأقصى، والحد الأقصى المدعوم هو 1 ميجابايت.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeoutNoNetwork">طول حزمة الطلب أكبر من الحد الأقصى، والحد الأقصى المدعوم هو 1 ميجابايت. لقد دخلت حزمة الطلب في قائمة الانتظار ليتم إرسالها. انتهت مهلة المخزن المؤقت للشبكة الذي ينتظر الدخول إلى النظام. يوجد عدد كبير جدًا من حزم البيانات أو لا يمكن لمؤشر الترابط المرسل معالجتها. عند استدعاء رمز الخطأ مرة أخرى، تم اكتشاف وجود لا يوجد اتصال بالإنترنت.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeoutNoNetwork">دخلت حزمة الطلب إلى المخزن المؤقت لشبكة النظام، وانتهت مهلة انتظار حزمة الإرجاع من الخادم، ربما لم تترك حزمة الطلب الجهاز الطرفي، وقد تجاهلها المسار الوسيط، وفقد الخادم عن طريق الخطأ الحزمة، أو تم تجاهل حزمة الإرجاع بواسطة طبقة شبكة النظام. لم يتم اكتشاف رمز خطأ عند معاودة الاتصال بالشبكة.</string>
|
||||
<string name="TUIKitErrorSDKNetRemainingTimeoutNoNetwork">لقد دخلت حزمة الطلب في قائمة الانتظار ليتم إرسالها، وتم إرسال جزء من البيانات. تحدث مهلة أثناء انتظار إرسال الجزء المتبقي. قد يكون عرض النطاق الترددي للوصلة الصاعدة غير كاف. يرجى التحقق مما إذا كانت الشبكة سلسة. عند الاتصال مرة أخرى رمز الخطأ، تم الكشف عن عدم وجود اتصال بالإنترنت.</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOConnectLimit">تم تجاوز الحد الأقصى لعدد اتصالات الخادم، تم رفض الخدمة من قبل الخادم.</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOVCode">انتهت مهلة إرسال رمز التحقق.</string>
|
||||
<string name="TUIKitErrorSVRSSOD2Expired">انتهت صلاحية المفتاح. المفتاح هو تذكرة داخلية تم إنشاؤها بناءً على UserSig، وصلاحية المفتاح أقل من أو تساوي صلاحية UserSig. يرجى إعادة استدعاء واجهة تسجيل الدخول TIMManager.getInstance().login لإنشاء مفتاح جديد.</string>
|
||||
<string name="TUIKitErrorSVRA2UpInvalid">انتهت صلاحية التذكرة. التذكرة هي تذكرة داخلية تم إنشاؤها بناءً على UserSig، وصلاحية التذكرة أقل من أو تساوي صلاحية UserSig. يرجى إعادة استدعاء واجهة تسجيل الدخول TIMManager.getInstance().login لإنشاء تذكرة جديدة.</string>
|
||||
<string name="TUIKitErrorSVRA2DownInvalid">فشل التحقق من التذكرة أو تعرض لهجوم أمني. يرجى إعادة استدعاء واجهة تسجيل الدخول TIMManager.getInstance().login لإنشاء تذكرة جديدة.</string>
|
||||
<string name="TUIKitErrorSVRSSOEmpeyKey">لا يسمح بمفتاح فارغ.</string>
|
||||
<string name="TUIKitErrorSVRSSOUinInvalid">لا يتطابق حساب المفتاح مع حساب رأس الطلب.</string>
|
||||
<string name="TUIKitErrorSVRSSOVCodeTimeout">انتهت مهلة إرسال رمز التحقق.</string>
|
||||
<string name="TUIKitErrorSVRSSONoImeiAndA2">يجب توفير المفتاح والتذكرة.</string>
|
||||
<string name="TUIKitErrorSVRSSOCookieInvalid">فشل التحقق من ملف تعريف الارتباط.</string>
|
||||
<string name="TUIKitErrorSVRSSODownTips">رسالة تذكير، انتهت صلاحية المفتاح.</string>
|
||||
<string name="TUIKitErrorSVRSSODisconnect">قفل الشاشة عند فصل الاتصال.</string>
|
||||
<string name="TUIKitErrorSVRSSOIdentifierInvalid">هوية غير صالحة.</string>
|
||||
<string name="TUIKitErrorSVRSSOClientClose">إغلاق العميل تلقائيًا.</string>
|
||||
<string name="TUIKitErrorSVRSSOMSFSDKQuit">خروج MSFSDK تلقائيًا.</string>
|
||||
<string name="TUIKitErrorSVRSSOD2KeyWrong">فشل فك التشفير للمفتاح عدة مرات، يجب إعادة تعيينه، يرجى إعادة استدعاء واجهة تسجيل الدخول TIMManager.getInstance().login لإنشاء مفتاح جديد.</string>
|
||||
<string name="TUIKitErrorSVRSSOUnsupport">غير مدعوم للتجميع، يتم إرجاع رمز خطأ موحد إلى العميل. يتوقف التجميع على هذه الاتصالات الطويلة.</string>
|
||||
<string name="TUIKitErrorSVRSSOPrepaidArrears">تأخر الدفع المسبق.</string>
|
||||
<string name="TUIKitErrorSVRSSOPacketWrong">تنسيق حزمة الطلب غير صحيح.</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidBlackList">قائمة الأسود SDKAppID.</string>
|
||||
<string name="TUIKitErrorSVRSSOCmdBlackList">SDKAppID تعيين قائمة الأسود لأوامر الخدمة.</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidWithoutUsing">SDKAppID متوقف.</string>
|
||||
<string name="TUIKitErrorSVRSSOFreqLimit">تم تحديد حد التردد (للمستخدم) ، وهو حد يتم تعيينه لعدد الطلبات في الثانية لبروتوكول معين.</string>
|
||||
<string name="TUIKitErrorSVRSSOOverload">حد الحمولة (النظام) ، يتعامل الخادم المتصل مع الكثير من الطلبات ولا يستطيع التعامل معها ، ويعتبر الخادم مشغولًا.</string>
|
||||
<string name="TUIKitErrorSVRResNotFound">الملف المراد إرساله غير موجود.</string>
|
||||
<string name="TUIKitErrorSVRResAccessDeny">لا يسمح بالوصول إلى الملف المراد إرساله.</string>
|
||||
<string name="TUIKitErrorSVRResSizeLimit">تجاوز حجم الملف الحد المسموح به.</string>
|
||||
<string name="TUIKitErrorSVRResSendCancel">ألغى المستخدم الإرسال ، مثل تسجيل الخروج أثناء الإرسال.</string>
|
||||
<string name="TUIKitErrorSVRResReadFailed">فشل قراءة محتوى الملف.</string>
|
||||
<string name="TUIKitErrorSVRResTransferTimeout">انتهت مهلة نقل الملف.</string>
|
||||
<string name="TUIKitErrorSVRResInvalidParameters">معلمات غير صالحة.</string>
|
||||
<string name="TUIKitErrorSVRResInvalidFileMd5">فشل التحقق من صحة MD5 للملف.</string>
|
||||
<string name="TUIKitErrorSVRResInvalidPartMd5">فشل التحقق من صحة MD5 للجزء.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidHttpUrl">خطأ في تحليل HTTP ، يرجى التحقق من تنسيق عنوان URL للطلب.</string>
|
||||
<string name="TUIKitErrorSVRCommomReqJsonParseFailed">فشل تحليل JSON لطلب HTTP ، يرجى التحقق من تنسيق JSON.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidAccount">خطأ في معرف URI أو Identifier أو UserSig في جسم JSON للطلب.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidSdkappid">SDKAppID غير صالح ، يرجى التحقق من صحة SDKAppID.</string>
|
||||
<string name="TUIKitErrorSVRCommonRestFreqLimit">تجاوز حد التردد لاستدعاء واجهة REST ، يرجى تقليل تردد الطلبات.</string>
|
||||
<string name="TUIKitErrorSVRCommonRequestTimeout">انتهت مهلة الطلب أو تنسيق الطلب HTTP غير صحيح ، يرجى التحقق وإعادة المحاولة.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidRes">خطأ في طلب الموارد ، يرجى التحقق من عنوان URL للطلب.</string>
|
||||
<string name="TUIKitErrorSVRCommonIDNotAdmin">يرجى ملء حقل Identifier المطلوب في طلب REST API بحساب مسؤول التطبيق.</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidFreqLimit">تجاوز حد التردد لـ SDKAppID ، يرجى تقليل تردد الطلبات.</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidMiss">يجب أن يحتوي واجهة REST على SDKAppID ، يرجى التحقق من SDKAppID في عنوان URL للطلب.</string>
|
||||
<string name="TUIKitErrorSVRCommonRspJsonParseFailed">فشل تحليل JSON لحزمة الاستجابة HTTP.</string>
|
||||
<string name="TUIKitErrorSVRCommonExchangeAccountTimeout">انتهت مهلة تبادل الحساب.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidIdFormat">خطأ في نوع Identifier في جسم الطلب ، يرجى التأكد من أن Identifier هو سلسلة.</string>
|
||||
<string name="TUIKitErrorSVRCommonSDkappidForbidden">SDKAppID محظور</string>
|
||||
<string name="TUIKitErrorSVRCommonReqForbidden">الطلب محظور</string>
|
||||
<string name="TUIKitErrorSVRCommonReqFreqLimit">الطلب متكرر جدًا ، يرجى المحاولة مرة أخرى في وقت لاحق.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidService">لم يتم شراء حزمة الخدمة ، أو انتهت صلاحية حزمة الخدمة ، أو لم تبدأ حزمة الخدمة التي تم شراؤها بعد التكوين. يرجى تسجيل الدخول إلى صفحة شراء IM لشراء حزمة الخدمة مرة أخرى. بعد الشراء ، سيتم تفعيلها بعد 5 دقائق.</string>
|
||||
<string name="TUIKitErrorSVRCommonSensitiveText">ضربة أمنية للنصوص ، قد يحتوي النص على كلمات حساسة.</string>
|
||||
<string name="TUIKitErrorSVRCommonBodySizeLimit">حجم حزمة الرسالة طويل جدًا ، يدعم حاليًا طول حزمة الرسالة الأقصى 12 كيلو بايت ، يرجى تقليل حجم الحزمة وإعادة المحاولة.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigExpired">انتهت صلاحية UserSig ، يرجى إعادة إنشاء UserSig</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigEmpty">طول UserSig هو 0</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigCheckFailed">فشل التحقق من صحة UserSig</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchPublicKey">فشل التحقق من UserSig باستخدام المفتاح العام</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchId">معرف الطلب لا يتطابق مع معرف إنشاء UserSig.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchSdkAppid">SDKAppID المطلوب لا يتطابق مع SDKAppID الذي تم إنشاء UserSig من أجله.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigPublicKeyNotFound">فشل التحقق من UserSig لعدم وجود المفتاح العام</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigSdkAppidNotFount">لم يتم العثور على SDKAppID ، يرجى التحقق من معلومات التطبيق في وحدة التحكم لـ IM.</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidUserSig">انتهت صلاحية UserSig، يرجى إعادة إنشائها والمحاولة مرة أخرى.</string>
|
||||
<string name="TUIKitErrorSVRAccountNotFound">حساب المستخدم المطلوب غير موجود.</string>
|
||||
<string name="TUIKitErrorSVRAccountSecRstr">تم تقييد الحساب لأسباب أمنية.</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalTimeout">انتهت مهلة الخادم الداخلية، يرجى المحاولة مرة أخرى.</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidCount">الكمية الدفعية في الطلب غير صالحة.</string>
|
||||
<string name="TUIkitErrorSVRAccountINvalidParameters">المعلمات غير صالحة، يرجى التحقق من ملء الحقول الإلزامية ومطابقتها لمتطلبات البروتوكول.</string>
|
||||
<string name="TUIKitErrorSVRAccountAdminRequired">الطلب يتطلب صلاحيات مسؤول التطبيق.</string>
|
||||
<string name="TUIKitErrorSVRAccountLowSDKVersion">إصدار SDK الخاص بك منخفض جدًا، يرجى الترقية إلى أحدث إصدار.</string>
|
||||
<string name="TUIKitErrorSVRAccountFreqLimit">تم تقييد الحساب بسبب الفشل والمحاولات المتكررة، يرجى التحقق من صحة UserSig والمحاولة مرة أخرى بعد دقيقة واحدة.</string>
|
||||
<string name="TUIKitErrorSVRAccountBlackList">تم إدراج الحساب في القائمة السوداء.</string>
|
||||
<string name="TUIKitErrorSVRAccountCountLimit">تجاوز الحد الأقصى لعدد الحسابات المسموح بها في الإصدار التجريبي المجاني، يرجى الترقية إلى الإصدار المتخصص.</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalError">خطأ داخلي في الخادم، يرجى المحاولة مرة أخرى.</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidParameters">معلمات الطلب غير صالحة، يرجى التحقق من وصف الخطأ والتحقق من صحة الطلب.</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountMiss">معلمات الطلب غير صالحة، لم يتم تحديد حساب المستخدم الذي يجب جلب بياناته.</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountNotFound">حساب المستخدم المطلوب غير موجود.</string>
|
||||
<string name="TUIKitErrorSVRProfileAdminRequired">الطلب يتطلب صلاحيات مسؤول التطبيق.</string>
|
||||
<string name="TUIKitErrorSVRProfileSensitiveText">يحتوي حقل الملف الشخصي على كلمات حساسة.</string>
|
||||
<string name="TUIKitErrorSVRProfileInternalError">خطأ داخلي في الخادم ، يرجى المحاولة مرة أخرى في وقت لاحق.</string>
|
||||
<string name="TUIKitErrorSVRProfileReadWritePermissionRequired">لا يوجد إذن قراءة لحقل الملف الشخصي ، يرجى الرجوع إلى حقول الملف الشخصي للحصول على التفاصيل.</string>
|
||||
<string name="TUIKitErrorSVRProfileTagNotFound">لا يوجد علامة لحقل الملف الشخصي.</string>
|
||||
<string name="TUIKitErrorSVRProfileSizeLimit">تجاوز طول قيمة حقل الملف الشخصي 500 بايت.</string>
|
||||
<string name="TUIKitErrorSVRProfileValueError">قيمة حقل الملف الشخصي القياسية غير صحيحة ، يرجى الرجوع إلى حقول الملف الشخصي للحصول على التفاصيل.</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidValueFormat">نوع قيمة حقل الملف الشخصي غير متطابق ، يرجى الرجوع إلى حقول الملف الشخصي للحصول على التفاصيل.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidParameters">معلمات الطلب غير صالحة، يرجى التحقق من وصف الخطأ والتحقق من صحة الطلب.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidSdkAppid">SDKAppID غير متطابق.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAccountNotFound">حساب المستخدم المطلوب غير موجود.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAdminRequired">الطلب يتطلب صلاحيات مسؤول التطبيق.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipSensitiveText">يحتوي حقل علاقة الصداقة على كلمات حساسة.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipNetTimeout">انتهت مهلة الشبكة، يرجى المحاولة مرة أخرى في وقت لاحق.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipWriteConflict">تعارض الكتابة المتزامنة يؤدي إلى تعارض الكتابة، يُنصح باستخدام الطريقة الدفعية.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendDeny">الخادم الخلفي يمنع هذا المستخدم من إرسال طلبات صداقة.</string>
|
||||
<string name="TUIkitErrorSVRFriendshipCountLimit">لقد وصلت إلى الحد الأقصى لعدد أصدقائك في النظام.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipGroupCountLimit">لقد وصلت إلى الحد الأقصى لعدد المجموعات في النظام.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyLimit">لقد وصلت إلى الحد الأقصى لعدد الطلبات المعلقة في النظام.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipBlacklistLimit">لقد وصلت إلى الحد الأقصى لعدد الأشخاص المحظورين في النظام.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPeerFriendLimit">لقد وصل الشخص الآخر إلى الحد الأقصى لعدد أصدقائه في النظام.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAlreadyFriends">بالفعل أصدقاء</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInSelfBlacklist">الشخص الآخر موجود في القائمة السوداء الخاصة بك، ولا يسمح بإضافته كصديق.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeDenyAny">طريقة التحقق من صداقة الشخص الآخر لا تسمح لأي شخص بإضافته كصديق.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInPeerBlackList">أنت موجود في القائمة السوداء الخاصة بالشخص الآخر، ولا يسمح لك بإضافته كصديق.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeNeedConfirm">تم إرسال الطلب، يرجى الانتظار حتى يوافق الشخص الآخر.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendSecRstr">تم رفض طلب إضافة الصديق بسبب سياسة الأمان، يرجى عدم إرسال طلبات إضافة الأصدقاء بشكل متكرر.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyNotFound">الطلب المعلق المطلوب غير موجود.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipDelFriendSecRstr">تم رفض طلب حذف الصديق بسبب سياسة الأمان، يرجى عدم إرسال طلبات حذف الأصدقاء بشكل متكرر.</string>
|
||||
<string name="TUIKirErrorSVRFriendAccountNotFoundEx">حساب المستخدم المطلوب غير موجود.</string>
|
||||
<string name="TUIKitErrorSVRMsgPkgParseFailed">فشل تحليل حزمة الطلب.</string>
|
||||
<string name="TUIKitErrorSVRMsgInternalAuthFailed">فشل التحقق الداخلي.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidId">معرف غير صالح</string>
|
||||
<string name="TUIKitErrorSVRMsgNetError">خطأ في الشبكة، يرجى المحاولة مرة أخرى.</string>
|
||||
<string name="TUIKitErrorSVRMsgPushDeny">تم رفض إرسال الرسالة قبل إرسال الدردشة الفردية، يرجى التحقق من الرد من الخلفية.</string>
|
||||
<string name="TUIKitErrorSVRMsgInPeerBlackList">تم حظر إرسال الرسالة الفردية من قبل الشخص الآخر، ولا يسمح بإرسالها.</string>
|
||||
<string name="TUIKitErrorSVRMsgBothNotFriend">الشخصان اللذان يرسلان الرسالة ليسا صديقين، ولا يسمح بإرسالها.</string>
|
||||
<string name="TUIKitErrorSVRMsgNotPeerFriend">إرسال رسالة دردشة فردية ، ولكن الشخص الآخر ليس صديقًا (علاقة في اتجاه واحد) ، والإرسال ممنوع.</string>
|
||||
<string name="TUIkitErrorSVRMsgNotSelfFriend">إرسال رسالة دردشة فردية ، ولكن الشخص الآخر ليس صديقًا (علاقة في اتجاه واحد) ، والإرسال ممنوع.</string>
|
||||
<string name="TUIKitErrorSVRMsgShutupDeny">بسبب الحظر عن الكلام ، يتم منع إرسال الرسائل.</string>
|
||||
<string name="TUIKitErrorSVRMsgRevokeTimeLimit">تجاوز الوقت المحدد لإلغاء الرسالة (الافتراضي 2 دقيقة)</string>
|
||||
<string name="TUIKitErrorSVRMsgDelRambleInternalError">خطأ داخلي في حذف الرسائل المتجولة</string>
|
||||
<string name="TUIKitErrorSVRMsgJsonParseFailed">فشل تحليل حزمة JSON، يرجى التحقق من صيغة الحزمة إذا كانت تتوافق مع صيغة JSON</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonBodyFormat">حزمة JSON للطلب تحتوي على MsgBody غير متوافق مع وصف الرسالة</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidToAccount">حزمة JSON للطلب تفتقد إلى حقل To_Account أو حقل To_Account ليس من نوع Integer</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidRand">حزمة JSON للطلب تفتقد إلى حقل MsgRandom أو حقل MsgRandom ليس من نوع Integer</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidTimestamp">حزمة JSON للطلب تفتقد إلى حقل MsgTimeStamp أو حقل MsgTimeStamp ليس من نوع Integer</string>
|
||||
<string name="TUIKitErrorSVRMsgBodyNotArray">نوع حزمة JSON للطلب MsgBody ليس من نوع Array</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonFormat">حزمة JSON للطلب غير متوافقة مع وصف الرسالة</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountCountLimit">تجاوز الحد الأقصى لعدد حسابات الوجهة في إرسال الرسائل الجماعية (500)</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountNotFound">To_Account غير مسجل أو غير موجود</string>
|
||||
<string name="TUIKitErrorSVRMsgTimeLimit">خطأ في وقت تخزين الرسالة (لا يمكن تخزين الرسائل لأكثر من 7 أيام)</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidSyncOtherMachine">حقل SyncOtherMachine في حزمة JSON للطلب ليس من نوع Integer</string>
|
||||
<string name="TUIkitErrorSVRMsgInvalidMsgLifeTime">حقل MsgLifeTime في حزمة JSON للطلب ليس من نوع Integer</string>
|
||||
<string name="TUIKitErrorSVRMsgBodySizeLimit">تجاوز حجم حزمة الرسالة البيانية JSON (لا يجب أن يتجاوز حجم حزمة الرسالة 12 كيلو بايت)</string>
|
||||
<string name="TUIKitErrorSVRmsgLongPollingCountLimit">تم طرد الاستطلاع الطويل على الويب (تجاوز عدد الأمثلة المتصلة في الوقت نفسه على الويب).</string>
|
||||
<string name="TUIKitErrorUnsupporInterface">هذه الميزة متاحة فقط في الإصدار الرئيسي، يرجى الترقية إلى الإصدار الرئيسي.</string>
|
||||
<string name="TUIKitErrorUnsupporInterfaceSuffix">هذه الميزة متاحة فقط في الإصدار الرئيسي، يرجى الترقية إلى الإصدار الرئيسي.</string>
|
||||
|
||||
<string name="TUIKitErrorSVRGroupApiNameError">اسم الواجهة المستخدمة في الطلب غير صحيح.</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountCountLimit">تم تجاوز الحد الأقصى لعدد الحسابات في حزمة الطلب.</string>
|
||||
<string name="TUIkitErrorSVRGroupFreqLimit">تم تقييد التردد ، يرجى محاولة تخفيض تردد الاستدعاء.</string>
|
||||
<string name="TUIKitErrorSVRGroupPermissionDeny">لا يوجد لديك الصلاحيات الكافية للقيام بهذا الإجراء.</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidReq">الطلب غير صالح.</string>
|
||||
<string name="TUIKitErrorSVRGroupSuperNotAllowQuit">لا يسمح بهذا النوع من المجموعات بخروج مالك المجموعة بنفسه.</string>
|
||||
<string name="TUIKitErrorSVRGroupNotFound">المجموعة غير موجودة</string>
|
||||
<string name="TUIKitErrorSVRGroupJsonParseFailed">فشل تحليل حزمة JSON، يرجى التحقق من صيغة الحزمة إذا كانت تتوافق مع صيغة JSON</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidId">عضو في المجموعة بالفعل</string>
|
||||
<string name="TUIKitErrorSVRGroupAllreadyMember">المستخدم الذي تم دعوته للانضمام إلى المجموعة هو بالفعل عضو في المجموعة</string>
|
||||
<string name="TUIKitErrorSVRGroupFullMemberCount">المجموعة ممتلئة، لا يمكن إضافة المستخدم المطلوب في الطلب إلى المجموعة</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidGroupId">معرف المجموعة غير صالح، يرجى التحقق من صحة معرف المجموعة</string>
|
||||
<string name="TUIKitErrorSVRGroupRejectFromThirdParty">رفض العملية من قبل خلفية التطبيق من خلال رد الاتصال من جهة خارجية</string>
|
||||
<string name="TUIKitErrorSVRGroupShutDeny">لا يمكن إرسال الرسائل بسبب الحظر، يرجى التحقق من إعدادات الحظر للمرسل</string>
|
||||
<string name="TUIKitErrorSVRGroupRspSizeLimit">تجاوز حجم حزمة الرد الحد الأقصى للحزمة</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountNotFound">لا يوجد حساب مستخدم مطلوب في الطلب</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdInUse">معرف المجموعة قيد الاستخدام، يرجى اختيار معرف مجموعة آخر</string>
|
||||
<string name="TUIKitErrorSVRGroupSendMsgFreqLimit">تجاوز حد التردد في إرسال الرسائل، يرجى زيادة فترة الانتظار بين إرسال الرسائل</string>
|
||||
<string name="TUIKitErrorSVRGroupReqAllreadyBeenProcessed">تم معالجة هذا الطلب أو الدعوة بالفعل</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdUserdForSuper">معرف المجموعة قيد الاستخدام والمستخدم هو مالك المجموعة، يمكن استخدامه مباشرة</string>
|
||||
<string name="TUIKitErrorSVRGroupSDkAppidDeny">تم تعطيل أمر الطلب SDKAppID المطلوب</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgNotFound">الرسالة التي تم طلب إلغاؤها غير موجودة</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgTimeLimit">تجاوز الوقت المحدد لإلغاء الرسالة (الافتراضي 2 دقيقة)</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgDeny">لا يمكن إلغاء الرسالة المطلوبة</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRevokeMsg">نوع المجموعة لا يدعم إلغاء الرسائل</string>
|
||||
<string name="TUIKitErrorSVRGroupRemoveMsgDeny">لا يمكن حذف هذا النوع من الرسائل</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRemoveMsg">لا يدعم غرف الدردشة الصوتية والمرئية والمجموعات الكبيرة للأعضاء عبر الإنترنت حذف الرسائل</string>
|
||||
<string name="TUIKitErrorSVRGroupAvchatRoomCountLimit">تجاوز الحد الأقصى لعدد غرف الدردشة الصوتية والمرئية المنشأة</string>
|
||||
<string name="TUIKitErrorSVRGroupCountLimit">تجاوز الحد الأقصى لعدد المجموعات التي يمكن للمستخدم إنشاؤها أو الانضمام إليها</string>
|
||||
<string name="TUIKitErrorSVRGroupMemberCountLimit">تجاوز الحد الأقصى لعدد أعضاء المجموعة</string>
|
||||
<string name="TUIKitErrorSVRNoSuccessResult">لا توجد نتائج ناجحة للعملية الجماعية</string>
|
||||
<string name="TUIKitErrorSVRToUserInvalid">IM: المستلم غير صالح</string>
|
||||
<string name="TUIKitErrorSVRRequestTimeout">انتهت مهلة الطلب</string>
|
||||
<string name="TUIKitErrorSVRInitCoreFail">فشل تهيئة وحدة INIT CORE</string>
|
||||
<string name="TUIKitErrorExpiredSessionNode">SessionNode غير صالح</string>
|
||||
<string name="TUIKitErrorLoggedOutBeforeLoginFinished">تم تسجيل الخروج قبل الانتهاء من تسجيل الدخول (تم الإرجاع أثناء تسجيل الدخول)</string>
|
||||
<string name="TUIKitErrorTLSSDKNotInitialized">لم يتم تهيئة tlssdk</string>
|
||||
<string name="TUIKitErrorTLSSDKUserNotFound">لم يتم العثور على معلومات المستخدم المطلوبة في TLSSDK</string>
|
||||
<string name="TUIKitErrorBindFaildRegTimeout">انتهت مهلة التسجيل</string>
|
||||
<string name="TUIKitErrorBindFaildIsBinding">جاري الآن عملية الربط</string>
|
||||
<string name="TUIKitErrorPacketFailUnknown">خطأ غير معروف في إرسال الحزمة</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoNet">لا يوجد اتصال بالشبكة عند إرسال حزمة الطلب، يتم تحويلها إلى حالة ERR_REQ_NO_NET_ON_REQ عند المعالجة</string>
|
||||
<string name="TUIKitErrorPacketFailRespNoNet">لا يوجد اتصال بالشبكة عند إرسال حزمة الرد، يتم تحويلها إلى حالة ERR_REQ_NO_NET_ON_RSP عند المعالجة</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoAuth">لا يوجد صلاحية عند إرسال حزمة الطلب</string>
|
||||
<string name="TUIKitErrorPacketFailSSOErr">خطأ في SSO</string>
|
||||
<string name="TUIKitErrorPacketFailRespTimeout">انتهت مهلة الرد</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncing">proxy_manager لم يكمل مزامنة بيانات svr</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncedFail">فشل مزامنة proxy_manager</string>
|
||||
<string name="TUIKitErrorFriendshipProxyLocalCheckErr">معلومات الطلب في proxy_manager غير صالحة عند التحقق المحلي</string>
|
||||
<string name="TUIKitErrorGroupInvalidField">حقل غير محدد موجود في طلب مساعد المجموعة</string>
|
||||
<string name="TUIKitErrorGroupStoreageDisabled">لم يتم تمكين تخزين معلومات المجموعة في مساعد المجموعة</string>
|
||||
<string name="TUIKitErrorLoadGrpInfoFailed">تعذر تحميل معلومات المجموعة من التخزين</string>
|
||||
<string name="TUIKitErrorReqNoNetOnReq">لا يوجد اتصال بالشبكة أثناء الطلب</string>
|
||||
<string name="TUIKitErrorReqNoNetOnResp">لا يوجد اتصال بالشبكة أثناء الاستجابة</string>
|
||||
<string name="TUIKitErrorServiceNotReady">خدمة QALSDK غير جاهزة</string>
|
||||
<string name="TUIKitErrorLoginAuthFailed">فشلت مصادقة الحساب (فشل الحصول على معلومات المستخدم)</string>
|
||||
<string name="TUIKitErrorNeverConnectAfterLaunch">لم يتم محاولة الاتصال بالإنترنت بعد تشغيل التطبيق</string>
|
||||
<string name="TUIKitErrorReqFailed">فشل تنفيذ QAL</string>
|
||||
<string name="TUIKitErrorReqInvaidReq">طلب غير صالح، toMsgService غير صالح</string>
|
||||
<string name="TUIKitErrorReqOnverLoaded">طابور الانتظار ممتلئ</string>
|
||||
<string name="TUIKitErrorReqKickOff">تم طردك بالفعل من قبل جهاز آخر</string>
|
||||
<string name="TUIKitErrorReqServiceSuspend">تم إيقاف الخدمة مؤقتًا</string>
|
||||
<string name="TUIKitErrorReqInvalidSign">توقيع SSO غير صالح</string>
|
||||
<string name="TUIKitErrorReqInvalidCookie">ملف تعريف الارتباط SSO غير صالح</string>
|
||||
<string name="TUIKitErrorLoginTlsRspParseFailed">فشل التحقق من حزمة الرد TLS أثناء تسجيل الدخول، طول حزمة الجسم غير صحيح</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgTimeout">انتهت مهلة تقرير حالة OPENSTATSVC إلى OPENMSG أثناء تسجيل الدخول</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgRspParseFailed">فشل تحليل حزمة الرد عند تقرير حالة OPENSTATSVC إلى OPENMSG أثناء تسجيل الدخول</string>
|
||||
<string name="TUIKitErrorLoginTslDecryptFailed">فشل فك تشفير TLS أثناء تسجيل الدخول</string>
|
||||
<string name="TUIKitErrorWifiNeedAuth">يتطلب الواي فاي المصادقة</string>
|
||||
<string name="TUIKitErrorUserCanceled">ألغى المستخدم</string>
|
||||
<string name="TUIkitErrorRevokeTimeLimitExceed">تجاوزت الحد الزمني لسحب الرسالة (الافتراضي 2 دقيقة)</string>
|
||||
<string name="TUIKitErrorLackUGExt">يفتقر إلى حزمة UGC الموسعة</string>
|
||||
<string name="TUIKitErrorAutoLoginNeedUserSig">تسجيل الدخول التلقائي، انتهت صلاحية التذكرة المحلية، يتطلب تسجيل الدخول اليدوي باستخدام userSig</string>
|
||||
<string name="TUIKitErrorQALNoShortConneAvailable">لا يوجد اتصال قصير SSO متاح</string>
|
||||
<string name="TUIKitErrorReqContentAttach">تعرض محتوى الرسالة لهجوم أمني</string>
|
||||
<string name="TUIKitErrorLoginSigExpire">انتهت صلاحية التذكرة عند تسجيل الدخول</string>
|
||||
<string name="TUIKitErrorSDKHadInit">تم تهيئة SDK بالفعل ولا يلزم إعادة التهيئة</string>
|
||||
<string name="TUIKitErrorOpenBDHBase">رمز خطأ openbdh</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnReq">لا يوجد اتصال بالشبكة أثناء الطلب، يرجى المحاولة مرة أخرى عند استعادة الاتصال بالشبكة</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnRsp">لا يوجد اتصال بالشبكة أثناء الاستجابة، يرجى المحاولة مرة أخرى عند استعادة الاتصال بالشبكة</string>
|
||||
<string name="TUIKitErrorRequestOnverLoaded">طابور الانتظار ممتلئ</string>
|
||||
<string name="TUIKitErrorEnableUserStatusOnConsole">لم تقم بتمكين ميزة حالة المستخدم، يرجى تسجيل الدخول إلى لوحة التحكم وتمكينها</string>
|
||||
</resources>
|
||||
17
tuicore/src/main/res/values-ar/strings.xml
Normal file
17
tuicore/src/main/res/values-ar/strings.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="open_file_tips">اختيار التطبيق الذي تريد فتح هذا الملف به</string>
|
||||
|
||||
<string name="sure">موافق</string>
|
||||
<string name="cancel">إلغاء</string>
|
||||
<string name="core_permission_dialog_title">طلب الإذن</string>
|
||||
<string name="core_permission_dialog_positive_setting_text">الذهاب إلى الإعدادات</string>
|
||||
<string name="date_year_short">سنة</string>
|
||||
<string name="date_month_short">شهر</string>
|
||||
<string name="date_day_short">يوم</string>
|
||||
<string name="date_hour_short">ساعة</string>
|
||||
<string name="date_minute_short">دقيقة</string>
|
||||
<string name="date_second_short">ثانية</string>
|
||||
<string name="date_yesterday">أمس</string>
|
||||
|
||||
</resources>
|
||||
299
tuicore/src/main/res/values-zh-rHK/im_error_msg.xml
Normal file
299
tuicore/src/main/res/values-zh-rHK/im_error_msg.xml
Normal file
@@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="TUIKitErrorInProcess">執行中</string>
|
||||
<string name="TUIKitErrorInvalidParameters">參數無效</string>
|
||||
<string name="TUIKitErrorIOOperateFaild">操作本地 IO 錯誤</string>
|
||||
<string name="TUIKitErrorInvalidJson">錯誤的 JSON 格式</string>
|
||||
<string name="TUIKitErrorOutOfMemory">內存不足</string>
|
||||
<string name="TUIKitErrorParseResponseFaild">PB 解析失敗</string>
|
||||
<string name="TUIKitErrorSerializeReqFaild">PB 序列化失敗</string>
|
||||
<string name="TUIKitErrorSDKNotInit">IM SDK 未初始化</string>
|
||||
<string name="TUIKitErrorLoadMsgFailed">加載本地數據庫操作失敗</string>
|
||||
<string name="TUIKitErrorDatabaseOperateFailed">本地數據庫操作失敗</string>
|
||||
<string name="TUIKitErrorCrossThread">跨線程錯誤</string>
|
||||
<string name="TUIKitErrorTinyIdEmpty">用戶信息為空</string>
|
||||
<string name="TUIKitErrorInvalidIdentifier">Identifier 非法</string>
|
||||
<string name="TUIKitErrorFileNotFound">文件不存在</string>
|
||||
<string name="TUIKitErrorFileTooLarge">文件大小超出了限制</string>
|
||||
<string name="TUIKitErrorEmptyFile">空文件</string>
|
||||
<string name="TUIKitErrorFileOpenFailed">文件打開失敗</string>
|
||||
<string name="TUIKitErrorNotLogin">IM SDK 未登錄</string>
|
||||
<string name="TUIKitErrorNoPreviousLogin">並沒有登錄過該用戶</string>
|
||||
<string name="TUIKitErrorUserSigExpired">UserSig 過期</string>
|
||||
<string name="TUIKitErrorLoginKickedOffByOther">其他終端登錄同一帳號</string>
|
||||
<string name="TUIKitErrorTLSSDKInit">TLS SDK 初始化失敗</string>
|
||||
<string name="TUIKitErrorTLSSDKUninit">TLS SDK 未初始化</string>
|
||||
<string name="TUIKitErrorTLSSDKTRANSPackageFormat">TLS SDK TRANS 包格式錯誤</string>
|
||||
<string name="TUIKitErrorTLSDecrypt">TLS SDK 解密失敗</string>
|
||||
<string name="TUIKitErrorTLSSDKRequest">TLS SDK 請求失敗</string>
|
||||
<string name="TUIKitErrorTLSSDKRequestTimeout">TLS SDK 請求超時</string>
|
||||
<string name="TUIKitErrorInvalidConveration">會話無效</string>
|
||||
<string name="TUIKitErrorFileTransAuthFailed">文件傳輸鑒權失敗</string>
|
||||
<string name="TUIKitErrorFileTransNoServer">文件傳輸獲取 Server 列表失敗</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailed">文件傳輸上傳失敗,請檢查網絡是否連接</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailedNotImage">文件傳輸上傳失敗,請檢查上傳的圖片是否能夠正常打開</string>
|
||||
<string name="TUIKitErrorFileTransDownloadFailed">文件傳輸下載失敗,請檢查網絡,或者文件、語音是否已經過期</string>
|
||||
<string name="TUIKitErrorHTTPRequestFailed">HTTP 請求失敗</string>
|
||||
<string name="TUIKitErrorInvalidMsgElem">IM SDK 無效消息 elem</string>
|
||||
<string name="TUIKitErrorInvalidSDKObject">無效的對象</string>
|
||||
<string name="TUIKitSDKMsgBodySizeLimit">消息長度超出限制</string>
|
||||
<string name="TUIKitErrorSDKMsgKeyReqDifferRsp">消息 KEY 錯誤</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidID">群組 ID 非法,自定義群組 ID 必須為可打印 ASCII 字符(0x20-0x7e),最長48個字節,且前綴不能為 @TGS#</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidName">群名稱非法,群名稱最長30字節</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidIntroduction">群簡介非法,群簡介最長240字節</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNotification">群公告非法,群公告最長300字節</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidFaceURL">群頭像 URL 非法,群頭像 URL 最長100字節</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNameCard">群名片非法,群名片最長50字節</string>
|
||||
<string name="TUIKitErrorSDKGroupMemberCountLimit">超過群組成員數的限制</string>
|
||||
<string name="TUIKitErrorSDKGroupJoinPrivateGroupDeny">不允許申請加入 Private 群組</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteSuperDeny">不允許邀請角色為群主的成員</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteNoMember">不允許邀請0個成員</string>
|
||||
<string name="TUIKitErrorSDKGroupPinnedMessageCountLimit">置頂消息數量超過上限</string>
|
||||
<string name="TUIKitErrorSDKFriendShipInvalidProfileKey">資料字段非法</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddRemark">備註字段非法,最大96字節</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddWording">請求添加好友的請求說明字段非法,最大120字節</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddSource">請求添加好友的添加來源字段非法,來源需要添加“AddSource_Type_”前綴。</string>
|
||||
<string name="TUIKitErrorSDKFriendshipFriendGroupEmpty">好友分組字段非法,必須不為空,每個分組的名稱最長30字節</string>
|
||||
<string name="TUIKitErrorSDKNetEncodeFailed">網絡鏈接加密失敗</string>
|
||||
<string name="TUIKitErrorSDKNetDecodeFailed">網絡鏈接解密失敗</string>
|
||||
<string name="TUIKitErrorSDKNetAuthInvalid">網絡鏈接未完成鑒權</string>
|
||||
<string name="TUIKitErrorSDKNetCompressFailed">數據包壓縮失敗</string>
|
||||
<string name="TUIKitErrorSDKNetUncompressFaile">數據包解壓失敗</string>
|
||||
<string name="TUIKitErrorSDKNetFreqLimit">調用頻率限制,最大每秒發起5次請求</string>
|
||||
<string name="TUIKitErrorSDKnetReqCountLimit">請求隊列滿,超過同時請求的數量限制,最大同時發起1000個請求。</string>
|
||||
<string name="TUIKitErrorSDKNetDisconnect">網絡已斷開,未建立連接,或者建立 socket 連接時,檢測到無網絡。</string>
|
||||
<string name="TUIKitErrorSDKNetAllreadyConn">網絡連接已建立,重複創建連接</string>
|
||||
<string name="TUIKitErrorSDKNetConnTimeout">建立網絡連接超時,請等網絡恢復後重試。</string>
|
||||
<string name="TUIKitErrorSDKNetConnRefuse">網絡連接已被拒絕,請求過於頻繁,服務端拒絕服務。</string>
|
||||
<string name="TUIKitErrorSDKNetNetUnreach">沒有到達網絡的可用路由,請等網絡恢復後重試。</string>
|
||||
<string name="TUIKitErrorSDKNetSocketNoBuff">系統中沒有足夠的緩衝區空間資源可用來完成調用,系統過於繁忙,內部錯誤。</string>
|
||||
<string name="TUIKitERRORSDKNetResetByPeer">對端重置了連接</string>
|
||||
<string name="TUIKitErrorSDKNetSOcketInvalid">socket 套接字無效</string>
|
||||
<string name="TUIKitErrorSDKNetHostGetAddressFailed">IP 地址解析失敗</string>
|
||||
<string name="TUIKitErrorSDKNetConnectReset">網絡連接到中間節點或服務端重置</string>
|
||||
<string name="TUIKitErrorSDKNetWaitInQueueTimeout">請求包等待進入待發送隊列超時</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeout">請求包已進入待發送隊列,等待進入系統的網絡 buffer 超時</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeut">請求包已進入系統的網絡 buffer,等待服務端回包超時</string>
|
||||
<string name="TUIKitErrorSDKWaitSendRemainingTimeout">請求包已進入待發送隊列,部分數據已發送,等待發送剩餘部分出現超時,可能上行帶寬不足,請檢查網絡是否暢通,在回調錯誤時檢測有聯網,內部錯誤</string>
|
||||
<string name="TUIKitErrorSDKNetPKGSizeLimit">請求包長度大於限制,最大支持 1MB 。</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeoutNoNetwork">請求包已進入待發送隊列,等待進入系統的網絡 buffer 超時,數據包較多 或 發送線程處理不過來,在回調錯誤碼時檢測到沒有聯網。</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeoutNoNetwork">請求包已進入系統的網絡 buffer ,等待服務端回包超時,可能請求包沒離開終端設備、中間路由丟棄、服務端意外丟包或回包被系統網絡層丟棄,在回調錯誤碼時檢測到沒有聯網。</string>
|
||||
<string name="TUIKitErrorSDKNetRemainingTimeoutNoNetwork">請求包已進入待發送隊列,部分數據已發送,等待發送剩餘部分出現超時,可能上行帶寬不足,請檢查網絡是否暢通,在回調錯誤碼時檢測到沒有聯網。</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOConnectLimit">Server 的連接數量超出限制,服務端拒絕服務。</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOVCode">驗證碼下發超時。</string>
|
||||
<string name="TUIKitErrorSVRSSOD2Expired">Key 過期。Key 是根據 UserSig 生成的內部票據,Key 的有效期小於或等於 UserSig 的有效期。請重新調用 TIMManager.getInstance().login 登錄接口生成新的 Key。</string>
|
||||
<string name="TUIKitErrorSVRA2UpInvalid">Ticket 過期。Ticket 是根據 UserSig 生成的內部票據,Ticket 的有效期小於或等於 UserSig 的有效期。請重新調用 TIMManager.getInstance().login 登錄接口生成新的 Ticket。</string>
|
||||
<string name="TUIKitErrorSVRA2DownInvalid">票據驗證沒通過或者被安全打擊。請重新調用 TIMManager.getInstance().login 登錄接口生成新的票據。</string>
|
||||
<string name="TUIKitErrorSVRSSOEmpeyKey">不允許空 Key。</string>
|
||||
<string name="TUIKitErrorSVRSSOUinInvalid">Key 中的帳號和請求包頭的帳號不匹配。</string>
|
||||
<string name="TUIKitErrorSVRSSOVCodeTimeout">驗證碼下發超時。</string>
|
||||
<string name="TUIKitErrorSVRSSONoImeiAndA2">需要帶上 Key 和 Ticket。</string>
|
||||
<string name="TUIKitErrorSVRSSOCookieInvalid">Cookie 檢查不匹配。</string>
|
||||
<string name="TUIKitErrorSVRSSODownTips">下發提示語,Key 過期。</string>
|
||||
<string name="TUIKitErrorSVRSSODisconnect">斷鏈鎖屏。</string>
|
||||
<string name="TUIKitErrorSVRSSOIdentifierInvalid">失效身份。</string>
|
||||
<string name="TUIKitErrorSVRSSOClientClose">終端自動退出。</string>
|
||||
<string name="TUIKitErrorSVRSSOMSFSDKQuit">MSFSDK 自動退出。</string>
|
||||
<string name="TUIKitErrorSVRSSOD2KeyWrong">解密失敗次數超過閾值,通知終端需要重置,請重新調用 TIMManager.getInstance().login 登錄接口生成新的 Key。</string>
|
||||
<string name="TUIKitErrorSVRSSOUnsupport">不支持聚合,給終端返回統一的錯誤碼。終端在該 TCP 長連接上停止聚合。</string>
|
||||
<string name="TUIKitErrorSVRSSOPrepaidArrears">預付費欠費。</string>
|
||||
<string name="TUIKitErrorSVRSSOPacketWrong">請求包格式錯誤。</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidBlackList">SDKAppID 黑名單。</string>
|
||||
<string name="TUIKitErrorSVRSSOCmdBlackList">SDKAppID 設置 service cmd 黑名單。</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidWithoutUsing">SDKAppID 停用。</string>
|
||||
<string name="TUIKitErrorSVRSSOFreqLimit">頻率限制(用戶),頻率限制是設置針對某一個協議的每秒請求數的限制。</string>
|
||||
<string name="TUIKitErrorSVRSSOOverload">過載丟包(系統),連接的服務端處理過多請求,處理不過來,拒絕服務。</string>
|
||||
<string name="TUIKitErrorSVRResNotFound">要發送的資源文件不存在。</string>
|
||||
<string name="TUIKitErrorSVRResAccessDeny">要發送的資源文件不允許訪問。</string>
|
||||
<string name="TUIKitErrorSVRResSizeLimit">文件大小超過限制。</string>
|
||||
<string name="TUIKitErrorSVRResSendCancel">用戶取消發送,如發送過程中登出等原因。</string>
|
||||
<string name="TUIKitErrorSVRResReadFailed">讀取文件內容失敗。</string>
|
||||
<string name="TUIKitErrorSVRResTransferTimeout">資源文件傳輸超時</string>
|
||||
<string name="TUIKitErrorSVRResInvalidParameters">參數非法。</string>
|
||||
<string name="TUIKitErrorSVRResInvalidFileMd5">文件 MD5 校驗失敗。</string>
|
||||
<string name="TUIKitErrorSVRResInvalidPartMd5">分片 MD5 校驗失敗。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidHttpUrl">HTTP 解析錯誤,請檢查 HTTP 請求 URL 格式。</string>
|
||||
<string name="TUIKitErrorSVRCommomReqJsonParseFailed">HTTP 請求 JSON 解析錯誤,請檢查 JSON 格式。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidAccount">請求 URI 或 JSON 包體中 Identifier 或 UserSig 錯誤。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidSdkappid">SDKAppID 失效,請核對 SDKAppID 有效性。</string>
|
||||
<string name="TUIKitErrorSVRCommonRestFreqLimit">REST 接口調用頻率超過限制,請降低請求頻率。</string>
|
||||
<string name="TUIKitErrorSVRCommonRequestTimeout">服務請求超時或 HTTP 請求格式錯誤,請檢查並重試。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidRes">請求資源錯誤,請檢查請求 URL。</string>
|
||||
<string name="TUIKitErrorSVRCommonIDNotAdmin">REST API 請求的 Identifier 欄位請填寫 App 管理員帳號。</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidFreqLimit">SDKAppID 請求頻率超限,請降低請求頻率。</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidMiss">REST 接口需要帶 SDKAppID,請檢查請求 URL 中的 SDKAppID。</string>
|
||||
<string name="TUIKitErrorSVRCommonRspJsonParseFailed">HTTP 響應包 JSON 解析錯誤。</string>
|
||||
<string name="TUIKitErrorSVRCommonExchangeAccountTimeout">置換帳號超時。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidIdFormat">請求包體 Identifier 類型錯誤,請確認 Identifier 為字符串格式。</string>
|
||||
<string name="TUIKitErrorSVRCommonSDkappidForbidden">SDKAppID 被禁用</string>
|
||||
<string name="TUIKitErrorSVRCommonReqForbidden">請求被禁用</string>
|
||||
<string name="TUIKitErrorSVRCommonReqFreqLimit">請求過於頻繁,請稍後重試。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidService">未購買套餐包,或套餐包已過期,或購買的套餐包正在配置中暫未生效。請登錄 即時通信 IM 購買頁面 重新購買套餐包。購買後,將在5分鐘後生效。</string>
|
||||
<string name="TUIKitErrorSVRCommonSensitiveText">文本安全打擊,文本中可能包含敏感詞匯。</string>
|
||||
<string name="TUIKitErrorSVRCommonBodySizeLimit">發消息包體過長,目前支持最大12k消息包體長度,請減少包體大小重試。</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigExpired">UserSig 已過期,請重新生成 UserSig</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigEmpty">UserSig 長度為0</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigCheckFailed">UserSig 校驗失敗</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchPublicKey">用公鑰驗證 UserSig 失敗</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchId">請求的 Identifier 與生成 UserSig 的 Identifier 不匹配。</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchSdkAppid">請求的 SDKAppID 與生成 UserSig 的 SDKAppID 不匹配。</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigPublicKeyNotFound">驗證 UserSig 時公鑰不存在</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigSdkAppidNotFount">SDKAppID 未找到,請在雲通信 IM 控制台確認應用信息。</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidUserSig">UserSig 已經失效,請重新生成,再次嘗試。</string>
|
||||
<string name="TUIKitErrorSVRAccountNotFound">請求的用戶帳號不存在。</string>
|
||||
<string name="TUIKitErrorSVRAccountSecRstr">安全原因被限制。</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalTimeout">服務端內部超時,請重試。</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidCount">請求中批量數量不合法。</string>
|
||||
<string name="TUIkitErrorSVRAccountINvalidParameters">參數非法,請檢查必填字段是否填充,或者字段的填充是否滿足協議要求。</string>
|
||||
<string name="TUIKitErrorSVRAccountAdminRequired">請求需要 App 管理員權限。</string>
|
||||
<string name="TUIKitErrorSVRAccountLowSDKVersion">您的SDK版本過低,請升級到最新版本。</string>
|
||||
<string name="TUIKitErrorSVRAccountFreqLimit">因失敗且重試次數過多導致被限制,請檢查 UserSig 是否正確,一分鐘之後再試。</string>
|
||||
<string name="TUIKitErrorSVRAccountBlackList">帳號被拉入黑名單。</string>
|
||||
<string name="TUIKitErrorSVRAccountCountLimit">創建帳號數量超過免費體驗版數量限制,請升級為專業版。</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalError">服務端內部錯誤,請重試。</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidParameters">請求參數錯誤,請根據錯誤描述檢查請求是否正確。</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountMiss">請求參數錯誤,沒有指定需要拉取資料的用戶帳號。</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountNotFound">請求的用戶帳號不存在。</string>
|
||||
<string name="TUIKitErrorSVRProfileAdminRequired">請求需要 App 管理員權限。</string>
|
||||
<string name="TUIKitErrorSVRProfileSensitiveText">資料字段中包含敏感詞。</string>
|
||||
<string name="TUIKitErrorSVRProfileInternalError">服務端內部錯誤,請稍後重試。</string>
|
||||
<string name="TUIKitErrorSVRProfileReadWritePermissionRequired">沒有資料字段的讀權限,詳情可參見 資料字段。</string>
|
||||
<string name="TUIKitErrorSVRProfileTagNotFound">資料字段的 Tag 不存在。</string>
|
||||
<string name="TUIKitErrorSVRProfileSizeLimit">資料字段的 Value 長度超過500字節。</string>
|
||||
<string name="TUIKitErrorSVRProfileValueError">標配資料字段的 Value 錯誤,詳情可參見 標配資料字段。</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidValueFormat">資料字段的 Value 類型不匹配,詳情可參見 標配資料字段。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidParameters">請求參數錯誤,請根據錯誤描述檢查請求是否正確。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidSdkAppid">SDKAppID 不匹配。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAccountNotFound">請求的用戶帳號不存在。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAdminRequired">請求需要 App 管理員權限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipSensitiveText">關係鏈字段中包含敏感詞。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipNetTimeout">網絡超時,請稍後重試。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipWriteConflict">並發寫導致寫衝突,建議使用批量方式。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendDeny">後台禁止該用戶發起加好友請求。</string>
|
||||
<string name="TUIkitErrorSVRFriendshipCountLimit">自己的好友數已達系統上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipGroupCountLimit">分組已達系統上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyLimit">未決數已達系統上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipBlacklistLimit">黑名單數已達系統上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPeerFriendLimit">對方的好友數已達系統上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAlreadyFriends">已經存在好友關係。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInSelfBlacklist">對方在自己的黑名單中,不允許加好友。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeDenyAny">對方的加好友驗證方式是不允許任何人添加自己為好友。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInPeerBlackList">自己在對方的黑名單中,不允許加好友。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeNeedConfirm">請求已發送,等待對方同意</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendSecRstr">添加好友請求被安全策略打擊,請勿頻繁發起添加好友請求。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyNotFound">請求的未決不存在。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipDelFriendSecRstr">刪除好友請求被安全策略打擊,請勿頻繁發起刪除好友請求。</string>
|
||||
<string name="TUIKirErrorSVRFriendAccountNotFoundEx">請求的用戶帳號不存在。</string>
|
||||
<string name="TUIKitErrorSVRMsgPkgParseFailed">解析請求包失敗。</string>
|
||||
<string name="TUIKitErrorSVRMsgInternalAuthFailed">內部鑒權失敗。</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidId">Identifier 無效</string>
|
||||
<string name="TUIKitErrorSVRMsgNetError">網絡異常,請重試。</string>
|
||||
<string name="TUIKitErrorSVRMsgPushDeny">觸發發送單聊消息之前回調,App 後台返回禁止下發該消息。</string>
|
||||
<string name="TUIKitErrorSVRMsgInPeerBlackList">發送單聊消息,被對方拉黑,禁止發送。</string>
|
||||
<string name="TUIKitErrorSVRMsgBothNotFriend">消息發送雙方互相不是好友,禁止發送。</string>
|
||||
<string name="TUIKitErrorSVRMsgNotPeerFriend">發送單聊消息,自己不是對方的好友(單向關係),禁止發送。</string>
|
||||
<string name="TUIkitErrorSVRMsgNotSelfFriend">發送單聊消息,對方不是自己的好友(單向關係),禁止發送。</string>
|
||||
<string name="TUIKitErrorSVRMsgShutupDeny">因禁言,禁止發送消息。</string>
|
||||
<string name="TUIKitErrorSVRMsgRevokeTimeLimit">消息撤回超過了時間限制(默認2分鐘)。</string>
|
||||
<string name="TUIKitErrorSVRMsgDelRambleInternalError">刪除漫遊內部錯誤。</string>
|
||||
<string name="TUIKitErrorSVRMsgJsonParseFailed">JSON 格式解析失敗,請檢查請求包是否符合 JSON 規範。</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonBodyFormat">JSON 格式請求包中 MsgBody 不符合消息格式描述</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidToAccount">JSON 格式請求包體中缺少 To_Account 字段或者 To_Account 字段不是 Integer 類型</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidRand">JSON 格式請求包體中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 類型</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidTimestamp">JSON 格式請求包體中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 類型</string>
|
||||
<string name="TUIKitErrorSVRMsgBodyNotArray">JSON 格式請求包體中 MsgBody 類型不是 Array 類型</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonFormat">JSON 格式請求包不符合消息格式描述</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountCountLimit">批量發消息目標帳號超過500</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountNotFound">To_Account 沒有註冊或不存在</string>
|
||||
<string name="TUIKitErrorSVRMsgTimeLimit">消息離線存儲時間錯誤(最多不能超過7天)。</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidSyncOtherMachine">JSON 格式請求包體中 SyncOtherMachine 字段不是 Integer 類型</string>
|
||||
<string name="TUIkitErrorSVRMsgInvalidMsgLifeTime">JSON 格式請求包體中 MsgLifeTime 字段不是 Integer 類型</string>
|
||||
<string name="TUIKitErrorSVRMsgBodySizeLimit">JSON 資料包超長,消息包體請不要超過12k。</string>
|
||||
<string name="TUIKitErrorSVRmsgLongPollingCountLimit">Web 端長輪詢被踢(Web 端同時在線實例個數超出限制)。</string>
|
||||
<string name="TUIKitErrorUnsupporInterface">該功能僅限旗艦版使用,請升級至旗艦版。</string>
|
||||
<string name="TUIKitErrorUnsupporInterfaceSuffix">功能僅限旗艦版使用,請升級至旗艦版。</string>
|
||||
|
||||
<string name="TUIKitErrorSVRGroupApiNameError">請求中的接口名稱錯誤</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountCountLimit">請求包體中攜帶的帳號數量過多。</string>
|
||||
<string name="TUIkitErrorSVRGroupFreqLimit">操作頻率限制,請嘗試降低調用的頻率。</string>
|
||||
<string name="TUIKitErrorSVRGroupPermissionDeny">操作權限不足</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidReq">請求非法</string>
|
||||
<string name="TUIKitErrorSVRGroupSuperNotAllowQuit">該群不允許群主主動退出。</string>
|
||||
<string name="TUIKitErrorSVRGroupNotFound">群組不存在</string>
|
||||
<string name="TUIKitErrorSVRGroupJsonParseFailed">解析 JSON 包體失敗,請檢查包體的格式是否符合 JSON 格式。</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidId">發起操作的 Identifier 非法,請檢查發起操作的用戶 Identifier 是否填寫正確。</string>
|
||||
<string name="TUIKitErrorSVRGroupAllreadyMember">已經是群成員。</string>
|
||||
<string name="TUIKitErrorSVRGroupFullMemberCount">群已滿員,無法將請求中的用戶加入群組</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidGroupId">群組 ID 非法,請檢查群組 ID 是否填寫正確。</string>
|
||||
<string name="TUIKitErrorSVRGroupRejectFromThirdParty">App 後台通過第三方回調拒絕本次操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupShutDeny">因被禁言而不能發送消息,請檢查發送者是否被設置禁言。</string>
|
||||
<string name="TUIKitErrorSVRGroupRspSizeLimit">應答包長度超過最大包長</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountNotFound">請求的用戶帳號不存在。</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdInUse">群組 ID 已被使用,請選擇其他的群組 ID。</string>
|
||||
<string name="TUIKitErrorSVRGroupSendMsgFreqLimit">發消息的頻率超限,請延長兩次發消息時間的間隔。</string>
|
||||
<string name="TUIKitErrorSVRGroupReqAllreadyBeenProcessed">此邀請或者申請請求已經被處理。</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdUserdForSuper">群組 ID 已被使用,並且操作者為群主,可以直接使用。</string>
|
||||
<string name="TUIKitErrorSVRGroupSDkAppidDeny">該 SDKAppID 請求的命令字已被禁用</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgNotFound">請求撤回的消息不存在。</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgTimeLimit">消息撤回超過了時間限制(默認2分鐘)。</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgDeny">請求撤回的消息不支持撤回操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRevokeMsg">群組類型不支持消息撤回操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupRemoveMsgDeny">該消息類型不支持刪除操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRemoveMsg">音視頻聊天室和在線成員廣播大群不支持刪除消息。</string>
|
||||
<string name="TUIKitErrorSVRGroupAvchatRoomCountLimit">音視頻聊天室創建數量超過了限制</string>
|
||||
<string name="TUIKitErrorSVRGroupCountLimit">單個用戶可創建和加入的群組數量超過了限制”。</string>
|
||||
<string name="TUIKitErrorSVRGroupMemberCountLimit">群成員數量超過限制</string>
|
||||
<string name="TUIKitErrorSVRNoSuccessResult">批量操作無成功結果</string>
|
||||
<string name="TUIKitErrorSVRToUserInvalid">IM: 無效接收方</string>
|
||||
<string name="TUIKitErrorSVRRequestTimeout">請求超時</string>
|
||||
<string name="TUIKitErrorSVRInitCoreFail">INIT CORE模塊失敗</string>
|
||||
<string name="TUIKitErrorExpiredSessionNode">SessionNode為null</string>
|
||||
<string name="TUIKitErrorLoggedOutBeforeLoginFinished">在登錄完成前進行了登出(在登錄時返回)</string>
|
||||
<string name="TUIKitErrorTLSSDKNotInitialized">tlssdk未初始化</string>
|
||||
<string name="TUIKitErrorTLSSDKUserNotFound">TLSSDK沒有找到相應的用戶信息</string>
|
||||
<string name="TUIKitErrorBindFaildRegTimeout">註冊超時</string>
|
||||
<string name="TUIKitErrorBindFaildIsBinding">正在bind操作中</string>
|
||||
<string name="TUIKitErrorPacketFailUnknown">發包未知錯誤</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoNet">發送請求包時沒有網絡,處理時轉換成case ERR_REQ_NO_NET_ON_REQ:</string>
|
||||
<string name="TUIKitErrorPacketFailRespNoNet">發送回覆包時沒有網絡,處理時轉換成case ERR_REQ_NO_NET_ON_RSP:</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoAuth">發送請求包時沒有權限</string>
|
||||
<string name="TUIKitErrorPacketFailSSOErr">SSO錯誤</string>
|
||||
<string name="TUIKitErrorPacketFailRespTimeout">回覆超時</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncing">proxy_manager沒有完成svr數據同步</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncedFail">proxy_manager同步失敗</string>
|
||||
<string name="TUIKitErrorFriendshipProxyLocalCheckErr">proxy_manager請求參數,在本地檢查不合法</string>
|
||||
<string name="TUIKitErrorGroupInvalidField">group assistant請求字段中包含非預設字段</string>
|
||||
<string name="TUIKitErrorGroupStoreageDisabled">group assistant群資料本地存儲沒有開啟</string>
|
||||
<string name="TUIKitErrorLoadGrpInfoFailed">無法從存儲中加載groupinfo</string>
|
||||
<string name="TUIKitErrorReqNoNetOnReq">請求的時候沒有網絡</string>
|
||||
<string name="TUIKitErrorReqNoNetOnResp">響應的時候沒有網絡</string>
|
||||
<string name="TUIKitErrorServiceNotReady">QALSDK服務未就緒</string>
|
||||
<string name="TUIKitErrorLoginAuthFailed">帳號認證失敗(用戶信息獲取失敗)</string>
|
||||
<string name="TUIKitErrorNeverConnectAfterLaunch">在應用啟動後沒有嘗試聯網</string>
|
||||
<string name="TUIKitErrorReqFailed">QAL執行失敗</string>
|
||||
<string name="TUIKitErrorReqInvaidReq">請求非法,toMsgService非法</string>
|
||||
<string name="TUIKitErrorReqOnverLoaded">請求隊列滿</string>
|
||||
<string name="TUIKitErrorReqKickOff">已經被其他終端踢了</string>
|
||||
<string name="TUIKitErrorReqServiceSuspend">服務被暫停</string>
|
||||
<string name="TUIKitErrorReqInvalidSign">SSO簽名錯誤</string>
|
||||
<string name="TUIKitErrorReqInvalidCookie">SSO cookie無效</string>
|
||||
|
||||
<string name="TUIKitErrorLoginTlsRspParseFailed">登錄時TLS回包校驗,包體長度錯誤</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgTimeout">登錄時OPENSTATSVC向OPENMSG上報狀態超時</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgRspParseFailed">登錄時OPENSTATSVC向OPENMSG上報狀態時解析回包失敗</string>
|
||||
<string name="TUIKitErrorLoginTslDecryptFailed">登錄時TLS解密失敗</string>
|
||||
<string name="TUIKitErrorWifiNeedAuth">wifi需要認證</string>
|
||||
<string name="TUIKitErrorUserCanceled">用戶已取消</string>
|
||||
<string name="TUIkitErrorRevokeTimeLimitExceed">消息撤回超過了時間限制(默認2分鐘)</string>
|
||||
<string name="TUIKitErrorLackUGExt">缺少UGC擴展包</string>
|
||||
<string name="TUIKitErrorAutoLoginNeedUserSig">自動登錄,本地票據過期,需要userSig手動登錄</string>
|
||||
<string name="TUIKitErrorQALNoShortConneAvailable">沒有可用的短連接sso</string>
|
||||
<string name="TUIKitErrorReqContentAttach">消息內容安全打擊</string>
|
||||
<string name="TUIKitErrorLoginSigExpire">登錄返回,票據過期</string>
|
||||
<string name="TUIKitErrorSDKHadInit">SDK 已經初始化無需重複初始化</string>
|
||||
<string name="TUIKitErrorOpenBDHBase">openbdh 錯誤碼</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnReq">請求時沒有網絡,請等網絡恢復後重試</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnRsp">響應時沒有網絡,請等網絡恢復後重試</string>
|
||||
<string name="TUIKitErrorRequestOnverLoaded">請求隊列滿</string>
|
||||
<string name="TUIKitErrorEnableUserStatusOnConsole">您未開啟用戶狀態功能,請先登錄控制台開啟</string>
|
||||
</resources>
|
||||
18
tuicore/src/main/res/values-zh-rHK/strings.xml
Normal file
18
tuicore/src/main/res/values-zh-rHK/strings.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="open_file_tips">選擇要打開此文件的應用</string>
|
||||
|
||||
<string name="sure">確定</string>
|
||||
<string name="cancel">取消</string>
|
||||
<string name="core_permission_dialog_title">權限申請</string>
|
||||
<string name="core_permission_dialog_positive_setting_text">去設置</string>
|
||||
<string name="date_year_short">年</string>
|
||||
<string name="date_month_short">月</string>
|
||||
<string name="date_day_short">天</string>
|
||||
<string name="date_hour_short">時</string>
|
||||
<string name="date_minute_short">分</string>
|
||||
<string name="date_second_short">秒</string>
|
||||
<string name="date_yesterday">昨天</string>
|
||||
|
||||
<string name="core_float_permission_hint">請同時打開\"後台彈出界面\"和\"顯示懸浮窗\"權限</string>
|
||||
</resources>
|
||||
299
tuicore/src/main/res/values-zh/im_error_msg.xml
Normal file
299
tuicore/src/main/res/values-zh/im_error_msg.xml
Normal file
@@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="TUIKitErrorInProcess">执行中</string>
|
||||
<string name="TUIKitErrorInvalidParameters">参数无效</string>
|
||||
<string name="TUIKitErrorIOOperateFaild">操作本地 IO 错误</string>
|
||||
<string name="TUIKitErrorInvalidJson">错误的 JSON 格式</string>
|
||||
<string name="TUIKitErrorOutOfMemory">内存不足</string>
|
||||
<string name="TUIKitErrorParseResponseFaild">PB 解析失败</string>
|
||||
<string name="TUIKitErrorSerializeReqFaild">PB 序列化失败</string>
|
||||
<string name="TUIKitErrorSDKNotInit">IM SDK 未初始化</string>
|
||||
<string name="TUIKitErrorLoadMsgFailed">加载本地数据库操作失败</string>
|
||||
<string name="TUIKitErrorDatabaseOperateFailed">本地数据库操作失败</string>
|
||||
<string name="TUIKitErrorCrossThread">跨线程错误</string>
|
||||
<string name="TUIKitErrorTinyIdEmpty">用户信息为空</string>
|
||||
<string name="TUIKitErrorInvalidIdentifier">Identifier 非法</string>
|
||||
<string name="TUIKitErrorFileNotFound">文件不存在</string>
|
||||
<string name="TUIKitErrorFileTooLarge">文件大小超出了限制</string>
|
||||
<string name="TUIKitErrorEmptyFile">空文件</string>
|
||||
<string name="TUIKitErrorFileOpenFailed">文件打开失败</string>
|
||||
<string name="TUIKitErrorNotLogin">IM SDK 未登陆</string>
|
||||
<string name="TUIKitErrorNoPreviousLogin">并没有登录过该用户</string>
|
||||
<string name="TUIKitErrorUserSigExpired">UserSig 过期</string>
|
||||
<string name="TUIKitErrorLoginKickedOffByOther">其他终端登录同一账号</string>
|
||||
<string name="TUIKitErrorTLSSDKInit">TLS SDK 初始化失败</string>
|
||||
<string name="TUIKitErrorTLSSDKUninit">TLS SDK 未初始化</string>
|
||||
<string name="TUIKitErrorTLSSDKTRANSPackageFormat">TLS SDK TRANS 包格式错误</string>
|
||||
<string name="TUIKitErrorTLSDecrypt">TLS SDK 解密失败</string>
|
||||
<string name="TUIKitErrorTLSSDKRequest">TLS SDK 请求失败</string>
|
||||
<string name="TUIKitErrorTLSSDKRequestTimeout">TLS SDK 请求超时</string>
|
||||
<string name="TUIKitErrorInvalidConveration">会话无效</string>
|
||||
<string name="TUIKitErrorFileTransAuthFailed">文件传输鉴权失败</string>
|
||||
<string name="TUIKitErrorFileTransNoServer">文件传输获取 Server 列表失败</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailed">文件传输上传失败,请检查网络是否连接</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailedNotImage">文件传输上传失败,请检查上传的图片是否能够正常打开</string>
|
||||
<string name="TUIKitErrorFileTransDownloadFailed">文件传输下载失败,请检查网络,或者文件、语音是否已经过期</string>
|
||||
<string name="TUIKitErrorHTTPRequestFailed">HTTP 请求失败</string>
|
||||
<string name="TUIKitErrorInvalidMsgElem">IM SDK 无效消息 elem</string>
|
||||
<string name="TUIKitErrorInvalidSDKObject">无效的对象</string>
|
||||
<string name="TUIKitSDKMsgBodySizeLimit">消息长度超出限制</string>
|
||||
<string name="TUIKitErrorSDKMsgKeyReqDifferRsp">消息 KEY 错误</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidID">群组 ID 非法,自定义群组 ID 必须为可打印 ASCII 字符(0x20-0x7e),最长48个字节,且前缀不能为 @TGS#</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidName">群名称非法,群名称最长30字节</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidIntroduction">群简介非法,群简介最长240字节</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNotification">群公告非法,群公告最长300字节</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidFaceURL">群头像 URL 非法,群头像 URL 最长100字节</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNameCard">群名片非法,群名片最长50字节</string>
|
||||
<string name="TUIKitErrorSDKGroupMemberCountLimit">超过群组成员数的限制</string>
|
||||
<string name="TUIKitErrorSDKGroupJoinPrivateGroupDeny">不允许申请加入 Private 群组</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteSuperDeny">不允许邀请角色为群主的成员</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteNoMember">不允许邀请0个成员</string>
|
||||
<string name="TUIKitErrorSDKGroupPinnedMessageCountLimit">置顶消息数量超过上限</string>
|
||||
<string name="TUIKitErrorSDKFriendShipInvalidProfileKey">资料字段非法</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddRemark">备注字段非法,最大96字节</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddWording">请求添加好友的请求说明字段非法,最大120字节</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddSource">请求添加好友的添加来源字段非法,来源需要添加“AddSource_Type_”前缀。</string>
|
||||
<string name="TUIKitErrorSDKFriendshipFriendGroupEmpty">好友分组字段非法,必须不为空,每个分组的名称最长30字节</string>
|
||||
<string name="TUIKitErrorSDKNetEncodeFailed">网络链接加密失败</string>
|
||||
<string name="TUIKitErrorSDKNetDecodeFailed">网络链接解密失败</string>
|
||||
<string name="TUIKitErrorSDKNetAuthInvalid">网络链接未完成鉴权</string>
|
||||
<string name="TUIKitErrorSDKNetCompressFailed">数据包压缩失败</string>
|
||||
<string name="TUIKitErrorSDKNetUncompressFaile">数据包解压失败</string>
|
||||
<string name="TUIKitErrorSDKNetFreqLimit">调用频率限制,最大每秒发起 5 次请求</string>
|
||||
<string name="TUIKitErrorSDKnetReqCountLimit">请求队列満,超过同时请求的数量限制,最大同时发起1000个请求。</string>
|
||||
<string name="TUIKitErrorSDKNetDisconnect">网络已断开,未建立连接,或者建立 socket 连接时,检测到无网络。</string>
|
||||
<string name="TUIKitErrorSDKNetAllreadyConn">网络连接已建立,重复创建连接</string>
|
||||
<string name="TUIKitErrorSDKNetConnTimeout">建立网络连接超时,请等网络恢复后重试。</string>
|
||||
<string name="TUIKitErrorSDKNetConnRefuse">网络连接已被拒绝,请求过于频繁,服务端拒绝服务。</string>
|
||||
<string name="TUIKitErrorSDKNetNetUnreach">没有到达网络的可用路由,请等网络恢复后重试。</string>
|
||||
<string name="TUIKitErrorSDKNetSocketNoBuff">系统中没有足够的缓冲区空间资源可用来完成调用,系统过于繁忙,内部错误。</string>
|
||||
<string name="TUIKitERRORSDKNetResetByPeer">对端重置了连接</string>
|
||||
<string name="TUIKitErrorSDKNetSOcketInvalid">socket 套接字无效</string>
|
||||
<string name="TUIKitErrorSDKNetHostGetAddressFailed">IP 地址解析失败</string>
|
||||
<string name="TUIKitErrorSDKNetConnectReset">网络连接到中间节点或服务端重置</string>
|
||||
<string name="TUIKitErrorSDKNetWaitInQueueTimeout">请求包等待进入待发送队列超时</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeout">请求包已进入待发送队列,等待进入系统的网络 buffer 超时</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeut">请求包已进入系统的网络 buffer ,等待服务端回包超时</string>
|
||||
<string name="TUIKitErrorSDKWaitSendRemainingTimeout">请求包已进入待发送队列,部分数据已发送,等待发送剩余部分出现超时,可能上行带宽不足,请检查网络是否畅通,在回调错误时检测有联网,内部错误</string>
|
||||
<string name="TUIKitErrorSDKNetPKGSizeLimit">请求包长度大于限制,最大支持 1MB 。</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeoutNoNetwork">请求包已进入待发送队列,等待进入系统的网络 buffer 超时,数据包较多 或 发送线程处理不过来,在回调错误码时检测到没有联网。</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeoutNoNetwork">请求包已进入系统的网络 buffer ,等待服务端回包超时,可能请求包没离开终端设备、中间路由丢弃、服务端意外丢包或回包被系统网络层丢弃,在回调错误码时检测到没有联网。</string>
|
||||
<string name="TUIKitErrorSDKNetRemainingTimeoutNoNetwork">请求包已进入待发送队列,部分数据已发送,等待发送剩余部分出现超时,可能上行带宽不足,请检查网络是否畅通,在回调错误码时检测到没有联网。</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOConnectLimit">Server 的连接数量超出限制,服务端拒绝服务。</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOVCode">验证码下发超时。</string>
|
||||
<string name="TUIKitErrorSVRSSOD2Expired">Key 过期。Key 是根据 UserSig 生成的内部票据,Key 的有效期小于或等于 UserSig 的有效期。请重新调用 TIMManager.getInstance().login 登录接口生成新的 Key。</string>
|
||||
<string name="TUIKitErrorSVRA2UpInvalid">Ticket 过期。Ticket 是根据 UserSig 生成的内部票据,Ticket 的有效期小于或等于 UserSig 的有效期。请重新调用 TIMManager.getInstance().login 登录接口生成新的 Ticket。</string>
|
||||
<string name="TUIKitErrorSVRA2DownInvalid">票据验证没通过或者被安全打击。请重新调用 TIMManager.getInstance().login 登录接口生成新的票据。</string>
|
||||
<string name="TUIKitErrorSVRSSOEmpeyKey">不允许空 Key。</string>
|
||||
<string name="TUIKitErrorSVRSSOUinInvalid">Key 中的账号和请求包头的账号不匹配。</string>
|
||||
<string name="TUIKitErrorSVRSSOVCodeTimeout">验证码下发超时。</string>
|
||||
<string name="TUIKitErrorSVRSSONoImeiAndA2">需要带上 Key 和 Ticket。</string>
|
||||
<string name="TUIKitErrorSVRSSOCookieInvalid">Cookie 检查不匹配。</string>
|
||||
<string name="TUIKitErrorSVRSSODownTips">下发提示语,Key 过期。</string>
|
||||
<string name="TUIKitErrorSVRSSODisconnect">断链锁屏。</string>
|
||||
<string name="TUIKitErrorSVRSSOIdentifierInvalid">失效身份。</string>
|
||||
<string name="TUIKitErrorSVRSSOClientClose">终端自动退出。</string>
|
||||
<string name="TUIKitErrorSVRSSOMSFSDKQuit">MSFSDK 自动退出。</string>
|
||||
<string name="TUIKitErrorSVRSSOD2KeyWrong">解密失败次数超过阈值,通知终端需要重置,请重新调用 TIMManager.getInstance().login 登录接口生成新的 Key。</string>
|
||||
<string name="TUIKitErrorSVRSSOUnsupport">不支持聚合,给终端返回统一的错误码。终端在该 TCP 长连接上停止聚合。</string>
|
||||
<string name="TUIKitErrorSVRSSOPrepaidArrears">预付费欠费。</string>
|
||||
<string name="TUIKitErrorSVRSSOPacketWrong">请求包格式错误。</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidBlackList">SDKAppID 黑名单。</string>
|
||||
<string name="TUIKitErrorSVRSSOCmdBlackList">SDKAppID 设置 service cmd 黑名单。</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidWithoutUsing">SDKAppID 停用。</string>
|
||||
<string name="TUIKitErrorSVRSSOFreqLimit">频率限制(用户),频率限制是设置针对某一个协议的每秒请求数的限制。</string>
|
||||
<string name="TUIKitErrorSVRSSOOverload">过载丢包(系统),连接的服务端处理过多请求,处理不过来,拒绝服务。</string>
|
||||
<string name="TUIKitErrorSVRResNotFound">要发送的资源文件不存在。</string>
|
||||
<string name="TUIKitErrorSVRResAccessDeny">要发送的资源文件不允许访问。</string>
|
||||
<string name="TUIKitErrorSVRResSizeLimit">文件大小超过限制。</string>
|
||||
<string name="TUIKitErrorSVRResSendCancel">用户取消发送,如发送过程中登出等原因。</string>
|
||||
<string name="TUIKitErrorSVRResReadFailed">读取文件内容失败。</string>
|
||||
<string name="TUIKitErrorSVRResTransferTimeout">资源文件传输超时</string>
|
||||
<string name="TUIKitErrorSVRResInvalidParameters">参数非法。</string>
|
||||
<string name="TUIKitErrorSVRResInvalidFileMd5">文件 MD5 校验失败。</string>
|
||||
<string name="TUIKitErrorSVRResInvalidPartMd5">分片 MD5 校验失败。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidHttpUrl">HTTP 解析错误 ,请检查 HTTP 请求 URL 格式。</string>
|
||||
<string name="TUIKitErrorSVRCommomReqJsonParseFailed">HTTP 请求 JSON 解析错误,请检查 JSON 格式。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidAccount">请求 URI 或 JSON 包体中 Identifier 或 UserSig 错误。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidSdkappid">SDKAppID 失效,请核对 SDKAppID 有效性。</string>
|
||||
<string name="TUIKitErrorSVRCommonRestFreqLimit">REST 接口调用频率超过限制,请降低请求频率。</string>
|
||||
<string name="TUIKitErrorSVRCommonRequestTimeout">服务请求超时或 HTTP 请求格式错误,请检查并重试。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidRes">请求资源错误,请检查请求 URL。</string>
|
||||
<string name="TUIKitErrorSVRCommonIDNotAdmin">REST API 请求的 Identifier 字段请填写 App 管理员账号。</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidFreqLimit">SDKAppID 请求频率超限,请降低请求频率。</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidMiss">REST 接口需要带 SDKAppID,请检查请求 URL 中的 SDKAppID。</string>
|
||||
<string name="TUIKitErrorSVRCommonRspJsonParseFailed">HTTP 响应包 JSON 解析错误。</string>
|
||||
<string name="TUIKitErrorSVRCommonExchangeAccountTimeout">置换账号超时。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidIdFormat">请求包体 Identifier 类型错误,请确认 Identifier 为字符串格式。</string>
|
||||
<string name="TUIKitErrorSVRCommonSDkappidForbidden">SDKAppID 被禁用</string>
|
||||
<string name="TUIKitErrorSVRCommonReqForbidden">请求被禁用</string>
|
||||
<string name="TUIKitErrorSVRCommonReqFreqLimit">请求过于频繁,请稍后重试。</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidService">未购买套餐包,或套餐包已过期,或购买的套餐包正在配置中暂未生效。请登录 即时通信 IM 购买页面 重新购买套餐包。购买后,将在5分钟后生效。</string>
|
||||
<string name="TUIKitErrorSVRCommonSensitiveText">文本安全打击,文本中可能包含敏感词汇。</string>
|
||||
<string name="TUIKitErrorSVRCommonBodySizeLimit">发消息包体过长,目前支持最大12k消息包体长度,请减少包体大小重试。</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigExpired">UserSig 已过期,请重新生成 UserSig</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigEmpty">UserSig 长度为0</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigCheckFailed">UserSig 校验失败</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchPublicKey">用公钥验证 UserSig 失败</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchId">请求的 Identifier 与生成 UserSig 的 Identifier 不匹配。</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchSdkAppid">请求的 SDKAppID 与生成 UserSig 的 SDKAppID 不匹配。</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigPublicKeyNotFound">验证 UserSig 时公钥不存在</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigSdkAppidNotFount">SDKAppID 未找到,请在云通信 IM 控制台确认应用信息。</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidUserSig">UserSig 已经失效,请重新生成,再次尝试。</string>
|
||||
<string name="TUIKitErrorSVRAccountNotFound">请求的用户账号不存在。</string>
|
||||
<string name="TUIKitErrorSVRAccountSecRstr">安全原因被限制。</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalTimeout">服务端内部超时,请重试。</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidCount">请求中批量数量不合法。</string>
|
||||
<string name="TUIkitErrorSVRAccountINvalidParameters">参数非法,请检查必填字段是否填充,或者字段的填充是否满足协议要求。</string>
|
||||
<string name="TUIKitErrorSVRAccountAdminRequired">请求需要 App 管理员权限。</string>
|
||||
<string name="TUIKitErrorSVRAccountLowSDKVersion">您的SDK版本过低,请升级到最新版本。</string>
|
||||
<string name="TUIKitErrorSVRAccountFreqLimit">因失败且重试次数过多导致被限制,请检查 UserSig 是否正确,一分钟之后再试。</string>
|
||||
<string name="TUIKitErrorSVRAccountBlackList">账号被拉入黑名单。</string>
|
||||
<string name="TUIKitErrorSVRAccountCountLimit">创建账号数量超过免费体验版数量限制,请升级为专业版。</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalError">服务端内部错误,请重试。</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidParameters">请求参数错误,请根据错误描述检查请求是否正确。</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountMiss">请求参数错误,没有指定需要拉取资料的用户账号。</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountNotFound">请求的用户账号不存在。</string>
|
||||
<string name="TUIKitErrorSVRProfileAdminRequired">请求需要 App 管理员权限。</string>
|
||||
<string name="TUIKitErrorSVRProfileSensitiveText">资料字段中包含敏感词。</string>
|
||||
<string name="TUIKitErrorSVRProfileInternalError">服务端内部错误,请稍后重试。</string>
|
||||
<string name="TUIKitErrorSVRProfileReadWritePermissionRequired">没有资料字段的读权限,详情可参见 资料字段。</string>
|
||||
<string name="TUIKitErrorSVRProfileTagNotFound">资料字段的 Tag 不存在。</string>
|
||||
<string name="TUIKitErrorSVRProfileSizeLimit">资料字段的 Value 长度超过500字节。</string>
|
||||
<string name="TUIKitErrorSVRProfileValueError">标配资料字段的 Value 错误,详情可参见 标配资料字段。</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidValueFormat">资料字段的 Value 类型不匹配,详情可参见 标配资料字段。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidParameters">请求参数错误,请根据错误描述检查请求是否正确。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidSdkAppid">SDKAppID 不匹配。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAccountNotFound">请求的用户账号不存在。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAdminRequired">请求需要 App 管理员权限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipSensitiveText">关系链字段中包含敏感词。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipNetTimeout">网络超时,请稍后重试。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipWriteConflict">并发写导致写冲突,建议使用批量方式。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendDeny">后台禁止该用户发起加好友请求。</string>
|
||||
<string name="TUIkitErrorSVRFriendshipCountLimit">自己的好友数已达系统上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipGroupCountLimit">分组已达系统上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyLimit">未决数已达系统上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipBlacklistLimit">黑名单数已达系统上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPeerFriendLimit">对方的好友数已达系统上限。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAlreadyFriends">已经存在好友关系。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInSelfBlacklist">对方在自己的黑名单中,不允许加好友。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeDenyAny">对方的加好友验证方式是不允许任何人添加自己为好友。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInPeerBlackList">自己在对方的黑名单中,不允许加好友。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeNeedConfirm">请求已发送,等待对方同意</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendSecRstr">添加好友请求被安全策略打击,请勿频繁发起添加好友请求。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyNotFound">请求的未决不存在。</string>
|
||||
<string name="TUIKitErrorSVRFriendshipDelFriendSecRstr">删除好友请求被安全策略打击,请勿频繁发起删除好友请求。</string>
|
||||
<string name="TUIKirErrorSVRFriendAccountNotFoundEx">请求的用户账号不存在。</string>
|
||||
<string name="TUIKitErrorSVRMsgPkgParseFailed">解析请求包失败。</string>
|
||||
<string name="TUIKitErrorSVRMsgInternalAuthFailed">内部鉴权失败。</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidId">Identifier 无效</string>
|
||||
<string name="TUIKitErrorSVRMsgNetError">网络异常,请重试。</string>
|
||||
<string name="TUIKitErrorSVRMsgPushDeny">触发发送单聊消息之前回调,App 后台返回禁止下发该消息。</string>
|
||||
<string name="TUIKitErrorSVRMsgInPeerBlackList">发送单聊消息,被对方拉黑,禁止发送。</string>
|
||||
<string name="TUIKitErrorSVRMsgBothNotFriend">消息发送双方互相不是好友,禁止发送。</string>
|
||||
<string name="TUIKitErrorSVRMsgNotPeerFriend">发送单聊消息,自己不是对方的好友(单向关系),禁止发送。</string>
|
||||
<string name="TUIkitErrorSVRMsgNotSelfFriend">发送单聊消息,对方不是自己的好友(单向关系),禁止发送。</string>
|
||||
<string name="TUIKitErrorSVRMsgShutupDeny">因禁言,禁止发送消息。</string>
|
||||
<string name="TUIKitErrorSVRMsgRevokeTimeLimit">消息撤回超过了时间限制(默认2分钟)。</string>
|
||||
<string name="TUIKitErrorSVRMsgDelRambleInternalError">删除漫游内部错误。</string>
|
||||
<string name="TUIKitErrorSVRMsgJsonParseFailed">JSON 格式解析失败,请检查请求包是否符合 JSON 规范。</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonBodyFormat">JSON 格式请求包中 MsgBody 不符合消息格式描述</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidToAccount">JSON 格式请求包体中缺少 To_Account 字段或者 To_Account 字段不是 Integer 类型</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidRand">JSON 格式请求包体中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidTimestamp">JSON 格式请求包体中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 类型</string>
|
||||
<string name="TUIKitErrorSVRMsgBodyNotArray">JSON 格式请求包体中 MsgBody 类型不是 Array 类型</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonFormat">JSON 格式请求包不符合消息格式描述</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountCountLimit">批量发消息目标账号超过500</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountNotFound">To_Account 没有注册或不存在</string>
|
||||
<string name="TUIKitErrorSVRMsgTimeLimit">消息离线存储时间错误(最多不能超过7天)。</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidSyncOtherMachine">JSON 格式请求包体中 SyncOtherMachine 字段不是 Integer 类型</string>
|
||||
<string name="TUIkitErrorSVRMsgInvalidMsgLifeTime">JSON 格式请求包体中 MsgLifeTime 字段不是 Integer 类型</string>
|
||||
<string name="TUIKitErrorSVRMsgBodySizeLimit">JSON 数据包超长,消息包体请不要超过12k。</string>
|
||||
<string name="TUIKitErrorSVRmsgLongPollingCountLimit">Web 端长轮询被踢(Web 端同时在线实例个数超出限制)。</string>
|
||||
<string name="TUIKitErrorUnsupporInterface">该功能仅限旗舰版使用,请升级至旗舰版。</string>
|
||||
<string name="TUIKitErrorUnsupporInterfaceSuffix">功能仅限旗舰版使用,请升级至旗舰版。</string>
|
||||
|
||||
<string name="TUIKitErrorSVRGroupApiNameError">请求中的接口名称错误</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountCountLimit">请求包体中携带的账号数量过多。</string>
|
||||
<string name="TUIkitErrorSVRGroupFreqLimit">操作频率限制,请尝试降低调用的频率。</string>
|
||||
<string name="TUIKitErrorSVRGroupPermissionDeny">操作权限不足</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidReq">请求非法</string>
|
||||
<string name="TUIKitErrorSVRGroupSuperNotAllowQuit">该群不允许群主主动退出。</string>
|
||||
<string name="TUIKitErrorSVRGroupNotFound">群组不存在</string>
|
||||
<string name="TUIKitErrorSVRGroupJsonParseFailed">解析 JSON 包体失败,请检查包体的格式是否符合 JSON 格式。</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidId">发起操作的 Identifier 非法,请检查发起操作的用户 Identifier 是否填写正确。</string>
|
||||
<string name="TUIKitErrorSVRGroupAllreadyMember">已经是群成员。</string>
|
||||
<string name="TUIKitErrorSVRGroupFullMemberCount">群已满员,无法将请求中的用户加入群组</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidGroupId">群组 ID 非法,请检查群组 ID 是否填写正确。</string>
|
||||
<string name="TUIKitErrorSVRGroupRejectFromThirdParty">App 后台通过第三方回调拒绝本次操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupShutDeny">因被禁言而不能发送消息,请检查发送者是否被设置禁言。</string>
|
||||
<string name="TUIKitErrorSVRGroupRspSizeLimit">应答包长度超过最大包长</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountNotFound">请求的用户账号不存在。</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdInUse">群组 ID 已被使用,请选择其他的群组 ID。</string>
|
||||
<string name="TUIKitErrorSVRGroupSendMsgFreqLimit">发消息的频率超限,请延长两次发消息时间的间隔。</string>
|
||||
<string name="TUIKitErrorSVRGroupReqAllreadyBeenProcessed">此邀请或者申请请求已经被处理。</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdUserdForSuper">群组 ID 已被使用,并且操作者为群主,可以直接使用。</string>
|
||||
<string name="TUIKitErrorSVRGroupSDkAppidDeny">该 SDKAppID 请求的命令字已被禁用</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgNotFound">请求撤回的消息不存在。</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgTimeLimit">消息撤回超过了时间限制(默认2分钟)。</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgDeny">请求撤回的消息不支持撤回操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRevokeMsg">群组类型不支持消息撤回操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupRemoveMsgDeny">该消息类型不支持删除操作。</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRemoveMsg">音视频聊天室和在线成员广播大群不支持删除消息。</string>
|
||||
<string name="TUIKitErrorSVRGroupAvchatRoomCountLimit">音视频聊天室创建数量超过了限制</string>
|
||||
<string name="TUIKitErrorSVRGroupCountLimit">单个用户可创建和加入的群组数量超过了限制”。</string>
|
||||
<string name="TUIKitErrorSVRGroupMemberCountLimit">群成员数量超过限制</string>
|
||||
<string name="TUIKitErrorSVRNoSuccessResult">批量操作无成功结果</string>
|
||||
<string name="TUIKitErrorSVRToUserInvalid">IM: 无效接收方</string>
|
||||
<string name="TUIKitErrorSVRRequestTimeout">请求超时</string>
|
||||
<string name="TUIKitErrorSVRInitCoreFail">INIT CORE模块失败</string>
|
||||
<string name="TUIKitErrorExpiredSessionNode">SessionNode为null</string>
|
||||
<string name="TUIKitErrorLoggedOutBeforeLoginFinished">在登录完成前进行了登出(在登录时返回)</string>
|
||||
<string name="TUIKitErrorTLSSDKNotInitialized">tlssdk未初始化</string>
|
||||
<string name="TUIKitErrorTLSSDKUserNotFound">TLSSDK没有找到相应的用户信息</string>
|
||||
<string name="TUIKitErrorBindFaildRegTimeout">注册超时</string>
|
||||
<string name="TUIKitErrorBindFaildIsBinding">正在bind操作中</string>
|
||||
<string name="TUIKitErrorPacketFailUnknown">发包未知错误</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoNet">发送请求包时没有网络,处理时转换成case ERR_REQ_NO_NET_ON_REQ:</string>
|
||||
<string name="TUIKitErrorPacketFailRespNoNet">发送回复包时没有网络,处理时转换成case ERR_REQ_NO_NET_ON_RSP:</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoAuth">发送请求包时没有权限</string>
|
||||
<string name="TUIKitErrorPacketFailSSOErr">SSO错误</string>
|
||||
<string name="TUIKitErrorPacketFailRespTimeout">回复超时</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncing">proxy_manager没有完成svr数据同步</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncedFail">proxy_manager同步失败</string>
|
||||
<string name="TUIKitErrorFriendshipProxyLocalCheckErr">proxy_manager请求参数,在本地检查不合法</string>
|
||||
<string name="TUIKitErrorGroupInvalidField">group assistant请求字段中包含非预设字段</string>
|
||||
<string name="TUIKitErrorGroupStoreageDisabled">group assistant群资料本地存储没有开启</string>
|
||||
<string name="TUIKitErrorLoadGrpInfoFailed">无法从存储中加载groupinfo</string>
|
||||
<string name="TUIKitErrorReqNoNetOnReq">请求的时候没有网络</string>
|
||||
<string name="TUIKitErrorReqNoNetOnResp">响应的时候没有网络</string>
|
||||
<string name="TUIKitErrorServiceNotReady">QALSDK服务未就绪</string>
|
||||
<string name="TUIKitErrorLoginAuthFailed">账号认证失败(用户信息获取失败)</string>
|
||||
<string name="TUIKitErrorNeverConnectAfterLaunch">在应用启动后没有尝试联网</string>
|
||||
<string name="TUIKitErrorReqFailed">QAL执行失败</string>
|
||||
<string name="TUIKitErrorReqInvaidReq">请求非法,toMsgService非法</string>
|
||||
<string name="TUIKitErrorReqOnverLoaded">请求队列满</string>
|
||||
<string name="TUIKitErrorReqKickOff">已经被其他终端踢了</string>
|
||||
<string name="TUIKitErrorReqServiceSuspend">服务被暂停</string>
|
||||
<string name="TUIKitErrorReqInvalidSign">SSO签名错误</string>
|
||||
<string name="TUIKitErrorReqInvalidCookie">SSO cookie无效</string>
|
||||
<string name="TUIKitErrorLoginTlsRspParseFailed">登录时TLS回包校验,包体长度错误</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgTimeout">登录时OPENSTATSVC向OPENMSG上报状态超时</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgRspParseFailed">登录时OPENSTATSVC向OPENMSG上报状态时解析回包失败</string>
|
||||
<string name="TUIKitErrorLoginTslDecryptFailed">登录时TLS解密失败</string>
|
||||
<string name="TUIKitErrorWifiNeedAuth">wifi需要认证</string>
|
||||
<string name="TUIKitErrorUserCanceled">用户已取消</string>
|
||||
<string name="TUIkitErrorRevokeTimeLimitExceed">消息撤回超过了时间限制(默认2分钟)</string>
|
||||
<string name="TUIKitErrorLackUGExt">缺少UGC扩展包</string>
|
||||
<string name="TUIKitErrorAutoLoginNeedUserSig">自动登录,本地票据过期,需要userSig手动登录</string>
|
||||
<string name="TUIKitErrorQALNoShortConneAvailable">没有可用的短连接sso</string>
|
||||
<string name="TUIKitErrorReqContentAttach">消息内容安全打击</string>
|
||||
<string name="TUIKitErrorLoginSigExpire">登录返回,票据过期</string>
|
||||
<string name="TUIKitErrorSDKHadInit">SDK 已经初始化无需重复初始化</string>
|
||||
<string name="TUIKitErrorOpenBDHBase">openbdh 错误码</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnReq">请求时没有网络,请等网络恢复后重试</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnRsp">响应时没有网络,请等网络恢复后重试</string>
|
||||
<string name="TUIKitErrorRequestOnverLoaded">请求队列満</string>
|
||||
<string name="TUIKitErrorEnableUserStatusOnConsole">您未开启用户状态功能,请先登录控制台开启</string>
|
||||
</resources>
|
||||
18
tuicore/src/main/res/values-zh/strings.xml
Normal file
18
tuicore/src/main/res/values-zh/strings.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="open_file_tips">选择要打开此文件的应用</string>
|
||||
|
||||
<string name="sure">确定</string>
|
||||
<string name="cancel">取消</string>
|
||||
<string name="core_permission_dialog_title">权限申请</string>
|
||||
<string name="core_permission_dialog_positive_setting_text">去设置</string>
|
||||
<string name="date_year_short">年</string>
|
||||
<string name="date_month_short">月</string>
|
||||
<string name="date_day_short">天</string>
|
||||
<string name="date_hour_short">时</string>
|
||||
<string name="date_minute_short">分</string>
|
||||
<string name="date_second_short">秒</string>
|
||||
<string name="date_yesterday">昨天</string>
|
||||
|
||||
<string name="core_float_permission_hint">请同时打开\"后台弹出界面\"和\"显示悬浮窗\"权限</string>
|
||||
</resources>
|
||||
79
tuicore/src/main/res/values/attrs.xml
Normal file
79
tuicore/src/main/res/values/attrs.xml
Normal file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="UserIconView">
|
||||
<attr name="default_image" format="reference" />
|
||||
<attr name="image_radius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="SynthesizedImageView">
|
||||
<attr name="synthesized_image_bg" format="color" />
|
||||
<attr name="synthesized_default_image" format="reference" />
|
||||
<attr name="synthesized_image_size" format="dimension" />
|
||||
<attr name="synthesized_image_gap" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="LineControllerView">
|
||||
<attr name="name" format="string"/>
|
||||
<attr name="subject" format="string"/>
|
||||
<attr name="isBottom" format="boolean"/>
|
||||
<attr name="isTop" format="boolean"/>
|
||||
<attr name="canNav" format="boolean"/>
|
||||
<attr name="isSwitch" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="IndexBar">
|
||||
<attr name="indexBarTextSize" format="dimension"/>
|
||||
<attr name="indexBarPressBackground" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="core_round_rect_image_style">
|
||||
<attr name="round_radius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TitleBarLayout">
|
||||
<attr name="title_bar_middle_title" format="string" />
|
||||
<attr name="title_bar_can_return" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="RoundFrameLayout">
|
||||
<attr name="corner_radius" format="dimension" />
|
||||
<attr name="left_top_corner_radius" format="dimension" />
|
||||
<attr name="right_top_corner_radius" format="dimension" />
|
||||
<attr name="right_bottom_corner_radius" format="dimension" />
|
||||
<attr name="left_bottom_corner_radius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="RoundCornerImageView" parent="RoundFrameLayout">
|
||||
<attr name="corner_radius"/>
|
||||
<attr name="left_top_corner_radius"/>
|
||||
<attr name="right_top_corner_radius" />
|
||||
<attr name="right_bottom_corner_radius" />
|
||||
<attr name="left_bottom_corner_radius" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="UnreadCountTextView">
|
||||
<attr name="paint_color" format="color|reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="CustomWidthSwitch">
|
||||
<attr name="custom_width" format="dimension|reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="SwipeLayout">
|
||||
<attr name="drag_edge">
|
||||
<flag name="left" value="1" />
|
||||
<flag name="right" value="2" />
|
||||
<flag name="top" value="4" />
|
||||
<flag name="bottom" value="8" />
|
||||
</attr>
|
||||
<attr name="leftEdgeSwipeOffset" format="dimension" />
|
||||
<attr name="rightEdgeSwipeOffset" format="dimension" />
|
||||
<attr name="topEdgeSwipeOffset" format="dimension" />
|
||||
<attr name="bottomEdgeSwipeOffset" format="dimension" />
|
||||
<attr name="show_mode" format="enum">
|
||||
<enum name="lay_down" value="0" />
|
||||
<enum name="pull_out" value="1" />
|
||||
</attr>
|
||||
<attr name="clickToClose" format="boolean" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
8
tuicore/src/main/res/values/colors.xml
Normal file
8
tuicore/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#000000</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="read_dot_bg">#f74c31</color>
|
||||
<color name="font_blue">#066fff</color>
|
||||
|
||||
</resources>
|
||||
299
tuicore/src/main/res/values/im_error_msg.xml
Normal file
299
tuicore/src/main/res/values/im_error_msg.xml
Normal file
@@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="TUIKitErrorInProcess">Executing</string>
|
||||
<string name="TUIKitErrorInvalidParameters">Invalid parameter</string>
|
||||
<string name="TUIKitErrorIOOperateFaild">Local IO operation error</string>
|
||||
<string name="TUIKitErrorInvalidJson">Invalid JSON format</string>
|
||||
<string name="TUIKitErrorOutOfMemory">Out of storage</string>
|
||||
<string name="TUIKitErrorParseResponseFaild">PB parsing failed</string>
|
||||
<string name="TUIKitErrorSerializeReqFaild">PB serialization failed</string>
|
||||
<string name="TUIKitErrorSDKNotInit">IM SDK is not initialized.</string>
|
||||
<string name="TUIKitErrorLoadMsgFailed">Failed to load local database</string>
|
||||
<string name="TUIKitErrorDatabaseOperateFailed">Local database operation failed</string>
|
||||
<string name="TUIKitErrorCrossThread">Cross-thread error</string>
|
||||
<string name="TUIKitErrorTinyIdEmpty">User info is empty.</string>
|
||||
<string name="TUIKitErrorInvalidIdentifier">Invalid identifier</string>
|
||||
<string name="TUIKitErrorFileNotFound">File not found</string>
|
||||
<string name="TUIKitErrorFileTooLarge">File size exceeds the limit.</string>
|
||||
<string name="TUIKitErrorEmptyFile">Empty file</string>
|
||||
<string name="TUIKitErrorFileOpenFailed">Failed to open file</string>
|
||||
<string name="TUIKitErrorNotLogin">Not logged in to IM SDK</string>
|
||||
<string name="TUIKitErrorNoPreviousLogin">Not logged in to the user\'s account.</string>
|
||||
<string name="TUIKitErrorUserSigExpired">UserSig expired</string>
|
||||
<string name="TUIKitErrorLoginKickedOffByOther">Log in to the same account on other devices</string>
|
||||
<string name="TUIKitErrorTLSSDKInit">TLS SDK initialization failed</string>
|
||||
<string name="TUIKitErrorTLSSDKUninit">TLS SDK is not initialized.</string>
|
||||
<string name="TUIKitErrorTLSSDKTRANSPackageFormat">Invalid TLS SDK TRANS packet format</string>
|
||||
<string name="TUIKitErrorTLSDecrypt">TLS SDK decryption failed</string>
|
||||
<string name="TUIKitErrorTLSSDKRequest">TLS SDK request failed</string>
|
||||
<string name="TUIKitErrorTLSSDKRequestTimeout">TLS SDK request timed out</string>
|
||||
<string name="TUIKitErrorInvalidConveration">Invalid session</string>
|
||||
<string name="TUIKitErrorFileTransAuthFailed">Authentication failed during file transfer.</string>
|
||||
<string name="TUIKitErrorFileTransNoServer">Failed to get the server list via FTP.</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailed">Failed to upload the file via FTP. Check your network connection.</string>
|
||||
<string name="TUIKitErrorFileTransUploadFailedNotImage">Failed to upload the file via FTP. Check if the uploaded image can be opened normally.</string>
|
||||
<string name="TUIKitErrorFileTransDownloadFailed">Failed to download the file via FTP. Check whether your network is connected or the file or audio has expired.</string>
|
||||
<string name="TUIKitErrorHTTPRequestFailed">HTTP request failed</string>
|
||||
<string name="TUIKitErrorInvalidMsgElem">Invalid IM SDK message elem</string>
|
||||
<string name="TUIKitErrorInvalidSDKObject">Invalid object</string>
|
||||
<string name="TUIKitSDKMsgBodySizeLimit">Message length exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSDKMsgKeyReqDifferRsp">Message key error</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidID">Invalid group ID. Custom group ID must be printable ASCII characters (0x20-0x7e), with maximum length of 48 bytes, and cannot be prefixed with @TGS#.</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidName">Group name is invalid, which cannot exceed 30 bytes.</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidIntroduction">Group description is invalid, which cannot exceed 240 bytes.</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNotification">Group notice is invalid, which cannot exceed 300 bytes.</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidFaceURL">Group profile photo URL is invalid, which should not exceed 100 bytes.</string>
|
||||
<string name="TUIKitErrorSDKGroupInvalidNameCard">Group card is invalid, which cannot exceed 50 bytes.</string>
|
||||
<string name="TUIKitErrorSDKGroupMemberCountLimit">The maximum number of group members is exceeded.</string>
|
||||
<string name="TUIKitErrorSDKGroupJoinPrivateGroupDeny">Request to join private groups is not allowed.</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteSuperDeny">Group owners cannot be invited.</string>
|
||||
<string name="TUIKitErrorSDKGroupInviteNoMember">The number of members to be invited cannot be 0.</string>
|
||||
<string name="TUIKitErrorSDKGroupPinnedMessageCountLimit">Pinned messages over limit.</string>
|
||||
|
||||
<string name="TUIKitErrorSDKFriendShipInvalidProfileKey">Invalid data field</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddRemark">The remark field exceeds the limit of 96 bytes.</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddWording">The description field in the friend request is invalid, which should not exceed 120 bytes.</string>
|
||||
<string name="TUIKitErrorSDKFriendshipInvalidAddSource">The source field in the friend request is invalid, which should be prefixed with \"AddSource_Type_\".</string>
|
||||
<string name="TUIKitErrorSDKFriendshipFriendGroupEmpty">The friend list field is invalid. It is required with each list name of 30 bytes at most.</string>
|
||||
<string name="TUIKitErrorSDKNetEncodeFailed">Network link encryption failed</string>
|
||||
<string name="TUIKitErrorSDKNetDecodeFailed">Network link decryption failed</string>
|
||||
<string name="TUIKitErrorSDKNetAuthInvalid">Network link authentication not completed</string>
|
||||
<string name="TUIKitErrorSDKNetCompressFailed">Unable to compress data packet</string>
|
||||
<string name="TUIKitErrorSDKNetUncompressFaile">Packet decompression failed</string>
|
||||
<string name="TUIKitErrorSDKNetFreqLimit">Call frequency is limited, with up to 5 requests per second.</string>
|
||||
<string name="TUIKitErrorSDKnetReqCountLimit">Request queue is full. The number of concurrent requests exceeds the limit of 1000.</string>
|
||||
<string name="TUIKitErrorSDKNetDisconnect">Network disconnected. No connection is established, or no network is detected when a socket connection is established.</string>
|
||||
<string name="TUIKitErrorSDKNetAllreadyConn">Network connection has been established.</string>
|
||||
<string name="TUIKitErrorSDKNetConnTimeout">Network connection timed out. Try again once network connection is restored.</string>
|
||||
<string name="TUIKitErrorSDKNetConnRefuse">Network connection denied. Too many attempts. Service denied by the server.</string>
|
||||
<string name="TUIKitErrorSDKNetNetUnreach">No available route to the network. Try again once network connection is restored.</string>
|
||||
<string name="TUIKitErrorSDKNetSocketNoBuff">Call failed to due to insufficient buffer resources in the system. System busy. Internal error.</string>
|
||||
<string name="TUIKitERRORSDKNetResetByPeer">The peer resets the connection.</string>
|
||||
<string name="TUIKitErrorSDKNetSOcketInvalid">Invalid socket</string>
|
||||
<string name="TUIKitErrorSDKNetHostGetAddressFailed">IP address resolution failed</string>
|
||||
<string name="TUIKitErrorSDKNetConnectReset">Network is connected to an intermediate node or connection to the server is reset.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitInQueueTimeout">Timed out waiting for request packet to enter the to-be-sent queue.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeout">Request packet has entered the to-be-sent queue. Timed out waiting to enter the network buffer of the system.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeut">Request packet has entered the network buffer of the system. Timed out waiting for response from server.</string>
|
||||
<string name="TUIKitErrorSDKWaitSendRemainingTimeout">The request packet has entered the queue to be sent, and part of the data has been sent. A timeout occurs while waiting for the remaining part to be sent. The uplink bandwidth may be insufficient. Please check whether the network is smooth. When the callback error occurs, it is detected that there is an Internet connection. Internal error</string>
|
||||
<string name="TUIKitErrorSDKNetPKGSizeLimit">The request packet length is greater than the limit, the maximum supported is 1MB.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitSendTimeoutNoNetwork">The request packet length is greater than the limit, the maximum supported is 1MB. The request packet has entered the queue to be sent. The network buffer waiting to enter the system has timed out. There are too many data packets or the sending thread cannot process them. When the error code is called back, it is detected that there is no Internet connection.</string>
|
||||
<string name="TUIKitErrorSDKNetWaitAckTimeoutNoNetwork">The request packet has entered the network buffer of the system, and the wait for the return packet from the server has timed out. The request packet may not have left the terminal device, the intermediate route has discarded it, the server has accidentally lost the packet, or the return packet has been discarded by the system network layer. There is no error code detected when calling back. networking.</string>
|
||||
<string name="TUIKitErrorSDKNetRemainingTimeoutNoNetwork">The request packet has entered the queue to be sent, and part of the data has been sent. A timeout occurs while waiting for the remaining part to be sent. The uplink bandwidth may be insufficient. Please check whether the network is smooth. When calling back the error code, it is detected that there is no Internet connection.</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOConnectLimit">The number of Server connections exceeds the limit. Service denied by the server.</string>
|
||||
<string name="TUIKitErrorSDKSVRSSOVCode">Sending verification code timeout.</string>
|
||||
<string name="TUIKitErrorSVRSSOD2Expired">Key expired. Key is an internal bill generated according to usersig. The validity period of the key is less than or equal to the validity period of usersig. Please call timmanager again getInstance(). The login interface generates a new key.</string>
|
||||
<string name="TUIKitErrorSVRA2UpInvalid">Ticket expired. Ticket is an internal bill generated according to usersig. The validity period of ticket is less than or equal to that of usersig. Please call timmanager again getInstance(). The login interface generates a new ticket.</string>
|
||||
<string name="TUIKitErrorSVRA2DownInvalid">The bill failed verification or was hit by security. Please call timmanager again getInstance(). The login interface generates a new ticket.</string>
|
||||
<string name="TUIKitErrorSVRSSOEmpeyKey">Empty key is not allowed.</string>
|
||||
<string name="TUIKitErrorSVRSSOUinInvalid">The account in the key does not match the account in the request header.</string>
|
||||
<string name="TUIKitErrorSVRSSOVCodeTimeout">Timed out sending verification code.</string>
|
||||
<string name="TUIKitErrorSVRSSONoImeiAndA2">You need to bring your key and ticket.</string>
|
||||
<string name="TUIKitErrorSVRSSOCookieInvalid">Cookie check mismatch.</string>
|
||||
<string name="TUIKitErrorSVRSSODownTips">Send a prompt: Key expired.</string>
|
||||
<string name="TUIKitErrorSVRSSODisconnect">Link disconnected and screen locked.</string>
|
||||
<string name="TUIKitErrorSVRSSOIdentifierInvalid">Invalid identity.</string>
|
||||
<string name="TUIKitErrorSVRSSOClientClose">The device automatically logs out.</string>
|
||||
<string name="TUIKitErrorSVRSSOMSFSDKQuit">MSFSDK automatically logs out.</string>
|
||||
<string name="TUIKitErrorSVRSSOD2KeyWrong">the number of decryption failures exceeds the threshold, notify the terminal that it needs to be reset, please call timmanager again getInstance(). The login interface generates a new key.</string>
|
||||
<string name="TUIKitErrorSVRSSOUnsupport">Aggregation is not supported. A unified error code is returned to devices. The device stops aggregation on the persistent TCP connection.</string>
|
||||
<string name="TUIKitErrorSVRSSOPrepaidArrears">Prepaid service is in arrears.</string>
|
||||
<string name="TUIKitErrorSVRSSOPacketWrong">Invalid request packet format.</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidBlackList">SDKAppID blocked list.</string>
|
||||
<string name="TUIKitErrorSVRSSOCmdBlackList">SDKAppID sets the service cmd blocked list.</string>
|
||||
<string name="TUIKitErrorSVRSSOAppidWithoutUsing">SDKAppID is disabled.</string>
|
||||
<string name="TUIKitErrorSVRSSOFreqLimit">Frequency limit (user), which is to limit the number of requests per second of a protocol.</string>
|
||||
<string name="TUIKitErrorSVRSSOOverload">Packet loss due to overload (system). Service denied by the connected server that failed to process too many requests.</string>
|
||||
<string name="TUIKitErrorSVRResNotFound">The resource file to be sent does not exist.</string>
|
||||
<string name="TUIKitErrorSVRResAccessDeny">Unable to access the resource file to be sent.</string>
|
||||
<string name="TUIKitErrorSVRResSizeLimit">File size exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRResSendCancel">Sending is canceled by the user due to reasons like logging out when sending a message.</string>
|
||||
<string name="TUIKitErrorSVRResReadFailed">Failed to access the file content.</string>
|
||||
<string name="TUIKitErrorSVRResTransferTimeout">Timed out transferring the resource file.</string>
|
||||
<string name="TUIKitErrorSVRResInvalidParameters">Invalid parameter.</string>
|
||||
<string name="TUIKitErrorSVRResInvalidFileMd5">File MD5 verification failed.</string>
|
||||
<string name="TUIKitErrorSVRResInvalidPartMd5">Sharding MD5 verification failed.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidHttpUrl">HTTP parsing error. Check the HTTP request URL format.</string>
|
||||
<string name="TUIKitErrorSVRCommomReqJsonParseFailed">JSON parsing error in the HTTP request. Check the JSON format.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidAccount">The Identifier or UserSig in the request URI or JSON packet is incorrect.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidSdkappid">Invalid SDKAppID. Check the SDKAppID validity.</string>
|
||||
<string name="TUIKitErrorSVRCommonRestFreqLimit">The REST API call frequency exceeds the limit. Reduce the request rate.</string>
|
||||
<string name="TUIKitErrorSVRCommonRequestTimeout">The service request timed out or the HTTP request format is incorrect. Check the error and try again.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidRes">Requested resource error. Check the request URL.</string>
|
||||
<string name="TUIKitErrorSVRCommonIDNotAdmin">Fill in the Identifier field of the REST API request with the app admin\'s account.</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidFreqLimit">SDKAppID request rate exceeds the limit. Reduce the request rate.</string>
|
||||
<string name="TUIKitErrorSVRCommonSdkappidMiss">SDKAppID is required for the REST API. Check the SDKAppID in the request URL.</string>
|
||||
<string name="TUIKitErrorSVRCommonRspJsonParseFailed">JSON parsing error in the HTTP response packet.</string>
|
||||
<string name="TUIKitErrorSVRCommonExchangeAccountTimeout">Account switching timed out.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidIdFormat">The Identifier type of the request packet body is incorrect. Confirm that the Identifier is a string.</string>
|
||||
<string name="TUIKitErrorSVRCommonSDkappidForbidden">SDKAppID is disabled.</string>
|
||||
<string name="TUIKitErrorSVRCommonReqForbidden">Request is disabled.</string>
|
||||
<string name="TUIKitErrorSVRCommonReqFreqLimit">Too many requests. Try again later.</string>
|
||||
<string name="TUIKitErrorSVRCommonInvalidService">The package has not been purchased, or the package has expired, or the purchased package is being configured and has not yet taken effect. Please log in to the im purchase page to re purchase the package. After purchase, it will take effect in 5 minutes.</string>
|
||||
<string name="TUIKitErrorSVRCommonSensitiveText">Text is filtered due to security reasons, which may contain sensitive words.</string>
|
||||
<string name="TUIKitErrorSVRCommonBodySizeLimit">The sending message package is too long. Currently, the maximum 12K message package length is supported. Please reduce the package size and try again.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigExpired">UserSig has expired. Generate a new one.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigEmpty">UserSig length is 0.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigCheckFailed">UserSig verification failed.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchPublicKey">Failed to verify UserSig with public key</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchId">The requested Identifier does not match the Identifier that is used to generate the UserSig.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigMismatchSdkAppid">The requested SDKAppID does not match the SDKAppID of the generated UserSig.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigPublicKeyNotFound">Public key does not exist when verifying UserSig.</string>
|
||||
<string name="TUIKitErrorSVRAccountUserSigSdkAppidNotFount">SDKAppID not found. Check the app information in the IM console.</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidUserSig">UserSig has expired. Generate a new one and try again.</string>
|
||||
<string name="TUIKitErrorSVRAccountNotFound">Requested user account not found.</string>
|
||||
<string name="TUIKitErrorSVRAccountSecRstr">Restricted for security reasons.</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalTimeout">Internal server timeout. Try again.</string>
|
||||
<string name="TUIKitErrorSVRAccountInvalidCount">Invalid batch quantity in the request.</string>
|
||||
<string name="TUIkitErrorSVRAccountINvalidParameters">Invalid parameter. Check whether the fields are entered as required in the protocol.</string>
|
||||
<string name="TUIKitErrorSVRAccountAdminRequired">The request requires app admin permissions.</string>
|
||||
<string name="TUIKitErrorSVRAccountLowSDKVersion">Your sdk version is too low, Please upgrade to the latest version.</string>
|
||||
<string name="TUIKitErrorSVRAccountFreqLimit">Restricted due to too many failures and retries. Check if the UserSig is correct and try again after one minute.</string>
|
||||
<string name="TUIKitErrorSVRAccountBlackList">The account is added to the blocked list.</string>
|
||||
<string name="TUIKitErrorSVRAccountCountLimit">The number of accounts created exceeds that allowed in the free trial version. Upgrade to the professional version.</string>
|
||||
<string name="TUIKitErrorSVRAccountInternalError">Internal server error. Try again.</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidParameters">Request parameter error. Check if the request is correct according to the error message.</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountMiss">Request parameter error. No user account specified to pull data.</string>
|
||||
<string name="TUIKitErrorSVRProfileAccountNotFound">Requested user account not found.</string>
|
||||
<string name="TUIKitErrorSVRProfileAdminRequired">The request requires app admin permissions.</string>
|
||||
<string name="TUIKitErrorSVRProfileSensitiveText">The data field contains sensitive words.</string>
|
||||
<string name="TUIKitErrorSVRProfileInternalError">Server internal error. Try again later.</string>
|
||||
<string name="TUIKitErrorSVRProfileReadWritePermissionRequired">You have no permission to read the data field. See the data field for details.</string>
|
||||
<string name="TUIKitErrorSVRProfileTagNotFound">The tag of the data field does not exist.</string>
|
||||
<string name="TUIKitErrorSVRProfileSizeLimit">The value of the data field exceeds 500 bytes.</string>
|
||||
<string name="TUIKitErrorSVRProfileValueError">The value of the standard data field is incorrect. See the standard data field for details.</string>
|
||||
<string name="TUIKitErrorSVRProfileInvalidValueFormat">The value type of the data field does not match. See the standard data field for details.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidParameters">Request parameter error. Check if the request is correct according to the error message.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInvalidSdkAppid">SDKAppID does not match.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAccountNotFound">Requested user account not found.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAdminRequired">The request requires app admin permissions.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipSensitiveText">The relation chain field contains sensitive words.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipNetTimeout">Network timed out. Try again later.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipWriteConflict">A write conflict occurred due to concurrent writes. The batch mode is recommended.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendDeny">The backend blocks the user from initiating friend requests.</string>
|
||||
<string name="TUIkitErrorSVRFriendshipCountLimit">The number of your friends exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipGroupCountLimit">The number of lists exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyLimit">You have reached the limit of pending friend requests.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipBlacklistLimit">The number of accounts in the blocked list exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPeerFriendLimit">The number of the other user\'s friends exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAlreadyFriends">Already a friend relationship.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInSelfBlacklist">You have blocked the other user. Unable to send friend request.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeDenyAny">The other user\'s friend request verification mode is \"Decline friend request from any user\".</string>
|
||||
<string name="TUIKitErrorSVRFriendshipInPeerBlackList">You are blocked by the other user. Unable to send friend request.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAllowTypeNeedConfirm">Request sent. Wait for acceptance.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipAddFriendSecRstr">The friend request was filtered by the security policy. Do not initiate friend requests too frequently.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipPendencyNotFound">The pending friend request does not exist.</string>
|
||||
<string name="TUIKitErrorSVRFriendshipDelFriendSecRstr">The friend deletion request was filtered by the security policy. Do not initiate friend deletion requests too frequently.</string>
|
||||
<string name="TUIKirErrorSVRFriendAccountNotFoundEx">Requested user account not found.</string>
|
||||
<string name="TUIKitErrorSVRMsgPkgParseFailed">Failed to parse the request packet.</string>
|
||||
<string name="TUIKitErrorSVRMsgInternalAuthFailed">Internal authentication failed.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidId">Invalid identifier</string>
|
||||
<string name="TUIKitErrorSVRMsgNetError">Network error. Try again.</string>
|
||||
<string name="TUIKitErrorSVRMsgPushDeny">A callback is triggered before sending a message in the private chat, and the App backend returns \"The message is prohibited from sending\".</string>
|
||||
<string name="TUIKitErrorSVRMsgInPeerBlackList">Unable to send messages in the private chat as you are blocked by the other user.</string>
|
||||
<string name="TUIKitErrorSVRMsgBothNotFriend">You are not a friend of this user. Unable to send messages.</string>
|
||||
<string name="TUIKitErrorSVRMsgNotPeerFriend">Unable to send messages in the private chat as you are not the other user\'s friend (one-way friend).</string>
|
||||
<string name="TUIkitErrorSVRMsgNotSelfFriend">Unable to send messages in the private chat as the other user is not your friend (one-way friend).</string>
|
||||
<string name="TUIKitErrorSVRMsgShutupDeny">Blocked from posting. Unable to send messages.</string>
|
||||
<string name="TUIKitErrorSVRMsgRevokeTimeLimit">Timed out recalling the message (default is 2 min).</string>
|
||||
<string name="TUIKitErrorSVRMsgDelRambleInternalError">An internal error occurred while deleting roaming messages.</string>
|
||||
<string name="TUIKitErrorSVRMsgJsonParseFailed">Failed to parse the JSON packet. Check whether the request packet meets the JSON specifications.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonBodyFormat">MsgBody in the JSON request packet does not conform to the message format description.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidToAccount">The To_Account field is missing from the JSON request packet body or the type of the To_Account field is not Integer.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidRand">The MsgRandom field is missing from the JSON request packet body or the type of the MsgRandom field is not Integer.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidTimestamp">The MsgTimeStamp field is missing from the JSON request packet body or the type of the MsgTimeStamp field is not Integer.</string>
|
||||
<string name="TUIKitErrorSVRMsgBodyNotArray">The MsgBody type in the JSON request packet body is not Array.</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidJsonFormat">The JSON request packet does not conform to the message format description.</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountCountLimit">The number of accounts to which messages are sent in batch exceeds 500.</string>
|
||||
<string name="TUIKitErrorSVRMsgToAccountNotFound">To_Account is not registered or does not exist.</string>
|
||||
<string name="TUIKitErrorSVRMsgTimeLimit">Invalid offline message storage time (up to 7 days).</string>
|
||||
<string name="TUIKitErrorSVRMsgInvalidSyncOtherMachine">The type of the SyncOtherMachine field in the JSON request packet body is not Integer.</string>
|
||||
<string name="TUIkitErrorSVRMsgInvalidMsgLifeTime">The type of the MsgLifeTime field in the JSON request packet body is not Integer.</string>
|
||||
<string name="TUIKitErrorSVRMsgBodySizeLimit">The length of JSON data packet exceeds the limit. The message packet body shall not exceed 12 KB.</string>
|
||||
<string name="TUIKitErrorSVRmsgLongPollingCountLimit">Forced logout on the Web page during long polling (the number of online instances on the Web page exceeds the limit).</string>
|
||||
<string name="TUIKitErrorUnsupporInterface">This feature is available only to the Premium Edition. Please upgrade.</string>
|
||||
<string name="TUIKitErrorUnsupporInterfaceSuffix"> feature is available only to the Premium Edition. Please upgrade.</string>
|
||||
|
||||
<string name="TUIKitErrorSVRGroupApiNameError">The API name in the request is incorrect.</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountCountLimit">The number of accounts in the request packet body exceeds the limit.</string>
|
||||
<string name="TUIkitErrorSVRGroupFreqLimit">Call frequency is limited. Reduce the call frequency.</string>
|
||||
<string name="TUIKitErrorSVRGroupPermissionDeny">Insufficient operation permissions</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidReq">Invalid request</string>
|
||||
<string name="TUIKitErrorSVRGroupSuperNotAllowQuit">Group owner is not allowed to leave this group.</string>
|
||||
<string name="TUIKitErrorSVRGroupNotFound">The group does not exist.</string>
|
||||
<string name="TUIKitErrorSVRGroupJsonParseFailed">Failed to parse the JSON packet. Check whether the packet body conforms to the JSON format.</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidId">The identifier that is used to initiated the operation is invalid. Check whether the identifier of the user who initiated the operation is correct.</string>
|
||||
<string name="TUIKitErrorSVRGroupAllreadyMember">Already a group member.</string>
|
||||
<string name="TUIKitErrorSVRGroupFullMemberCount">The number of group members has reached the limit. Unable to add the user in the request to the group.</string>
|
||||
<string name="TUIKitErrorSVRGroupInvalidGroupId">Invalid group ID. Check whether the group ID is correct.</string>
|
||||
<string name="TUIKitErrorSVRGroupRejectFromThirdParty">The app backend rejected this operation via a third-party callback.</string>
|
||||
<string name="TUIKitErrorSVRGroupShutDeny">This user is blocked from posting and thus cannot send messages. Check whether the sender is blocked from posting.</string>
|
||||
<string name="TUIKitErrorSVRGroupRspSizeLimit">The response packet length exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRGroupAccountNotFound">Requested user account not found.</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdInUse">The group ID has been used. Select another one.</string>
|
||||
<string name="TUIKitErrorSVRGroupSendMsgFreqLimit">The frequency of sending messages exceeds the limit. Extend the interval between sending messages.</string>
|
||||
<string name="TUIKitErrorSVRGroupReqAllreadyBeenProcessed">This invitation or request has been processed.</string>
|
||||
<string name="TUIKitErrorSVRGroupGroupIdUserdForSuper">The group ID has been used by the group owner. It can be used directly.</string>
|
||||
<string name="TUIKitErrorSVRGroupSDkAppidDeny">The command word used in the SDKAppID request has been disabled.</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgNotFound">This message does not exist.</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgTimeLimit">Timed out recalling the message (default is 2 min).</string>
|
||||
<string name="TUIKitErrorSVRGroupRevokeMsgDeny">Unable to recall this message.</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRevokeMsg">Unable to recall messages in groups of this type.</string>
|
||||
<string name="TUIKitErrorSVRGroupRemoveMsgDeny">Unable to delete messages of this type.</string>
|
||||
<string name="TUIKitErrorSVRGroupNotAllowRemoveMsg">Unable to delete messages in the voice/video chat room and the broadcast group of online members.</string>
|
||||
<string name="TUIKitErrorSVRGroupAvchatRoomCountLimit">The number of created voice/video chat rooms exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRGroupCountLimit">The number of groups that a single user can create and join exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRGroupMemberCountLimit">The number of group members exceeds the limit.</string>
|
||||
<string name="TUIKitErrorSVRNoSuccessResult">No success result returned for the batch operation.</string>
|
||||
<string name="TUIKitErrorSVRToUserInvalid">IM: Invalid recipient</string>
|
||||
<string name="TUIKitErrorSVRRequestTimeout">Request timeout</string>
|
||||
<string name="TUIKitErrorSVRInitCoreFail">INIT CORE module failed</string>
|
||||
<string name="TUIKitErrorExpiredSessionNode">SessionNode is null.</string>
|
||||
<string name="TUIKitErrorLoggedOutBeforeLoginFinished">Logged out before login (returned at login time)</string>
|
||||
<string name="TUIKitErrorTLSSDKNotInitialized">tlssdk is not initialized.</string>
|
||||
<string name="TUIKitErrorTLSSDKUserNotFound">The user information for TLSSDK was not found.</string>
|
||||
<string name="TUIKitErrorBindFaildRegTimeout">Registration timed out</string>
|
||||
<string name="TUIKitErrorBindFaildIsBinding">The bind operation in progress.</string>
|
||||
<string name="TUIKitErrorPacketFailUnknown">Unknown error occurred while sending packet</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoNet">No network connection when sending request packet, which is converted to case ERR_REQ_NO_NET_ON_REQ:</string>
|
||||
<string name="TUIKitErrorPacketFailRespNoNet">No network connection when sending response packet, which is converted to case ERR_REQ_NO_NET_ON_RSP:</string>
|
||||
<string name="TUIKitErrorPacketFailReqNoAuth">No permission when sending request packet</string>
|
||||
<string name="TUIKitErrorPacketFailSSOErr">SSO error</string>
|
||||
<string name="TUIKitErrorPacketFailRespTimeout">Response timed out</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncing">proxy_manager failed to sync SVR data</string>
|
||||
<string name="TUIKitErrorFriendshipProxySyncedFail">proxy_manager sync failed</string>
|
||||
<string name="TUIKitErrorFriendshipProxyLocalCheckErr">proxy_manager request parameter is invalid in local check.</string>
|
||||
<string name="TUIKitErrorGroupInvalidField">group assistant request field contains non-preset fields.</string>
|
||||
<string name="TUIKitErrorGroupStoreageDisabled">Local storage of group assistant group data is disabled.</string>
|
||||
<string name="TUIKitErrorLoadGrpInfoFailed">Failed to load groupinfo from storage</string>
|
||||
<string name="TUIKitErrorReqNoNetOnReq">No network connection when sending request</string>
|
||||
<string name="TUIKitErrorReqNoNetOnResp">No network connection when sending response</string>
|
||||
<string name="TUIKitErrorServiceNotReady">QALSDK service is not ready.</string>
|
||||
<string name="TUIKitErrorLoginAuthFailed">Account verification failed (user info get failed)</string>
|
||||
<string name="TUIKitErrorNeverConnectAfterLaunch">Failed to connect network when the app is lunched.</string>
|
||||
<string name="TUIKitErrorReqFailed">QAL execution failed</string>
|
||||
<string name="TUIKitErrorReqInvaidReq">Invalid request. Invalid toMsgService.</string>
|
||||
<string name="TUIKitErrorReqOnverLoaded">Request queue is full.</string>
|
||||
<string name="TUIKitErrorReqKickOff">Forced logout on another device</string>
|
||||
<string name="TUIKitErrorReqServiceSuspend">Service suspended</string>
|
||||
<string name="TUIKitErrorReqInvalidSign">SSO signature error</string>
|
||||
<string name="TUIKitErrorReqInvalidCookie">Invalid SSO cookie</string>
|
||||
<string name="TUIKitErrorLoginTlsRspParseFailed">TSL response packet is verified at login time. Packet length error.</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgTimeout">Timeout occurred when OPENSTATSVC attempted to report status to OPENMSG during login.</string>
|
||||
<string name="TUIKitErrorLoginOpenMsgRspParseFailed">Response parsing failed when OPENSTATSVC reports status to OPENMSG during login.</string>
|
||||
<string name="TUIKitErrorLoginTslDecryptFailed">TLS decryption failed at login time.</string>
|
||||
<string name="TUIKitErrorWifiNeedAuth">Verification is required for Wi-Fi connection.</string>
|
||||
<string name="TUIKitErrorUserCanceled">Canceled by user</string>
|
||||
<string name="TUIkitErrorRevokeTimeLimitExceed">Timed out recalling the message (default is 2 min).</string>
|
||||
<string name="TUIKitErrorLackUGExt">Missing UGC extension pack</string>
|
||||
<string name="TUIKitErrorAutoLoginNeedUserSig">Local ticket for auto login expired. userSig is required for manual login.</string>
|
||||
<string name="TUIKitErrorQALNoShortConneAvailable">No available SSO for short connections.</string>
|
||||
<string name="TUIKitErrorReqContentAttach">Message content is filtered due to security reasons.</string>
|
||||
<string name="TUIKitErrorLoginSigExpire">Returned at login time. Ticket expired.</string>
|
||||
<string name="TUIKitErrorSDKHadInit">SDK has been initialized. Do not initialize again.</string>
|
||||
<string name="TUIKitErrorOpenBDHBase">Openbdh error</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnReq">No network connection when sending request. Try again once network connection is restored.</string>
|
||||
<string name="TUIKitErrorRequestNoNetOnRsp">No network connection when sending response. Try again once network connection is restored.</string>
|
||||
<string name="TUIKitErrorRequestOnverLoaded">Request queue is full.</string>
|
||||
<string name="TUIKitErrorEnableUserStatusOnConsole">The user status not supported. Please enable the ability in the console first.</string>
|
||||
</resources>
|
||||
18
tuicore/src/main/res/values/strings.xml
Normal file
18
tuicore/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="open_file_tips">Select an app to open the file</string>
|
||||
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="sure">Confirm</string>
|
||||
<string name="core_permission_dialog_title">Authorization Request</string>
|
||||
<string name="core_permission_dialog_positive_setting_text">Settings</string>
|
||||
<string name="date_yesterday">Yesterday</string>
|
||||
<string name="date_year_short">YYYY</string>
|
||||
<string name="date_month_short">MM</string>
|
||||
<string name="date_day_short">DD</string>
|
||||
<string name="date_hour_short">HH</string>
|
||||
<string name="date_minute_short">MM</string>
|
||||
<string name="date_second_short">SS</string>
|
||||
|
||||
<string name="core_float_permission_hint">Please enable both \"Display pop-up window while running in the background\" and \"Display pop-up Window\" permissions</string>
|
||||
</resources>
|
||||
20
tuicore/src/main/res/values/styles.xml
Normal file
20
tuicore/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="CoreActivityTranslucent">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowAnimationStyle">@null</item>
|
||||
<item name="android:windowDisablePreview">true</item>
|
||||
</style>
|
||||
|
||||
<style name="TUIBaseTheme">
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
25
tuicore/src/main/res/values/tui_theme_attrs.xml
Normal file
25
tuicore/src/main/res/values/tui_theme_attrs.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<attr name="core_light_bg_title_text_color" format="reference|color"/>
|
||||
<attr name="core_light_bg_primary_text_color" format="reference|color"/>
|
||||
<attr name="core_light_bg_secondary_text_color" format="reference|color"/>
|
||||
<attr name="core_light_bg_secondary2_text_color" format="reference|color"/>
|
||||
<attr name="core_light_bg_disable_text_color" format="reference|color"/>
|
||||
<attr name="core_dark_bg_primary_text_color" format="reference|color"/>
|
||||
<attr name="core_primary_bg_color" format="reference|color"/>
|
||||
<attr name="core_bg_color" format="reference|color"/>
|
||||
<attr name="core_primary_color" format="reference|color"/>
|
||||
<attr name="core_error_tip_color" format="reference|color"/>
|
||||
<attr name="core_success_tip_color" format="reference|color"/>
|
||||
<attr name="core_bubble_bg_color" format="reference|color"/>
|
||||
<attr name="core_divide_color" format="reference|color"/>
|
||||
<attr name="core_border_color" format="reference|color"/>
|
||||
<attr name="core_header_start_color" format="reference|color"/>
|
||||
<attr name="core_header_end_color" format="reference|color"/>
|
||||
<attr name="core_header_text_color" format="reference|color"/>
|
||||
|
||||
<attr name="core_btn_normal_color" format="reference|color"/>
|
||||
<attr name="core_btn_pressed_color" format="reference|color"/>
|
||||
<attr name="core_btn_disable_color" format="reference|color"/>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user