添加发现页面的调试接口
This commit is contained in:
parent
cdd9af4fee
commit
e209eae9a0
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
// ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -26,19 +26,19 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
private ImageView ivIcon;
|
||||
private WebView nWebView;
|
||||
private String content = "<div>\n" +
|
||||
"<h2>定义和用法</h2>\n" +
|
||||
"\n" +
|
||||
"<p>\n" +
|
||||
"\t<img src=\"https://exp-picture.cdn.bcebos.com/560be432939c2cf72dff4caa452c5b1b1fde12e1.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1%2Fformat%2Cf_jpg%2Fquality%2Cq_80\">\n" +
|
||||
"</p>\n" +
|
||||
"\n" +
|
||||
"<p style=\"color: red; margin-left: 20px\"><style> 标签用于为 HTML 文档定义样式信息。</p>\n" +
|
||||
"\n" +
|
||||
"<p style=\"background-color: lightblue; margin-left: 20px\">在 style 中,您可以规定在浏览器中如何呈现 HTML 文档。</p>\n" +
|
||||
"\n" +
|
||||
"<p style=\"font-family: verdana; margin-left: 20px\">type 属性是必需的,定义 style 元素的内容。唯一可能的值是 \"text/css\"。</p>\n" +
|
||||
"\n" +
|
||||
"<p style=\"font-size: 20px; margin-left: 20px\">style 元素位于 head 部分中。</p>\n" +
|
||||
"<a>测试</a>\n" +
|
||||
// "\n" +
|
||||
// "<p>\n" +
|
||||
// "\t<img src=\"https://exp-picture.cdn.bcebos.com/560be432939c2cf72dff4caa452c5b1b1fde12e1.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1%2Fformat%2Cf_jpg%2Fquality%2Cq_80\">\n" +
|
||||
// "</p>\n" +
|
||||
// "\n" +
|
||||
// "<p style=\"color: red; margin-left: 20px\"><style> 标签用于为 HTML 文档定义样式信息。</p>\n" +
|
||||
// "\n" +
|
||||
// "<p style=\"background-color: lightblue; margin-left: 20px\">在 style 中,您可以规定在浏览器中如何呈现 HTML 文档。</p>\n" +
|
||||
// "\n" +
|
||||
// "<p style=\"font-family: verdana; margin-left: 20px\">type 属性是必需的,定义 style 元素的内容。唯一可能的值是 \"text/css\"。</p>\n" +
|
||||
// "\n" +
|
||||
// "<p style=\"font-size: 20px; margin-left: 20px\">style 元素位于 head 部分中。</p>\n" +
|
||||
"</div>";
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
|
@ -15,18 +15,21 @@ import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.CapacityMeasureBean;
|
||||
import com.navinfo.outdoor.bean.TaskExplainBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEvaluationAdapter.ViewHolder> {
|
||||
private List<CapacityMeasureBean.BodyBean.DataBean> capacityList = new ArrayList<>();
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> capacityList = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public CapacityEvaluationAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setCapacityList(List<CapacityMeasureBean.BodyBean.DataBean> capacityList) {
|
||||
public void setCapacityList(List<TaskPrefectureBean.BodyBean.ListBean> capacityList) {
|
||||
this.capacityList.addAll(capacityList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -41,8 +44,8 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.tvCapacity.setText(capacityList.get(position).getTitle());
|
||||
holder.tvResults.setText(capacityList.get(position).getStatus());
|
||||
Glide.with(context).load(capacityList.get(position).getSrc()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivCapacity);
|
||||
holder.tvResults.setText(capacityList.get(position).getStatus() + "");
|
||||
Glide.with(context).load(capacityList.get(position).getIconurl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivCapacity);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -15,19 +15,20 @@ import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.CapacityMeasureBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CapacityItemAdapter extends RecyclerView.Adapter<CapacityItemAdapter.ViewHolder> {
|
||||
private List<CapacityMeasureBean.BodyBean.DataBean> capItemList = new ArrayList<>();
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> capItemList = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public CapacityItemAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setCapItemList(List<CapacityMeasureBean.BodyBean.DataBean> capItemList) {
|
||||
public void setCapItemList(List<TaskPrefectureBean.BodyBean.ListBean> capItemList) {
|
||||
this.capItemList.addAll(capItemList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -42,8 +43,8 @@ public class CapacityItemAdapter extends RecyclerView.Adapter<CapacityItemAdapte
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.tvCapItem.setText(capItemList.get(position).getTitle());
|
||||
holder.tvReaus.setText(capItemList.get(position).getStatus());
|
||||
Glide.with(context).load(capItemList.get(position).getSrc()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivCapItem);
|
||||
holder.tvReaus.setText(capItemList.get(position).getStatus()+"");
|
||||
Glide.with(context).load(capItemList.get(position).getIconurl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivCapItem);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -11,19 +11,20 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.EventPrefectureBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EventPrefectureAdapter extends RecyclerView.Adapter<EventPrefectureAdapter.ViewHolder> {
|
||||
private List<EventPrefectureBean.BodyBean.DataBean> dataBeans=new ArrayList<>();
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeans=new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public EventPrefectureAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setDataBeans(List<EventPrefectureBean.BodyBean.DataBean> dataBeans) {
|
||||
public void setDataBeans(List<TaskPrefectureBean.BodyBean.ListBean> dataBeans) {
|
||||
this.dataBeans.addAll(dataBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -37,15 +38,15 @@ public class EventPrefectureAdapter extends RecyclerView.Adapter<EventPrefecture
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
EventPrefectureBean.BodyBean.DataBean dataBean = dataBeans.get(position);
|
||||
holder.tvTitle.setText(dataBean.getTitle());
|
||||
holder.tvDest.setText(dataBean.getSubtitle());
|
||||
holder.tvTime.setText(dataBean.getCreatetime());
|
||||
TaskPrefectureBean.BodyBean.ListBean listBean = dataBeans.get(position);
|
||||
holder.tvTitle.setText(listBean.getTitle());
|
||||
holder.tvDest.setText(listBean.getSubtitle());
|
||||
holder.tvTime.setText(listBean.getCreatetime());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (clickItem!=null){
|
||||
clickItem.item(dataBean.getId());
|
||||
clickItem.item(listBean.getId());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -15,19 +15,20 @@ import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.TaskExplainInfo;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TaskExplainAdapter extends RecyclerView.Adapter<TaskExplainAdapter.ViewHolder> {
|
||||
private List<TaskExplainInfo.BodyBean.DataBean> explainList = new ArrayList<>();
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> explainList = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public TaskExplainAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setExplainList(List<TaskExplainInfo.BodyBean.DataBean> explainList) {
|
||||
public void setExplainList(List<TaskPrefectureBean.BodyBean.ListBean> explainList) {
|
||||
this.explainList.addAll(explainList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -42,7 +43,7 @@ public class TaskExplainAdapter extends RecyclerView.Adapter<TaskExplainAdapter.
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
Glide.with(context).load(explainList.get(position).getSrc()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivExplain);
|
||||
Glide.with(context).load(explainList.get(position).getIconurl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivExplain);
|
||||
holder.tvExplain.setText(explainList.get(position).getTitle());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -11,19 +11,20 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.TaskExplainBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TaskPrefectureAdapter extends RecyclerView.Adapter<TaskPrefectureAdapter.ViewHolder> {
|
||||
private List<TaskExplainBean.BodyBean.DataBean> dataBeans=new ArrayList<>();
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeans=new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public TaskPrefectureAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setDataBeans(List<TaskExplainBean.BodyBean.DataBean> dataBeans) {
|
||||
public void setDataBeans(List<TaskPrefectureBean.BodyBean.ListBean> dataBeans) {
|
||||
this.dataBeans.addAll(dataBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -37,7 +38,7 @@ public class TaskPrefectureAdapter extends RecyclerView.Adapter<TaskPrefectureAd
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
TaskExplainBean.BodyBean.DataBean dataBean = dataBeans.get(position);
|
||||
TaskPrefectureBean.BodyBean.ListBean dataBean = dataBeans.get(position);
|
||||
holder.tvTitle.setText(dataBean.getTitle());
|
||||
holder.tvDest.setText(dataBean.getSubtitle());
|
||||
holder.tvTime.setText(dataBean.getCreatetime());
|
||||
|
@ -63,7 +63,6 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
|
@ -0,0 +1,184 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TaskPrefectureBean {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private BodyBean body;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BodyBean getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(BodyBean body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private Integer totalPage;
|
||||
private Integer total;
|
||||
private List<ListBean> list;
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(Integer totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public Integer getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Integer total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<ListBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<ListBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public static class ListBean {
|
||||
private Integer id;
|
||||
private String title;
|
||||
private String subtitle;
|
||||
private Object context;
|
||||
private String iconurl;
|
||||
private Integer createpid;
|
||||
private String createtime;
|
||||
private Integer fid;
|
||||
private Integer updatepid;
|
||||
private String updatetime;
|
||||
private Object status;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public void setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
}
|
||||
|
||||
public Object getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Object context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public String getIconurl() {
|
||||
return iconurl;
|
||||
}
|
||||
|
||||
public void setIconurl(String iconurl) {
|
||||
this.iconurl = iconurl;
|
||||
}
|
||||
|
||||
public Integer getCreatepid() {
|
||||
return createpid;
|
||||
}
|
||||
|
||||
public void setCreatepid(Integer createpid) {
|
||||
this.createpid = createpid;
|
||||
}
|
||||
|
||||
public String getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(String createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public Integer getFid() {
|
||||
return fid;
|
||||
}
|
||||
|
||||
public void setFid(Integer fid) {
|
||||
this.fid = fid;
|
||||
}
|
||||
|
||||
public Integer getUpdatepid() {
|
||||
return updatepid;
|
||||
}
|
||||
|
||||
public void setUpdatepid(Integer updatepid) {
|
||||
this.updatepid = updatepid;
|
||||
}
|
||||
|
||||
public String getUpdatetime() {
|
||||
return updatetime;
|
||||
}
|
||||
|
||||
public void setUpdatetime(String updatetime) {
|
||||
this.updatetime = updatetime;
|
||||
}
|
||||
|
||||
public Object getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Object status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,12 +10,14 @@ import android.widget.Toast;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.adapter.CapacityEvaluationAdapter;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.CapacityMeasureBean;
|
||||
import com.navinfo.outdoor.bean.TaskExplainInfo;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
@ -31,13 +33,9 @@ import java.util.ArrayList;
|
||||
* 发现-能力测评
|
||||
*/
|
||||
public class CapacityEvaluationFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
|
||||
|
||||
private ImageView ivEvaluationTaskFinish;
|
||||
private XRecyclerView capacityEvaluationRecycler;
|
||||
private CapacityEvaluationAdapter capacityEvaluationAdapter;
|
||||
private ArrayList<TaskExplainInfo.BodyBean.DataBean> capacityList;
|
||||
|
||||
public static CapacityEvaluationFragment newInstance(Bundle bundle) {
|
||||
CapacityEvaluationFragment fragment = new CapacityEvaluationFragment();
|
||||
@ -89,23 +87,27 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
capacityList = new ArrayList<>();
|
||||
initNewWork(true);
|
||||
|
||||
initNewWork();
|
||||
}
|
||||
|
||||
private void initNewWork(boolean b) {
|
||||
private void initNewWork() {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("fid","1");
|
||||
httpParams.put("pageNum","1");
|
||||
httpParams.put("pageSize","2");
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MSG_LISt)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(CapacityMeasureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<CapacityMeasureBean>() {
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.params(httpParams)
|
||||
.callback(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(CapacityMeasureBean response, int id) {
|
||||
public void onSuccess(TaskPrefectureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
capacityEvaluationAdapter.setCapacityList(response.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + response.getMsg() + "sssssssssssss");
|
||||
capacityEvaluationAdapter.setCapacityList(response.getBody().getList());
|
||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "sssssssssssss");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,8 +12,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.adapter.CapacityItemAdapter;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.CapacityMeasureBean;
|
||||
import com.navinfo.outdoor.bean.TaskExplainInfo;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
@ -22,8 +21,6 @@ import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 能力测评的第二个页面
|
||||
*/
|
||||
@ -32,13 +29,14 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
private ImageView ivCapItemFinish;
|
||||
private XRecyclerView capacityRlv;
|
||||
private CapacityItemAdapter capacityItemAdapter;
|
||||
private ArrayList<TaskExplainInfo.BodyBean.DataBean> capItemList;
|
||||
|
||||
|
||||
public static CapacityEvaluationFragment2 newInstance(Bundle bundle) {
|
||||
CapacityEvaluationFragment2 fragment = new CapacityEvaluationFragment2();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_capacity_evaluation2;
|
||||
@ -81,7 +79,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
capItemList = new ArrayList<>();
|
||||
|
||||
initNetWorks(true);
|
||||
}
|
||||
|
||||
@ -90,14 +88,14 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MSG_LISt)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(CapacityMeasureBean.class)
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<CapacityMeasureBean>() {
|
||||
.callback(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(CapacityMeasureBean response, int id) {
|
||||
public void onSuccess(TaskPrefectureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
capacityItemAdapter.setCapItemList(response.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + response.getMsg() + "sssssssssssss");
|
||||
capacityItemAdapter.setCapItemList(response.getBody().getList());
|
||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "sssssssssssss");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -84,9 +84,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
String[] ctype = new String[]{"全部", "poi", "道路", "充电站", "其他"};
|
||||
private ArrayAdapter<String> adapter;
|
||||
private LinearLayout linearChargingPile;
|
||||
private static ChargingStationFragment fragment;
|
||||
|
||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||
fragment = new ChargingStationFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
@ -105,6 +106,28 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
ImageView ivChargingFinal = header.findViewById(R.id.iv_charging_final);
|
||||
ivChargingFinal.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@ -118,6 +141,29 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
// ImageView ivChargingFinal = header.findViewById(R.id.iv_charging_final);
|
||||
// ivChargingFinal.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// // fragment.dismissLoadingDialog();
|
||||
// Bundle arguments = getArguments();
|
||||
// if (arguments!=null) {
|
||||
// isSliding= arguments.getBoolean("isSliding",true);
|
||||
// Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
// }
|
||||
// if (isSliding) {
|
||||
// // 监听到返回按钮点击事件
|
||||
// Message obtain = Message.obtain();
|
||||
// obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
// obtain.obj=isSliding;
|
||||
// EventBus.getDefault().post(obtain);
|
||||
// Message mainButtonVisiableMsg = Message.obtain();
|
||||
// mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
// mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
// EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,11 +10,13 @@ import android.widget.Toast;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.adapter.EventPrefectureAdapter;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.EventPrefectureBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
@ -33,9 +35,9 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
|
||||
private ImageView ivEventTask;
|
||||
private XRecyclerView eventRecycler;
|
||||
private List<EventPrefectureBean.BodyBean.DataBean> taskExplainBean;
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> taskExplainBean;
|
||||
private EventPrefectureAdapter eventPrefectureAdapter;
|
||||
private int page = 1;
|
||||
|
||||
|
||||
public static EventPrefectureFragment newInstance(Bundle bundle) {
|
||||
EventPrefectureFragment fragment = new EventPrefectureFragment();
|
||||
@ -54,22 +56,26 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
taskExplainBean = new ArrayList<>();
|
||||
initNetwork(true);
|
||||
initNetwork();
|
||||
}
|
||||
|
||||
private void initNetwork(boolean b) {
|
||||
private void initNetwork() {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("fid", "1");
|
||||
httpParams.put("pageNum", "1");
|
||||
httpParams.put("pageSize", "2");
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listEvent)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(EventPrefectureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<EventPrefectureBean>() {
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.params(httpParams)
|
||||
.callback(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(EventPrefectureBean eventPrefectureBean, int id) {
|
||||
public void onSuccess(TaskPrefectureBean taskPrefectureBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
eventPrefectureAdapter.setDataBeans(eventPrefectureBean.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + eventPrefectureBean.getMsg() + "sssssssssssss");
|
||||
eventPrefectureAdapter.setDataBeans(taskPrefectureBean.getBody().getList());
|
||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "sssssssssssss");
|
||||
//initEventPrefecture(eventPrefectureBean,b);
|
||||
}
|
||||
|
||||
@ -82,45 +88,45 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
}).build();
|
||||
}
|
||||
|
||||
private void initEventPrefecture(EventPrefectureBean eventPrefectureBean, boolean start) {
|
||||
if (eventPrefectureBean.getStatus() == 0) {
|
||||
if (start) {
|
||||
if (taskExplainBean.size() > 0) {
|
||||
taskExplainBean.clear();
|
||||
}
|
||||
if (eventPrefectureBean.getBody() == null) {
|
||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
taskExplainBean.addAll(eventPrefectureBean.getBody().getData());
|
||||
page++;
|
||||
}
|
||||
eventPrefectureAdapter.notifyDataSetChanged();
|
||||
eventRecycler.refreshComplete();
|
||||
} else {
|
||||
if (eventPrefectureBean.getBody() == null) {
|
||||
eventRecycler.setNoMore(true);
|
||||
} else {
|
||||
taskExplainBean.addAll(eventPrefectureBean.getBody().getData());
|
||||
eventPrefectureAdapter.notifyDataSetChanged();
|
||||
eventRecycler.loadMoreComplete();
|
||||
page++;
|
||||
}
|
||||
}
|
||||
} else if (eventPrefectureBean.getStatus() == 2) {
|
||||
if (start) {
|
||||
if (taskExplainBean.size() > 0) {
|
||||
taskExplainBean.clear();
|
||||
eventPrefectureAdapter.notifyDataSetChanged();
|
||||
}
|
||||
eventRecycler.refreshComplete();
|
||||
} else {
|
||||
eventRecycler.setNoMore(true);
|
||||
}
|
||||
Toast.makeText(getActivity(), eventPrefectureBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), eventPrefectureBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
// private void initEventPrefecture(TaskPrefectureBean taskPrefectureBean, boolean start) {
|
||||
// if (taskPrefectureBean.getStatus() == 0) {
|
||||
// if (start) {
|
||||
// if (taskExplainBean.size() > 0) {
|
||||
// taskExplainBean.clear();
|
||||
// }
|
||||
// if (taskPrefectureBean.getBody() == null) {
|
||||
// Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
||||
// } else {
|
||||
// taskExplainBean.addAll(taskPrefectureBean.getBody().getList());
|
||||
// page++;
|
||||
// }
|
||||
// eventPrefectureAdapter.notifyDataSetChanged();
|
||||
// eventRecycler.refreshComplete();
|
||||
// } else {
|
||||
// if (taskPrefectureBean.getBody() == null) {
|
||||
// eventRecycler.setNoMore(true);
|
||||
// } else {
|
||||
// taskExplainBean.addAll(taskPrefectureBean.getBody().getList());
|
||||
// eventPrefectureAdapter.notifyDataSetChanged();
|
||||
// eventRecycler.loadMoreComplete();
|
||||
// page++;
|
||||
// }
|
||||
// }
|
||||
// } else if (taskPrefectureBean.getStatus() == 2) {
|
||||
// if (start) {
|
||||
// if (taskExplainBean.size() > 0) {
|
||||
// taskExplainBean.clear();
|
||||
// eventPrefectureAdapter.notifyDataSetChanged();
|
||||
// }
|
||||
// eventRecycler.refreshComplete();
|
||||
// } else {
|
||||
// eventRecycler.setNoMore(true);
|
||||
// }
|
||||
// Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// } else {
|
||||
// Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
@ -8,10 +8,12 @@ import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.kongzue.dialog.interfaces.OnMenuItemClickListener;
|
||||
@ -23,15 +25,17 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FilterFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||
private Button btnFilter;
|
||||
private XRecyclerView recyclerFilter;
|
||||
private TextView tvType, tvExclusive, tvPhotograph,tvNumber;
|
||||
private ConstraintLayout clPhotograph, clExclusive, clType,clNumber;
|
||||
private TextView tvType, tvExclusive, tvPhotograph, tvNumber;
|
||||
private ConstraintLayout clPhotograph, clExclusive, clType, clNumber;
|
||||
private PoiDatabase poiDatabase;
|
||||
private PoiDao poiDao;
|
||||
private FilterAdapter filterAdapter;
|
||||
@ -53,10 +57,37 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
ImageView ivFilterFinal = header.findViewById(R.id.iv_filter_final);
|
||||
ivFilterFinal.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@ -65,6 +96,28 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
// ImageView ivFilterFinal = header.findViewById(R.id.iv_filter_final);
|
||||
// ivFilterFinal.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// Bundle arguments = getArguments();
|
||||
// if (arguments != null) {
|
||||
// isSliding = arguments.getBoolean("isSliding", true);
|
||||
// Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
// }
|
||||
// if (isSliding) {
|
||||
// // 监听到返回按钮点击事件
|
||||
// Message obtain = Message.obtain();
|
||||
// obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
// obtain.obj = isSliding;
|
||||
// EventBus.getDefault().post(obtain);
|
||||
// Message mainButtonVisiableMsg = Message.obtain();
|
||||
// mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
// mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
// EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -72,6 +125,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
return R.layout.fragment_filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
poiEntities.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
@ -159,7 +217,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
EventBus.getDefault().post(obtain);
|
||||
break;
|
||||
case R.id.cl_number:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500","1000"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvNumber.setText(text);
|
||||
@ -167,7 +225,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_photograph:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部","专属任务", "普通任务"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "专属任务", "普通任务"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvPhotograph.setText(text);
|
||||
@ -176,7 +234,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_exclusive:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部","poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvExclusive.setText(text);
|
||||
@ -184,12 +242,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_type:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部","已领取", "待提交","未领取"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "已领取", "待提交", "未领取"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvType.setText(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
@ -44,7 +45,29 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
//点击按钮返回上一页
|
||||
ImageView ivOtherFinal = header.findViewById(R.id.iv_other_final);
|
||||
ivOtherFinal.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,6 +82,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
private CheckBox checkBoxRight;
|
||||
private String phone;
|
||||
private PoiEntity showPoiEntity;
|
||||
private View ivPoiFinal;
|
||||
|
||||
public static PoiFragment newInstance(Bundle bundle) {
|
||||
PoiFragment fragment = new PoiFragment();
|
||||
@ -106,8 +107,28 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
|
||||
ImageView ivPoiFinal = header.findViewById(R.id.iv_poi_final);
|
||||
ivPoiFinal.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain1.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -149,7 +170,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
rlInternalPhotos.setOnClickListener(this::onClick);
|
||||
rlCard = findViewById(R.id.rl_card);
|
||||
rlCard.setOnClickListener(this::onClick);
|
||||
|
||||
// ivPoiFinal = findViewById(R.id.iv_poi_final);
|
||||
// ivPoiFinal.setOnClickListener(this::onClick);
|
||||
rlElse = findViewById(R.id.rl_else);
|
||||
rlElse.setOnClickListener(this::onClick);
|
||||
recyclerPhone = findViewById(R.id.recycler_phone);
|
||||
@ -379,6 +401,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
startActivityForResult(intentElse, 105);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import android.graphics.Bitmap;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@ -76,7 +77,22 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
ivPoiVideoFinal.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getActivity().finish();
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5,6 +5,7 @@ import android.graphics.Bitmap;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@ -75,9 +76,35 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
ImageView ivRoadFinal = header.findViewById(R.id.iv_road_final);
|
||||
ivRoadFinal.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
@ -116,7 +143,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
// infos = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,11 +9,13 @@ import android.widget.ImageView;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.adapter.TaskExplainAdapter;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.TaskExplainInfo;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
@ -30,9 +32,9 @@ import java.util.ArrayList;
|
||||
public class TaskExplainFragment extends BaseFragment implements View.OnClickListener {
|
||||
private ImageView ivFindTaskExplain;
|
||||
private XRecyclerView taskExplainRecycle;
|
||||
private ArrayList<TaskExplainInfo.BodyBean.DataBean> dataBeans;
|
||||
|
||||
private TaskExplainAdapter taskExplainAdapter;
|
||||
private int page1 = 1;
|
||||
|
||||
|
||||
public static TaskExplainFragment newInstance(Bundle bundle) {
|
||||
TaskExplainFragment fragment = new TaskExplainFragment();
|
||||
@ -89,29 +91,32 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
dataBeans = new ArrayList<>();
|
||||
initNetWork(true);
|
||||
initNetWork();
|
||||
}
|
||||
|
||||
private void initNetWork(boolean b) {
|
||||
private void initNetWork() {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("fid", "1");
|
||||
httpParams.put("pageNum", "1");
|
||||
httpParams.put("pageSize", "2");
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listTaskExplain)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskExplainInfo.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskExplainInfo>() {
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.params(httpParams)
|
||||
.callback(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainInfo response, int id) {
|
||||
public void onSuccess(TaskPrefectureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
taskExplainAdapter.setExplainList(response.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + response.getMsg() + "");
|
||||
taskExplainAdapter.setExplainList(response.getBody().getList());
|
||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
|
@ -10,11 +10,13 @@ import android.widget.Toast;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.adapter.TaskPrefectureAdapter;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.TaskExplainBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
@ -24,24 +26,26 @@ import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发现-任务专区
|
||||
*/
|
||||
public class TaskPrefectureFragment extends BaseFragment implements View.OnClickListener{
|
||||
public class TaskPrefectureFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView mIvFindTask;
|
||||
private XRecyclerView taskRecycler;
|
||||
private List<TaskExplainBean.BodyBean.DataBean> dataBeanList;
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeanList;
|
||||
private TaskPrefectureAdapter taskPrefectureAdapter;
|
||||
private int page=1;
|
||||
|
||||
|
||||
public static TaskPrefectureFragment newInstance(Bundle bundle) {
|
||||
TaskPrefectureFragment fragment = new TaskPrefectureFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.task_prefecture_fragment;
|
||||
@ -54,7 +58,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
mIvFindTask.setOnClickListener(this::onClick);
|
||||
taskRecycler = findViewById(R.id.task_recycler);
|
||||
taskRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
taskRecycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL));
|
||||
taskRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
taskRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
taskRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
@ -78,7 +82,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
@Override
|
||||
public void item(int id) {
|
||||
Intent intent = new Intent(getContext(), WebActivity.class);
|
||||
intent.putExtra("id",id);
|
||||
intent.putExtra("id", id);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
@ -87,79 +91,83 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
dataBeanList=new ArrayList<>();
|
||||
initNetwork(true);
|
||||
|
||||
dataBeanList = new ArrayList<>();
|
||||
initNetwork();
|
||||
}
|
||||
|
||||
private void initNetwork(boolean start) {
|
||||
private void initNetwork() {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("fid", "1");
|
||||
httpParams.put("pageNum", "1");
|
||||
httpParams.put("pageSize", "2");
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listTask)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskExplainBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskExplainBean>() {
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.params(httpParams)
|
||||
.callback(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainBean taskSpecificationBean, int id) {
|
||||
public void onSuccess(TaskPrefectureBean taskPrefectureBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
taskPrefectureAdapter.setDataBeans(taskSpecificationBean.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: "+taskSpecificationBean.getMsg()+"");
|
||||
taskPrefectureAdapter.setDataBeans(taskPrefectureBean.getBody().getList());
|
||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "");
|
||||
//initTaskSpecification(taskSpecificationBean,start);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: "+e.getMessage());
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
|
||||
private void initTaskSpecification(TaskExplainBean taskSpecificationBean, boolean start) {
|
||||
if (taskSpecificationBean.getStatus()==0) {
|
||||
if (start) {
|
||||
if (dataBeanList.size() > 0) {
|
||||
dataBeanList.clear();
|
||||
}
|
||||
if (taskSpecificationBean.getBody() == null) {
|
||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
dataBeanList.addAll(taskSpecificationBean.getBody().getData());
|
||||
page++;
|
||||
}
|
||||
taskPrefectureAdapter.notifyDataSetChanged();
|
||||
taskRecycler.refreshComplete();
|
||||
} else {
|
||||
if (taskSpecificationBean.getBody() == null) {
|
||||
taskRecycler.setNoMore(true);
|
||||
} else {
|
||||
dataBeanList.addAll(taskSpecificationBean.getBody().getData());
|
||||
taskPrefectureAdapter.notifyDataSetChanged();
|
||||
taskRecycler.loadMoreComplete();
|
||||
page++;
|
||||
}
|
||||
}
|
||||
} else if (taskSpecificationBean.getStatus() == 2) {
|
||||
if (start) {
|
||||
if (dataBeanList.size() > 0) {
|
||||
dataBeanList.clear();
|
||||
taskPrefectureAdapter.notifyDataSetChanged();
|
||||
}
|
||||
taskRecycler.refreshComplete();
|
||||
}else {
|
||||
taskRecycler.setNoMore(true);
|
||||
}
|
||||
Toast.makeText(getActivity(), taskSpecificationBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), taskSpecificationBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
// private void initTaskSpecification(TaskPrefectureBean taskPrefectureBean, boolean start) {
|
||||
// if (taskPrefectureBean.getStatus() == 0) {
|
||||
// if (start) {
|
||||
// if (dataBeanList.size() > 0) {
|
||||
// dataBeanList.clear();
|
||||
// }
|
||||
// if (taskPrefectureBean.getBody() == null) {
|
||||
// Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
||||
// } else {
|
||||
// dataBeanList.addAll(taskPrefectureBean.getBody().getList());
|
||||
// page++;
|
||||
// }
|
||||
// taskPrefectureAdapter.notifyDataSetChanged();
|
||||
// taskRecycler.refreshComplete();
|
||||
// } else {
|
||||
// if (taskPrefectureBean.getBody() == null) {
|
||||
// taskRecycler.setNoMore(true);
|
||||
// } else {
|
||||
// dataBeanList.addAll(taskPrefectureBean.getBody().getList());
|
||||
// taskPrefectureAdapter.notifyDataSetChanged();
|
||||
// taskRecycler.loadMoreComplete();
|
||||
// page++;
|
||||
// }
|
||||
// }
|
||||
// } else if (taskPrefectureBean.getStatus() == 2) {
|
||||
// if (start) {
|
||||
// if (dataBeanList.size() > 0) {
|
||||
// dataBeanList.clear();
|
||||
// taskPrefectureAdapter.notifyDataSetChanged();
|
||||
// }
|
||||
// taskRecycler.refreshComplete();
|
||||
// } else {
|
||||
// taskRecycler.setNoMore(true);
|
||||
// }
|
||||
// Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// } else {
|
||||
// Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_find_task:
|
||||
getActivity().finish();
|
||||
getActivity().finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -477,15 +477,15 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void initHeader(View view) {
|
||||
dragView.removeAllViews();
|
||||
dragView.addView(view);
|
||||
view.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
sliding_layout.setPanelHeight(0);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
// view.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// frameLayout.setVisibility(View.GONE);
|
||||
// sliding_layout.setPanelHeight(0);
|
||||
// sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
// setMainButtonVisiable(View.VISIBLE);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2,13 +2,15 @@ package com.navinfo.outdoor.http;
|
||||
|
||||
public class HttpInterface {
|
||||
//http://172.21.91.160:8000/api/user/list
|
||||
public static final String IP1 = "http://172.21.91.160:8000/api/1/";
|
||||
//发现接口
|
||||
//http://172.23.139.4:8002/m4/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
|
||||
public static final String IP1 = "http://172.23.139.4:8002/m4/findAndMessage/1/";
|
||||
public static final String IPm4 = "https://mockapi.eolinker.com/m5LxPbRb58eec57f4943420b1eb3b4e95b93968619a2973/m4/1/";
|
||||
//发现:测试接口
|
||||
public static final String listTask = IP1 + "task/list";//任务专区
|
||||
public static final String listEvent = IP1 + "task/list";//活动专区
|
||||
public static final String listTaskExplain = IP1 + "task/info";//任务说明
|
||||
public static final String MSG_LISt = IPm4 + "msg_list";//发现查询接口
|
||||
public static final String listTask = IP1 + "msg_list";//任务专区
|
||||
public static final String listEvent = IP1 + "msg_list";//活动专区
|
||||
public static final String listTaskExplain = IP1 + "msg_list";//任务说明
|
||||
public static final String MSG_LISt = IP1 + "msg_list";//发现查询接口
|
||||
public static final String MSG_CONTENT = IPm4 + "msg_content";//发现 -富文本详情页请求
|
||||
public static final String EXAM_CONTENT = IPm4 + "exam_content";//发现 -能力测评获取试题接口
|
||||
public static final String EXAM_SUBMIT = IPm4 + "exam_submit";//发现 -能力测评提交试卷 post
|
||||
|
@ -15,7 +15,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_final"
|
||||
android:id="@+id/iv_charging_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -16,7 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_final"
|
||||
android:id="@+id/iv_filter_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -15,7 +15,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_final"
|
||||
android:id="@+id/iv_other_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_01"
|
||||
android:layout_width="wrap_content"
|
||||
@ -23,7 +22,7 @@
|
||||
android:text="01基本资料填写"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/linear_pot"
|
||||
|
@ -16,7 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_final"
|
||||
android:id="@+id/iv_poi_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -15,7 +15,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_final"
|
||||
android:id="@+id/iv_road_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user