Skip to content

Commit

Permalink
【Android】update version to 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rulongzhang authored and AbySwifter committed Dec 16, 2023
1 parent b3cc72a commit 6449cfd
Show file tree
Hide file tree
Showing 83 changed files with 1,320 additions and 654 deletions.
22 changes: 17 additions & 5 deletions Android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import org.gradle.util.VersionNumber

apply plugin: 'com.android.application'

android {
namespace "com.tencent.liteav.demo"
compileSdkVersion 30
buildToolsVersion "30.0.2"
buildToolsVersion "30.0.3"

defaultConfig {
applicationId 'com.tencent.liteav.tuiroom'
Expand All @@ -12,10 +15,8 @@ android {
targetSdkVersion 30
multiDexEnabled true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
buildFeatures {
buildConfig = false
}

buildTypes {
Expand All @@ -24,12 +25,23 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

def roomSourceJavaVersion = JavaVersion.VERSION_1_8
VersionNumber currentGradleVersion = VersionNumber.parse(gradle.gradleVersion)
if (currentGradleVersion.major >= 8) {
roomSourceJavaVersion = JavaVersion.VERSION_17
}
compileOptions {
sourceCompatibility roomSourceJavaVersion
targetCompatibility roomSourceJavaVersion
}
}

dependencies {
implementation project(':tuiroomkit')
implementation project(':debug')

implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.navigation:navigation-fragment:2.1.0"
implementation "androidx.navigation:navigation-ui:2.1.0"
implementation "de.hdodenhof:circleimageview:3.1.0"
Expand Down
23 changes: 10 additions & 13 deletions Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.tencent.liteav.demo">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".BaseApplication"
android:name="com.tencent.liteav.demo.BaseApplication"
android:allowBackup="false"
android:icon="@drawable/app_ic_launcher"
android:label="@string/app_name"
Expand All @@ -13,35 +12,33 @@
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup">
<activity
android:name=".view.activity.PrepareActivity"
android:name="com.tencent.liteav.demo.view.activity.PrepareActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".view.activity.CreateRoomActivity"
android:name="com.tencent.liteav.demo.view.activity.CreateRoomActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".view.activity.EnterRoomActivity"
android:name="com.tencent.liteav.demo.view.activity.EnterRoomActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".LoginActivity"
android:launchMode="singleTask"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".MainActivity"
android:name="com.tencent.liteav.demo.LoginActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".ProfileActivity"
android:name="com.tencent.liteav.demo.ProfileActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".SplashActivity"
android:name="com.tencent.liteav.demo.SplashActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void onSuccess() {
Log.d(TAG, "TUILogin.login onSuccess");
String userName = TextUtils.isEmpty(userModel.userName) ? userModel.userId : userModel.userName;
TUIRoomKit.createInstance().setSelfInfo(userName, userModel.userAvatar, null);
TUICore.startActivity("MainActivity", null);
TUICore.startActivity("PrepareActivity", null);
finish();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onSuccess() {
Log.d(TAG, "TUILogin.login onSuccess");
String userName = TextUtils.isEmpty(userModel.userName) ? userModel.userId : userModel.userName;
TUIRoomKit.createInstance().setSelfInfo(userName, userModel.userAvatar, null);
TUICore.startActivity("MainActivity", null);
TUICore.startActivity("PrepareActivity", null);
finish();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class CreateRoomActivity extends AppCompatActivity implements RoomEventCe
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tuiroomkit_activity_create_room);
setContentView(R.layout.app_activity_create_room);
CreateRoomView createRoomView = new CreateRoomView(this);
ViewGroup root = findViewById(R.id.ll_root_create_room);
root.addView(createRoomView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class EnterRoomActivity extends AppCompatActivity implements RoomEventCen
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tuiroomkit_activity_enter_room);
setContentView(R.layout.app_activity_enter_room);
EnterRoomView enterRoomView = new EnterRoomView(this);
ViewGroup root = findViewById(R.id.ll_root_enter_room);
root.addView(enterRoomView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import androidx.appcompat.app.AppCompatActivity;

import com.tencent.cloud.tuikit.roomkit.TUIRoomKit;
import com.tencent.liteav.demo.R;
import com.tencent.liteav.demo.view.component.PrepareView;
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
Expand All @@ -16,7 +15,7 @@ public class PrepareActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tuiroomkit_activity_prepare);
setContentView(R.layout.app_activity_prepare);
ViewGroup root = findViewById(R.id.ll_root);
boolean enablePreview = getIntent().getBooleanExtra(INTENT_ENABLE_PREVIEW, true);
PrepareView prepareView = new PrepareView(this, enablePreview);
Expand All @@ -32,6 +31,5 @@ public void onError(int errorCode, String errorMessage) {

}
});
TUIRoomKit.createInstance();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.tencent.liteav.demo.view.component;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
Expand All @@ -13,14 +14,14 @@
import com.tencent.liteav.demo.viewmodel.CreateRoomViewModel;
import com.tencent.qcloud.tuicore.TUILogin;
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
import com.tencent.qcloud.tuicore.util.ToastUtil;

import java.util.ArrayList;

public class CreateRoomView extends RelativeLayout
implements View.OnClickListener {
private Context mContext;
private Toolbar mToolbar;
private TextView mTextRoomId;
private TextView mTextCreateRoom;

private TextView mTextUserName;
Expand All @@ -31,9 +32,11 @@ public class CreateRoomView extends RelativeLayout

private TUICallback mFinishCallback;

private String mRoomId;

public CreateRoomView(Context context) {
super(context);
View.inflate(context, R.layout.tuiroomkit_view_create_room, this);
View.inflate(context, R.layout.app_view_create_room, this);
mContext = context;
mViewModel = new CreateRoomViewModel(mContext);
initView();
Expand All @@ -45,19 +48,20 @@ public void setFinishCallback(TUICallback finishCallback) {
}

private void initData() {
String userId = TUILogin.getUserId();
String userName = TUILogin.getNickName();
String roomId = mViewModel.getRoomId(userId);
mTextRoomId.setText(roomId);
mTextUserName.setText(userName);
mViewModel.getRoomId(new CreateRoomViewModel.GetRoomIdCallback() {
@Override
public void onGetRoomId(String roomId) {
mRoomId = roomId;
}
});
}


private void initView() {
mToolbar = findViewById(R.id.toolbar);
mTextCreateRoom = findViewById(R.id.tv_create);
mTextUserName = findViewById(R.id.tv_user_name);
mTextRoomId = findViewById(R.id.tv_room_id);
mTextRoomType = findViewById(R.id.tv_room_type);
mLayoutSettingContainer = findViewById(R.id.ll_setting_container);
mRoomTypeDialog = new RoomTypeSelectView(mContext);
Expand All @@ -66,8 +70,8 @@ private void initView() {
public void onSpeechModeChanged(TUIRoomDefine.SpeechMode speechMode) {
mViewModel.setSpeechMode(speechMode);
int resId = TUIRoomDefine.SpeechMode.FREE_TO_SPEAK.equals(speechMode)
? R.string.tuiroomkit_room_free_speech
: R.string.tuiroomkit_room_raise_hand;
? R.string.app_room_free_speech
: R.string.app_room_raise_hand;
mTextRoomType.setText(resId);
}
});
Expand Down Expand Up @@ -107,7 +111,11 @@ public void onClick(View view) {
}
mRoomTypeDialog.show();
} else if (view.getId() == R.id.tv_create) {
mViewModel.createRoom(mTextRoomId.getText().toString());
if (TextUtils.isEmpty(mRoomId)) {
ToastUtil.toastShortMessage(mContext.getString(R.string.app_tip_creating_room_id));
return;
}
mViewModel.createRoom(mRoomId);
mTextCreateRoom.setClickable(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class EnterRoomView extends RelativeLayout {

public EnterRoomView(Context context) {
super(context);
View.inflate(context, R.layout.tuiroomkit_view_enter_room, this);
View.inflate(context, R.layout.app_view_enter_room, this);
mContext = context;
mViewModel = new EnterRoomViewModel(mContext);
initView();
Expand Down
Loading

0 comments on commit 6449cfd

Please sign in to comment.