This commit is contained in:
18401019693 2022-07-26 14:47:38 +08:00
parent af24e4a785
commit d3c37e4ec4
7 changed files with 201 additions and 3 deletions

View File

@ -0,0 +1,22 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
/**
* 用户面向指导员的数据类
*/
public class NoviceInstructorModel extends BaseModel {
@SerializedName("sendFirstMessage")
private String sendFirstMessage = "";
public String getSendFirstMessage() {
return sendFirstMessage;
}
public NoviceInstructorModel setSendFirstMessage(String sendFirstMessage) {
this.sendFirstMessage = sendFirstMessage;
return this;
}
}

View File

@ -0,0 +1,31 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
/**
* 指引用户与指导员交互的通讯数据类
*/
public class NoviceInstructorEvent extends BaseModel {
//是否展示指引弹窗
private boolean isShowHomeDialoh = false;
//是否展示指引icon
private boolean isShowHomeIcon = false;
public boolean isShowHomeDialoh() {
return isShowHomeDialoh;
}
public NoviceInstructorEvent setShowHomeDialoh(boolean showHomeDialoh) {
isShowHomeDialoh = showHomeDialoh;
return this;
}
public boolean isShowHomeIcon() {
return isShowHomeIcon;
}
public NoviceInstructorEvent setShowHomeIcon(boolean showHomeIcon) {
isShowHomeIcon = showHomeIcon;
return this;
}
}

View File

@ -0,0 +1,94 @@
package com.yunbao.common.manager;
import android.content.Context;
import android.os.Handler;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.yunbao.common.bean.NoviceInstructorModel;
import com.yunbao.common.event.NoviceInstructorEvent;
import com.yunbao.common.manager.base.BaseCacheManager;
import org.greenrobot.eventbus.EventBus;
/***
* 新手指导员管理引导
*/
public class NoviceInstructorManager extends BaseCacheManager {
private NoviceInstructorModel model = null;
private final static String KEY_NOVICE_INSTRUCTOR = "NoviceInstructor";
private static NoviceInstructorManager manager;
private Context context;
//展示新手指导员福利
private Handler netHandler = new Handler();
public NoviceInstructorManager(Context context) {
super(context);
this.context = context;
}
/**
* 获取单利
*
* @return
*/
public static NoviceInstructorManager get(Context context) {
if (null == manager) {
manager = new NoviceInstructorManager(context);
}
return manager;
}
/**
* 新手指导员相关信息类
*
* @return
*/
public NoviceInstructorModel getNoviceInstructor() {
if (null == model) {
model = new Gson().fromJson(
getString(KEY_NOVICE_INSTRUCTOR), NoviceInstructorModel.class);
}
return model;
}
/**
* 请求接口保存相应序列化数据
*
* @param model
*/
public void setNoviceInstructor(@NonNull NoviceInstructorModel model) {
this.model = model;
put(KEY_NOVICE_INSTRUCTOR, new Gson().toJson(model));
}
/**
* 清除相关信息
*/
public void removeNoviceInstructor() {
deleteByKey(KEY_NOVICE_INSTRUCTOR);
}
/**
* 请求接口获取是否展示
*/
public void getNetNoviceInstructor() {
if (null != model) {
netHandler.post(instructorOperationRunnable);
}
}
/**
* 指导员操作
*/
private Runnable instructorOperationRunnable = new Runnable() {
@Override
public void run() {
//展示指引弹窗
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(true));
}
};
}

View File

@ -18,6 +18,8 @@ import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@ -47,6 +49,7 @@ import com.yunbao.common.bean.LiveSvgGiftBean;
import com.yunbao.common.bean.UpdataListBean;
import com.yunbao.common.custom.TabButtonGroup;
import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.event.NoviceInstructorEvent;
import com.yunbao.common.event.RongIMConnectionStatusEvent;
import com.yunbao.common.event.UpdateTablePointMe;
import com.yunbao.common.http.CommonHttpConsts;
@ -147,6 +150,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
public static boolean isTabClose = false;
private boolean isFirstOpen = true;
private int messageNumber = 0, numberMe = 1;
private ImageView waitingTip;
@Override
protected int getLayoutId() {
@ -258,6 +262,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mRootView = (ViewGroup) findViewById(R.id.rootView);
mTabButtonGroup = (TabButtonGroup) findViewById(R.id.tab_group);
mViewPager = (ViewPager) findViewById(R.id.viewPager);
waitingTip = findViewById(R.id.waiting_tip);
mViewPager.setOffscreenPageLimit(4);
mViewList = new ArrayList<>();
for (int i = 0; i < 4; i++) {
@ -1004,5 +1009,21 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
ConversationIMListManager.get(mContext).jumpConversation(mContext, model.getTargetId());
}
/**
* 用户被踢下线
*
* @param event
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onNoviceInstructorEvent(NoviceInstructorEvent event) {
//是否展示指引弹窗
boolean isShowHomeDialoh = event.isShowHomeDialoh();
//是否展示指引icon
boolean isShowHomeIcon = event.isShowHomeIcon();
if (isShowHomeIcon) {
}
}
}

View File

@ -17,7 +17,6 @@ import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.bean.WeekListBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.main.R;
@ -116,6 +115,8 @@ public class MainHomeLiveWeekItemViewHolder<T> extends RecyclerView.ViewHolder {
@Override
public void onClick(View v) {
if (listener != null) {
WeekListBean model = mWeekList.get(viewflipperBanner.getDisplayedChild());
bean.setUid(model.getAnchor_id());
listener.onItemClick(bean, position);
}
}

View File

@ -144,4 +144,33 @@
android:src="@mipmap/icon_main_start" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="50dp">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="2" />
<ImageView
android:id="@+id/waiting_tip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clickable="true"
android:layout_marginStart="57dp"
android:src="@mipmap/waiting_tip"
android:focusable="true" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB