修改我的页面的bug
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
|
||||
public class LinkActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private android.widget.ImageView ivIcon;
|
||||
private android.webkit.WebView linkWeb;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_link;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
String url = getIntent().getStringExtra("url");
|
||||
ivIcon = (ImageView) findViewById(R.id.iv_icon);
|
||||
ivIcon.setOnClickListener(this::onClick);
|
||||
linkWeb = (WebView) findViewById(R.id.link_web);
|
||||
linkWeb.getSettings().setBlockNetworkImage(false);
|
||||
WebSettings settings = linkWeb.getSettings();
|
||||
settings.setJavaScriptEnabled(true);
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||
linkWeb.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
settings.setBuiltInZoomControls(false);
|
||||
linkWeb.loadUrl(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.iv_icon:
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
|
||||
/*
|
||||
* 地图寻宝-关于地图的web页面
|
||||
* */
|
||||
public class RegardMapActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private ImageView ivFilterFinal;
|
||||
private TextView tvPhone;
|
||||
private TextView tvMapLink;
|
||||
private TextView tvOfficialLink;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_regard_map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivFilterFinal = (ImageView) findViewById(R.id.iv_filter_final);
|
||||
ivFilterFinal.setOnClickListener(this::onClick);
|
||||
tvPhone = findViewById(R.id.tv_phone);
|
||||
tvMapLink = (TextView) findViewById(R.id.tv_map_link);
|
||||
tvMapLink.setOnClickListener(this::onClick);
|
||||
tvOfficialLink = (TextView) findViewById(R.id.tv_official_link);
|
||||
tvOfficialLink.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_filter_final:
|
||||
finish();
|
||||
break;
|
||||
case R.id.tv_map_link:
|
||||
Intent linkIntent = new Intent(this, LinkActivity.class);
|
||||
linkIntent.putExtra("url","http://www.navinfo.com");
|
||||
startActivity(linkIntent);
|
||||
break;
|
||||
case R.id.tv_official_link:
|
||||
Intent officialIntent = new Intent(this, LinkActivity.class);
|
||||
officialIntent.putExtra("url","https://dtxbmaps.navinfo.com/user");
|
||||
startActivity(officialIntent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
final View capacity = LayoutInflater.from(context).inflate(R.layout.capacity_item, parent, false);
|
||||
View capacity = LayoutInflater.from(context).inflate(R.layout.capacity_item, parent, false);
|
||||
return new ViewHolder(capacity);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,25 +11,33 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
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 TaskExplainAdapter2 extends RecyclerView.Adapter<TaskExplainAdapter2.ViewHolder2> {
|
||||
private List<TaskExplainInfo.BodyBean.DataBean> explainList2 = new ArrayList<>();
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> explainList2 = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public TaskExplainAdapter2(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setExplainList2(List<TaskExplainInfo.BodyBean.DataBean> explainList2) {
|
||||
if (explainList2!=null){
|
||||
public void setExplainList2(List<TaskPrefectureBean.BodyBean.ListBean> explainList2) {
|
||||
if (explainList2 != null) {
|
||||
this.explainList2.addAll(explainList2);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void taskExplainClearData() {
|
||||
if (explainList2 != null) {
|
||||
explainList2.clear();
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder2 onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
@@ -43,7 +51,7 @@ public class TaskExplainAdapter2 extends RecyclerView.Adapter<TaskExplainAdapter
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnItemClick2!=null){
|
||||
if (mOnItemClick2 != null) {
|
||||
mOnItemClick2.onClick2(explainList2.get(position).getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,12 @@ public class TaskPrefectureAdapter extends RecyclerView.Adapter<TaskPrefectureAd
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View mView = LayoutInflater.from(context).inflate(R.layout.task_prefecture_item, parent, false);
|
||||
return new ViewHolder(mView);
|
||||
ViewHolder viewHolder = new ViewHolder(mView);
|
||||
// int parentHeight= parent.getHeight();
|
||||
// parent.getWidth();
|
||||
// ViewGroup.LayoutParams layoutParams = viewHolder.itemView.getLayoutParams();
|
||||
// layoutParams.height = (parentHeight/ 6);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -173,5 +173,37 @@ public class Constant {
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
||||
|
||||
|
||||
//--/
|
||||
|
||||
/**
|
||||
* 联系我们的QQ群名称和QQ群号
|
||||
* */
|
||||
public static String REGION_JING_NAME = "京津冀晋蒙-地图寻宝群";
|
||||
public static String REGION_JING_PHONE = "9721810";
|
||||
public static String REGION_HEI_NAME = "黑吉辽-地图寻宝群";
|
||||
public static String REGION_HEI_PHONE = "549321657";
|
||||
public static String REGION_SHAN_NAME = "山东-地图寻宝群";
|
||||
public static String REGION_SHAN_PHONE = "581827297";
|
||||
public static String REGION_YU_NAME = "豫陕-地图寻宝群";
|
||||
public static String REGION_YU_PHONE = "344192497";
|
||||
public static String REGION_CHUAN_NAME = "川渝藏-地图寻宝";
|
||||
public static String REGION_CHUAN_PHONE = "741373102";
|
||||
public static String REGION_GAN_NAME = "甘青宁新蒙-地图寻宝群";
|
||||
public static String REGION_GAN_PHONE = "343620420";
|
||||
public static String REGION_SU_NAME = "苏皖-地图寻宝群";
|
||||
public static String REGION_SU_PHONE = "1034993745";
|
||||
public static String REGION_LU_NAME = "沪浙-地图寻宝群";
|
||||
public static String REGION_LU_PHONE = "590815485";
|
||||
public static String REGION_FU_NAME = "福建-地图寻宝群";
|
||||
public static String REGION_FU_PHONE = "662056094";
|
||||
public static String REGION_GUANG_NAME = "广西海南-地图寻宝群";
|
||||
public static String REGION_GUANG_PHONE = "139376252";
|
||||
public static String REGION_GANZ_NAME = "赣湘鄂-地图寻宝群";
|
||||
public static String REGION_GANZ_PHONE = "229231160";
|
||||
public static String REGION_YUE_NAME = "粤港澳-地图寻宝群";
|
||||
public static String REGION_YUE_PHONE = "892781071";
|
||||
public static String REGION_YUN_NAME = "云贵-地图寻宝群";
|
||||
public static String REGION_YUN_PHONE = "284447253";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.navinfo.outdoor.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
@@ -19,10 +20,12 @@ import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.api.UserApplication;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@@ -101,7 +104,14 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
protected void intint2WebActivity(String url, HashMap<String, String> paramMap) {
|
||||
Intent intent = new Intent(this, WebActivity.class);
|
||||
if (paramMap !=null) {
|
||||
intent.putExtra("map", paramMap);
|
||||
}
|
||||
intent.putExtra("url", url);
|
||||
startActivity(intent);
|
||||
}
|
||||
protected void initListener() {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.widget.RelativeLayout;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.RegardMapActivity;
|
||||
import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
@@ -57,7 +58,8 @@ public class AboutFragment extends BaseFragment implements View.OnClickListener
|
||||
getActivity().finish();
|
||||
break;
|
||||
case R.id.rl_about:
|
||||
intint2WebActivity(HttpInterface.ABOUT_MAP, null);
|
||||
Intent regardIntent = new Intent(getActivity(), RegardMapActivity.class);
|
||||
startActivity(regardIntent);
|
||||
break;
|
||||
case R.id.rl_serve:
|
||||
intint2WebActivity(HttpInterface.MAP_AGREEMENT, null);
|
||||
|
||||
@@ -1,42 +1,54 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
|
||||
/**
|
||||
* 联系我们的Fragment
|
||||
*/
|
||||
public class ContactFragment extends BaseFragment implements View.OnClickListener{
|
||||
public class ContactFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView ivContact;
|
||||
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" +
|
||||
"</div>";
|
||||
private WebView nWebView;
|
||||
private TextView tvJingName;
|
||||
private TextView tvJingPhone;
|
||||
private TextView tvHeiName;
|
||||
private TextView tvHeiPhone;
|
||||
private TextView tvShanName;
|
||||
private TextView tvShanPhone;
|
||||
private TextView tvYuName;
|
||||
private TextView tvYuPhone;
|
||||
private TextView tvChuanName;
|
||||
private TextView tvChuanPhone;
|
||||
private TextView tvGanName;
|
||||
private TextView tvGanPhone;
|
||||
private TextView tvSuName;
|
||||
private TextView tvSuPhone;
|
||||
private TextView tvLuName;
|
||||
private TextView tvLuPhone;
|
||||
private TextView tvFuName;
|
||||
private TextView tvFuPhone;
|
||||
private TextView tvGuangName;
|
||||
private TextView tvGuangPhone;
|
||||
private TextView tvGanzName;
|
||||
private TextView tvGanzPhone;
|
||||
private TextView tvYueName;
|
||||
private TextView tvYuePhone;
|
||||
private TextView tvYunName;
|
||||
private TextView tvYunPhone;
|
||||
|
||||
|
||||
public static ContactFragment newInstance(Bundle bundle) {
|
||||
ContactFragment fragment = new ContactFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.contact_fragment;
|
||||
@@ -52,21 +64,65 @@ public class ContactFragment extends BaseFragment implements View.OnClickListene
|
||||
super.initView();
|
||||
ivContact = findViewById(R.id.iv_contact);
|
||||
ivContact.setOnClickListener(this);
|
||||
nWebView = findViewById(R.id.news_webView);
|
||||
nWebView.getSettings().setBlockNetworkImage(false);
|
||||
WebSettings settings = nWebView.getSettings();
|
||||
settings.setJavaScriptEnabled(true);
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||
nWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
settings.setBuiltInZoomControls(false);
|
||||
content = content.replace("<img", "<img style='max-width: 100%'");
|
||||
nWebView.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);
|
||||
|
||||
tvJingName = (TextView) findViewById(R.id.tv_jingName);
|
||||
tvJingName.setText(Constant.REGION_JING_NAME);
|
||||
tvJingPhone = (TextView) findViewById(R.id.tv_jingPhone);
|
||||
tvJingPhone.setText(Constant.REGION_JING_PHONE);
|
||||
tvHeiName = (TextView) findViewById(R.id.tv_heiName);
|
||||
tvHeiName.setText(Constant.REGION_HEI_NAME);
|
||||
tvHeiPhone = (TextView) findViewById(R.id.tv_heiPhone);
|
||||
tvHeiPhone.setText(Constant.REGION_HEI_PHONE);
|
||||
tvShanName = (TextView) findViewById(R.id.tv_shanName);
|
||||
tvShanName.setText(Constant.REGION_SHAN_NAME);
|
||||
tvShanPhone = (TextView) findViewById(R.id.tv_shanPhone);
|
||||
tvShanPhone.setText(Constant.REGION_SHAN_PHONE);
|
||||
tvYuName = (TextView) findViewById(R.id.tv_yuName);
|
||||
tvYuName.setText(Constant.REGION_YU_NAME);
|
||||
tvYuPhone = (TextView) findViewById(R.id.tv_yuPhone);
|
||||
tvYuPhone.setText(Constant.REGION_YU_PHONE);
|
||||
tvChuanName = (TextView) findViewById(R.id.tv_chuanName);
|
||||
tvChuanName.setText(Constant.REGION_CHUAN_NAME);
|
||||
tvChuanPhone = (TextView) findViewById(R.id.tv_chuanPhone);
|
||||
tvChuanPhone.setText(Constant.REGION_CHUAN_PHONE);
|
||||
tvGanName = (TextView) findViewById(R.id.tv_ganName);
|
||||
tvGanName.setText(Constant.REGION_GAN_NAME);
|
||||
tvGanPhone = (TextView) findViewById(R.id.tv_ganPhone);
|
||||
tvGanPhone.setText(Constant.REGION_GAN_PHONE);
|
||||
tvSuName = (TextView) findViewById(R.id.tv_suName);
|
||||
tvSuName.setText(Constant.REGION_SU_NAME);
|
||||
tvSuPhone = (TextView) findViewById(R.id.tv_suPhone);
|
||||
tvSuPhone.setText(Constant.REGION_SU_PHONE);
|
||||
tvLuName = (TextView) findViewById(R.id.tv_luName);
|
||||
tvLuName.setText(Constant.REGION_LU_NAME);
|
||||
tvLuPhone = (TextView) findViewById(R.id.tv_luPhone);
|
||||
tvLuPhone.setText(Constant.REGION_LU_PHONE);
|
||||
tvFuName = (TextView) findViewById(R.id.tv_fuName);
|
||||
tvFuName.setText(Constant.REGION_FU_NAME);
|
||||
tvFuPhone = (TextView) findViewById(R.id.tv_fuPhone);
|
||||
tvFuPhone.setText(Constant.REGION_FU_PHONE);
|
||||
tvGuangName = (TextView) findViewById(R.id.tv_guangName);
|
||||
tvGuangName.setText(Constant.REGION_GUANG_NAME);
|
||||
tvGuangPhone = (TextView) findViewById(R.id.tv_guangPhone);
|
||||
tvGuangPhone.setText(Constant.REGION_GUANG_PHONE);
|
||||
tvGanzName = (TextView) findViewById(R.id.tv_ganzName);
|
||||
tvGanzName.setText(Constant.REGION_GANZ_NAME);
|
||||
tvGanzPhone = (TextView) findViewById(R.id.tv_ganzPhone);
|
||||
tvGanzPhone.setText(Constant.REGION_GANZ_PHONE);
|
||||
tvYueName = (TextView) findViewById(R.id.tv_yueName);
|
||||
tvYueName.setText(Constant.REGION_YUE_NAME);
|
||||
tvYuePhone = (TextView) findViewById(R.id.tv_yuePhone);
|
||||
tvYuePhone.setText(Constant.REGION_YUE_PHONE);
|
||||
tvYunName = (TextView) findViewById(R.id.tv_yunName);
|
||||
tvYunName.setText(Constant.REGION_YUN_NAME);
|
||||
tvYunPhone = (TextView) findViewById(R.id.tv_yunPhone);
|
||||
tvYunPhone.setText(Constant.REGION_YUN_PHONE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_contact:
|
||||
getActivity().finish();
|
||||
break;
|
||||
|
||||
@@ -55,6 +55,7 @@ public class IssueWebFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
settings.setBuiltInZoomControls(false);
|
||||
issueWebView.loadUrl("http://172.23.139.4:10001/#/serveclause");
|
||||
// issueWebView.loadUrl("http://www.navinfo.com");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
@@ -54,6 +55,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.mine_fragment;
|
||||
@@ -93,10 +95,11 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
btnQuit.setOnClickListener(this::onClick);
|
||||
initNetWork();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.HOME_MINE) {
|
||||
if ((boolean)data.obj){
|
||||
if ((boolean) data.obj) {
|
||||
initNetWork();
|
||||
}
|
||||
}
|
||||
@@ -114,14 +117,14 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
@Override
|
||||
public void onSuccess(GetPriceBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200){
|
||||
if (response.getCode() == 200) {
|
||||
GetPriceBean.BodyBean body = response.getBody();
|
||||
if (body!=null){
|
||||
Double userPrice =body.getUserPrice();
|
||||
if (body != null) {
|
||||
Double userPrice = body.getUserPrice();
|
||||
tvMoney.setText(userPrice + "");
|
||||
}
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
@@ -151,10 +154,10 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
startActivity(intentUser);
|
||||
break;
|
||||
case R.id.image_share://分享
|
||||
Toast.makeText(getActivity(), "分享", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case R.id.image_sign://签到
|
||||
Toast.makeText(getActivity(), "签到", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case R.id.btn_withdraw://提现页面
|
||||
|
||||
@@ -163,24 +166,28 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
startActivity(intentWithdraw);
|
||||
break;
|
||||
case R.id.rl_grade://我的等级
|
||||
Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentGrade.putExtra("tag", 17);
|
||||
startActivity(intentGrade);
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
// Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
|
||||
// intentGrade.putExtra("tag", 17);
|
||||
// startActivity(intentGrade);
|
||||
break;
|
||||
case R.id.rl_privilege://我的特权
|
||||
Intent intentPrivilege = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentPrivilege.putExtra("tag", 18);
|
||||
startActivity(intentPrivilege);
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
// Intent intentPrivilege = new Intent(getActivity(), FragmentManagement.class);
|
||||
// intentPrivilege.putExtra("tag", 18);
|
||||
// startActivity(intentPrivilege);
|
||||
break;
|
||||
case R.id.rl_map://地图下载
|
||||
Intent intentMap = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentMap.putExtra("tag", 19);
|
||||
startActivity(intentMap);
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
// Intent intentMap = new Intent(getActivity(), FragmentManagement.class);
|
||||
// intentMap.putExtra("tag", 19);
|
||||
// startActivity(intentMap);
|
||||
break;
|
||||
case R.id.rl_issue://常见问题
|
||||
Intent intentIssue = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentIssue.putExtra("tag", 20);
|
||||
startActivity(intentIssue);
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
// Intent intentIssue = new Intent(getActivity(), FragmentManagement.class);
|
||||
// intentIssue.putExtra("tag", 20);
|
||||
// startActivity(intentIssue);
|
||||
break;
|
||||
case R.id.rl_contact://联系我们
|
||||
Intent intentContact = new Intent(getActivity(), FragmentManagement.class);
|
||||
@@ -188,9 +195,10 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
startActivity(intentContact);
|
||||
break;
|
||||
case R.id.rl_set://设置
|
||||
Intent intentSet = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentSet.putExtra("tag", 22);
|
||||
startActivity(intentSet);
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
// Intent intentSet = new Intent(getActivity(), FragmentManagement.class);
|
||||
// intentSet.putExtra("tag", 22);
|
||||
// startActivity(intentSet);
|
||||
break;
|
||||
case R.id.rl_about://关于
|
||||
Intent intentAbout = new Intent(getActivity(), FragmentManagement.class);
|
||||
@@ -202,6 +210,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
|
||||
@@ -38,8 +38,6 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
|
||||
private TaskExplainAdapter taskExplainAdapter;
|
||||
private int taskPage = 1;
|
||||
private Integer fId;
|
||||
|
||||
|
||||
public static TaskExplainFragment newInstance(Bundle bundle) {
|
||||
TaskExplainFragment fragment = new TaskExplainFragment();
|
||||
@@ -87,7 +85,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
public void onClick(int pos) {
|
||||
Intent itemIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
itemIntent.putExtra("tag", 10);
|
||||
itemIntent.putExtra("id",fId);
|
||||
itemIntent.putExtra("id",pos+"");
|
||||
startActivity(itemIntent);
|
||||
|
||||
}
|
||||
@@ -118,11 +116,6 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200){
|
||||
taskExplainAdapter.setExplainList(response.getBody().getList());
|
||||
TaskPrefectureBean.BodyBean body = response.getBody();
|
||||
// List<TaskPrefectureBean.BodyBean.ListBean> list = body.getList();
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// fId = list.get(i).getId();
|
||||
// }
|
||||
taskPage++;
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.navinfo.outdoor.adapter.TaskExplainAdapter2;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
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;
|
||||
@@ -38,6 +39,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
private XRecyclerView taskExplain2Recycler;
|
||||
private ArrayList<TaskExplainInfo.BodyBean.DataBean> dataBeans2;
|
||||
private TaskExplainAdapter2 taskExplainAdapter2;
|
||||
private int taskExplainPage = 1;
|
||||
|
||||
public static TaskExplainFragment2 newInstance(Bundle bundle) {
|
||||
TaskExplainFragment2 fragment = new TaskExplainFragment2();
|
||||
@@ -53,12 +55,13 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
ivTaskExplain2 = findViewById(R.id.iv_task_explain2_finish);
|
||||
taskExplain2Recycler = findViewById(R.id.task_explain2_recycler);
|
||||
ivTaskExplain2.setOnClickListener(this::onClick);
|
||||
taskExplain2Recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
//下划线
|
||||
taskExplain2Recycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL));
|
||||
// taskExplain2Recycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL));
|
||||
taskExplain2Recycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
taskExplain2Recycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
@@ -71,12 +74,14 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
taskExplain2Recycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
taskExplainAdapter2.taskExplainClearData();
|
||||
taskExplainPage=1;
|
||||
initNetWork2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
|
||||
initNetWork2();
|
||||
}
|
||||
});
|
||||
taskExplainAdapter2.setOnItemClick(new TaskExplainAdapter2.OnItemClick2() {
|
||||
@@ -98,26 +103,34 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
|
||||
private void initNetWork2() {
|
||||
showLoadingDialog();
|
||||
String id = getActivity().getIntent().getStringExtra("id");
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("fid", "3");
|
||||
httpParams.put("pageNum", "1");
|
||||
httpParams.put("fid", id);
|
||||
httpParams.put("pageNum", taskExplainPage);
|
||||
httpParams.put("pageSize", "20");
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.LIST_TASK_EXPLAIN)
|
||||
.cls(TaskExplainInfo.class)
|
||||
.params(new HttpParams())
|
||||
.url(HttpInterface.LIST_TASK)
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.params(httpParams)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.getRequest(new Callback<TaskExplainInfo>() {
|
||||
.getRequest(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainInfo response, int id) {
|
||||
public void onSuccess(TaskPrefectureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
taskExplainAdapter2.setExplainList2(response.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + response.getMsg() + "sssssssssssss");
|
||||
if (response.getCode() == 200){
|
||||
taskExplainAdapter2.setExplainList2(response.getBody().getList());
|
||||
taskExplainPage++;
|
||||
}
|
||||
taskExplain2Recycler.refreshComplete();
|
||||
taskExplain2Recycler.loadMoreComplete();
|
||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "sssssssssssss");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
taskExplain2Recycler.refreshComplete();
|
||||
taskExplain2Recycler.loadMoreComplete();
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
|
||||
@@ -116,7 +116,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
dismissLoadingDialog();
|
||||
if (taskPrefectureBean.getCode() == 200){
|
||||
taskPrefectureAdapter.setDataBeans(taskPrefectureBean.getBody().getList());
|
||||
// taskPage++;
|
||||
taskPage++;
|
||||
}else {
|
||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user