Skip to content

Commit 1e67219

Browse files
committed
docs: update api doc about android
1 parent b4cc979 commit 1e67219

4 files changed

Lines changed: 74 additions & 30 deletions

File tree

docs/sdks/api/conversation/changeInputStates.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,36 @@ Future changeInputStates({
112112

113113
<TabItem value="Android">
114114

115+
### 函数原型
116+
117+
```java showLineNumbers
118+
public void changeInputState(OnBase<String> base, String conversionId, boolean focus)
119+
```
120+
121+
### 输入参数
122+
123+
| 参数名称 | 参数类型 | 是否必填 | 描述 |
124+
| -------------- | -------- | -------- | ------- |
125+
| conversationID | String || 会话 ID |
126+
| focus | boolean || 是否正在输入 |
127+
128+
### 返回结果
129+
130+
### 代码示例
131+
132+
```java showLineNumbers
133+
OpenIMClient.getInstance().conversationManager.changeInputState(new OnBase<String>() {
134+
@Override
135+
public void onError(int code, String error) {
136+
// todo: 处理错误信息
137+
}
138+
@Override
139+
public void onSuccess(String data) {
140+
// todo: 请求成功
141+
}
142+
}, conversationID , focus);
143+
```
144+
115145
</TabItem>
116146

117147
<TabItem value="Web">

docs/sdks/api/conversation/getInputStates.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,36 @@ Future getInputstates({
107107

108108
<TabItem value="Android">
109109

110+
### 函数原型
111+
112+
```java showLineNumbers
113+
public void getInputState(OnBase<String> base, String conversionId, String userId)
114+
```
115+
116+
### 输入参数
117+
118+
| 参数名称 | 参数类型 | 是否必填 | 描述 |
119+
| -------------- | -------- | -------- | ------- |
120+
| conversationID | String || 会话 ID |
121+
| userId | String || 用户ID |
122+
123+
### 返回结果
124+
125+
### 代码示例
126+
127+
```java showLineNumbers
128+
OpenIMClient.getInstance().conversationManager.getInputState(new OnBase<String>() {
129+
@Override
130+
public void onError(int code, String error) {
131+
// todo: 处理错误信息
132+
}
133+
@Override
134+
public void onSuccess(String data) {
135+
// todo: 请求成功
136+
}
137+
}, conversationID , userId);
138+
```
139+
110140

111141
</TabItem>
112142

i18n/en/docusaurus-plugin-content-docs-sdks/current/api/conversation/changeInputStates.mdx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ Future changeInputStates({
115115
### Function Prototype
116116

117117
```java showLineNumbers
118-
public void changeInputStates(String conversationID, boolean focus, OIMSuccessCallback onSuccess, OIMFailureCallback onFailure) {
119-
// implementation
120-
}
118+
public void changeInputState(OnBase<String> base, String conversionId, boolean focus)
121119
```
122120

123121
### Input Parameters
@@ -129,25 +127,19 @@ public void changeInputStates(String conversationID, boolean focus, OIMSuccessCa
129127

130128
### Return Result
131129

132-
| Name | Type | Description |
133-
| --------- | --------------------- | -------------- |
134-
| onSuccess | OIMSuccessCallback | Success return |
135-
| onFailure | OIMFailureCallback | Failure return |
136-
137130
### Code Example
138131

139132
```java showLineNumbers
140-
changeInputStates(conversationID, focus, new OIMSuccessCallback() {
133+
OpenIMClient.getInstance().conversationManager.changeInputState(new OnBase<String>() {
141134
@Override
142-
public void onSuccess(String data) {
143-
// handle success
135+
public void onError(int code, String error) {
136+
// todo: handle success
144137
}
145-
}, new OIMFailureCallback() {
146138
@Override
147-
public void onFailure(int code, String msg) {
148-
// handle failure
139+
public void onSuccess(String data) {
140+
// todo: request fail
149141
}
150-
});
142+
}, conversationID , focus);
151143
```
152144

153145
</TabItem>

i18n/en/docusaurus-plugin-content-docs-sdks/current/api/conversation/getInputStates.mdx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ Future getInputstates({
109109
### Function Prototype
110110

111111
```java showLineNumbers
112-
public void getInputStates(String conversationID, String userID, OIMSuccessCallback onSuccess, OIMFailureCallback onFailure) {
113-
// implementation
114-
}
112+
public void getInputState(OnBase<String> base, String conversionId, String userId)
115113
```
116114

117115
### Input Parameters
@@ -123,25 +121,19 @@ public void getInputStates(String conversationID, String userID, OIMSuccessCallb
123121

124122
### Return Result
125123

126-
| Name | Type | Description |
127-
| --------- | --------------------- | -------------- |
128-
| onSuccess | OIMSuccessCallback | Success return |
129-
| onFailure | OIMFailureCallback | Failure return |
130-
131124
### Code Example
132125

133126
```java showLineNumbers
134-
getInputStates(conversationID, userID, new OIMSuccessCallback() {
127+
OpenIMClient.getInstance().conversationManager.getInputState(new OnBase<String>() {
135128
@Override
136-
public void onSuccess(String data) {
137-
// handle success
129+
public void onError(int code, String error) {
130+
// todo: handle success
138131
}
139-
}, new OIMFailureCallback() {
140132
@Override
141-
public void onFailure(int code, String msg) {
142-
// handle failure
133+
public void onSuccess(String data) {
134+
// todo: request fail
143135
}
144-
});
136+
}, conversationID , userId);
145137
```
146138

147139
</TabItem>

0 commit comments

Comments
 (0)