This commit is contained in:
18401019693 2022-07-27 09:29:23 +08:00
parent 18cf3c9ba3
commit 4ea1758595
10 changed files with 198 additions and 13 deletions

View File

@ -13,22 +13,11 @@ public class NoviceInstructorModel extends BaseModel {
* msg_zdy_send : 1 * msg_zdy_send : 1
* msg_zdy_send_text : 您好 * msg_zdy_send_text : 您好
*/ */
@SerializedName("home_zdy_pop")
private int homeZdyPop;
@SerializedName("msg_zdy_send") @SerializedName("msg_zdy_send")
private String msgZdySend; private String msgZdySend;
@SerializedName("msg_zdy_send_text") @SerializedName("msg_zdy_send_text")
private String msgZdySendText; private String msgZdySendText;
public int getHomeZdyPop() {
return homeZdyPop;
}
public NoviceInstructorModel setHomeZdyPop(int homeZdyPop) {
this.homeZdyPop = homeZdyPop;
return this;
}
public String getMsgZdySend() { public String getMsgZdySend() {
return msgZdySend; return msgZdySend;
} }

View File

@ -0,0 +1,68 @@
package com.yunbao.common.dialog;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.yunbao.common.R;
import java.lang.reflect.Field;
public class InstructorOperationDialog extends AbsDialogFragment {
@Override
protected int getLayoutId() {
return R.layout.view_instructor_operation;
}
/**
* 主要时这个方法上面两个方法只是获取布局用的可以不要
*
* @param manager
* @param tag
*/
@Override
public void show(FragmentManager manager, String tag) {
try {
Field dismissed = DialogFragment.class.getDeclaredField("mDismissed");
dismissed.setAccessible(true);
dismissed.set(this, false);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
try {
Field showByMe = DialogFragment.class.getDeclaredField("mShownByMe");
showByMe.setAccessible(true);
showByMe.set(this, true);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
FragmentTransaction ft = manager.beginTransaction();
ft.add(this, tag);
ft.commitAllowingStateLoss();
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return false;
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.CENTER;
window.setAttributes(params);
}
}

View File

@ -31,12 +31,24 @@ public class NoviceInstructorManager extends BaseCacheManager {
private Context context; private Context context;
//展示新手指导员福利 //展示新手指导员福利
private Handler netHandler = new Handler(); private Handler netHandler = new Handler();
//是否弹出指导员引导弹窗
private String homeZdyPop = "";
public NoviceInstructorManager(Context context) { public NoviceInstructorManager(Context context) {
super(context); super(context);
this.context = context; this.context = context;
} }
/**
* 呼出指导员引导弹窗
*
* @return
*/
public NoviceInstructorManager setHomeZdyPop(String homeZdyPop) {
this.homeZdyPop = homeZdyPop;
netHandler.post(instructorOperationOpenRunnable);
return this;
}
/** /**
* 获取单利 * 获取单利
@ -128,4 +140,15 @@ public class NoviceInstructorManager extends BaseCacheManager {
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(TextUtils.equals(model.getMsgZdySend(), "1"))); EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(TextUtils.equals(model.getMsgZdySend(), "1")));
} }
}; };
/**
* 呼出指导员引导操作
*/
private Runnable instructorOperationOpenRunnable = new Runnable() {
@Override
public void run() {
//展示指引弹窗
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(false).setShowHomeDialoh(true));
}
};
} }

View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/transparent"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="350dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="66dp"
android:background="@mipmap/tip_box"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:text="@string/welcome_pd"
android:textColor="#FF1A1A1A"
android:textSize="21sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:text="@string/welcome_pd_tip"
android:textColor="#FFF19DA0"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:drawableLeft="@mipmap/icon_love_message"
android:drawablePadding="3dp"
android:text="@string/do_you_like_find"
android:textColor="#FFFFBE41"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:gravity="center"
android:text="@string/exclusive_instructor"
android:textColor="#FF737373"
android:textSize="10sp" />
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="1" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_margin="30dp"
android:orientation="vertical"
app:cardBackgroundColor="#FFFFBE41"
app:cardCornerRadius="20dp"
app:cardElevation="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="21dp"
android:gravity="center"
android:text="@string/hurry_contact"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@mipmap/top_zhidao_bg" />
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

View File

@ -840,4 +840,9 @@
<string name="live_hot_ruletext31">熱度卡生效多久?</string> <string name="live_hot_ruletext31">熱度卡生效多久?</string>
<string name="live_hot_ruletext32">對指定主播使用熱度卡後將會立即生效效果時長為24小時不管主播是否在線熱度時長都將會持續減少</string> <string name="live_hot_ruletext32">對指定主播使用熱度卡後將會立即生效效果時長為24小時不管主播是否在線熱度時長都將會持續減少</string>
<string name="quote">引用</string> <string name="quote">引用</string>
<string name="welcome_pd">歡迎來到PD LIVE</string>
<string name="welcome_pd_tip">這有各類好看有趣的主播\n還有各種豐富的活動玩法</string>
<string name="do_you_like_find">在找您喜歡的主播嗎?</string>
<string name="exclusive_instructor">聯系您的專屬指導員,\n給您匹配更多風格的主播唷</string>
<string name="hurry_contact">趕快聯系他/她吧!</string>
</resources> </resources>

View File

@ -49,6 +49,7 @@ import com.yunbao.common.bean.LiveSvgGiftBean;
import com.yunbao.common.bean.NoviceInstructorModel; import com.yunbao.common.bean.NoviceInstructorModel;
import com.yunbao.common.bean.UpdataListBean; import com.yunbao.common.bean.UpdataListBean;
import com.yunbao.common.custom.TabButtonGroup; import com.yunbao.common.custom.TabButtonGroup;
import com.yunbao.common.dialog.InstructorOperationDialog;
import com.yunbao.common.event.MessageIMEvent; import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.event.NoviceInstructorEvent; import com.yunbao.common.event.NoviceInstructorEvent;
import com.yunbao.common.event.RongIMConnectionStatusEvent; import com.yunbao.common.event.RongIMConnectionStatusEvent;
@ -591,6 +592,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} }
Constants.isShowPage = -1; Constants.isShowPage = -1;
NoviceInstructorManager.get(mContext).getNoviceInstructor(); NoviceInstructorManager.get(mContext).getNoviceInstructor();
NoviceInstructorManager.get(mContext).setHomeZdyPop("1");
} }
/** /**
@ -1032,7 +1035,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
boolean isShowHomeDialoh = event.isShowHomeDialoh(); boolean isShowHomeDialoh = event.isShowHomeDialoh();
//是否展示指引icon //是否展示指引icon
boolean isShowHomeIcon = event.isShowHomeIcon(); boolean isShowHomeIcon = event.isShowHomeIcon();
if (isShowHomeDialoh) {
InstructorOperationDialog fragment1 = new InstructorOperationDialog();
fragment1.show(getSupportFragmentManager(), "InstructorOperationDialog");
}
if (isShowHomeIcon) { if (isShowHomeIcon) {
waitingTip.setVisibility(View.VISIBLE); waitingTip.setVisibility(View.VISIBLE);
//跳转消息中心 //跳转消息中心

View File

@ -22,6 +22,7 @@ import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
@ -124,7 +125,7 @@ public class OneLoginDialog extends AbsDialogFragment {
gotoLive(obj.getString("anchor_id")); gotoLive(obj.getString("anchor_id"));
IMLoginManager.get(mContext).setisNewUserOne(true); IMLoginManager.get(mContext).setisNewUserOne(true);
if (obj.containsKey("home_zdy_pop")) { if (obj.containsKey("home_zdy_pop")) {
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
} }
// OneLoginActivity.act.finish(); // OneLoginActivity.act.finish();
} else { } else {