Skip to content

Commit

Permalink
Dev/1.1.0 (#125)
Browse files Browse the repository at this point in the history
* feat: migration rtm to 2.1.7

* fix: enable setup rtm channel type for rtmmanager

* feat: add local mic seat service & add local enterseat func

* feat: add all local micseat set meta data

* fix: add receipt

* feat: release the lock when room will destroy

* fix: fix presence reset when timeout to rejoined

* fix: add @objc to protocol

* feat: add interaction handler to increase interaction between services

* feat: update music local service

* fix: remove custom log path

* fix: remove logs

* fix: remove "releasetime" in song model

* feat: add chorus local service

* fix:  create room to setup metadata

* feat: remove AUIiCreateRoomInfo

* fix: try acquire lock if release lock by any one

* fix: leave room to clean user info

* feat: add more interactionHandler

* fix: remove interaction of service

* refactor: rename class

* feat: add more func to aui arbiter

* fix: minor changes

* perf: add batch set metadata & refactor service interaction

* style: copy xxx local service to xxx service

* refactor: remove roommanager

* refactor: batch remove metadata

* style: rename protocol function

* feat: add  debug generate token closure

* fix: use message channel type & remove unused roominfo param & fix dispatch value change incorrect

* refactor: migration model & function

* refactor: new create room/get room/destroy room

* perf: remove unused token & remove join stream channel

* perf: update benchmark

* style: update error type

* fix: add timerout when receipt no response

* feat: add timerout for throttler

* feat: add local gift list json file & parse

* [Android]Update rtm version to v217 and adjust room controller.

* [Android]Complete lock logic and etc.

* [Android]Complete lock logic and etc.

* [Android]Perfect mic seat controller and etc.

* [Android]Perfect room and mic seat service and etc.

* [Android]Perfect choose song logic and etc.

* [Android]Perfect chorus logic and etc.

* [Android]Perfect gift logic and etc.

* [Android]Fix create room anr.

* [Android]Fix room destory info bug and etc.

* [Android]Fix audience choose song bug and etc.

* fix: remove lock incorrect

* feat: migration channel message to user message

* [Android]Change rtm channel message to user p2p message.

* perf: migration ktvapi

* [Android]Update room and channel name config and etc.

* fix: revert channel message

* feat: add map/list collection

* fix: send receipt incorrect

* feature: add merge type

* fix: fix build fail

* fix: merge permission fixed

* fix: clean metadata when destroy room fixed

* fix: update list collection

* fix: add clean type

* feat: add new property(sceneKey )

* feat: music/chorus service using list collection

* feat: add subscribe metadata closure

* feat: add calc metadata

* fix: leave seat user id incorrect

* refactor: collection model

* fix: cmd incorrect

* fix: receipt incorrect when set list collection metadata

* fix: add subscribe calc closure

* refactor: add base collection

* fix: remove music service filter(userId == xxx)

* [Android]Add map collection.

* [Android]Fix map collection problem.

* [Android]Add list collection and fix bugs.

* fix: sort music incorrect

* feat: add meta data will set closure & music sort

* fix: main thread check

* refactor: remove unused net work model

* fix: filter match bug fixed

* [Android]Update chorus service with list collection and fix bugs.

* fix: minor changes

* [Android]Perfect collection codes and fix some bugs.

* fix: add AUIAttributesModel

* fix: missing filter

* [Android]Add collection calculate method and etc.

* [Android]Change collection attribute callback model to AUIAttributesModel.

* feat: migration im service

* [Android]Add chat room create interface, adjust chat logic and etc.

* fix: chat id validation

* fix: receipt time out fixed

* fix: cleanUserInfo to remove all chorus info

* fix: chorus filter fixed

* feat: add collection operation error code

* [Android]1.Fix lock owner empty callback bug;2.Fix mic seat operations bug;

* [Android]1.Fix music player voice conversion bug;2.Fix user snapshot bug.

* [Android]Fix chorus tag bug.

* [Android]Adjust rtm publish timeout to 1000ms.

* [Android]perfect chorus code.

* style: minor changes func format

* fix: If it is the lock owner, fetch the metadata when recv the lock

* fix: im token reques bug fixed

* [Android]1.Perfect collection with error code;2.Fetch metadata when arbiter changing;3.Toast error message in ui.

* fix: recv lock bug fixed

* [Android]Fix audience with lock exit bug.

* docs: update readme

* docs: update changelog

* docs: update readme

* docs: update change log

* Dev/local service p2p (#121)

* docs: update readme

* docs: update changelog

* docs: update readme

* docs: update change log

* fix: podspec fixed

* fix: rtc sdk limited version range

* [Android]Fix bugs.

* [Android]Fix app compile problems.

* [Android]Perfect invitation logic and fix bugs.

* [Android]commit leak file.

* [Android]fix app demo bug.

* [Android]Perfect room interface, add kickout interface and etc.

* [Android]add kickout interface and etc.

* [Android]perfect user kick out api.

* feat: mirgration invitation service to local (#123)

* feat: mirgration invitation service to local

* fix: invitation optimize

* fix: timeout & invalid status clean

* fix: upgrade room manager

* fix: invite timer reset

* fix: kick user fixed

* fix: rtm logout before rtm login

* feat: add update room

* fix: invite bug fixed

* fix: invitation bundle folder  migration

* fix: update version

* fix: add value will change closure

* [Android]perfect invitation logic and etc.

* feat(backend):add backend to AUIKit (#124)

feat(backend):add backend

* [Android]fix bugs and perfect business logics.

* Update README.

* perf: localize optimize

* perf: remove unused function

* fix:  members view fixed

* fix: add roomManager

* fix: fix warning

* fix: update room manager

* fix: localize string & theme fixed

* fix: remove seat.backgroundColor

* [Android]fix mic seat count change bug and etc.

* docs: update readme

* fix: member view display incorrect

* [Android]fix mic seat ui bug and etc.

* fix: ripple view display fixed

* [Android]update strings.

* docs: update change log

* fix: emoji visible bug fixed

* fix merge problem.

---------

Co-authored-by: wushengtao <tamworth@163.com>
Co-authored-by: sync2gitee <sync2gitee@example.com>
Co-authored-by: Xianmeng Tang <tangxianmeng@live.com>
  • Loading branch information
4 people authored Feb 21, 2024
1 parent 7d97b85 commit f1fd202
Show file tree
Hide file tree
Showing 213 changed files with 6,176 additions and 2,920 deletions.
2 changes: 1 addition & 1 deletion AUIKitCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'AUIKitCore'
s.version = '1.0.0'
s.version = '1.1.0'
s.summary = 'A short description of AUIKit.'

# This description is used to generate tags and improve search results.
Expand Down
91 changes: 54 additions & 37 deletions Android/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,63 @@
# UiKit-Android

*English | [中文](README.zh.md)*
AUIKit是一套场景化应用的脚手架,提供Ui组件以及Service组件,方便开发者快速搭建起自己的场景化应用。

AUIKit is a set of scaffolding for scenario-based applications. It provides UI components and Service components to facilitate developers to quickly build their own scenario-based applications.

## Features
## 特性
- [AUIKit](auikit)
- [Service](auikit-service/src/main/java/io/agora/auikit/service)**([Document](doc/AUIKit-Service.md))**
- [AUIRoomManager](auikit-service/src/main/java/io/agora/auikit/service/IAUIRoomManager.java)
- [AUIUserService](auikit-service/src/main/java/io/agora/auikit/service/IAUIUserService.java)
- [AUIMicSeatService](auikit-service/src/main/java/io/agora/auikit/service/IAUIMicSeatService.java)
- [AUIMusicPlayerService](auikit-service/src/main/java/io/agora/auikit/service/IAUIMusicPlayerService.java)
- [AUIChorusService](auikit-service/src/main/java/io/agora/auikit/service/IAUIChorusService.java)
- [AUIJukeboxService](auikit-service/src/main/java/io/agora/auikit/service/IAUIJukeboxService.java)
- [UI](auikit-ui/src/main/java/io/agora/auikit/ui)**([Document](doc/AUIKit-UI.md))**
- [Feature UI Widgets](auikit-ui/src/main/java/io/agora/auikit/ui)
- [AUIMicSeatsView](auikit-ui/src/main/java/io/agora/auikit/ui/micseats/IMicSeatsView.java)
- [AUIJukeboxView](auikit-ui/src/main/java/io/agora/auikit/ui/jukebox/IAUIJukeboxView.java)
- [AUIMusicPlayerView](auikit-ui/src/main/java/io/agora/auikit/ui/musicplayer/IMusicPlayerView.java)
- [AUIMemberView](auikit-ui/src/main/java/io/agora/auikit/ui/member/IMemberListView.java)
- [Basic UI Widgets](auikit-ui/src/main/java/io/agora/auikit/ui/basic)
- [AUIButton](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIButton.java)
- [AUIBottomDialog](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIBottomDialog.java)
- [AUIAlertDialog](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIAlertDialog.java)
- [AUITabLayout](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUITabLayout.java)
- [AUIEditText](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIEditText.java)
- ...

## Quick Start

### 1. Environment Setup

- <mark>Minimum Compatibility with Android 5.0</mark>(SDK API Level 21)
- Android Studio 3.5 and above versions.
- Mobile devices with Android 5.0 and above.
- [Service](auikit-service/src/main/java/io/agora/auikit/service)**([使用指南](auikit-service))**
- [AUIRoomManager](auikit-service/src/main/java/io/agora/auikit/service/room/AUIRoomManager.kt)
- [AUIUserService](auikit-service/src/main/java/io/agora/auikit/service/IAUIUserService.java)
- [AUIMicSeatService](auikit-service/src/main/java/io/agora/auikit/service/IAUIMicSeatService.java)
- [AUIMusicPlayerService](auikit-service/src/main/java/io/agora/auikit/service/IAUIMusicPlayerService.java)
- [AUIChorusService](auikit-service/src/main/java/io/agora/auikit/service/IAUIChorusService.java)
- [AUIJukeboxService](auikit-service/src/main/java/io/agora/auikit/service/IAUIJukeboxService.java)
- [UI](auikit-ui/src/main/java/io/agora/auikit/ui)**([使用指南](auikit-ui))**
- [Feature UI Widgets](auikit-ui/src/main/java/io/agora/auikit/ui)
- [AUIMicSeatsView](auikit-ui/src/main/java/io/agora/auikit/ui/micseats/IMicSeatsView.java)
- [AUIJukeboxView](auikit-ui/src/main/java/io/agora/auikit/ui/jukebox/IAUIJukeboxView.java)
- [AUIMusicPlayerView](auikit-ui/src/main/java/io/agora/auikit/ui/musicplayer/IMusicPlayerView.java)
- [AUIMemberView](auikit-ui/src/main/java/io/agora/auikit/ui/member/IMemberListView.java)
- [Basic UI Widgets](auikit-ui/src/main/java/io/agora/auikit/ui/basic)
- [AUIButton](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIButton.java)
- [AUIBottomDialog](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIBottomDialog.java)
- [AUIAlertDialog](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIAlertDialog.java)
- [AUITabLayout](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUITabLayout.java)
- [AUIEditText](auikit-ui/src/main/java/io/agora/auikit/ui/basic/AUIEditText.java)
- 更多ui组件见[auikit-ui代码](auikit-ui/src/main/java/io/agora/auikit/ui)

---
## 快速跑通

### 1. 环境准备

- <mark>最低兼容 Android 5.0</mark>(SDK API Level 21)
- Android Studio 3.5及以上版本。
- Android 5.0 及以上的手机设备。


### 2. 运行示例

- 用 Android Studio 运行项目即可开始您的体验

> 注意:本示例只包含ui的基本使用,不包含service的使用示例,service的使用示例代码见以下场景化代码:
> - [AUIKaraoke](https://github.com/AgoraIO-Community/AUIKaraoke)
> - [AUIVoiceRoom](https://github.com/AgoraIO-Community/AUIVoiceRoom)


---
## 反馈

### 2. Running the Example
> 方案1:如果您已经在使用声网服务或者在对接中,可以直接联系对接的销售或服务
>
> 方案2:发送邮件给 [support@agora.io](mailto:support@agora.io) 咨询
>
> 方案3:扫码加入我们的微信交流群提问
>
> <img src="https://download.agora.io/demo/release/SDHY_QA.jpg" width="360" height="360">
- Run the project with Android Studio to begin your experience.
---
## 许可证

## License
Copyright © Agora Corporation. All rights reserved.
Licensed under the [MIT license](../LICENSE).
版权所有 Agora, Inc. 保留所有权利。
使用 [MIT 许可证](../LICENSE)
46 changes: 0 additions & 46 deletions Android/README.zh.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# AUIKit Service

*[English](AUIKit-Service.md) | 中文*

AUIKit Service提供一套通用的服务接口,可用于数据交互。这套接口可以结合rtm2.0或者其他serverless云服务实现一套完整的服务


Expand Down Expand Up @@ -52,26 +50,15 @@ auikit-service/src/main/java/io/agora/auikit/model
| getChannelName | 获取当前频道名 |


* **房间管理**

房间管理抽象类 -> [IAUIRoomManager](../auikit-service/src/main/java/io/agora/auikit/service/IAUIRoomManager.java)
Agora房间管理类 -> [AUIRoomManagerImpl](../auikit-service/src/main/java/io/agora/auikit/service/imp/AUIRoomServiceImpl.kt)
* **房间管理** -> [AUIRoomManager](../auikit-service/src/main/java/io/agora/auikit/service/room/AUIRoomManager.kt)

| 方法 | 注释 |
| :- | :- |
| createRoom | 创建房间(房主调用),若房间不存在,系统将自动创建一个新房间 |
| destroyRoom | 销毁房间(房主调用) |
| enterRoom | 进入房间(听众调用) |
| exitRoom | 退出房间(听众调用) |
| getRoomInfo | 获取指定房间信息 |
| getRoomInfoList | 获取指定房间id列表的详细信息,如果房间id列表为空,则获取所有房间的信息 |

房间信息回调接口 -> [IAUIRoomManager.AUIRoomRespObserver](../auikit-service/src/main/java/io/agora/auikit/service/IAUIRoomManager.java)

| 方法 | 注释 |
| :- | :- |
| onRoomDestroy | 房间被销毁的回调 |
| onRoomInfoChange | 房间信息变更回调 |

* **用户管理**

用户管理抽象类 -> [IAUIUserService](../auikit-service/src/main/java/io/agora/auikit/service/IAUIUserService.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class AUICommonConfig {
public @NonNull String appId = "";
// 声网App证书(可选,如果没有用到后端token生成服务可以不设置)
public @NonNull String appCert = "";
public @NonNull String basicAuth = "";
// 域名(可选,如果没有用到后端服务可以不设置)
public @NonNull String host = "";
// 用户信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import java.lang.annotation.Target;

public class AUIInvitationInfo {

private static final long kInvitationTimeoutTs = 10 * 1000;
private static final long kInvitationInvalidTs = 20 * 1000;

@IntDef({
AUIInvitationType.Apply,
AUIInvitationType.Invite,
Expand All @@ -25,6 +29,7 @@ public class AUIInvitationInfo {
AUIInvitationStatus.Accept,
AUIInvitationStatus.Reject,
AUIInvitationStatus.Timeout,
AUIInvitationStatus.Cancel,
})
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
Expand All @@ -33,6 +38,8 @@ public class AUIInvitationInfo {
int Accept = 2; // 同意
int Reject = 3; // 拒绝
int Timeout = 4; // 超时

int Cancel = 5; // 取消
}

// 申请观众userId,被邀请观众userId
Expand All @@ -46,4 +53,11 @@ public class AUIInvitationInfo {

public @AUIInvitationStatus int status = AUIInvitationStatus.Waiting;

public long createTime = System.currentTimeMillis();

public long editTime = System.currentTimeMillis();

public long timeoutTs = kInvitationTimeoutTs;

public long invalidTs = kInvitationInvalidTs;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

public class AUIRoomContext {
private static volatile AUIRoomContext instance = null;

private AUIRoomContext() {
// 私有构造函数
}

public static AUIRoomContext shared() {
if (instance == null) {
synchronized (AUIRoomContext.class){
if(instance == null){
synchronized (AUIRoomContext.class) {
if (instance == null) {
instance = new AUIRoomContext();
}
}
Expand All @@ -34,25 +36,27 @@ public static AUIRoomContext shared() {
public @Nullable AUICommonConfig mCommonConfig;
private final Map<String, AUIRoomInfo> roomInfoMap = new HashMap<>();

private @Nullable NtpTimeSource ntpTimeSource;

public void setCommonConfig(@NonNull AUICommonConfig config) {
mCommonConfig = config;
currentUserInfo = config.owner;
}

public @NonNull AUICommonConfig requireCommonConfig() {
if(mCommonConfig == null){
if (mCommonConfig == null) {
throw new RuntimeException("mCommonConfig is null now!");
}
return mCommonConfig;
}

public boolean isRoomOwner(String channelName){
public boolean isRoomOwner(String channelName) {
return isRoomOwner(channelName, currentUserInfo.userId);
}

public boolean isRoomOwner(String channelName, String userId){
public boolean isRoomOwner(String channelName, String userId) {
AUIRoomInfo roomInfo = roomInfoMap.get(channelName);
if(roomInfo == null || roomInfo.owner == null){
if (roomInfo == null || roomInfo.owner == null) {
return false;
}
return roomInfo.owner.userId.equals(userId);
Expand All @@ -72,18 +76,18 @@ public void insertRoomInfo(AUIRoomInfo info) {
roomInfoMap.put(info.roomId, info);
}

public void cleanRoom(String channelName){
public void cleanRoom(String channelName) {
roomInfoMap.remove(channelName);
roomConfigMap.remove(channelName);
AUIArbiter auiArbiter = roomArbiterMap.remove(channelName);
if(auiArbiter != null){
if (auiArbiter != null) {
auiArbiter.deInit();
}
}

public String getRoomOwner(String channelName){
public String getRoomOwner(String channelName) {
AUIRoomInfo roomInfo = roomInfoMap.get(channelName);
if(roomInfo == null || roomInfo.owner == null){
if (roomInfo == null || roomInfo.owner == null) {
return "";
}
return roomInfo.owner.userId;
Expand All @@ -96,4 +100,19 @@ public String getRoomOwner(String channelName){
public @Nullable AUIArbiter getArbiter(@NotNull String channelName) {
return roomArbiterMap.get(channelName);
}

public void setNtpTimeSource(@Nullable NtpTimeSource ntpTimeSource) {
this.ntpTimeSource = ntpTimeSource;
}

public long getNtpTime() {
if (ntpTimeSource != null) {
return ntpTimeSource.getNtpTime();
}
return System.currentTimeMillis();
}

public interface NtpTimeSource {
long getNtpTime();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Map;

public class AUIRoomInfo extends AUICreateRoomInfo implements Serializable {

Expand All @@ -14,4 +15,6 @@ public class AUIRoomInfo extends AUICreateRoomInfo implements Serializable {
public int memberCount = 0; // 房间人数
public long createTime = 0; // 房间创建时间

public Map<String, Object> customPayload; // 扩展字段

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.jetbrains.annotations.NotNull;

import java.util.List;

import io.agora.auikit.model.AUIUserInfo;
import io.agora.auikit.service.callback.AUICallback;
import io.agora.auikit.service.callback.AUIException;

public interface IAUIInvitationService extends IAUICommonService<IAUIInvitationService.AUIInvitationRespObserver> {
/**
Expand Down Expand Up @@ -125,5 +128,13 @@ default void onReceiveInvitation(String userId,int micIndex){}
* @param userList
*/
default void onApplyListUpdate(List<AUIUserInfo> userList){}

default @Nullable AUIException onInviteWillAccept(@NotNull String userId, int seatIndex) {
return null;
}

default @Nullable AUIException onApplyWillAccept(@NotNull String userId, int seatIndex) {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface IAUIMicSeatService extends IAUICommonService<IAUIMicSeatService
* @param userId 用户id
* @param callback 成功/失败回调
*/
void pickSeat(int seatIndex, @NonNull String userId, @Nullable AUICallback callback);
void pickSeat(int seatIndex, @NonNull AUIUserThumbnailInfo user, @Nullable AUICallback callback);

/**
* 踢人下麦(房主调用)
Expand Down
Loading

0 comments on commit f1fd202

Please sign in to comment.