Commit 22643ca0 by upwork.021

feat: 增加离开群聊房间二次确认弹窗

parent 389058c4
...@@ -196,8 +196,8 @@ public class MDTMainActivity extends AppCompatActivity { ...@@ -196,8 +196,8 @@ public class MDTMainActivity extends AppCompatActivity {
private void showLogoutDialog() { private void showLogoutDialog() {
final Dialog dialog = new Dialog(this, R.style.logoutDialogStyle); final Dialog dialog = new Dialog(this, R.style.logoutDialogStyle);
dialog.setContentView(R.layout.calling_logout_dialog); dialog.setContentView(R.layout.calling_logout_dialog);
Button btnPositive = (Button) dialog.findViewById(R.id.btn_positive); Button btnPositive = (Button) dialog.findViewById(R.id.btn_sure);
Button btnNegative = (Button) dialog.findViewById(R.id.btn_negative); Button btnNegative = (Button) dialog.findViewById(R.id.btn_cancel);
btnPositive.setOnClickListener(new View.OnClickListener() { btnPositive.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
......
...@@ -386,7 +386,7 @@ public class TUICallingEntranceActivity extends Activity { ...@@ -386,7 +386,7 @@ public class TUICallingEntranceActivity extends Activity {
final Dialog dialog = new Dialog(this, R.style.logoutDialogStyle); final Dialog dialog = new Dialog(this, R.style.logoutDialogStyle);
dialog.setContentView(R.layout.app_show_tip_dialog_confirm); dialog.setContentView(R.layout.app_show_tip_dialog_confirm);
TextView tvMessage = dialog.findViewById(R.id.tv_message); TextView tvMessage = dialog.findViewById(R.id.tv_message);
Button btnOk = dialog.findViewById(R.id.btn_negative); Button btnOk = dialog.findViewById(R.id.btn_cancel);
tvMessage.setText(R.string.app_permission_hint); tvMessage.setText(R.string.app_permission_hint);
btnOk.setOnClickListener(new View.OnClickListener() { btnOk.setOnClickListener(new View.OnClickListener() {
@Override @Override
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
app:layout_constraintTop_toBottomOf="@id/view_divide"> app:layout_constraintTop_toBottomOf="@id/view_divide">
<Button <Button
android:id="@+id/btn_negative" android:id="@+id/btn_cancel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="44dp" android:layout_height="44dp"
android:background="@android:color/transparent" android:background="@android:color/transparent"
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintBottom_toBottomOf="parent">
<Button <Button
android:id="@+id/btn_negative" android:id="@+id/btn_cancel"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
app:layout_constraintBottom_toBottomOf="@id/cl_button_panel" app:layout_constraintBottom_toBottomOf="@id/cl_button_panel"
app:layout_constraintHorizontal_weight="1" app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="@id/cl_button_panel" app:layout_constraintLeft_toLeftOf="@id/cl_button_panel"
app:layout_constraintRight_toLeftOf="@+id/btn_positive" /> app:layout_constraintRight_toLeftOf="@+id/btn_sure" />
<Button <Button
android:id="@+id/btn_positive" android:id="@+id/btn_sure"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
android:textSize="17sp" android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@id/cl_button_panel" app:layout_constraintBottom_toBottomOf="@id/cl_button_panel"
app:layout_constraintHorizontal_weight="1" app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/btn_negative" app:layout_constraintLeft_toRightOf="@id/btn_cancel"
app:layout_constraintRight_toRightOf="@id/cl_button_panel" /> app:layout_constraintRight_toRightOf="@id/cl_button_panel" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
...@@ -33,7 +33,7 @@ ext { ...@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.20", "ydl-tuicore" : "0.0.21",
// "m-tuicore-ydl" : "0.0.10", // "m-tuicore-ydl" : "0.0.10",
//第一步 //第一步
"ydl-platform" : "0.0.40.96", "ydl-platform" : "0.0.40.96",
......
package com.tencent.qcloud.tuicore.calling.videocall; package com.tencent.qcloud.tuicore.calling.videocall;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMCreateGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMGroupInfo;
import com.tencent.imsdk.v2.V2TIMGroupListener; import com.tencent.imsdk.v2.V2TIMGroupListener;
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo; import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMManager;
...@@ -250,9 +249,8 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli ...@@ -250,9 +249,8 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
@Override @Override
public void onClick(View v) { public void onClick(View v) {
int id = v.getId(); int id = v.getId();
if (id == R.id.iv_back || id == R.id.tv_leave) { if (id == R.id.tv_leave) {
exitRoom(); showLeaveRoom();
finish();
} else if (id == R.id.btn_audio) { } else if (id == R.id.btn_audio) {
muteAudio(); muteAudio();
} else if (id == R.id.btn_video) { } else if (id == R.id.btn_video) {
...@@ -538,4 +536,20 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli ...@@ -538,4 +536,20 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
} }
} }
/**
* 退出房间
*/
private void showLeaveRoom() {
final Dialog dialog = new Dialog(this, R.style.DialogStyle);
dialog.setContentView(R.layout.dialog_leave_room);
Button btnSure= dialog.findViewById(R.id.btn_sure);
Button btnCancel = dialog.findViewById(R.id.btn_cancel);
btnSure.setOnClickListener(v -> {
exitRoom();
finish();
});
btnCancel.setOnClickListener(v -> dialog.dismiss());
dialog.show();
}
} }
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="270dp"
android:layout_height="142dp"
android:layout_gravity="center"
android:background="@drawable/bg_edit_text">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text="你确定要离开房间吗?"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view_divide"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="43dp"
android:background="@color/trtccalling_color_text_search_hit"
app:layout_constraintBottom_toBottomOf="parent" />
<View
android:layout_width="1dp"
android:layout_height="43dp"
android:background="@color/trtccalling_color_text_search_hit"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_button_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent">
<Button
android:id="@+id/btn_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="取消"
android:textColor="@color/text_color_gray"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/cl_button_panel"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="@id/cl_button_panel"
app:layout_constraintRight_toLeftOf="@+id/btn_sure" />
<Button
android:id="@+id/btn_sure"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="确认"
android:textColor="@color/font_blue"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@id/cl_button_panel"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/btn_cancel"
app:layout_constraintRight_toRightOf="@id/cl_button_panel" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:visibility="invisible"
android:background="@drawable/ic_back_video" /> android:background="@drawable/ic_back_video" />
<TextView <TextView
......
...@@ -27,4 +27,12 @@ ...@@ -27,4 +27,12 @@
<!--<item name="android:windowIsTranslucent">true</item>--> <!--<item name="android:windowIsTranslucent">true</item>-->
<!--<item name="android:windowNoTitle">true</item>--> <!--<item name="android:windowNoTitle">true</item>-->
</style> </style>
<style name="DialogStyle" parent="@android:style/Theme.Holo.Dialog">
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowBackground">@color/trtccalling_color_countrycode_bg_dialog</item>
<item name="android:windowSoftInputMode">adjustResize</item>
</style>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment