页面调整
This commit is contained in:
parent
c5cfdec4e3
commit
0274bb9e9a
@ -7,8 +7,8 @@ package com.tenlionsoft.baselib.core.retrofit_net;
|
|||||||
*/
|
*/
|
||||||
public class BaseUrlApi {
|
public class BaseUrlApi {
|
||||||
|
|
||||||
public static final String IP = "http://192.168.0.120:8080/";/* 测试IP */
|
// public static final String IP = "http://192.168.0.120:8080/";/* 测试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://www.wlcbsyzl.cn/";/* 正式IP */
|
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||||
public static final String SYS_USERCENTER = "usercenter/";
|
public static final String SYS_USERCENTER = "usercenter/";
|
||||||
public static final String SYS_POPULATION = "population/";/*人口系统*/
|
public static final String SYS_POPULATION = "population/";/*人口系统*/
|
||||||
|
@ -9,6 +9,7 @@ import android.app.ActivityManager;
|
|||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
@ -41,6 +42,11 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
@ -54,11 +60,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者 : Adam on 2018/10/15.
|
* 作者 : Adam on 2018/10/15.
|
||||||
* 邮箱 : itgaojian@163.com
|
* 邮箱 : itgaojian@163.com
|
||||||
@ -116,6 +117,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
if (!isPad()) {
|
||||||
|
//手机界面下锁定横竖屏切换
|
||||||
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||||
|
}
|
||||||
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
||||||
setContentView(R.layout.base_activity);
|
setContentView(R.layout.base_activity);
|
||||||
//默认隐藏键盘
|
//默认隐藏键盘
|
||||||
@ -177,7 +182,8 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
deviceInfo = "navigationbar_is_min";
|
deviceInfo = "navigationbar_is_min";
|
||||||
} else if (brand.equalsIgnoreCase("xiaomi") || brand.equalsIgnoreCase("blackshark")) {
|
} else if (brand.equalsIgnoreCase("xiaomi") || brand.equalsIgnoreCase("blackshark")) {
|
||||||
deviceInfo = "force_fsg_nav_bar";
|
deviceInfo = "force_fsg_nav_bar";
|
||||||
} else if (brand.equalsIgnoreCase("VIVO") || brand.equalsIgnoreCase("OnePlus") || brand.equalsIgnoreCase("OPPO")) {
|
} else if (brand.equalsIgnoreCase("VIVO") || brand.equalsIgnoreCase("OnePlus") || brand.equalsIgnoreCase(
|
||||||
|
"OPPO")) {
|
||||||
return !ImmersionBar.isGesture(this);
|
return !ImmersionBar.isGesture(this);
|
||||||
} else {
|
} else {
|
||||||
deviceInfo = "noah_navi_mode_value";
|
deviceInfo = "noah_navi_mode_value";
|
||||||
@ -186,7 +192,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
int navigationBarIsMin = 0;
|
int navigationBarIsMin = 0;
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||||
navigationBarIsMin = Settings.System.getInt(ctx.getContentResolver(),
|
navigationBarIsMin = Settings.System.getInt(ctx.getContentResolver(),
|
||||||
deviceInfo, 0);
|
deviceInfo, 0);
|
||||||
} else {
|
} else {
|
||||||
if (Build.BRAND.equalsIgnoreCase("VIVO") || Build.BRAND.equalsIgnoreCase("OPPO")) {
|
if (Build.BRAND.equalsIgnoreCase("VIVO") || Build.BRAND.equalsIgnoreCase("OPPO")) {
|
||||||
navigationBarIsMin = Settings.Secure.getInt(ctx.getContentResolver(), deviceInfo, 0);
|
navigationBarIsMin = Settings.Secure.getInt(ctx.getContentResolver(), deviceInfo, 0);
|
||||||
@ -413,7 +419,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
public void setEditTextInhibitInputSpeChat(EditText editText) {
|
public void setEditTextInhibitInputSpeChat(EditText editText) {
|
||||||
InputFilter inputFilter = new InputFilter() {
|
InputFilter inputFilter = new InputFilter() {
|
||||||
Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
|
Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
|
||||||
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
|
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||||
@ -552,8 +558,8 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void openActivity(String path) {
|
private void openActivity(String path) {
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(path)
|
.build(path)
|
||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getRunningTopActivity() {
|
private String getRunningTopActivity() {
|
||||||
@ -626,9 +632,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
int[] l = {0, 0};
|
int[] l = {0, 0};
|
||||||
v.getLocationInWindow(l);
|
v.getLocationInWindow(l);
|
||||||
int left = l[0], top = l[1], bottom = top + v.getHeight(), right = left
|
int left = l[0], top = l[1], bottom = top + v.getHeight(), right = left
|
||||||
+ v.getWidth();
|
+ v.getWidth();
|
||||||
if (ev.getX() > left && ev.getX() < right && ev.getY() > top
|
if (ev.getX() > left && ev.getX() < right && ev.getY() > top
|
||||||
&& ev.getY() < bottom) {
|
&& ev.getY() < bottom) {
|
||||||
//判断点击处与EditText距离
|
//判断点击处与EditText距离
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -642,7 +648,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
if (token != null) {
|
if (token != null) {
|
||||||
InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
manager.hideSoftInputFromWindow(token,
|
manager.hideSoftInputFromWindow(token,
|
||||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -754,12 +760,12 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
protected void checkIsLogin(String path) {
|
protected void checkIsLogin(String path) {
|
||||||
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
|
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
|
||||||
.navigation(mActivity, 2333);
|
.navigation(mActivity, 2333);
|
||||||
} else {
|
} else {
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(path)
|
.build(path)
|
||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.tenlionsoft.oamodule.pad.fragments;
|
package com.tenlionsoft.oamodule.pad.fragments;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -23,6 +24,7 @@ import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
|||||||
import com.tenlionsoft.baselib.core.widget.base.FunctionTitleNumAdapter;
|
import com.tenlionsoft.baselib.core.widget.base.FunctionTitleNumAdapter;
|
||||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
import com.tenlionsoft.baselib.utils.TimeUtils;
|
import com.tenlionsoft.baselib.utils.TimeUtils;
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
@ -150,14 +152,7 @@ public class PadOaMainFragment extends BaseFragment {
|
|||||||
scheduleDetailBean.getScheduleId());
|
scheduleDetailBean.getScheduleId());
|
||||||
mPadMainActivity.addFragment(1, fragment);
|
mPadMainActivity.addFragment(1, fragment);
|
||||||
});
|
});
|
||||||
//常用功能
|
|
||||||
mFuncBeans = new ArrayList<>();
|
|
||||||
FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(mActivity, FlexDirection.ROW,
|
|
||||||
FlexWrap.WRAP);
|
|
||||||
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 6, 140);
|
|
||||||
mRlvFuncs.setLayoutManager(flexboxLayoutManager);
|
|
||||||
mRlvFuncs.setAdapter(mFunctionAdapter);
|
|
||||||
mFunctionAdapter.addOnItemClickListener(this::choosePage);
|
|
||||||
//通知公告
|
//通知公告
|
||||||
mNoticeListBeanRows = new ArrayList<>();
|
mNoticeListBeanRows = new ArrayList<>();
|
||||||
mNoticeShowAdapter = new NoticeShowAdapter(mActivity, mNoticeListBeanRows);
|
mNoticeShowAdapter = new NoticeShowAdapter(mActivity, mNoticeListBeanRows);
|
||||||
@ -251,10 +246,44 @@ public class PadOaMainFragment extends BaseFragment {
|
|||||||
mPadMainActivity = (PadMainActivity) getActivity();
|
mPadMainActivity = (PadMainActivity) getActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfigurationChanged(@androidx.annotation.NonNull Configuration newConfig) {
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
|
//竖屏
|
||||||
|
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 6, 140);
|
||||||
|
} else {
|
||||||
|
//横屏
|
||||||
|
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 11, 20);
|
||||||
|
}
|
||||||
|
mFunctionAdapter.setData(mFuncBeans);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新页面
|
* 刷新页面
|
||||||
*/
|
*/
|
||||||
private void doRefresh() {
|
private void doRefresh() {
|
||||||
|
//常用功能
|
||||||
|
mFuncBeans = new ArrayList<>();
|
||||||
|
FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(mActivity, FlexDirection.ROW,
|
||||||
|
FlexWrap.WRAP);
|
||||||
|
//判断横竖屏
|
||||||
|
Configuration configuration = mActivity.getResources().getConfiguration();
|
||||||
|
int orientation = configuration.orientation;
|
||||||
|
LogUtils.e(orientation);
|
||||||
|
if (orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
|
//竖屏
|
||||||
|
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 6, 140);
|
||||||
|
} else {
|
||||||
|
//横屏
|
||||||
|
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 11, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
mRlvFuncs.setLayoutManager(flexboxLayoutManager);
|
||||||
|
mRlvFuncs.setAdapter(mFunctionAdapter);
|
||||||
|
mFunctionAdapter.addOnItemClickListener(this::choosePage);
|
||||||
|
|
||||||
|
|
||||||
mCsvSchedule.setState(CustomStateView.STATE_LOAD);
|
mCsvSchedule.setState(CustomStateView.STATE_LOAD);
|
||||||
mCsvFuncs.setState(CustomStateView.STATE_LOAD);
|
mCsvFuncs.setState(CustomStateView.STATE_LOAD);
|
||||||
mCsvNotice.setState(CustomStateView.STATE_LOAD);
|
mCsvNotice.setState(CustomStateView.STATE_LOAD);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tenlionsoft.oamodule.pad.fragments.home.oaflow;
|
package com.tenlionsoft.oamodule.pad.fragments.home.oaflow;
|
||||||
|
|
||||||
|
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
@ -26,6 +28,13 @@ import android.widget.FrameLayout;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.widget.NestedScrollView;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@ -86,12 +95,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.core.widget.NestedScrollView;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
@ -101,13 +104,11 @@ import okhttp3.MediaType;
|
|||||||
import okhttp3.MultipartBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者: adam
|
* 作者: adam
|
||||||
* 日期: 2022/6/20 - 10:53
|
* 日期: 2022/6/20 - 10:53
|
||||||
* 邮箱: itgaojian@163.com
|
* 邮箱: itgaojian@163.com
|
||||||
* 描述:
|
* 描述: 平板页面发起流程
|
||||||
*/
|
*/
|
||||||
@Route(path = PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY)
|
@Route(path = PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY)
|
||||||
public class OaFlowApplyFragment extends BaseFragment {
|
public class OaFlowApplyFragment extends BaseFragment {
|
||||||
@ -165,24 +166,24 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
private int mCurrentSigned = 0;//当前会签框
|
private int mCurrentSigned = 0;//当前会签框
|
||||||
private List<OperateBean> mControls;
|
private List<OperateBean> mControls;
|
||||||
private String[] fileFilter = new String[]{
|
private String[] fileFilter = new String[]{
|
||||||
".doc",
|
".doc",
|
||||||
".docx",
|
".docx",
|
||||||
".xls",
|
".xls",
|
||||||
".xlsx",
|
".xlsx",
|
||||||
".pptx",
|
".pptx",
|
||||||
".ppt",
|
".ppt",
|
||||||
".txt",
|
".txt",
|
||||||
".pdf",
|
".pdf",
|
||||||
".jpg",
|
".jpg",
|
||||||
".jpeg",
|
".jpeg",
|
||||||
".png",
|
".png",
|
||||||
".mp4",
|
".mp4",
|
||||||
".avi",
|
".avi",
|
||||||
".mkv",
|
".mkv",
|
||||||
".flv",
|
".flv",
|
||||||
".mp3",
|
".mp3",
|
||||||
".wmv",
|
".wmv",
|
||||||
".amr"};
|
".amr"};
|
||||||
private PadMainActivity mMainActivity;
|
private PadMainActivity mMainActivity;
|
||||||
private ActivityResultLauncher<Intent> mFileLauncher;
|
private ActivityResultLauncher<Intent> mFileLauncher;
|
||||||
private ActivityResultLauncher<Intent> mTrLauncher;
|
private ActivityResultLauncher<Intent> mTrLauncher;
|
||||||
@ -244,7 +245,9 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
mIsShowOnlyThree = !mIsShowOnlyThree;
|
mIsShowOnlyThree = !mIsShowOnlyThree;
|
||||||
mLogAdapter.setShowOnlyThree(mIsShowOnlyThree);
|
mLogAdapter.setShowOnlyThree(mIsShowOnlyThree);
|
||||||
//改变箭头方向
|
//改变箭头方向
|
||||||
@SuppressLint("UseCompatLoadingForDrawables") Drawable drawable1 = mActivity.getResources().getDrawable(mIsShowOnlyThree ? R.drawable.ic_close_more_icon : R.drawable.ic_show_more_icon);
|
@SuppressLint("UseCompatLoadingForDrawables") Drawable drawable1 =
|
||||||
|
mActivity.getResources().getDrawable(mIsShowOnlyThree ? R.drawable.ic_close_more_icon :
|
||||||
|
R.drawable.ic_show_more_icon);
|
||||||
drawable1.setBounds(0, 0, drawable1.getMinimumWidth(), drawable1.getMinimumHeight());
|
drawable1.setBounds(0, 0, drawable1.getMinimumWidth(), drawable1.getMinimumHeight());
|
||||||
mTvShowMoreLog.setCompoundDrawables(null, null, drawable1, null);
|
mTvShowMoreLog.setCompoundDrawables(null, null, drawable1, null);
|
||||||
mTvShowMoreLog.setText(mIsShowOnlyThree ? "展开" : "收起");
|
mTvShowMoreLog.setText(mIsShowOnlyThree ? "展开" : "收起");
|
||||||
@ -271,19 +274,19 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
mTvPre.setEnabled(false);
|
mTvPre.setEnabled(false);
|
||||||
//让输入法
|
//让输入法
|
||||||
mRlContent.getViewTreeObserver()
|
mRlContent.getViewTreeObserver()
|
||||||
.addOnGlobalLayoutListener(() -> {
|
.addOnGlobalLayoutListener(() -> {
|
||||||
Rect rect = new Rect();
|
Rect rect = new Rect();
|
||||||
mRlContent.getWindowVisibleDisplayFrame(rect);
|
mRlContent.getWindowVisibleDisplayFrame(rect);
|
||||||
int screenHeight = mRlContent.getRootView().getHeight();
|
int screenHeight = mRlContent.getRootView().getHeight();
|
||||||
int softHeight = screenHeight - rect.bottom;
|
int softHeight = screenHeight - rect.bottom;
|
||||||
if (softHeight > 100) {//当输入法高度大于100判定为输入法打开了
|
if (softHeight > 100) {//当输入法高度大于100判定为输入法打开了
|
||||||
if (mEtCountersigned.hasFocus()) {
|
if (mEtCountersigned.hasFocus()) {
|
||||||
mRlContent.scrollTo(0, softHeight + 10);
|
mRlContent.scrollTo(0, softHeight + 10);
|
||||||
|
}
|
||||||
|
} else {//否则判断为输入法隐藏了
|
||||||
|
mRlContent.scrollTo(0, 10);
|
||||||
}
|
}
|
||||||
} else {//否则判断为输入法隐藏了
|
});
|
||||||
mRlContent.scrollTo(0, 10);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mControls = new ArrayList<>();
|
mControls = new ArrayList<>();
|
||||||
mBtnConfirm.setOnClickListener(v -> onShowConfirmDialog());
|
mBtnConfirm.setOnClickListener(v -> onShowConfirmDialog());
|
||||||
@ -295,14 +298,14 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
private void onShowConfirmDialog() {
|
private void onShowConfirmDialog() {
|
||||||
if (mConfirmAssignees != null && mConfirmAssignees.size() > 0) {
|
if (mConfirmAssignees != null && mConfirmAssignees.size() > 0) {
|
||||||
BOaConfirmCenterDialogView dialog = new BOaConfirmCenterDialogView.DialogBuilder(mActivity)
|
BOaConfirmCenterDialogView dialog = new BOaConfirmCenterDialogView.DialogBuilder(mActivity)
|
||||||
.setBtnBean(mConfirmAssignees)
|
.setBtnBean(mConfirmAssignees)
|
||||||
.build();
|
.build();
|
||||||
dialog.addOnChoseListener(new BOaConfirmCenterDialogView.OnChoseListener() {
|
dialog.addOnChoseListener(new BOaConfirmCenterDialogView.OnChoseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void showSelect(OaFlowFormBean.ConfirmAssigneesBean b, int index) {
|
public void showSelect(OaFlowFormBean.ConfirmAssigneesBean b, int index) {
|
||||||
mNsvScroll.post(() -> mNsvScroll.fullScroll(View.FOCUS_UP));
|
mNsvScroll.post(() -> mNsvScroll.fullScroll(View.FOCUS_UP));
|
||||||
mWebView.getJsAccessEntrace()
|
mWebView.getJsAccessEntrace()
|
||||||
.quickCallJs("appOaFormUtil.submitFormReport", index + 1 + "");
|
.quickCallJs("appOaFormUtil.submitFormReport", index + 1 + "");
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,20 +369,20 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void doDelFile(AddFileBean bean, int i) {
|
private void doDelFile(AddFileBean bean, int i) {
|
||||||
new AlertDialog.Builder(mActivity)
|
new AlertDialog.Builder(mActivity)
|
||||||
.setTitle("提示")
|
.setTitle("提示")
|
||||||
.setMessage("确定要删除该附件吗?")
|
.setMessage("确定要删除该附件吗?")
|
||||||
.setPositiveButton("确定", (dialog, which) -> {
|
.setPositiveButton("确定", (dialog, which) -> {
|
||||||
//通知页面刷新附件
|
//通知页面刷新附件
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
mFiles.remove(i);
|
mFiles.remove(i);
|
||||||
mFileBlueAdapter.setData(mFiles);
|
mFileBlueAdapter.setData(mFiles);
|
||||||
if (mFiles.size() <= 0) {
|
if (mFiles.size() <= 0) {
|
||||||
mCsvFiles.setState(CustomStateView.STATE_EMPTY);
|
mCsvFiles.setState(CustomStateView.STATE_EMPTY);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
||||||
.create()
|
.create()
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -387,43 +390,43 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void getOaFlowLog() {
|
private void getOaFlowLog() {
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getOaFlowLogList(mProcessId)
|
.getOaFlowLogList(mProcessId)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<List<OaFlowLogBean>>() {
|
.subscribe(new Observer<List<OaFlowLogBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull List<OaFlowLogBean> oaFlowLogBeans) {
|
|
||||||
if (oaFlowLogBeans.size() > 0) {
|
|
||||||
mCsvLog.setState(CustomStateView.STATE_SUCCESS);
|
|
||||||
mLogs = oaFlowLogBeans;
|
|
||||||
mLogAdapter.setData(mLogs);
|
|
||||||
if (mLogs.size() > 2) {
|
|
||||||
mLogAdapter.setShowOnlyCount(true, 2);
|
|
||||||
mLlShowMoreLog.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
mLlShowMoreLog.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mCsvLog.setState(CustomStateView.STATE_EMPTY);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
public void onNext(@io.reactivex.rxjava3.annotations.NonNull List<OaFlowLogBean> oaFlowLogBeans) {
|
||||||
ExceptionHandler.handleException(e);
|
if (oaFlowLogBeans.size() > 0) {
|
||||||
mCsvLog.setState(CustomStateView.STATE_ERROR);
|
mCsvLog.setState(CustomStateView.STATE_SUCCESS);
|
||||||
}
|
mLogs = oaFlowLogBeans;
|
||||||
|
mLogAdapter.setData(mLogs);
|
||||||
|
if (mLogs.size() > 2) {
|
||||||
|
mLogAdapter.setShowOnlyCount(true, 2);
|
||||||
|
mLlShowMoreLog.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mLlShowMoreLog.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mCsvLog.setState(CustomStateView.STATE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
mCsvLog.setState(CustomStateView.STATE_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -434,7 +437,8 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
mCsvWeb.setState(CustomStateView.STATE_LOAD);
|
mCsvWeb.setState(CustomStateView.STATE_LOAD);
|
||||||
mWebChromeClient = new WebChromeClient() {
|
mWebChromeClient = new WebChromeClient() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback,
|
||||||
|
FileChooserParams fileChooserParams) {
|
||||||
LogUtils.e(filePathCallback);
|
LogUtils.e(filePathCallback);
|
||||||
if (mFilePathCallback != null) {
|
if (mFilePathCallback != null) {
|
||||||
mFilePathCallback.onReceiveValue(null);
|
mFilePathCallback.onReceiveValue(null);
|
||||||
@ -456,57 +460,59 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
mWebView = AgentWeb.with(this)
|
mWebView = AgentWeb.with(this)
|
||||||
.setAgentWebParent(mFlContent, new FrameLayout.LayoutParams(-1, -1))
|
.setAgentWebParent(mFlContent, new FrameLayout.LayoutParams(-1, -1))
|
||||||
.useDefaultIndicator(R.color.status_bar_blue)
|
.useDefaultIndicator(R.color.status_bar_blue)
|
||||||
.addJavascriptInterface("android", new OnJsInterface())
|
.addJavascriptInterface("android", new OnJsInterface())
|
||||||
.setWebViewClient(new WebViewClient() {
|
.setWebViewClient(new WebViewClient() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
handler.proceed();
|
handler.proceed();
|
||||||
// NestedScrollAgentWebView
|
// NestedScrollAgentWebView
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
super.onPageFinished(view, url);
|
super.onPageFinished(view, url);
|
||||||
mCsvWeb.setState(CustomStateView.STATE_SUCCESS);
|
mCsvWeb.setState(CustomStateView.STATE_SUCCESS);
|
||||||
LogUtils.e("加载完成");
|
LogUtils.e("加载完成");
|
||||||
mActivity.runOnUiThread(() -> {
|
mActivity.runOnUiThread(() -> {
|
||||||
WebView webView = mWebView.getWebCreator().getWebView();
|
WebView webView = mWebView.getWebCreator().getWebView();
|
||||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT);
|
FrameLayout.LayoutParams params =
|
||||||
webView.setLayoutParams(params);
|
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
|
||||||
});
|
FrameLayout.LayoutParams.WRAP_CONTENT);
|
||||||
}
|
webView.setLayoutParams(params);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||||
super.onPageStarted(view, url, favicon);
|
super.onPageStarted(view, url, favicon);
|
||||||
LogUtils.e("加载中");
|
LogUtils.e("加载中");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setWebChromeClient(mWebChromeClient)
|
.setWebChromeClient(mWebChromeClient)
|
||||||
.setAgentWebWebSettings(new AbsAgentWebSettings() {
|
.setAgentWebWebSettings(new AbsAgentWebSettings() {
|
||||||
@Override
|
@Override
|
||||||
protected void bindAgentWebSupport(AgentWeb agentWeb) {
|
protected void bindAgentWebSupport(AgentWeb agentWeb) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//自定义webview缓存
|
//自定义webview缓存
|
||||||
@Override
|
@Override
|
||||||
public IAgentWebSettings toSetting(WebView webView) {
|
public IAgentWebSettings toSetting(WebView webView) {
|
||||||
IAgentWebSettings iAgentWebSettings = super.toSetting(webView);
|
IAgentWebSettings iAgentWebSettings = super.toSetting(webView);
|
||||||
iAgentWebSettings.getWebSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
iAgentWebSettings.getWebSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||||
iAgentWebSettings.getWebSettings().setAllowFileAccess(true);//允许选择文件
|
iAgentWebSettings.getWebSettings().setAllowFileAccess(true);//允许选择文件
|
||||||
iAgentWebSettings.getWebSettings().setAllowContentAccess(true);//允许选择文件
|
iAgentWebSettings.getWebSettings().setAllowContentAccess(true);//允许选择文件
|
||||||
iAgentWebSettings.getWebSettings().setAllowFileAccessFromFileURLs(true);//允许选择文件
|
iAgentWebSettings.getWebSettings().setAllowFileAccessFromFileURLs(true);//允许选择文件
|
||||||
iAgentWebSettings.getWebSettings().setAllowUniversalAccessFromFileURLs(true);//允许选择文件
|
iAgentWebSettings.getWebSettings().setAllowUniversalAccessFromFileURLs(true);//允许选择文件
|
||||||
iAgentWebSettings.getWebSettings().setSupportMultipleWindows(true);//是否允许多个窗口
|
iAgentWebSettings.getWebSettings().setSupportMultipleWindows(true);//是否允许多个窗口
|
||||||
return iAgentWebSettings;
|
return iAgentWebSettings;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.createAgentWeb()
|
.createAgentWeb()
|
||||||
.ready()
|
.ready()
|
||||||
.go(mUrl);
|
.go(mUrl);
|
||||||
WebView webView = mWebView.getWebCreator().getWebView();
|
WebView webView = mWebView.getWebCreator().getWebView();
|
||||||
webView.setLayerType(View.LAYER_TYPE_NONE, null);
|
webView.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
}
|
}
|
||||||
@ -518,13 +524,13 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
//我的待办
|
//我的待办
|
||||||
MineTodoBean.RowsBean b = (MineTodoBean.RowsBean) mBean;
|
MineTodoBean.RowsBean b = (MineTodoBean.RowsBean) mBean;
|
||||||
String url = String.format(mActivity.getResources()
|
String url = String.format(mActivity.getResources()
|
||||||
.getString(R.string.mine_todo),
|
.getString(R.string.mine_todo),
|
||||||
b.getTaskId(),
|
b.getTaskId(),
|
||||||
b.getFormCode(),
|
b.getFormCode(),
|
||||||
b.getFormVersion() + "",
|
b.getFormVersion() + "",
|
||||||
b.getIsNeedClaim() + "",
|
b.getIsNeedClaim() + "",
|
||||||
UserLgUtils.getToken(),
|
UserLgUtils.getToken(),
|
||||||
b.getReportUid());
|
b.getReportUid());
|
||||||
String path = BaseUrlApi.BASE_OA + url;
|
String path = BaseUrlApi.BASE_OA + url;
|
||||||
params.put("url", path);
|
params.put("url", path);
|
||||||
params.put("type", "edit");
|
params.put("type", "edit");
|
||||||
@ -534,11 +540,11 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
//发起流程
|
//发起流程
|
||||||
OaFlowApplyBean.RowsBean b = (OaFlowApplyBean.RowsBean) mBean;
|
OaFlowApplyBean.RowsBean b = (OaFlowApplyBean.RowsBean) mBean;
|
||||||
String url = String.format(mActivity.getResources()
|
String url = String.format(mActivity.getResources()
|
||||||
.getString(R.string.apply_flow),
|
.getString(R.string.apply_flow),
|
||||||
b.getProcessDefinitionId(),
|
b.getProcessDefinitionId(),
|
||||||
b.getFormCode(),
|
b.getFormCode(),
|
||||||
b.getFormVersion() + "",
|
b.getFormVersion() + "",
|
||||||
UserLgUtils.getToken());
|
UserLgUtils.getToken());
|
||||||
String path = BaseUrlApi.BASE_OA + url;
|
String path = BaseUrlApi.BASE_OA + url;
|
||||||
params.put("url", path);
|
params.put("url", path);
|
||||||
params.put("type", "create");
|
params.put("type", "create");
|
||||||
@ -546,12 +552,12 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
//我的已办
|
//我的已办
|
||||||
MineDoneBean.RowsBean b = (MineDoneBean.RowsBean) mBean;
|
MineDoneBean.RowsBean b = (MineDoneBean.RowsBean) mBean;
|
||||||
String url = String.format(mActivity.getResources()
|
String url = String.format(mActivity.getResources()
|
||||||
.getString(R.string.mine_todo_detail),
|
.getString(R.string.mine_todo_detail),
|
||||||
b.getFormCode(),
|
b.getFormCode(),
|
||||||
b.getFormVersion() + "",
|
b.getFormVersion() + "",
|
||||||
UserLgUtils.getToken(),
|
UserLgUtils.getToken(),
|
||||||
b.getReportUid(),
|
b.getReportUid(),
|
||||||
b.getProcessInstanceId());
|
b.getProcessInstanceId());
|
||||||
String path = BaseUrlApi.BASE_OA + url;
|
String path = BaseUrlApi.BASE_OA + url;
|
||||||
params.put("url", path);
|
params.put("url", path);
|
||||||
params.put("type", "show");
|
params.put("type", "show");
|
||||||
@ -560,13 +566,13 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
} else if (mBean instanceof MineReadBean.RowsBean) {
|
} else if (mBean instanceof MineReadBean.RowsBean) {
|
||||||
MineReadBean.RowsBean b = (MineReadBean.RowsBean) mBean;
|
MineReadBean.RowsBean b = (MineReadBean.RowsBean) mBean;
|
||||||
String url = String.format(mActivity.getResources()
|
String url = String.format(mActivity.getResources()
|
||||||
.getString(R.string.mine_read),
|
.getString(R.string.mine_read),
|
||||||
b.getFormCode(),
|
b.getFormCode(),
|
||||||
b.getFormVersion() + "",
|
b.getFormVersion() + "",
|
||||||
b.getCcId(),
|
b.getCcId(),
|
||||||
UserLgUtils.getToken(),
|
UserLgUtils.getToken(),
|
||||||
b.getReportUid(),
|
b.getReportUid(),
|
||||||
b.getProcessInstanceId());
|
b.getProcessInstanceId());
|
||||||
String path = BaseUrlApi.BASE_OA + url;
|
String path = BaseUrlApi.BASE_OA + url;
|
||||||
params.put("url", path);
|
params.put("url", path);
|
||||||
params.put("type", "show");
|
params.put("type", "show");
|
||||||
@ -657,7 +663,7 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void doCopyTo(String ids) {
|
private void doCopyTo(String ids) {
|
||||||
mWebView.getJsAccessEntrace()
|
mWebView.getJsAccessEntrace()
|
||||||
.quickCallJs("appOaFormUtil.setCcs", ids);
|
.quickCallJs("appOaFormUtil.setCcs", ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -685,36 +691,37 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
SaveTransferBean bodyBean = new SaveTransferBean();
|
SaveTransferBean bodyBean = new SaveTransferBean();
|
||||||
bodyBean.setAssignee(bean.getUserId());
|
bodyBean.setAssignee(bean.getUserId());
|
||||||
bodyBean.setReason(content);
|
bodyBean.setReason(content);
|
||||||
RequestBody body = RequestBody.create(new Gson().toJson(bodyBean), MediaType.parse("application/json; charset=utf-8"));
|
RequestBody body = RequestBody.create(new Gson().toJson(bodyBean), MediaType.parse("application/json; " +
|
||||||
|
"charset=utf-8"));
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.doOaFlowTransfer(mProcessId, mTaskId, body)
|
.doOaFlowTransfer(mProcessId, mTaskId, body)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<BaseSuccessBean>() {
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull BaseSuccessBean bean) {
|
public void onNext(@io.reactivex.rxjava3.annotations.NonNull BaseSuccessBean bean) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ToastUtils.show("提交成功");
|
ToastUtils.show("提交成功");
|
||||||
mMainActivity.getPreFragment().mIsRefresh = true;
|
mMainActivity.getPreFragment().mIsRefresh = true;
|
||||||
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initControlBtn() {
|
private void initControlBtn() {
|
||||||
@ -816,13 +823,13 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
protected void hasManageFileManage() {
|
protected void hasManageFileManage() {
|
||||||
//有权限
|
//有权限
|
||||||
new LFilePicker()
|
new LFilePicker()
|
||||||
.withFragment(OaFlowApplyFragment.this)
|
.withFragment(OaFlowApplyFragment.this)
|
||||||
.withFragmentLauncher(mFileLauncher)
|
.withFragmentLauncher(mFileLauncher)
|
||||||
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
||||||
.withTitle("文件选择")
|
.withTitle("文件选择")
|
||||||
.withMaxNum(4)
|
.withMaxNum(4)
|
||||||
.withFileFilter(fileFilter)
|
.withFileFilter(fileFilter)
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -845,36 +852,37 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
SaveTransferBean bodyBean = new SaveTransferBean();
|
SaveTransferBean bodyBean = new SaveTransferBean();
|
||||||
bodyBean.setReason(content);
|
bodyBean.setReason(content);
|
||||||
RequestBody body = RequestBody.create(new Gson().toJson(bodyBean), MediaType.parse("application/json; charset=utf-8"));
|
RequestBody body = RequestBody.create(new Gson().toJson(bodyBean), MediaType.parse("application/json; " +
|
||||||
|
"charset=utf-8"));
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.doForcedEnd(mProcessId, mTaskId, body)
|
.doForcedEnd(mProcessId, mTaskId, body)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<BaseSuccessBean>() {
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull BaseSuccessBean bean) {
|
public void onNext(@io.reactivex.rxjava3.annotations.NonNull BaseSuccessBean bean) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ToastUtils.show("结束成功");
|
ToastUtils.show("结束成功");
|
||||||
mMainActivity.getPreFragment().mIsRefresh = true;
|
mMainActivity.getPreFragment().mIsRefresh = true;
|
||||||
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -891,8 +899,8 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void onShowBackNode(List<OaFlowFormButton.GoBackUserTasksBean> nodes) {
|
private void onShowBackNode(List<OaFlowFormButton.GoBackUserTasksBean> nodes) {
|
||||||
OaBackNodeDialog dialog = new OaBackNodeDialog.Builder(mActivity)
|
OaBackNodeDialog dialog = new OaBackNodeDialog.Builder(mActivity)
|
||||||
.setBean(nodes)
|
.setBean(nodes)
|
||||||
.build();
|
.build();
|
||||||
dialog.addOnChangeListener(bean -> {
|
dialog.addOnChangeListener(bean -> {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
doShowBackReason(bean);
|
doShowBackReason(bean);
|
||||||
@ -922,36 +930,37 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
SaveTransferBean bodyBean = new SaveTransferBean();
|
SaveTransferBean bodyBean = new SaveTransferBean();
|
||||||
bodyBean.setReason(content);
|
bodyBean.setReason(content);
|
||||||
RequestBody body = RequestBody.create(new Gson().toJson(bodyBean), MediaType.parse("application/json; charset=utf-8"));
|
RequestBody body = RequestBody.create(new Gson().toJson(bodyBean), MediaType.parse("application/json; " +
|
||||||
|
"charset=utf-8"));
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.doBackNode(mProcessId, mTaskId, bean.getNodeId(), body)
|
.doBackNode(mProcessId, mTaskId, bean.getNodeId(), body)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<BaseSuccessBean>() {
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull BaseSuccessBean bean) {
|
public void onNext(@io.reactivex.rxjava3.annotations.NonNull BaseSuccessBean bean) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ToastUtils.show("回退成功");
|
ToastUtils.show("回退成功");
|
||||||
mMainActivity.getPreFragment().mIsRefresh = true;
|
mMainActivity.getPreFragment().mIsRefresh = true;
|
||||||
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -963,9 +972,9 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
for (int i = 0; i < mFiles.size(); i++) {
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
AddFileBean fileBean = mFiles.get(i);
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
sb.append(fileBean.getId())
|
sb.append(fileBean.getId())
|
||||||
.append(":")
|
.append(":")
|
||||||
.append(fileBean.getFileName())
|
.append(fileBean.getFileName())
|
||||||
.append(",");
|
.append(",");
|
||||||
}
|
}
|
||||||
if (sb.toString().endsWith(",")) {
|
if (sb.toString().endsWith(",")) {
|
||||||
sb = new StringBuilder(sb.substring(0, sb.length() - 1));
|
sb = new StringBuilder(sb.substring(0, sb.length() - 1));
|
||||||
@ -983,6 +992,7 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void invokeNative(String method, String params) {
|
public void invokeNative(String method, String params) {
|
||||||
mActivity.runOnUiThread(() -> {
|
mActivity.runOnUiThread(() -> {
|
||||||
|
LogUtils.e(method + "===" + params);
|
||||||
if ("back".equals(method)) {
|
if ("back".equals(method)) {
|
||||||
LogUtils.e("关闭");
|
LogUtils.e("关闭");
|
||||||
mMainActivity.getPreFragment().mIsRefresh = true;
|
mMainActivity.getPreFragment().mIsRefresh = true;
|
||||||
@ -1057,10 +1067,10 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
if (addFileBean.getFileType() == 1) {
|
if (addFileBean.getFileType() == 1) {
|
||||||
//文档
|
//文档
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
.withString("fileName", addFileBean.getFileName())
|
.withString("fileName", addFileBean.getFileName())
|
||||||
.withString("fileId", addFileBean.getId())
|
.withString("fileId", addFileBean.getId())
|
||||||
.navigation();
|
.navigation();
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
//图片预览
|
//图片预览
|
||||||
//遍历文件获取所有图片文件
|
//遍历文件获取所有图片文件
|
||||||
@ -1073,16 +1083,17 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
.navigation();
|
.navigation();
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
.withString("title", addFileBean.getFileName().substring(0,
|
||||||
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
addFileBean.getFileName().lastIndexOf(".")))
|
||||||
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
.navigation();
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1107,53 +1118,53 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
Observable<BaseSuccessBean>[] observables1 = requests.toArray(new Observable[requests.size()]);
|
Observable<BaseSuccessBean>[] observables1 = requests.toArray(new Observable[requests.size()]);
|
||||||
|
|
||||||
Observable.mergeArrayDelayError(observables1)
|
Observable.mergeArrayDelayError(observables1)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer() {
|
.subscribe(new Observer() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NotNull Object o) {
|
|
||||||
++mUploadCount;
|
|
||||||
if (o instanceof BaseSuccessBean) {
|
|
||||||
//刷新文件
|
|
||||||
BaseSuccessBean bean = (BaseSuccessBean) o;
|
|
||||||
AddFileBean fileBean = new AddFileBean();
|
|
||||||
fileBean.setId(bean.getData());
|
|
||||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + bean.getData());
|
|
||||||
fileBean.setFileName(fileNames.get(mUploadCount - 1).replace(",", ""));
|
|
||||||
fileBean.setFileType(FileUtils.getFileType(fileNames.get(mUploadCount - 1)));
|
|
||||||
mFiles.add(0, fileBean);
|
|
||||||
}
|
}
|
||||||
if (mUploadCount == paths.size()) {
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NotNull Object o) {
|
||||||
|
++mUploadCount;
|
||||||
|
if (o instanceof BaseSuccessBean) {
|
||||||
|
//刷新文件
|
||||||
|
BaseSuccessBean bean = (BaseSuccessBean) o;
|
||||||
|
AddFileBean fileBean = new AddFileBean();
|
||||||
|
fileBean.setId(bean.getData());
|
||||||
|
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + bean.getData());
|
||||||
|
fileBean.setFileName(fileNames.get(mUploadCount - 1).replace(",", ""));
|
||||||
|
fileBean.setFileType(FileUtils.getFileType(fileNames.get(mUploadCount - 1)));
|
||||||
|
mFiles.add(0, fileBean);
|
||||||
|
}
|
||||||
|
if (mUploadCount == paths.size()) {
|
||||||
|
mUploadCount = 0;
|
||||||
|
ToastUtils.show("上传成功");
|
||||||
|
if (progressDialog.isShowing()) {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
}
|
||||||
|
//刷新
|
||||||
|
doSetFileToWebView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
mUploadCount = 0;
|
mUploadCount = 0;
|
||||||
ToastUtils.show("上传成功");
|
|
||||||
if (progressDialog.isShowing()) {
|
if (progressDialog.isShowing()) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
//刷新
|
ToastUtils.show("上传失败,请稍后重试.");
|
||||||
doSetFileToWebView();
|
doSetFileToWebView();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
public void onComplete() {
|
||||||
e.printStackTrace();
|
|
||||||
mUploadCount = 0;
|
|
||||||
if (progressDialog.isShowing()) {
|
|
||||||
progressDialog.dismiss();
|
|
||||||
}
|
}
|
||||||
ToastUtils.show("上传失败,请稍后重试.");
|
});
|
||||||
doSetFileToWebView();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Observable createObservable(File file) {
|
private Observable createObservable(File file) {
|
||||||
@ -1163,28 +1174,28 @@ public class OaFlowApplyFragment extends BaseFragment {
|
|||||||
if (1 == fileType) {
|
if (1 == fileType) {
|
||||||
body = MultipartBody.Part.createFormData("file", file.getName(), requestFile);
|
body = MultipartBody.Part.createFormData("file", file.getName(), requestFile);
|
||||||
return RetrofitManager.getInstance()
|
return RetrofitManager.getInstance()
|
||||||
.create(BaseApiService.class)
|
.create(BaseApiService.class)
|
||||||
.uploadFile(body)
|
.uploadFile(body)
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
} else if (2 == fileType) {
|
} else if (2 == fileType) {
|
||||||
body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||||
return RetrofitManager.getInstance()
|
return RetrofitManager.getInstance()
|
||||||
.create(BaseApiService.class)
|
.create(BaseApiService.class)
|
||||||
.uploadImage(body)
|
.uploadImage(body)
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
|
|
||||||
} else if (3 == fileType) {
|
} else if (3 == fileType) {
|
||||||
body = MultipartBody.Part.createFormData("video", file.getName(), requestFile);
|
body = MultipartBody.Part.createFormData("video", file.getName(), requestFile);
|
||||||
return RetrofitManager.getInstance()
|
return RetrofitManager.getInstance()
|
||||||
.create(BaseApiService.class)
|
.create(BaseApiService.class)
|
||||||
.uploadVideo(body)
|
.uploadVideo(body)
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
} else if (4 == fileType) {
|
} else if (4 == fileType) {
|
||||||
body = MultipartBody.Part.createFormData("audio", file.getName(), requestFile);
|
body = MultipartBody.Part.createFormData("audio", file.getName(), requestFile);
|
||||||
return RetrofitManager.getInstance()
|
return RetrofitManager.getInstance()
|
||||||
.create(BaseApiService.class)
|
.create(BaseApiService.class)
|
||||||
.uploadAudio(body)
|
.uploadAudio(body)
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
android:id="@+id/iv_banner"
|
android:id="@+id/iv_banner"
|
||||||
android:layout_width="216dp"
|
android:layout_width="216dp"
|
||||||
android:layout_height="178dp"
|
android:layout_height="178dp"
|
||||||
|
android:visibility="gone"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/ic_empty_data" />
|
android:src="@drawable/ic_empty_data" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user