11111
This commit is contained in:
@@ -13,22 +13,11 @@ public class NoviceInstructorModel extends BaseModel {
|
||||
* msg_zdy_send : 1
|
||||
* msg_zdy_send_text : 您好
|
||||
*/
|
||||
@SerializedName("home_zdy_pop")
|
||||
private int homeZdyPop;
|
||||
@SerializedName("msg_zdy_send")
|
||||
private String msgZdySend;
|
||||
@SerializedName("msg_zdy_send_text")
|
||||
private String msgZdySendText;
|
||||
|
||||
public int getHomeZdyPop() {
|
||||
return homeZdyPop;
|
||||
}
|
||||
|
||||
public NoviceInstructorModel setHomeZdyPop(int homeZdyPop) {
|
||||
this.homeZdyPop = homeZdyPop;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsgZdySend() {
|
||||
return msgZdySend;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -31,12 +31,24 @@ public class NoviceInstructorManager extends BaseCacheManager {
|
||||
private Context context;
|
||||
//展示新手指导员福利
|
||||
private Handler netHandler = new Handler();
|
||||
//是否弹出指导员引导弹窗
|
||||
private String homeZdyPop = "";
|
||||
|
||||
public NoviceInstructorManager(Context context) {
|
||||
super(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")));
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 呼出指导员引导操作
|
||||
*/
|
||||
private Runnable instructorOperationOpenRunnable = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
//展示指引弹窗
|
||||
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(false).setShowHomeDialoh(true));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user