新增个播滑动换房引导弹窗
This commit is contained in:
@@ -49,6 +49,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.dialog.SingleRoomTipDialog;
|
||||
import com.yizhuan.erban.avroom.fragment.FakeSingleRoomFragment;
|
||||
import com.yizhuan.erban.avroom.fragment.HomePartyFragment;
|
||||
import com.yizhuan.erban.avroom.fragment.InputPwdDialogFragment;
|
||||
@@ -194,6 +195,8 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private boolean isResume = true;
|
||||
@Nullable
|
||||
private SingleRoomTipDialog singleRoomTipDialog;
|
||||
|
||||
public static void start(Context context, long roomUid) {
|
||||
Intent intent = new Intent(context, AVRoomActivity.class);
|
||||
@@ -423,6 +426,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
if (positionOffsetPixels != 0) {
|
||||
((FakeSingleRoomFragment) mAdapter.getItem(1)).requestPreRoomInfo();
|
||||
if (singleRoomTipDialog != null) {
|
||||
singleRoomTipDialog.dismissAllowingStateLoss();
|
||||
singleRoomTipDialog = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,6 +619,13 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
mRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
Logger.i("进入房间成功:" + mRoomInfo.getRoomId());
|
||||
dismissDialog();
|
||||
if (AvRoomDataManager.get().isSingleRoom() && DemoCache.readSingleRoomTip()) {
|
||||
DemoCache.saveSingleRoomTip(false);
|
||||
if (singleRoomTipDialog == null) {
|
||||
singleRoomTipDialog = new SingleRoomTipDialog();
|
||||
singleRoomTipDialog.show(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -0,0 +1,18 @@
|
||||
package com.yizhuan.erban.avroom.dialog
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.WindowManager
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogSingleRoomTipBinding
|
||||
|
||||
class SingleRoomTipDialog :
|
||||
BaseDialog<DialogSingleRoomTipBinding>() {
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun init() {
|
||||
binding.root.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
dialog?.window?.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)
|
||||
}
|
||||
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/ic_single_room_tip.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_single_room_tip.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.0 KiB |
22
app/src/main/res/layout/dialog_single_room_tip.xml
Normal file
22
app/src/main/res/layout/dialog_single_room_tip.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_single_room_tip" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="46dp"
|
||||
android:text="向上滑动发现更多精彩房间"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
@@ -62,6 +62,7 @@ public class DemoCache {
|
||||
private static final String KEY_RED_PACKAGE = "RedPackage";
|
||||
private static final String KEY_AT_MSG_UUID = "AtMsgUuid";
|
||||
private static final String KEY_BGM_SINGLE_CYCLE = "key_bgm_single_cycle";
|
||||
private static final String KEY_SINGLE_ROOM_TIP = "key_single_room_tip";
|
||||
/**
|
||||
* 保存网页域名
|
||||
*/
|
||||
@@ -347,5 +348,13 @@ public class DemoCache {
|
||||
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_BGM_SINGLE_CYCLE, false);
|
||||
}
|
||||
|
||||
public static void saveSingleRoomTip(boolean value) {
|
||||
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_SINGLE_ROOM_TIP , value);
|
||||
}
|
||||
|
||||
public static Boolean readSingleRoomTip() {
|
||||
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_SINGLE_ROOM_TIP, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user