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