退出房间弹窗高斯模糊改为使用第三方SDK
This commit is contained in:
@@ -270,6 +270,8 @@ dependencies {
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
}
|
||||
|
||||
String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
|
||||
|
@@ -1,17 +1,13 @@
|
||||
package com.yizhuan.erban.avroom.dialog
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.ImageView
|
||||
import android.widget.PopupWindow
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.drawToBitmap
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@@ -25,7 +21,6 @@ import com.yizhuan.erban.avroom.presenter.HomePartyPresenter
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager.LambdaOkDialogListener
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager.OkCancelDialogListener
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.erban.utils.FastBlur
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
@@ -35,14 +30,15 @@ import io.reactivex.disposables.Disposable
|
||||
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_exit_room)
|
||||
class ExitRoomPopupWindow(val avRoomActivity: AVRoomActivity, val rootView: View) : PopupWindow() {
|
||||
class ExitRoomPopupWindow(val avRoomActivity: AVRoomActivity) : PopupWindow() {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(avRoomActivity: AVRoomActivity, rootView: View): ExitRoomPopupWindow {
|
||||
return ExitRoomPopupWindow(avRoomActivity, rootView)
|
||||
fun newInstance(avRoomActivity: AVRoomActivity): ExitRoomPopupWindow {
|
||||
return ExitRoomPopupWindow(avRoomActivity)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private val recyclerView: RecyclerView
|
||||
@@ -74,11 +70,6 @@ class ExitRoomPopupWindow(val avRoomActivity: AVRoomActivity, val rootView: View
|
||||
|
||||
animationStyle = R.style.style_anim_right_in_out
|
||||
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
|
||||
contentView.findViewById<View>(R.id.tv_more).setOnClickListener {
|
||||
//HomeMoreRoomActivity.start(context)
|
||||
}
|
||||
|
||||
tvReport.setOnClickListener {
|
||||
val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo ?: return@setOnClickListener
|
||||
UIHelper.showReportPage(avRoomActivity, roomInfo.uid, XChatConstants.REPORT_TYPE_ROOM)
|
||||
@@ -135,37 +126,20 @@ class ExitRoomPopupWindow(val avRoomActivity: AVRoomActivity, val rootView: View
|
||||
disposable?.dispose()
|
||||
}
|
||||
|
||||
val bitmap = rootView.drawToBitmap()
|
||||
val bitmapX = bitmap.width
|
||||
val bitmapY = bitmap.height
|
||||
val bitmap1 = Bitmap.createBitmap(
|
||||
bitmap,
|
||||
bitmapX - ScreenUtil.dip2px(250f),
|
||||
0,
|
||||
ScreenUtil.dip2px(250f),
|
||||
bitmapY
|
||||
)
|
||||
blur(bitmap1, contentView.findViewById(R.id.iv_blur))
|
||||
}
|
||||
|
||||
private fun blur(bkg: Bitmap, view: ImageView) {
|
||||
val scaleFactor = 8
|
||||
var overlay =
|
||||
Bitmap.createScaledBitmap(bkg, bkg.width / scaleFactor, bkg.height / scaleFactor, false)
|
||||
overlay = FastBlur.blur(overlay, 5, true) //高斯模糊
|
||||
view.setImageBitmap(overlay)
|
||||
}
|
||||
|
||||
private fun handleExitRoom() {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying) {
|
||||
avRoomActivity.dialogManager.showOkCancelDialog("游戏中退出房间默认逃跑,确定进行此操作?", false,
|
||||
OkCancelDialogListener { avRoomActivity.toBack() })
|
||||
avRoomActivity.dialogManager.showOkCancelDialog(
|
||||
"游戏中退出房间默认逃跑,确定进行此操作?", false
|
||||
) { avRoomActivity.toBack() }
|
||||
return
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenKTV && AvRoomDataManager.get().isOwnerOnMic) {
|
||||
avRoomActivity.dialogManager.showOkCancelDialog("KTV模式下退出房间会移除您已点的所有歌曲,确定进行此操作?",
|
||||
false,
|
||||
OkCancelDialogListener { avRoomActivity.toBack() })
|
||||
avRoomActivity.dialogManager.showOkCancelDialog(
|
||||
"KTV模式下退出房间会移除您已点的所有歌曲,确定进行此操作?",
|
||||
false
|
||||
) { avRoomActivity.toBack() }
|
||||
return
|
||||
}
|
||||
if ((AvRoomDataManager.get().isQueuingMicro || AvRoomDataManager.get().isOpenPKMode)
|
||||
|
@@ -110,16 +110,16 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
addPKAction(optAdapter);
|
||||
addRoomPKAction(optAdapter);
|
||||
addSingleRoomPKAction(optAdapter);
|
||||
addInviteFansOptAdapter();
|
||||
addSendBroadcastAction(optAdapter);
|
||||
addInviteFansOptAdapter();
|
||||
addVipSendBroadcastAction(optAdapter);
|
||||
addRedPacketAction(optAdapter);
|
||||
addRoomLimit(optAdapter);
|
||||
addGiftEffectAction(optAdapter);
|
||||
addRoomSettingAction(optAdapter);
|
||||
addGiftEffectAction(optAdapter);
|
||||
addOpenOrClosePublicScreenAction(optAdapter);
|
||||
addRedPackageSwitch();
|
||||
addCleanScreenAction(optAdapter);
|
||||
addRoomLimit(optAdapter);
|
||||
addGiftValueAction(optAdapter);
|
||||
addSuperAdminAction(optAdapter);
|
||||
rvOPtList.setAdapter(optAdapter);
|
||||
|
@@ -495,8 +495,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.room_more:
|
||||
View view = requireActivity().findViewById(android.R.id.content);
|
||||
ExitRoomPopupWindow.newInstance((AVRoomActivity) requireActivity(), view)
|
||||
ExitRoomPopupWindow.newInstance((AVRoomActivity) requireActivity())
|
||||
.showAtLocation(gameMainBinding.getRoot(), Gravity.END, 0, 0);
|
||||
break;
|
||||
case R.id.ll_room_info:
|
||||
|
@@ -74,7 +74,7 @@ public class AllServiceVipLevelUPDialog extends BaseDialog {
|
||||
|
||||
private void showVipNotifyBySVGA() {
|
||||
SpannableBuilder text = new SpannableBuilder()
|
||||
.append("引爆全场!恭喜", new ForegroundColorSpan(Color.WHITE))
|
||||
.append("引爆全场!恭喜 ", new ForegroundColorSpan(Color.WHITE))
|
||||
.append("-", new CircleImageSpan(new ColorDrawable(Color.TRANSPARENT), vipMessageInfo.getAvatar(), 50, 50))
|
||||
.append(" " + StringExtensionKt.sub(vipMessageInfo.getNick(), 6) + " ", new ForegroundColorSpan(getContext().getResources().getColor(R.color.notice_nick)))
|
||||
.append("贵族身份升级为" + vipMessageInfo.getCurrVipName(), new ForegroundColorSpan(Color.WHITE)+"!");
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 798 B |
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 941 B |
@@ -12,11 +12,18 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:background="@color/blue">
|
||||
|
||||
<ImageView
|
||||
<!-- <ImageView
|
||||
android:id="@+id/iv_blur"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY" />
|
||||
android:scaleType="fitXY" />-->
|
||||
|
||||
<com.github.mmin18.widget.RealtimeBlurView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:realtimeBlurRadius="20dp"
|
||||
app:realtimeDownsampleFactor="3"
|
||||
app:realtimeOverlayColor="#B3020023" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
|
Reference in New Issue
Block a user