流程发起添加选择人员
This commit is contained in:
parent
9590b630fa
commit
217d12f63e
@ -16,6 +16,7 @@ android {
|
|||||||
"room.schemaLocation": "$projectDir/schemas".toString()]
|
"room.schemaLocation": "$projectDir/schemas".toString()]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -28,6 +29,12 @@ android {
|
|||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
jniLibs.srcDirs = ['libs']
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -7,10 +7,10 @@ package com.tenlionsoft.baselib.core.retrofit_net;
|
|||||||
*/
|
*/
|
||||||
public class BaseUrlApi {
|
public class BaseUrlApi {
|
||||||
|
|
||||||
// public static final String IP = "http://192.168.0.120:8082/";/* 测试IP */
|
public static final String IP = "http://192.168.0.120:8082/";/* 测试IP */
|
||||||
// public static final String IP = "http://121.36.71.250/";/* 测试IP */
|
// public static final String IP = "http://121.36.71.250/";/* 测试IP */
|
||||||
// public static final String IP = "http://106.12.218.237:8002/";/* 公司IP */
|
// public static final String IP = "http://106.12.218.237:8002/";/* 公司IP */
|
||||||
public static final String IP="http://106.74.34.13:8081/";//* 呼市玉泉区司法 */
|
// public static final String IP="http://106.74.34.13:8081/";//* 呼市玉泉区司法 */
|
||||||
// public static final String IP = "https://www.xzszwhy.cn/";/* 公司IP */
|
// public static final String IP = "https://www.xzszwhy.cn/";/* 公司IP */
|
||||||
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||||
// public static final String SYS_USERCENTER = "xzszwhy/";//西藏统一用户
|
// public static final String SYS_USERCENTER = "xzszwhy/";//西藏统一用户
|
||||||
|
@ -32,8 +32,10 @@ import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
|||||||
import com.tenlionsoft.baselib.core.widget.base.BaseViewPage2Adapter;
|
import com.tenlionsoft.baselib.core.widget.base.BaseViewPage2Adapter;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||||
import com.tenlionsoft.baselib.utils.KeyBoardListener;
|
import com.tenlionsoft.baselib.utils.KeyBoardListener;
|
||||||
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -110,6 +112,7 @@ public class MainTabActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化视图
|
* 初始化视图
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +39,7 @@ import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
|||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.bigkoo.pickerview.view.TimePickerView;
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.just.agentweb.AbsAgentWebSettings;
|
import com.just.agentweb.AbsAgentWebSettings;
|
||||||
@ -76,6 +77,8 @@ import com.tenlionsoft.oamodule.R2;
|
|||||||
import com.tenlionsoft.oamodule.adapter.OaFlowLogAdapter;
|
import com.tenlionsoft.oamodule.adapter.OaFlowLogAdapter;
|
||||||
import com.tenlionsoft.oamodule.beans.CarBean;
|
import com.tenlionsoft.oamodule.beans.CarBean;
|
||||||
import com.tenlionsoft.oamodule.beans.ChoosePersonListBean;
|
import com.tenlionsoft.oamodule.beans.ChoosePersonListBean;
|
||||||
|
import com.tenlionsoft.oamodule.beans.ChooseUserBean;
|
||||||
|
import com.tenlionsoft.oamodule.beans.DocumentTypeList;
|
||||||
import com.tenlionsoft.oamodule.beans.DriverBean;
|
import com.tenlionsoft.oamodule.beans.DriverBean;
|
||||||
import com.tenlionsoft.oamodule.beans.MeetingRoomBean;
|
import com.tenlionsoft.oamodule.beans.MeetingRoomBean;
|
||||||
import com.tenlionsoft.oamodule.beans.MineApplyBean;
|
import com.tenlionsoft.oamodule.beans.MineApplyBean;
|
||||||
@ -89,6 +92,7 @@ import com.tenlionsoft.oamodule.beans.OaFlowLogBean;
|
|||||||
import com.tenlionsoft.oamodule.beans.SaveTransferBean;
|
import com.tenlionsoft.oamodule.beans.SaveTransferBean;
|
||||||
import com.tenlionsoft.oamodule.net.OAApi;
|
import com.tenlionsoft.oamodule.net.OAApi;
|
||||||
import com.tenlionsoft.oamodule.widget.BOaConfirmCenterDialogView;
|
import com.tenlionsoft.oamodule.widget.BOaConfirmCenterDialogView;
|
||||||
|
import com.tenlionsoft.oamodule.widget.CenterChooseUserView;
|
||||||
import com.tenlionsoft.oamodule.widget.OaBackNodeDialog;
|
import com.tenlionsoft.oamodule.widget.OaBackNodeDialog;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -654,7 +658,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
params.put("type", "show");
|
params.put("type", "show");
|
||||||
params.put("processId", b.getProcessInstanceId());
|
params.put("processId", b.getProcessInstanceId());
|
||||||
params.put("taskId", b.getReportUid());
|
params.put("taskId", b.getReportUid());
|
||||||
}else if(mBean instanceof MineApplyBean.RowsBean){
|
} else if (mBean instanceof MineApplyBean.RowsBean) {
|
||||||
//我的已办
|
//我的已办
|
||||||
MineApplyBean.RowsBean b = (MineApplyBean.RowsBean) mBean;
|
MineApplyBean.RowsBean b = (MineApplyBean.RowsBean) mBean;
|
||||||
String url = String.format(mActivity.getResources()
|
String url = String.format(mActivity.getResources()
|
||||||
@ -1126,6 +1130,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void invokeNative(String method, String params) {
|
public void invokeNative(String method, String params) {
|
||||||
|
LogUtils.e(method + "===" + params);
|
||||||
mActivity.runOnUiThread(() -> {
|
mActivity.runOnUiThread(() -> {
|
||||||
if ("back".equals(method)) {
|
if ("back".equals(method)) {
|
||||||
LogUtils.e("关闭");
|
LogUtils.e("关闭");
|
||||||
@ -1192,6 +1197,8 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_SEL_CAR)
|
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_SEL_CAR)
|
||||||
.navigation(mActivity, 15);
|
.navigation(mActivity, 15);
|
||||||
|
} else if ("chooseUser".equals(method)) {
|
||||||
|
onShowChooseUserDialog(params);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1236,6 +1243,35 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示选择人员
|
||||||
|
*/
|
||||||
|
private void onShowChooseUserDialog(String params) {
|
||||||
|
try {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
ArrayList<ChooseUserBean> users = gson.fromJson(params, new TypeToken<ArrayList<ChooseUserBean>>() {
|
||||||
|
}.getType());
|
||||||
|
CenterChooseUserView chooseDir = new CenterChooseUserView.DialogBuilder(mActivity).setUsers(users).build();
|
||||||
|
chooseDir.addOnChoseListener(new CenterChooseUserView.OnChoseListener() {
|
||||||
|
@Override
|
||||||
|
public void doConfirm(DocumentTypeList bean) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doConfirmMulti(String ids, String names) {
|
||||||
|
chooseDir.dismiss();
|
||||||
|
mWebView.getJsAccessEntrace().quickCallJs("addCheckUser", ids, names);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
chooseDir.show();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典选择
|
* 字典选择
|
||||||
*
|
*
|
||||||
|
@ -0,0 +1,80 @@
|
|||||||
|
package com.tenlionsoft.oamodule.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||||
|
import com.tenlionsoft.oamodule.R;
|
||||||
|
import com.tenlionsoft.oamodule.beans.ChooseUserBean;
|
||||||
|
import com.tenlionsoft.oamodule.beans.DeptBean;
|
||||||
|
import com.tenlionsoft.oamodule.holder.ChooseUserHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者: adam
|
||||||
|
* 日期: 2020/11/24 - 9:16 AM
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述: 人员选择
|
||||||
|
*/
|
||||||
|
public class ChooseUserAdapter extends BaseRecyclerAdapter<ChooseUserBean, ChooseUserHolder> {
|
||||||
|
public List<DeptBean> mSelBeans = new ArrayList<>();
|
||||||
|
public int mType = 1;
|
||||||
|
|
||||||
|
public ChooseUserAdapter(Context ctx, List<ChooseUserBean> list) {
|
||||||
|
super(ctx, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChooseUserHolder createHolder(ViewGroup parent, int viewType) {
|
||||||
|
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_choose_user, parent, false);
|
||||||
|
return new ChooseUserHolder(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.mType = type;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindHolder(ChooseUserHolder holder, int i) {
|
||||||
|
ChooseUserBean bean = mData.get(i);
|
||||||
|
holder.mTvName.setText(bean.getUserName());
|
||||||
|
holder.mCbCheck.setOnCheckedChangeListener(null);
|
||||||
|
holder.mCbCheck.setChecked(bean.isCheck());
|
||||||
|
// holder.mCbCheck.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
|
||||||
|
holder.mTvName.setOnClickListener(v -> mLis.onLowerDept(bean, i));
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnItemCheckChange mLis;
|
||||||
|
|
||||||
|
public void addOnItemCheckChange(OnItemCheckChange lis) {
|
||||||
|
this.mLis = lis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemCheckChange {
|
||||||
|
void onItemCheckChange(ChooseUserBean bean, boolean isCheck, int pos);
|
||||||
|
|
||||||
|
void onLowerDept(ChooseUserBean bean, int pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnControlListener mControlListener;
|
||||||
|
|
||||||
|
public void addOnControlListener(OnControlListener listener) {
|
||||||
|
this.mControlListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnControlListener {
|
||||||
|
void doEdit(ChooseUserBean bean, int pos);
|
||||||
|
|
||||||
|
void doDel(ChooseUserBean bean, int pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.tenlionsoft.oamodule.beans;
|
||||||
|
|
||||||
|
public class ChooseUserBean {
|
||||||
|
private String userId;// "563546a6-0025-4368-b5a7-8a779572bee9"
|
||||||
|
private String userName;//: "崔晶"
|
||||||
|
private String userUsername;//: "18586005066
|
||||||
|
private boolean isCheck;
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isCheck() {
|
||||||
|
return isCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheck(boolean check) {
|
||||||
|
isCheck = check;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserUsername() {
|
||||||
|
return userUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserUsername(String userUsername) {
|
||||||
|
this.userUsername = userUsername;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.tenlionsoft.oamodule.holder;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.tenlionsoft.baselib.core.widget.base.BaseViewHolder;
|
||||||
|
import com.tenlionsoft.oamodule.R2;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者: adam
|
||||||
|
* 日期: 2020/11/24 - 9:10 AM
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述: 人员选择
|
||||||
|
*/
|
||||||
|
public class ChooseUserHolder extends BaseViewHolder {
|
||||||
|
@BindView(R2.id.tv_name)
|
||||||
|
public TextView mTvName;
|
||||||
|
@BindView(R2.id.cb_check)
|
||||||
|
public CheckBox mCbCheck;
|
||||||
|
|
||||||
|
|
||||||
|
public ChooseUserHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
}
|
248
oamodule/src/main/java/com/tenlionsoft/oamodule/widget/CenterChooseUserView.java
Executable file
248
oamodule/src/main/java/com/tenlionsoft/oamodule/widget/CenterChooseUserView.java
Executable file
@ -0,0 +1,248 @@
|
|||||||
|
package com.tenlionsoft.oamodule.widget;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import com.tenlionsoft.oamodule.R;
|
||||||
|
import com.tenlionsoft.oamodule.adapter.ChooseUserAdapter;
|
||||||
|
import com.tenlionsoft.oamodule.beans.ChooseUserBean;
|
||||||
|
import com.tenlionsoft.oamodule.beans.DocumentTypeList;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者 : Adam on 2018/7/23.
|
||||||
|
* 邮箱 : itgaojian@163.com
|
||||||
|
* 描述 : 时间加输入
|
||||||
|
*/
|
||||||
|
public class CenterChooseUserView extends Dialog {
|
||||||
|
|
||||||
|
private boolean iscancelable;
|
||||||
|
private boolean isBackCancelable;
|
||||||
|
private View view;
|
||||||
|
private Context context;
|
||||||
|
private int gravity;
|
||||||
|
private OnChoseListener mListener;
|
||||||
|
private boolean mIsShow;
|
||||||
|
private boolean mIsShowOther;
|
||||||
|
|
||||||
|
|
||||||
|
private String mSelCatalogId;
|
||||||
|
private boolean mIsSingle;
|
||||||
|
private RecyclerView mRlvUsers;
|
||||||
|
private List<ChooseUserBean> mChooseUserBeans;
|
||||||
|
private ChooseUserAdapter mAdapter;
|
||||||
|
|
||||||
|
private CenterChooseUserView(Context context, List<ChooseUserBean> users) {
|
||||||
|
super(context, R.style.dialog_center_alpha);
|
||||||
|
this.context = context;
|
||||||
|
this.mChooseUserBeans = users;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
view = LayoutInflater.from(context).inflate(R.layout.dialog_center_choose_user, null);
|
||||||
|
setContentView(view);
|
||||||
|
setCancelable(iscancelable);
|
||||||
|
setCanceledOnTouchOutside(isBackCancelable);
|
||||||
|
initViews(view);
|
||||||
|
|
||||||
|
Button btnConfirm = view.findViewById(R.id.btn_confirm);
|
||||||
|
view.findViewById(R.id.btn_cancel).setOnClickListener(v -> this.dismiss());
|
||||||
|
btnConfirm.setOnClickListener(v -> doConfirm());
|
||||||
|
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||||
|
Window window = this.getWindow();
|
||||||
|
window.setGravity(Gravity.CENTER);
|
||||||
|
window.setWindowAnimations(R.style.dialog_center_alpha);
|
||||||
|
WindowManager.LayoutParams params = window.getAttributes();
|
||||||
|
params.width = (int) (displayMetrics.widthPixels * 0.9);
|
||||||
|
params.height = (int) (displayMetrics.widthPixels * 0.7);
|
||||||
|
window.setAttributes(params);
|
||||||
|
window.setBackgroundDrawable(new ColorDrawable());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<ChooseUserBean> mSelBeans;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化视图
|
||||||
|
*/
|
||||||
|
private void initViews(View view) {
|
||||||
|
mSelBeans = new ArrayList<>();
|
||||||
|
mRlvUsers = view.findViewById(R.id.rlv_users);
|
||||||
|
mRlvUsers.setLayoutManager(new LinearLayoutManager(context));
|
||||||
|
mAdapter = new ChooseUserAdapter(context, mChooseUserBeans);
|
||||||
|
mRlvUsers.setAdapter(mAdapter);
|
||||||
|
mAdapter.addOnItemCheckChange(new ChooseUserAdapter.OnItemCheckChange() {
|
||||||
|
@Override
|
||||||
|
public void onItemCheckChange(ChooseUserBean bean, boolean isCheck, int pos) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowerDept(ChooseUserBean bean, int pos) {
|
||||||
|
//判断是否选择中了
|
||||||
|
boolean isExit = false;
|
||||||
|
for (int i = 0; i < mSelBeans.size(); i++) {
|
||||||
|
if (bean.getUserId().equals(mSelBeans.get(i).getUserId())) {
|
||||||
|
isExit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isExit) {
|
||||||
|
bean.setCheck(false);
|
||||||
|
mSelBeans.remove(bean);
|
||||||
|
} else {
|
||||||
|
bean.setCheck(true);
|
||||||
|
mSelBeans.add(bean);
|
||||||
|
}
|
||||||
|
mAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Button btnConfirm = view.findViewById(R.id.btn_confirm);
|
||||||
|
Button btnCancel = view.findViewById(R.id.btn_cancel);
|
||||||
|
btnCancel.setOnClickListener(v -> {
|
||||||
|
this.dismiss();
|
||||||
|
});
|
||||||
|
btnConfirm.setOnClickListener(v -> {
|
||||||
|
doConfirm();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void doConfirm() {
|
||||||
|
if (mSelBeans != null && mSelBeans.size() > 0) {
|
||||||
|
String ids = "";
|
||||||
|
String names = "";
|
||||||
|
for (int i = 0; i < mSelBeans.size(); i++) {
|
||||||
|
ChooseUserBean bean = mSelBeans.get(i);
|
||||||
|
ids += bean.getUserId() + ",";
|
||||||
|
names += bean.getUserName() + ",";
|
||||||
|
}
|
||||||
|
ids = ids.substring(0, ids.length() - 1);
|
||||||
|
names = names.substring(0, names.length() - 1);
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.doConfirmMulti(ids, names);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtils.show("请选择人员");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hideSoftKeyBoardDialog(Activity activity) {
|
||||||
|
try {
|
||||||
|
InputMethodManager imm = (InputMethodManager) activity.getSystemService(activity.INPUT_METHOD_SERVICE);
|
||||||
|
imm.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验参数
|
||||||
|
*/
|
||||||
|
private boolean checkParams() {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void addOnChoseListener(OnChoseListener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择
|
||||||
|
*
|
||||||
|
* @param i
|
||||||
|
*/
|
||||||
|
private void choseType(int i) {
|
||||||
|
this.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnChoseListener {
|
||||||
|
void doConfirm(DocumentTypeList bean);
|
||||||
|
|
||||||
|
void doConfirmMulti(String ids, String names);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DialogBuilder {
|
||||||
|
private Context mContext;
|
||||||
|
private boolean isCancelable;
|
||||||
|
private boolean mIsBackable;
|
||||||
|
private int mGravity = Gravity.BOTTOM;
|
||||||
|
private OnChoseListener mListener;
|
||||||
|
private boolean mIsShowOther;
|
||||||
|
|
||||||
|
public DialogBuilder(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogBuilder setIscancelable(boolean iscancelable) {
|
||||||
|
this.isCancelable = iscancelable;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogBuilder setIsBackCancelable(boolean isBackCancelable) {
|
||||||
|
this.mIsBackable = isBackCancelable;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogBuilder setShowLocation(int gravity) {
|
||||||
|
this.mGravity = gravity;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean mIsShow;
|
||||||
|
|
||||||
|
public DialogBuilder setIsShowFile(boolean isShowFile) {
|
||||||
|
mIsShow = isShowFile;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogBuilder setIsShowOther(boolean isShow) {
|
||||||
|
mIsShowOther = isShow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DocumentTypeList b;
|
||||||
|
|
||||||
|
public DialogBuilder setBean(DocumentTypeList b) {
|
||||||
|
this.b = b;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isSingle;
|
||||||
|
|
||||||
|
public DialogBuilder setIsSingle(boolean isSingle) {
|
||||||
|
this.isSingle = isSingle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<ChooseUserBean> mChooseUserBeans;
|
||||||
|
|
||||||
|
public DialogBuilder setUsers(List<ChooseUserBean> users) {
|
||||||
|
this.mChooseUserBeans = users;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CenterChooseUserView build() {
|
||||||
|
return new CenterChooseUserView(this.mContext, this.mChooseUserBeans);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
63
oamodule/src/main/res/layout/dialog_center_choose_user.xml
Executable file
63
oamodule/src/main/res/layout/dialog_center_choose_user.xml
Executable file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:background="@drawable/shp_rectangle_white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="人员选择:"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rlv_users"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="right"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_cancel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="取消"
|
||||||
|
android:textColor="@color/gray_text" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_confirm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@null"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="确定"
|
||||||
|
android:textColor="@color/text_blue" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
49
oamodule/src/main/res/layout/item_choose_user.xml
Normal file
49
oamodule/src/main/res/layout/item_choose_user.xml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/cb_check"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:button="@drawable/sel_check_item_cir"
|
||||||
|
android:gravity="center"
|
||||||
|
android:enabled="false"
|
||||||
|
android:padding="10dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@drawable/ic_user_default" />
|
||||||
|
|
||||||
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="15dp"
|
||||||
|
tools:text="测试" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user