各类上报页面选择默认网格员的网格
This commit is contained in:
parent
2d0d92b32d
commit
dacb22db46
@ -10,6 +10,7 @@ import com.baidu.mapapi.CoordType;
|
||||
import com.baidu.mapapi.SDKInitializer;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tengshisoft.chatmodule.hwclud.receiver.NetWorkStateReceiver;
|
||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.utils.AppUtils;
|
||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||
@ -32,6 +33,7 @@ public class BaseMyApplication extends BaseAppContext {
|
||||
private NetWorkStateReceiver mNetWorkStateReceiver;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@ -74,28 +76,28 @@ public class BaseMyApplication extends BaseAppContext {
|
||||
String[] list_inDir = getAssets().list(inDir);
|
||||
assert list_inDir != null;
|
||||
for (String fileName :
|
||||
list_inDir) {
|
||||
list_inDir) {
|
||||
FileUtils.copyAssetToFiles(inDir, fileName);
|
||||
}
|
||||
|
||||
String[] list_smDir = getAssets().list(smDir);
|
||||
assert list_smDir != null;
|
||||
for (String fileName :
|
||||
list_smDir) {
|
||||
list_smDir) {
|
||||
FileUtils.copyAssetToFiles(smDir, fileName);
|
||||
}
|
||||
|
||||
String[] list_root = getAssets().list(root);
|
||||
assert list_root != null;
|
||||
for (String fileName :
|
||||
list_root) {
|
||||
list_root) {
|
||||
FileUtils.copyAssetToFiles(root, fileName);
|
||||
}
|
||||
|
||||
String[] list_smRoot = getAssets().list(smRoot);
|
||||
assert list_smRoot != null;
|
||||
for (String fileName :
|
||||
list_smRoot) {
|
||||
list_smRoot) {
|
||||
FileUtils.copyAssetToFiles(smRoot, fileName);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
@ -121,5 +123,7 @@ public class BaseMyApplication extends BaseAppContext {
|
||||
public static void setLogin(boolean login) {
|
||||
isLogin = login;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ public class BaseAppContext extends MultiDexApplication {
|
||||
public static NetworkInfo.State cacheState;
|
||||
public static int netType;
|
||||
|
||||
private Object mGridBean;
|
||||
/**
|
||||
* 锁屏监听器
|
||||
*/
|
||||
@ -191,4 +192,14 @@ public class BaseAppContext extends MultiDexApplication {
|
||||
public String getOtherUserTel() {
|
||||
return this.otherUserTel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setGridBean(Object bean) {
|
||||
this.mGridBean = bean;
|
||||
}
|
||||
|
||||
public Object getGridBean() {
|
||||
return this.mGridBean;
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,9 @@ import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
@ -51,9 +54,6 @@ import java.util.ArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/**
|
||||
* 作者 : Adam on 2018/10/15.
|
||||
* 邮箱 : itgaojian@163.com
|
||||
@ -104,7 +104,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
private LocalBroad mLocalBroad;
|
||||
private LinearLayout mLlBaseSearch;
|
||||
private static final String NAVIGATION = "navigationBarBackground";
|
||||
|
||||
protected Object mCurGrid;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
@ -160,7 +160,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
int navigationBarIsMin = 0;
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
navigationBarIsMin = Settings.System.getInt(ctx.getContentResolver(),
|
||||
deviceInfo, 0);
|
||||
deviceInfo, 0);
|
||||
} else {
|
||||
if (Build.BRAND.equalsIgnoreCase("VIVO") || Build.BRAND.equalsIgnoreCase("OPPO")) {
|
||||
navigationBarIsMin = Settings.Secure.getInt(ctx.getContentResolver(), deviceInfo, 0);
|
||||
@ -214,6 +214,13 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
this.mLocalBroad = localBroad;
|
||||
}
|
||||
|
||||
public void setCurGrid(Object grid) {
|
||||
this.mCurGrid = grid;
|
||||
}
|
||||
|
||||
public Object getCurGrid() {
|
||||
return mCurGrid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化标题布局
|
||||
@ -364,7 +371,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
public void setEditTextInhibitInputSpeChat(EditText editText) {
|
||||
InputFilter inputFilter = new InputFilter() {
|
||||
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
|
||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||
@ -502,8 +509,8 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
|
||||
private void openActivity(String path) {
|
||||
ARouter.getInstance()
|
||||
.build(path)
|
||||
.navigation();
|
||||
.build(path)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
private String getRunningTopActivity() {
|
||||
@ -621,9 +628,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
*/
|
||||
protected void startImageActivity(ArrayList imageUrls) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_CMUTILS_PHOTO_SHOW)
|
||||
.withStringArrayList("imgUrls", imageUrls)
|
||||
.navigation();
|
||||
.build(PathConfig.PATH_MODULE_CMUTILS_PHOTO_SHOW)
|
||||
.withStringArrayList("imgUrls", imageUrls)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -639,20 +646,20 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
*/
|
||||
protected void startCameraActivity(boolean isMovie, int requestCode) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULEMEDIA_CAMERA)
|
||||
.withBoolean("isMovie", isMovie)
|
||||
.navigation(this, requestCode);
|
||||
.build(PathConfig.PATH_MODULEMEDIA_CAMERA)
|
||||
.withBoolean("isMovie", isMovie)
|
||||
.navigation(this, requestCode);
|
||||
}
|
||||
|
||||
protected void checkIsLogin(String path) {
|
||||
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
|
||||
.navigation(mActivity, 2333);
|
||||
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
|
||||
.navigation(mActivity, 2333);
|
||||
} else {
|
||||
ARouter.getInstance()
|
||||
.build(path)
|
||||
.navigation();
|
||||
.build(path)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,10 @@ import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.github.promeg.pinyinhelper.Pinyin;
|
||||
@ -37,9 +41,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -82,10 +83,10 @@ public class AddressListActivity extends BaseActivity {
|
||||
mBind = ButterKnife.bind(this);
|
||||
|
||||
ImmersionBar.with(mActivity)
|
||||
.statusBarColor("#FFFFFF")
|
||||
.statusBarDarkFont(true)
|
||||
.titleBar(mRlTitleBar)
|
||||
.init();
|
||||
.statusBarColor("#FFFFFF")
|
||||
.statusBarDarkFont(true)
|
||||
.titleBar(mRlTitleBar)
|
||||
.init();
|
||||
mTvBaseTitle.setTextColor(Color.BLACK);
|
||||
mRlTitleBar.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
mTvAppBack.setBackgroundResource(R.drawable.ic_back_black);
|
||||
@ -108,17 +109,17 @@ public class AddressListActivity extends BaseActivity {
|
||||
Pinyin.init(Pinyin.newConfig());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
builder.setTitle("提示")
|
||||
.setMessage("您还未同步通讯录,现在要同步吗?")
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
doSyncContact();
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
dialog.dismiss();
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
.setMessage("您还未同步通讯录,现在要同步吗?")
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
doSyncContact();
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
dialog.dismiss();
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,45 +141,45 @@ public class AddressListActivity extends BaseActivity {
|
||||
*/
|
||||
private void doSyncUser() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getAllUserList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<UserDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@androidx.annotation.NonNull Disposable d) {
|
||||
.create(GridApis.class)
|
||||
.getAllUserList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<UserDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@androidx.annotation.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@androidx.annotation.NonNull List<UserDatabaseBean> userDatabaseBeans) {
|
||||
mUserDatabaseBeanList = userDatabaseBeans;
|
||||
for (UserDatabaseBean next : mUserDatabaseBeanList) {
|
||||
if (!TextUtils.isEmpty(next.getUserName())) {
|
||||
next.setPinYin(Pinyin.toPinyin(next.getUserName(), ","));
|
||||
} else {
|
||||
next.setPinYin("#");
|
||||
@Override
|
||||
public void onNext(@androidx.annotation.NonNull List<UserDatabaseBean> userDatabaseBeans) {
|
||||
mUserDatabaseBeanList = userDatabaseBeans;
|
||||
for (UserDatabaseBean next : mUserDatabaseBeanList) {
|
||||
if (!TextUtils.isEmpty(next.getUserName())) {
|
||||
next.setPinYin(Pinyin.toPinyin(next.getUserName(), ","));
|
||||
} else {
|
||||
next.setPinYin("#");
|
||||
}
|
||||
}
|
||||
++mCount;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
++mCount;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
|
||||
@Override
|
||||
public void onError(@androidx.annotation.NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
mDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@androidx.annotation.NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
mDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -186,38 +187,38 @@ public class AddressListActivity extends BaseActivity {
|
||||
*/
|
||||
private void doSyncDept() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getAllDeptList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<DeptDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@androidx.annotation.NonNull Disposable d) {
|
||||
.create(GridApis.class)
|
||||
.getAllDeptList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<DeptDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@androidx.annotation.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@androidx.annotation.NonNull List<DeptDatabaseBean> deptDatabaseBeans) {
|
||||
++mCount;
|
||||
mDatabaseBeanList = deptDatabaseBeans;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
@Override
|
||||
public void onNext(@androidx.annotation.NonNull List<DeptDatabaseBean> deptDatabaseBeans) {
|
||||
++mCount;
|
||||
mDatabaseBeanList = deptDatabaseBeans;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,6 +264,7 @@ public class AddressListActivity extends BaseActivity {
|
||||
commonNavigator.setAdjustMode(true);
|
||||
mMiTabs.setNavigator(commonNavigator);
|
||||
mVpContent.setOffscreenPageLimit(2);
|
||||
mVpContent.setUserInputEnabled(false);
|
||||
UIUtil.bindViewPager2(mMiTabs, mVpContent, null);
|
||||
}
|
||||
|
||||
@ -284,8 +286,8 @@ public class AddressListActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void listenerSearch() {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_CHAT_ADDRESSLIST_SEARCH)
|
||||
.navigation();
|
||||
.build(PathConfig.PATH_MODULE_CHAT_ADDRESSLIST_SEARCH)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,11 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ZoomControls;
|
||||
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.baidu.mapapi.map.BaiduMap;
|
||||
@ -65,6 +70,7 @@ import com.tenlionsoft.baselib.core.widget.videorecord.MediaManager;
|
||||
import com.tenlionsoft.baselib.core.widget.views.AreaChooseDialog;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ButtomDialogView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.PermissionUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
@ -73,10 +79,6 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -165,7 +167,7 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
|
||||
private String mVideoPath;//视频文件路径
|
||||
private String mVideoId;//视频ID
|
||||
private int mIsSelf = 0;//是否自处理
|
||||
private int mIsSelf = 1;//是否自处理
|
||||
private CaseComponentListBean.RowsBean mSelComponentBean;//部件
|
||||
private String mSelAreaCode;
|
||||
private String mSelAreaId;
|
||||
@ -219,9 +221,9 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
ToastUtils.show("请先选择所在地区");
|
||||
} else {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_SEL_GRID)
|
||||
.withString("areaCode", mSelAreaCode)
|
||||
.navigation(mActivity, 15);
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_SEL_GRID)
|
||||
.withString("areaCode", mSelAreaCode)
|
||||
.navigation(mActivity, 15);
|
||||
}
|
||||
});
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
@ -231,8 +233,8 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
Glide.with(mActivity)
|
||||
.load(R.drawable.shp_rectangle_black)
|
||||
.into(mIvCover);
|
||||
.load(R.drawable.shp_rectangle_black)
|
||||
.into(mIvCover);
|
||||
});
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvPlayVideo.setOnClickListener(v -> {
|
||||
@ -242,15 +244,15 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
} else {
|
||||
//播放视频
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", mVideoPath)
|
||||
.withString("title", "事件视频")
|
||||
.navigation();
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", mVideoPath)
|
||||
.withString("title", "事件视频")
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
mTvAddressSel.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAP_SEL_POINT)
|
||||
.navigation(mActivity, 16));
|
||||
.build(PathConfig.PATH_MODULE_MAP_SEL_POINT)
|
||||
.navigation(mActivity, 16));
|
||||
|
||||
//录音
|
||||
mArbAudio.setAudioFinishRecorderListener((seconds, filePath) -> uploadVoice(filePath));
|
||||
@ -259,11 +261,11 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
AnimationDrawable animationDrawable = (AnimationDrawable) mTvVoiceAnim.getBackground();
|
||||
animationDrawable.start();
|
||||
MediaManager.playSound(mAudioPath,
|
||||
mp -> {
|
||||
animationDrawable.selectDrawable(0);//显示动画第一帧
|
||||
animationDrawable.stop();
|
||||
MediaManager.destroy();
|
||||
});
|
||||
mp -> {
|
||||
animationDrawable.selectDrawable(0);//显示动画第一帧
|
||||
animationDrawable.stop();
|
||||
MediaManager.destroy();
|
||||
});
|
||||
}
|
||||
});
|
||||
mIvDelAudio.setOnClickListener(v -> {
|
||||
@ -280,10 +282,10 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
} else {
|
||||
//视频播放
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", mVideoPath)
|
||||
.withString("title", "视频")
|
||||
.navigation();
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", mVideoPath)
|
||||
.withString("title", "视频")
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
//是否自处理
|
||||
@ -299,15 +301,21 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
ToastUtils.show("请选择所在网格");
|
||||
} else {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_INCIDENT_SEL_COMPONENT)
|
||||
.withBoolean("isSingle", true)
|
||||
.withString("id", mSelGridBean.getGridCode())
|
||||
.navigation(mActivity, 13);
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_INCIDENT_SEL_COMPONENT)
|
||||
.withBoolean("isSingle", true)
|
||||
.withString("id", mSelGridBean.getGridCode())
|
||||
.navigation(mActivity, 13);
|
||||
}
|
||||
});
|
||||
mBtnSubmit.setOnClickListener(v -> doSubmit());
|
||||
checkAuthority();
|
||||
setCurrentLoc();
|
||||
// getMineGridList();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGridId.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
private void setCurrentLoc() {
|
||||
@ -331,22 +339,22 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
*/
|
||||
private void checkAuthority() {
|
||||
PermissionUtils.permission(PermissionConstants.STORAGE,
|
||||
PermissionConstants.LOCATION,
|
||||
PermissionConstants.CAMERA,
|
||||
PermissionConstants.MICROPHONE)
|
||||
.callback(new PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
mArbAudio.setHasRecordPromission(true);
|
||||
}
|
||||
PermissionConstants.LOCATION,
|
||||
PermissionConstants.CAMERA,
|
||||
PermissionConstants.MICROPHONE)
|
||||
.callback(new PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
mArbAudio.setHasRecordPromission(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied() {
|
||||
ToastUtils.show("App需要读取SD的权限,和定位的权限,请前往设置里授权.");
|
||||
mArbAudio.setHasRecordPromission(false);
|
||||
finish();
|
||||
}
|
||||
}).request();
|
||||
@Override
|
||||
public void onDenied() {
|
||||
ToastUtils.show("App需要读取SD的权限,和定位的权限,请前往设置里授权.");
|
||||
mArbAudio.setHasRecordPromission(false);
|
||||
finish();
|
||||
}
|
||||
}).request();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -358,20 +366,60 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "上报中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.doSaveCase(body, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("上报成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自己的网格
|
||||
*/
|
||||
private void getMineGridList() {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.doSaveCase(body, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
.getMineGridList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<AreaGridListBean.RowsBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
public void onNext(@NonNull List<AreaGridListBean.RowsBean> rowsBeans) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("上报成功");
|
||||
finish();
|
||||
if (rowsBeans != null && rowsBeans.size() > 0) {
|
||||
mSelGridBean = rowsBeans.get(0);
|
||||
mTvGridId.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -385,7 +433,6 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -393,9 +440,9 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
*/
|
||||
private void onShowArea() {
|
||||
AreaChooseDialog dialog = new AreaChooseDialog
|
||||
.DialogBuilder(mActivity)
|
||||
.setDefault(true)
|
||||
.build();
|
||||
.DialogBuilder(mActivity)
|
||||
.setDefault(true)
|
||||
.build();
|
||||
dialog.addOnChoseListener((names, id, code) -> {
|
||||
mSelAreaCode = code;
|
||||
mSelAreaId = id;
|
||||
@ -503,11 +550,11 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
*/
|
||||
private void showSelectPhoto(AddPhotoBean bean) {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
@ -518,7 +565,7 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
mCurrentBean = bean;
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
"image/*");
|
||||
"image/*");
|
||||
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
@ -527,10 +574,10 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
public void choseShoot() {
|
||||
mCurrentBean = bean;
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "photo")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "photo")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@ -552,11 +599,11 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
*/
|
||||
private void showSelectVideo() {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
@ -566,7 +613,7 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
public void choseAlbum() {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
|
||||
"video/*");
|
||||
"video/*");
|
||||
startActivityForResult(intent, BaseUrlApi.CAMERA_REQUEST_PHOTO);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
@ -574,10 +621,10 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
@Override
|
||||
public void choseShoot() {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "video")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST_VIDEO);
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "video")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST_VIDEO);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@ -705,10 +752,10 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
mBitMap = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_location_marker);
|
||||
}
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.position(new LatLng(lat, lng))//mark出现的位置
|
||||
.icon(mBitMap) //mark图标
|
||||
.draggable(false)//mark可拖拽
|
||||
.animateType(MarkerOptions.MarkerAnimateType.none);
|
||||
.position(new LatLng(lat, lng))//mark出现的位置
|
||||
.icon(mBitMap) //mark图标
|
||||
.draggable(false)//mark可拖拽
|
||||
.animateType(MarkerOptions.MarkerAnimateType.none);
|
||||
mBaiduMap.addOverlay(markerOptions);
|
||||
}
|
||||
|
||||
@ -725,50 +772,50 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("video", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadVideo(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
.create(BaseApiService.class)
|
||||
.uploadVideo(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mVideoPath = videoPath;
|
||||
mVideoId = baseUserBean.getData();
|
||||
mIvDelVideo.setVisibility(View.VISIBLE);
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||
Glide.with(mActivity)
|
||||
.setDefaultRequestOptions(
|
||||
new RequestOptions()
|
||||
.frame(0)
|
||||
.centerCrop()
|
||||
)
|
||||
.load(mVideoPath)
|
||||
.into(mIvCover);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mVideoPath = videoPath;
|
||||
mVideoId = baseUserBean.getData();
|
||||
mIvDelVideo.setVisibility(View.VISIBLE);
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||
Glide.with(mActivity)
|
||||
.setDefaultRequestOptions(
|
||||
new RequestOptions()
|
||||
.frame(0)
|
||||
.centerCrop()
|
||||
)
|
||||
.load(mVideoPath)
|
||||
.into(mIvCover);
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.show("视频文件路径有误.");
|
||||
@ -788,48 +835,48 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("audio", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadAudio(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
.create(BaseApiService.class)
|
||||
.uploadAudio(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
mIvVoice.setVisibility(View.GONE);
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mAudioPath = filePath;
|
||||
mAudioId = baseUserBean.getData();
|
||||
mTvVoiceAnim.setVisibility(View.VISIBLE);
|
||||
mIvDelAudio.setVisibility(View.VISIBLE);
|
||||
mArbAudio.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
mIvVoice.setVisibility(View.GONE);
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mAudioPath = filePath;
|
||||
mAudioId = baseUserBean.getData();
|
||||
mTvVoiceAnim.setVisibility(View.VISIBLE);
|
||||
mIvDelAudio.setVisibility(View.VISIBLE);
|
||||
mArbAudio.setVisibility(View.GONE);
|
||||
}
|
||||
mTvVoiceAnim.setVisibility(View.GONE);
|
||||
mIvDelAudio.setVisibility(View.GONE);
|
||||
mArbAudio.setVisibility(View.VISIBLE);
|
||||
mIvVoice.setVisibility(View.VISIBLE);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
mTvVoiceAnim.setVisibility(View.GONE);
|
||||
mIvDelAudio.setVisibility(View.GONE);
|
||||
mArbAudio.setVisibility(View.VISIBLE);
|
||||
mIvVoice.setVisibility(View.VISIBLE);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.show("录音文件路径有误.");
|
||||
@ -853,45 +900,45 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
.create(BaseApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mPhotoIds += (baseUserBean.getData() + ",");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 8) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mPhotoIds += (baseUserBean.getData() + ",");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 8) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -914,11 +961,11 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
ToastUtils.show("详细类型数据未录入,无法选取");
|
||||
}
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTypeList, mTypeSubList);
|
||||
}
|
||||
mTypePicker.show();
|
||||
@ -934,38 +981,38 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getCaseTypeListAll(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CaseTypeBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
.create(GridApis.class)
|
||||
.getCaseTypeListAll(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CaseTypeBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<CaseTypeBean> componentTypeBeans) {
|
||||
dialog.dismiss();
|
||||
if (componentTypeBeans != null && componentTypeBeans.size() > 0) {
|
||||
mTypeList = componentTypeBeans;
|
||||
buildTypeSubBean();
|
||||
} else {
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
@Override
|
||||
public void onNext(@NonNull List<CaseTypeBean> componentTypeBeans) {
|
||||
dialog.dismiss();
|
||||
if (componentTypeBeans != null && componentTypeBeans.size() > 0) {
|
||||
mTypeList = componentTypeBeans;
|
||||
buildTypeSubBean();
|
||||
} else {
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void buildTypeSubBean() {
|
||||
|
@ -8,6 +8,9 @@ import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
@ -26,8 +29,6 @@ import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -95,12 +96,12 @@ public class ChooseGridActivity extends BaseActivity {
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("确定");
|
||||
mTvPublish.setOnClickListener(v -> doConfirm());
|
||||
mIvAppSearchIcon.setVisibility(View.VISIBLE);
|
||||
mIvAppSearchIcon.setVisibility(View.GONE);
|
||||
mBeans = new ArrayList<>();
|
||||
//字典ID
|
||||
mIsSingle = getIntent().getBooleanExtra("isSingle", true);
|
||||
mAreaCode = getIntent().getStringExtra("areaCode");
|
||||
mAdapter = new GridSelAdapter(mActivity, mBeans,1);
|
||||
mAdapter = new GridSelAdapter(mActivity, mBeans, 1);
|
||||
mAdapter.addOnitemCheckChange((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
if (mIsSingle) {
|
||||
@ -131,22 +132,25 @@ public class ChooseGridActivity extends BaseActivity {
|
||||
mRlvComponents.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#BFBFBF")));
|
||||
|
||||
mTvPublish.setOnClickListener(v -> doConfirm());
|
||||
getAreaGridList(1);
|
||||
mSrlContent.setOnLoadMoreListener(refreshLayout -> doLoadMore());
|
||||
// getAreaGridList(1);
|
||||
getMineGridList();
|
||||
// mSrlContent.setOnLoadMoreListener(refreshLayout -> doLoadMore());
|
||||
mSrlContent.setEnableLoadMore(false);
|
||||
mSrlContent.setOnRefreshListener(refreshLayout -> doRefresh());
|
||||
setStateView(13);
|
||||
}
|
||||
|
||||
//加载更多
|
||||
private void doLoadMore() {
|
||||
getAreaGridList(mCurrentPage);
|
||||
// getAreaGridList(mCurrentPage);
|
||||
}
|
||||
|
||||
//刷新
|
||||
private void doRefresh() {
|
||||
mBeans.clear();
|
||||
mAdapter.setData(mBeans);
|
||||
getAreaGridList(1);
|
||||
// getAreaGridList(1);
|
||||
getMineGridList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,71 +247,111 @@ public class ChooseGridActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void getMineGridList() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getMineGridList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<AreaGridListBean.RowsBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<AreaGridListBean.RowsBean> rowsBeans) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
if (rowsBeans != null && rowsBeans.size() > 0) {
|
||||
mBeans = rowsBeans;
|
||||
mAdapter.setData(mBeans);
|
||||
setStateView(14);
|
||||
} else {
|
||||
setStateView(15);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典
|
||||
*/
|
||||
private void getAreaGridList(int currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getGridByAreaCode(mAreaCode, mKeywords, currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<AreaGridListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
.create(GridApis.class)
|
||||
.getGridByAreaCode(mAreaCode, mKeywords, currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<AreaGridListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull AreaGridListBean areaGridListBean) {
|
||||
if (areaGridListBean.getRows() != null && areaGridListBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mBeans.clear();
|
||||
mBeans.addAll(areaGridListBean.getRows());
|
||||
} else {
|
||||
mBeans.addAll(areaGridListBean.getRows());
|
||||
}
|
||||
setStateView(14);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mBeans.size() >= areaGridListBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
setStateView(14);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
setStateView(15);
|
||||
@Override
|
||||
public void onNext(@NonNull AreaGridListBean areaGridListBean) {
|
||||
if (areaGridListBean.getRows() != null && areaGridListBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mBeans.clear();
|
||||
mBeans.addAll(areaGridListBean.getRows());
|
||||
} else {
|
||||
setStateView(15);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
mBeans.addAll(areaGridListBean.getRows());
|
||||
}
|
||||
setStateView(14);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mBeans.size() >= areaGridListBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
setStateView(14);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
setStateView(15);
|
||||
} else {
|
||||
setStateView(15);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(16);
|
||||
}
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -178,6 +178,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/switch_ios_track_selector"
|
||||
android:checked="true"
|
||||
android:switchMinWidth="40dp"
|
||||
android:switchPadding="0dp"
|
||||
android:textOff=""
|
||||
|
@ -168,6 +168,11 @@ public class CommunityAddActivity extends BaseActivity {
|
||||
.navigation(mActivity, 16));
|
||||
initMap();
|
||||
setCurrentLoc();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
private void setCurrentLoc() {
|
||||
|
@ -25,6 +25,7 @@ import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.DicIds;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddPhotoBean;
|
||||
@ -136,6 +137,11 @@ public class CarManageAddActivity extends BaseActivity {
|
||||
}
|
||||
});
|
||||
mBtnSubmit.setOnClickListener(v -> doConfirm());
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,10 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ZoomControls;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.baidu.mapapi.map.BaiduMap;
|
||||
@ -64,9 +68,6 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -214,31 +215,37 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
ToastUtils.show("请选择所在地区");
|
||||
} else {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_SEL_GRID)
|
||||
.withString("areaCode", mSelAreaCode)
|
||||
.navigation(mActivity, 15);
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_SEL_GRID)
|
||||
.withString("areaCode", mSelAreaCode)
|
||||
.navigation(mActivity, 15);
|
||||
}
|
||||
});
|
||||
mTvDept1.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_COMPONENT_SEL_DEPT)
|
||||
.withBoolean("isSingle", true)
|
||||
.navigation(mActivity, 12));
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_COMPONENT_SEL_DEPT)
|
||||
.withBoolean("isSingle", true)
|
||||
.navigation(mActivity, 12));
|
||||
mTvDept2.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_COMPONENT_SEL_DEPT)
|
||||
.withBoolean("isSingle", true)
|
||||
.navigation(mActivity, 13));
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_COMPONENT_SEL_DEPT)
|
||||
.withBoolean("isSingle", true)
|
||||
.navigation(mActivity, 13));
|
||||
mTvDept3.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_COMPONENT_SEL_DEPT)
|
||||
.withBoolean("isSingle", true)
|
||||
.navigation(mActivity, 14));
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_COMPONENT_SEL_DEPT)
|
||||
.withBoolean("isSingle", true)
|
||||
.navigation(mActivity, 14));
|
||||
mTvAddressSel.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAP_SEL_POINT)
|
||||
.navigation(mActivity, 16));
|
||||
.build(PathConfig.PATH_MODULE_MAP_SEL_POINT)
|
||||
.navigation(mActivity, 16));
|
||||
initDataSource();
|
||||
initState();
|
||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||
initMap();
|
||||
setCurrentLoc();
|
||||
// getMineGridList();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGridId.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
private BaiduMap mBaiduMap;
|
||||
@ -287,10 +294,10 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
mBitMap = BitmapDescriptorFactory.fromResource(com.tengshisoft.commonmodule.R.drawable.ic_map_location_marker);
|
||||
}
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.position(new LatLng(lat, lng))//mark出现的位置
|
||||
.icon(mBitMap) //mark图标
|
||||
.draggable(false)//mark可拖拽
|
||||
.animateType(MarkerOptions.MarkerAnimateType.none);
|
||||
.position(new LatLng(lat, lng))//mark出现的位置
|
||||
.icon(mBitMap) //mark图标
|
||||
.draggable(false)//mark可拖拽
|
||||
.animateType(MarkerOptions.MarkerAnimateType.none);
|
||||
mBaiduMap.addOverlay(markerOptions);
|
||||
}
|
||||
|
||||
@ -310,14 +317,53 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自己的网格
|
||||
*/
|
||||
private void getMineGridList() {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getMineGridList(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<AreaGridListBean.RowsBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<AreaGridListBean.RowsBean> rowsBeans) {
|
||||
dialog.dismiss();
|
||||
if (rowsBeans != null && rowsBeans.size() > 0) {
|
||||
mSelGridBean = rowsBeans.get(0);
|
||||
mTvGridId.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 地区选择
|
||||
*/
|
||||
private void onShowArea() {
|
||||
AreaChooseDialog dialog = new AreaChooseDialog
|
||||
.DialogBuilder(mActivity)
|
||||
.setDefault(true)
|
||||
.build();
|
||||
.DialogBuilder(mActivity)
|
||||
.setDefault(true)
|
||||
.build();
|
||||
dialog.addOnChoseListener((names, id, code) -> {
|
||||
mSelAreaCode = code;
|
||||
mSelAreaId = id;
|
||||
@ -339,35 +385,35 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.doSaveComponent(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
.create(GridApis.class)
|
||||
.doSaveComponent(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("保存成功");
|
||||
setResult(13);
|
||||
finish();
|
||||
}
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("保存成功");
|
||||
setResult(13);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,11 +492,11 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
mTvState.setText(bea.getDataName());
|
||||
mSelState = bea.getDataId();
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mStatePicker.setPicker(mStateList);
|
||||
}
|
||||
mStatePicker.show();
|
||||
@ -469,11 +515,11 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
mTvDataSource.setText(bea.getDataName());
|
||||
mSelDataSource = bea.getDataId();
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mDataSourcePicker.setPicker(mDataSource);
|
||||
}
|
||||
mDataSourcePicker.show();
|
||||
@ -500,11 +546,11 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
mTvType.setText(bean.getName());
|
||||
}
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTypeList, mTypeSubList);
|
||||
}
|
||||
mTypePicker.show();
|
||||
@ -520,38 +566,38 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getComponentTypeListAll(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<ComponentTypeBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
.create(GridApis.class)
|
||||
.getComponentTypeListAll(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<ComponentTypeBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<ComponentTypeBean> componentTypeBeans) {
|
||||
dialog.dismiss();
|
||||
if (componentTypeBeans != null && componentTypeBeans.size() > 0) {
|
||||
mTypeList = componentTypeBeans;
|
||||
buildTypeSubBean();
|
||||
} else {
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
@Override
|
||||
public void onNext(@NonNull List<ComponentTypeBean> componentTypeBeans) {
|
||||
dialog.dismiss();
|
||||
if (componentTypeBeans != null && componentTypeBeans.size() > 0) {
|
||||
mTypeList = componentTypeBeans;
|
||||
buildTypeSubBean();
|
||||
} else {
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void buildTypeSubBean() {
|
||||
@ -575,11 +621,11 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
*/
|
||||
private void showSelectPhoto(AddPhotoBean bean) {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
@ -590,7 +636,7 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
mCurrentBean = bean;
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
"image/*");
|
||||
"image/*");
|
||||
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
@ -599,10 +645,10 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
public void choseShoot() {
|
||||
mCurrentBean = bean;
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "photo")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "photo")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@ -795,47 +841,47 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
.create(BaseApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mPhotoIds += (baseUserBean.getData() + ",");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 4) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mPhotoIds += (baseUserBean.getData() + ",");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 4) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
ToastUtils.show("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -11,11 +11,13 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tengshisoft.commonmodule.adapters.CensusPersonAdapter;
|
||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||
import com.tengshisoft.commonmodule.beans.CensusPersonBean;
|
||||
import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
@ -109,6 +111,7 @@ public class CensusBaseActivity extends BaseActivity {
|
||||
doEditBean(bean, pos);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.DicIds;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaBean;
|
||||
@ -202,6 +203,11 @@ public class CensusBaseEnterActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,6 +209,11 @@ public class SchoolManageAddActivity extends BaseActivity {
|
||||
}
|
||||
});
|
||||
initMap();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -205,6 +205,11 @@ public class ExpressPoiAddActivity extends BaseActivity {
|
||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||
initMap();
|
||||
setCurrentLoc();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
private BaiduMap mBaiduMap;
|
||||
@ -261,9 +266,9 @@ public class ExpressPoiAddActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void setCurrentLoc() {
|
||||
// mSelAreaNames = UserLgUtils.getLocationAddress();
|
||||
// mSelAreaCode = UserLgUtils.getUserAreaCode();
|
||||
// mTvArea.setText(mSelAreaNames);
|
||||
mSelAreaNames = UserLgUtils.getLocationAddress();
|
||||
mSelAreaCode = UserLgUtils.getUserAreaCode();
|
||||
mTvArea.setText(mSelAreaNames);
|
||||
|
||||
mLat = BaseAppContext.getInstance().getLat();
|
||||
mLng = BaseAppContext.getInstance().getLng();
|
||||
|
@ -160,6 +160,11 @@ public class KeyAreaAddActivity extends BaseActivity {
|
||||
});
|
||||
mTvArea.setOnClickListener(v -> onShowArea());
|
||||
setCurrentLoc();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
private void setCurrentLoc() {
|
||||
|
@ -144,6 +144,11 @@ public class KeyPlaceAddActivity extends BaseActivity {
|
||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||
initMap();
|
||||
setCurrentLoc();
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
private BaiduMap mBaiduMap;
|
||||
|
@ -20,6 +20,7 @@ import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.DicIds;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.DicBean;
|
||||
@ -135,6 +136,11 @@ public class KeyRoadAddActivity extends BaseActivity {
|
||||
mSelAreaName = UserLgUtils.getLocationAddress();
|
||||
mSelAreaCode = UserLgUtils.getUserAreaCode();
|
||||
mTvArea.setText(mSelAreaName);
|
||||
Object curGrid = ((BaseAppContext) getApplicationContext()).getGridBean();
|
||||
if (curGrid != null && curGrid instanceof AreaGridListBean.RowsBean) {
|
||||
mSelGridBean = (AreaGridListBean.RowsBean) curGrid;
|
||||
mTvGrid.setText(mSelGridBean.getGridName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,12 +28,13 @@ import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tengshisoft.mainmodule.BaseLineTextAdapter;
|
||||
import com.tengshisoft.mainmodule.R;
|
||||
import com.tengshisoft.mainmodule.R2;
|
||||
import com.tengshisoft.mainmodule.base.MainTabActivity;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.FuncBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FunctionNumAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FunctionTitleNumAdapter;
|
||||
@ -195,6 +196,8 @@ public class GridMainFragment extends BaseFragment {
|
||||
public void onNext(@NonNull List<AreaGridListBean.RowsBean> rowsBeans) {
|
||||
if (rowsBeans.size() <= 0) {
|
||||
showBindGridDialog();
|
||||
} else {
|
||||
((BaseAppContext) getApplicationContext()).setGridBean(rowsBeans.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +302,6 @@ public class GridMainFragment extends BaseFragment {
|
||||
mRlvKnow.setAdapter(mKnowAdapter);
|
||||
mKnowAdapter.addOnItemClickListener(this::showKnowDetail);
|
||||
getInfoFromNet();
|
||||
showBindGridDialog();
|
||||
}
|
||||
|
||||
//知识详情
|
||||
@ -581,7 +583,7 @@ public class GridMainFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onAttach(@NonNull @NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
this.mActivity = (BaseActivity) getActivity();
|
||||
this.mActivity = (MainTabActivity) getActivity();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user