各类上报页面选择默认网格员的网格
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();
|
||||
@ -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
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化标题布局
|
||||
|
@ -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;
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
@ -308,6 +310,12 @@ public class IncidentReportActivity extends BaseActivity {
|
||||
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() {
|
||||
@ -388,6 +396,45 @@ public class IncidentReportActivity 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() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示地区选择
|
||||
*/
|
||||
|
@ -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,6 +247,46 @@ 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() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典
|
||||
*/
|
||||
|
@ -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;
|
||||
@ -239,6 +240,12 @@ public class ComponentAddActivity extends BaseActivity {
|
||||
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;
|
||||
@ -310,6 +317,45 @@ 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() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 地区选择
|
||||
*/
|
||||
|
@ -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