Merge remote-tracking branch 'OutDoor/master'
This commit is contained in:
commit
e5d85ac72f
@ -1,11 +1,10 @@
|
||||
package com.example.myapplication.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseActivity;
|
||||
import com.example.myapplication.fragment.CapacityMeasurementFragment;
|
||||
import com.example.myapplication.fragment.CapacityEvaluationFragment;
|
||||
import com.example.myapplication.fragment.CapacityEvaluationFragment2;
|
||||
import com.example.myapplication.fragment.EventPrefectureFragment;
|
||||
@ -13,6 +12,7 @@ import com.example.myapplication.fragment.FindFragment;
|
||||
import com.example.myapplication.fragment.ForgetPawFragment;
|
||||
import com.example.myapplication.fragment.MineFragment;
|
||||
import com.example.myapplication.fragment.RecordFragment;
|
||||
import com.example.myapplication.fragment.TaskExWebFragment;
|
||||
import com.example.myapplication.fragment.TaskExplainFragment;
|
||||
import com.example.myapplication.fragment.TaskExplainFragment2;
|
||||
import com.example.myapplication.fragment.TaskPrefectureFragment;
|
||||
@ -33,21 +33,26 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
public class FragmentManagement extends BaseActivity {
|
||||
private FragmentManager fragmentManager;
|
||||
private int fourthly_tag;
|
||||
private MineFragment mineFragment;//我的fragment
|
||||
private FindFragment findFragment;//发现的fragment
|
||||
private RecordFragment recordFragment;//纪录的fragment
|
||||
private TreasureFragment treasureFragment;//寻宝的fragment
|
||||
private TaskPrefectureFragment taskPrefectureFragment;//发现-任务专区的fragment
|
||||
private CapacityEvaluationFragment capacityEvaluationFragment;//发现-能力测评fragment
|
||||
private MineFragment mineFragment;//我的fragment -1
|
||||
private FindFragment findFragment;//发现的fragment -2
|
||||
private RecordFragment recordFragment;//纪录的fragment -3
|
||||
private TreasureFragment treasureFragment;//寻宝的fragment -4
|
||||
private RegisterFragment registerFragment;//注册的fragment -5
|
||||
private ForgetPawFragment forgetPawFragment;//忘记密码fragment -6
|
||||
private TaskPrefectureFragment taskPrefectureFragment;//发现-任务专区的fragment -7
|
||||
private TaskExplainFragment taskExplainFragment;//发现-任务说明的fragment -8
|
||||
private EventPrefectureFragment eventPrefectureFragment;//发现-活动专区的fragment -9
|
||||
private TaskExplainFragment2 taskExplainFragment2;//发现-任务说明点击Item进入fragment -10
|
||||
private CapacityEvaluationFragment capacityEvaluationFragment;//发现-能力测评fragment -11
|
||||
private CapacityEvaluationFragment2 capacityEvaluationFragment2;//发现-能力测评2的fragment -12
|
||||
private TaskExWebFragment taskExWebFragment;//发现-任务说明点击Item进入Web页面的fragment -13
|
||||
private CapacityMeasurementFragment capacityMeasurementFragment;//发现-能力测评item点击跳转web的fragment -14
|
||||
|
||||
|
||||
|
||||
|
||||
private TaskExplainFragment taskExplainFragment;//发现-任务说明的fragment
|
||||
private EventPrefectureFragment eventPrefectureFragment;//发现-活动专区的fragment
|
||||
private TaskExplainFragment2 taskExplainFragment2;//发现-任务说明2的fragment
|
||||
|
||||
private CapacityEvaluationFragment2 capacityEvaluationFragment2;//发现-能力测评2的fragment
|
||||
|
||||
private RegisterFragment registerFragment;//注册的fragment
|
||||
private ForgetPawFragment forgetPawFragment;//忘记密码fragment
|
||||
|
||||
|
||||
|
||||
@ -69,34 +74,37 @@ public class FragmentManagement extends BaseActivity {
|
||||
|
||||
//隐藏所有Fragment
|
||||
private void hideAllFragment(FragmentTransaction fragmentTransaction) {
|
||||
if (mineFragment != null)
|
||||
if (mineFragment != null)//我的fragment -1
|
||||
fragmentTransaction.hide(mineFragment);
|
||||
if (findFragment != null)
|
||||
if (findFragment != null)//发现的fragment -2
|
||||
fragmentTransaction.hide(findFragment);
|
||||
if (recordFragment != null)
|
||||
if (recordFragment != null)//记录的fragment -3
|
||||
fragmentTransaction.hide(recordFragment);
|
||||
if (treasureFragment != null)
|
||||
if (treasureFragment != null)//寻宝的fragment -4
|
||||
fragmentTransaction.hide(treasureFragment);
|
||||
if (taskPrefectureFragment!=null)
|
||||
|
||||
if (taskPrefectureFragment != null)
|
||||
fragmentTransaction.hide(taskPrefectureFragment);
|
||||
if (taskExplainFragment != null)
|
||||
fragmentTransaction.hide(taskExplainFragment);
|
||||
if (taskExplainFragment2 != null)
|
||||
fragmentTransaction.hide(taskExplainFragment2);
|
||||
|
||||
if (capacityEvaluationFragment != null)
|
||||
fragmentTransaction.hide(capacityEvaluationFragment);
|
||||
if (capacityEvaluationFragment2 != null)
|
||||
fragmentTransaction.hide(capacityEvaluationFragment2);
|
||||
|
||||
if (registerFragment != null)
|
||||
if (registerFragment != null)//注册的fragment -5
|
||||
fragmentTransaction.hide(registerFragment);
|
||||
if (forgetPawFragment != null)
|
||||
if (forgetPawFragment != null)//忘记密码fragment -6
|
||||
fragmentTransaction.hide(forgetPawFragment);
|
||||
if (eventPrefectureFragment != null)
|
||||
if (taskPrefectureFragment != null)//发现-任务专区的fragment -7
|
||||
fragmentTransaction.hide(taskPrefectureFragment);
|
||||
if (taskExplainFragment != null) //发现 - 任务说明的fragment -8
|
||||
fragmentTransaction.hide(taskExplainFragment);
|
||||
if (eventPrefectureFragment != null)//发现-活动专区的fragment -9
|
||||
fragmentTransaction.hide(eventPrefectureFragment);
|
||||
if (taskExplainFragment2 != null)//发现-任务说明点击Item进入fragment -10
|
||||
fragmentTransaction.hide(taskExplainFragment2);
|
||||
if (capacityEvaluationFragment != null)//发现-能力测评fragment -11
|
||||
fragmentTransaction.hide(capacityEvaluationFragment);
|
||||
if (capacityEvaluationFragment2 != null)//发现-能力测评2的fragment -12
|
||||
fragmentTransaction.hide(capacityEvaluationFragment2);
|
||||
if (taskExWebFragment != null)//发现-任务说明点击Item进入Web页面的fragment -13
|
||||
fragmentTransaction.hide(taskExWebFragment);
|
||||
if (capacityMeasurementFragment != null)//发现-能力测评item点击跳转web的fragment -14
|
||||
fragmentTransaction.hide(capacityMeasurementFragment);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -104,7 +112,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||
hideAllFragment(fragmentTransaction);
|
||||
switch (i) {
|
||||
case 1:
|
||||
case 1://我的fragment
|
||||
if (mineFragment == null) {
|
||||
mineFragment = new MineFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, mineFragment);
|
||||
@ -115,7 +123,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
bundle1.putString("grad", getIntent().getStringExtra("grad"));
|
||||
mineFragment.setArguments(bundle1);*/
|
||||
break;
|
||||
case 2:
|
||||
case 2://发现的fragment
|
||||
if (findFragment == null) {
|
||||
findFragment = new FindFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, findFragment);
|
||||
@ -123,7 +131,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(findFragment);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 3://纪录的fragment
|
||||
if (recordFragment == null) {
|
||||
recordFragment = new RecordFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, recordFragment);
|
||||
@ -131,7 +139,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(recordFragment);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 4://寻宝的fragment
|
||||
if (treasureFragment == null) {
|
||||
treasureFragment = new TreasureFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, treasureFragment);
|
||||
@ -139,7 +147,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(treasureFragment);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case 5://注册的fragment
|
||||
if (registerFragment == null) {
|
||||
registerFragment = new RegisterFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, registerFragment);
|
||||
@ -147,7 +155,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(registerFragment);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case 6://忘记密码fragment
|
||||
if (forgetPawFragment == null) {
|
||||
forgetPawFragment = new ForgetPawFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, forgetPawFragment);
|
||||
@ -155,7 +163,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(forgetPawFragment);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case 7://发现-任务专区的fragment
|
||||
if (taskPrefectureFragment == null) {
|
||||
taskPrefectureFragment = new TaskPrefectureFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, taskPrefectureFragment);
|
||||
@ -163,7 +171,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(taskPrefectureFragment);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 8: //发现 - 任务说明的fragment
|
||||
if (taskExplainFragment == null) {
|
||||
taskExplainFragment = new TaskExplainFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, taskExplainFragment);
|
||||
@ -171,7 +179,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(taskExplainFragment);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
case 9://发现-活动专区的fragment
|
||||
if (eventPrefectureFragment == null) {
|
||||
eventPrefectureFragment = new EventPrefectureFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, eventPrefectureFragment);
|
||||
@ -179,7 +187,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(eventPrefectureFragment);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
case 10://发现-任务说明点击Item进入fragment
|
||||
if (taskExplainFragment2 == null) {
|
||||
taskExplainFragment2 = new TaskExplainFragment2();
|
||||
fragmentTransaction.add(R.id.frame_layout, taskExplainFragment2);
|
||||
@ -187,7 +195,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(taskExplainFragment2);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 11://发现-能力测评fragment -
|
||||
if (capacityEvaluationFragment == null) {
|
||||
capacityEvaluationFragment = new CapacityEvaluationFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, capacityEvaluationFragment);
|
||||
@ -195,7 +203,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(capacityEvaluationFragment);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
case 12://发现-能力测评2的fragment -
|
||||
if (capacityEvaluationFragment2 == null) {
|
||||
capacityEvaluationFragment2 = new CapacityEvaluationFragment2();
|
||||
fragmentTransaction.add(R.id.frame_layout, capacityEvaluationFragment2);
|
||||
@ -203,6 +211,22 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(capacityEvaluationFragment2);
|
||||
}
|
||||
break;
|
||||
case 13://发现-任务说明点击Item进入Web页面的fragment
|
||||
if (taskExWebFragment == null) {
|
||||
taskExWebFragment = new TaskExWebFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, taskExWebFragment);
|
||||
} else {
|
||||
fragmentTransaction.show(taskExWebFragment);
|
||||
}
|
||||
break;
|
||||
case 14://发现-能力测评item点击跳转测试的fragment
|
||||
if (capacityMeasurementFragment == null) {
|
||||
capacityMeasurementFragment = new CapacityMeasurementFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, capacityMeasurementFragment);
|
||||
} else {
|
||||
fragmentTransaction.show(capacityMeasurementFragment);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
@ -246,17 +270,24 @@ public class FragmentManagement extends BaseActivity {
|
||||
case 11:
|
||||
capacityEvaluationFragment.onActivityResult(requestCode, resultCode, data);
|
||||
break;
|
||||
case 12:
|
||||
case 12:
|
||||
capacityEvaluationFragment2.onActivityResult(requestCode, resultCode, data);
|
||||
break;
|
||||
case 13:
|
||||
taskExWebFragment.onActivityResult(requestCode, resultCode, data);
|
||||
break;
|
||||
case 14:
|
||||
capacityMeasurementFragment.onActivityResult(requestCode, resultCode, data);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void setZtlTextColor() {
|
||||
ImmersionBar.with(this).statusBarDarkFont(true, 0.2f)
|
||||
//原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持状态栏字体变色,会使当前状态栏加上透明度,否则不执行透明度
|
||||
ImmersionBar.with(this)
|
||||
.statusBarDarkFont(true, 0.2f) //原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持状态栏字体变色,会使当前状态栏加上透明度,否则不执行透明度
|
||||
.init();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.example.myapplication.activity;
|
||||
package com.example.myapplication.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
@ -14,20 +14,20 @@ import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
import com.example.myapplication.bean.CapacityMeasureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEvaluationAdapter.ViewHolder> {
|
||||
private List<TaskExplainInfo.BodyBean.DataBean> capacityList = new ArrayList<>();
|
||||
private List<CapacityMeasureBean.BodyBean.DataBean> capacityList = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public CapacityEvaluationAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setCapacityList(List<TaskExplainInfo.BodyBean.DataBean> capacityList) {
|
||||
public void setCapacityList(List<CapacityMeasureBean.BodyBean.DataBean> capacityList) {
|
||||
this.capacityList.addAll(capacityList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -42,6 +42,7 @@ 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.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -62,11 +63,13 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView ivCapacity;
|
||||
TextView tvCapacity;
|
||||
TextView tvResults;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
ivCapacity = itemView.findViewById(R.id.iv_tas_capacity);
|
||||
tvCapacity = itemView.findViewById(R.id.tas_capacity_title);
|
||||
tvResults = itemView.findViewById(R.id.tv_capacity_through);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.example.myapplication.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.bean.CapacityMeasureBean;
|
||||
|
||||
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 Context context;
|
||||
|
||||
public CapacityItemAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setCapItemList(List<CapacityMeasureBean.BodyBean.DataBean> capItemList) {
|
||||
this.capItemList.addAll(capItemList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
final View capItem = LayoutInflater.from(context).inflate(R.layout.capacity_item, parent, false);
|
||||
return new ViewHolder(capItem);
|
||||
}
|
||||
|
||||
@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.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (setOnClick!=null){
|
||||
setOnClick.onClick(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return capItemList.size();
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView ivCapItem;
|
||||
TextView tvCapItem;
|
||||
TextView tvReaus;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
ivCapItem = itemView.findViewById(R.id.iv_tas_capacity);
|
||||
tvCapItem = itemView.findViewById(R.id.tas_capacity_title);
|
||||
tvReaus = itemView.findViewById(R.id.tv_capacity_through);
|
||||
}
|
||||
}
|
||||
public interface setOnClick{
|
||||
void onClick(int position);
|
||||
}
|
||||
|
||||
private setOnClick setOnClick;
|
||||
|
||||
public void setSetOnClick(setOnClick setOnClick) {
|
||||
this.setOnClick = setOnClick;
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.example.myapplication.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.bean.BolBean;
|
||||
import com.example.myapplication.bean.MeasureBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CapacityMeasureAdapter extends RecyclerView.Adapter {
|
||||
private List<BolBean> measureList = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public CapacityMeasureAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setMeasureList(List<BolBean> measureList) {
|
||||
this.measureList.addAll(measureList);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
final View inflate = LayoutInflater.from(context).inflate(R.layout.measure_item, parent, false);
|
||||
return new ViewHolder(inflate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
ViewHolder holder1 = (ViewHolder) holder;
|
||||
holder1.tvMeasure.setText((position+1)+measureList.get(position).getQuestion());
|
||||
|
||||
// Glide.with(context).load(measureList.get(position).getSingleChoice().get(0).getOption());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return measureList.size();
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvMeasure;
|
||||
TextView tvMeasure2;
|
||||
RadioButton tvMeasureA;
|
||||
RadioButton tvMeasureB;
|
||||
RadioButton tvMeasureC;
|
||||
RadioButton tvMeasureD;
|
||||
ImageView ivMeasureA;
|
||||
ImageView ivMeasureB;
|
||||
ImageView ivMeasureC;
|
||||
ImageView ivMeasureD;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvMeasure = itemView.findViewById(R.id.tv_measure_text1);
|
||||
tvMeasure2 = itemView.findViewById(R.id.tv_measure_text2);
|
||||
tvMeasureA = itemView.findViewById(R.id.rb_tv_measureA);
|
||||
tvMeasureB = itemView.findViewById(R.id.rb_tv_measureB);
|
||||
tvMeasureC = itemView.findViewById(R.id.rb_tv_measureC);
|
||||
tvMeasureD = itemView.findViewById(R.id.rb_tv_measureD);
|
||||
ivMeasureA = itemView.findViewById(R.id.iv_measureA);
|
||||
ivMeasureB = itemView.findViewById(R.id.iv_measureB);
|
||||
ivMeasureC = itemView.findViewById(R.id.iv_measureC);
|
||||
ivMeasureD = itemView.findViewById(R.id.iv_measureD);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.example.myapplication.activity;
|
||||
package com.example.myapplication.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
@ -1,4 +1,4 @@
|
||||
package com.example.myapplication.activity;
|
||||
package com.example.myapplication.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
@ -0,0 +1,49 @@
|
||||
package com.example.myapplication.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BolBean {
|
||||
private long id;
|
||||
private String question;
|
||||
private List<?> option;
|
||||
private boolean isM;//是否多选
|
||||
|
||||
public BolBean(long id, String question, List<?> option, boolean isM) {
|
||||
this.id = id;
|
||||
this.question = question;
|
||||
this.option = option;
|
||||
this.isM = isM;
|
||||
}
|
||||
|
||||
public boolean isM() {
|
||||
return isM;
|
||||
}
|
||||
|
||||
public void setM(boolean m) {
|
||||
isM = m;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public List<?> getOption() {
|
||||
return option;
|
||||
}
|
||||
|
||||
public void setOption(List<?> option) {
|
||||
this.option = option;
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
package com.example.myapplication.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CapacityMeasureBean {
|
||||
|
||||
/**
|
||||
* status : 0
|
||||
* msg : 成功
|
||||
* body : {"rownum":0,"data":[{"Subtitle":"(vZcEVf","createtime":"N)VOM","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":11,"title":"标题11","status":"通过"}],"numFound":100,"rows":10}
|
||||
*/
|
||||
|
||||
private int status;
|
||||
private String msg;
|
||||
private BodyBean body;
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public BodyBean getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(BodyBean body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
/**
|
||||
* rownum : 0
|
||||
* data : [{"Subtitle":"(vZcEVf","createtime":"N)VOM","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":11,"title":"标题11","status":"通过"}]
|
||||
* numFound : 100
|
||||
* rows : 10
|
||||
*/
|
||||
|
||||
private int rownum;
|
||||
private int numFound;
|
||||
private int rows;
|
||||
private List<DataBean> data;
|
||||
|
||||
public int getRownum() {
|
||||
return rownum;
|
||||
}
|
||||
|
||||
public void setRownum(int rownum) {
|
||||
this.rownum = rownum;
|
||||
}
|
||||
|
||||
public int getNumFound() {
|
||||
return numFound;
|
||||
}
|
||||
|
||||
public void setNumFound(int numFound) {
|
||||
this.numFound = numFound;
|
||||
}
|
||||
|
||||
public int getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(int rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* Subtitle : (vZcEVf
|
||||
* createtime : N)VOM
|
||||
* src : http://10.130.23.166:8080/cbt/img/blue.png
|
||||
* id : 11
|
||||
* title : 标题11
|
||||
* status : 通过
|
||||
*/
|
||||
|
||||
private String Subtitle;
|
||||
private String createtime;
|
||||
private String src;
|
||||
private int id;
|
||||
private String title;
|
||||
private String status;
|
||||
|
||||
public String getSubtitle() {
|
||||
return Subtitle;
|
||||
}
|
||||
|
||||
public void setSubtitle(String Subtitle) {
|
||||
this.Subtitle = Subtitle;
|
||||
}
|
||||
|
||||
public String getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(String createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public String getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
public void setSrc(String src) {
|
||||
this.src = src;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package com.example.myapplication.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MeasureBean {
|
||||
|
||||
/**
|
||||
* status : 0
|
||||
* msg : 成功
|
||||
* body : {"title":"0","singleChoice":[{"id":-7433716441913744,"question":"ucEnJR","option":[]}],"multiChoice":[{"id":165541861534708,"question":"ByClM","option":[]}]}
|
||||
*/
|
||||
|
||||
private int status;
|
||||
private String msg;
|
||||
private BodyBean body;
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public BodyBean getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(BodyBean body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
/**
|
||||
* title : 0
|
||||
* singleChoice : [{"id":-7433716441913744,"question":"ucEnJR","option":[]},{"id":-7433716441913744,"question":"ucEnJR","option":[]}]
|
||||
* multiChoice : [{"id":165541861534708,"question":"ByClM","option":[]}]
|
||||
*/
|
||||
|
||||
private String title;
|
||||
private List<SingleChoiceBean> singleChoice;
|
||||
private List<MultiChoiceBean> multiChoice;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public List<SingleChoiceBean> getSingleChoice() {
|
||||
return singleChoice;
|
||||
}
|
||||
|
||||
public void setSingleChoice(List<SingleChoiceBean> singleChoice) {
|
||||
this.singleChoice = singleChoice;
|
||||
}
|
||||
|
||||
public List<MultiChoiceBean> getMultiChoice() {
|
||||
return multiChoice;
|
||||
}
|
||||
|
||||
public void setMultiChoice(List<MultiChoiceBean> multiChoice) {
|
||||
this.multiChoice = multiChoice;
|
||||
}
|
||||
|
||||
public static class SingleChoiceBean {
|
||||
/**
|
||||
* id : -7433716441913744
|
||||
* question : ucEnJR
|
||||
* option : []
|
||||
*/
|
||||
|
||||
private long id;
|
||||
private String question;
|
||||
private List<?> option;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public List<?> getOption() {
|
||||
return option;
|
||||
}
|
||||
|
||||
public void setOption(List<?> option) {
|
||||
this.option = option;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MultiChoiceBean {
|
||||
/**
|
||||
* id : 165541861534708
|
||||
* question : ByClM
|
||||
* option : []
|
||||
*/
|
||||
|
||||
private long id;
|
||||
private String question;
|
||||
private List<?> option;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public List<?> getOption() {
|
||||
return option;
|
||||
}
|
||||
|
||||
public void setOption(List<?> option) {
|
||||
this.option = option;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -10,9 +10,10 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.CapacityEvaluationAdapter;
|
||||
import com.example.myapplication.adapter.CapacityEvaluationAdapter;
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.CapacityMeasureBean;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
import com.example.myapplication.http.Callback;
|
||||
import com.example.myapplication.http.HttpInterface;
|
||||
@ -25,7 +26,7 @@ import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 发现页面的活动专区
|
||||
* 发现-能力测评
|
||||
*/
|
||||
public class CapacityEvaluationFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
@ -91,13 +92,13 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
private void initNewWork(boolean b) {
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listTaskExplain)
|
||||
.url(HttpInterface.MSG_LISt)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskExplainInfo.class)
|
||||
.cls(CapacityMeasureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskExplainInfo>() {
|
||||
.callback(new Callback<CapacityMeasureBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainInfo response, int id) {
|
||||
public void onSuccess(CapacityMeasureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
capacityEvaluationAdapter.setCapacityList(response.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + response.getMsg() + "sssssssssssss");
|
||||
|
@ -1,21 +1,40 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.adapter.CapacityItemAdapter;
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.CapacityMeasureBean;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
import com.example.myapplication.http.Callback;
|
||||
import com.example.myapplication.http.HttpInterface;
|
||||
import com.example.myapplication.http.OkGoBuilder;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 能力测评的第二个页面
|
||||
*/
|
||||
public class CapacityEvaluationFragment2 extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView ivCapItemFinish;
|
||||
private XRecyclerView capacityRlv;
|
||||
private CapacityItemAdapter capacityItemAdapter;
|
||||
private ArrayList<TaskExplainInfo.BodyBean.DataBean> capItemList;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_capacity_evaluation2;
|
||||
@ -24,13 +43,78 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivCapItemFinish = findViewById(R.id.iv_task_capacity2_finish);
|
||||
capacityRlv = findViewById(R.id.task_capacity2_recycler);
|
||||
ivCapItemFinish.setOnClickListener(this::onClick);
|
||||
capacityRlv.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
capacityRlv.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
capacityRlv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
capacityRlv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
capacityRlv.setPullRefreshEnabled(false);
|
||||
capacityRlv.setLoadingMoreEnabled(false);
|
||||
capacityItemAdapter = new CapacityItemAdapter(getActivity());
|
||||
capacityRlv.setAdapter(capacityItemAdapter);
|
||||
capacityRlv.getDefaultFootView().setNoMoreHint("已经加载成功");
|
||||
capacityRlv.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
|
||||
}
|
||||
});
|
||||
capacityItemAdapter.setSetOnClick(new CapacityItemAdapter.setOnClick() {
|
||||
@Override
|
||||
public void onClick(int position) {
|
||||
final Intent capacityEvaWeb = new Intent(getActivity(), FragmentManagement.class);
|
||||
capacityEvaWeb.putExtra("tag",14);
|
||||
startActivity(capacityEvaWeb);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
capItemList = new ArrayList<>();
|
||||
initNetWorks(true);
|
||||
}
|
||||
|
||||
private void initNetWorks(boolean b) {
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MSG_LISt)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(CapacityMeasureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<CapacityMeasureBean>() {
|
||||
@Override
|
||||
public void onSuccess(CapacityMeasureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
capacityItemAdapter.setCapItemList(response.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + response.getMsg() + "sssssssssssss");
|
||||
//Toast.makeText(getActivity(), response.getMsg() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_task_capacity2_finish:
|
||||
getActivity().finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.adapter.CapacityItemAdapter;
|
||||
import com.example.myapplication.adapter.CapacityMeasureAdapter;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.BolBean;
|
||||
import com.example.myapplication.bean.CapacityMeasureBean;
|
||||
import com.example.myapplication.bean.MeasureBean;
|
||||
import com.example.myapplication.http.Callback;
|
||||
import com.example.myapplication.http.HttpInterface;
|
||||
import com.example.myapplication.http.OkGoBuilder;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发现-能力测评条目点击进入测试页面
|
||||
*/
|
||||
public class CapacityMeasurementFragment extends BaseFragment implements View.OnClickListener {
|
||||
private ImageView ivMeasurementFinish;
|
||||
private RecyclerView capacityMeasurementRel;
|
||||
private CapacityMeasureAdapter capacityMeasureAdapter;
|
||||
private ArrayList<BolBean> bolbean;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_capacity_eva_web;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivMeasurementFinish = (ImageView) findViewById(R.id.iv_measurement_finish);
|
||||
capacityMeasurementRel = (RecyclerView) findViewById(R.id.capacity_measurementRel);
|
||||
ivMeasurementFinish.setOnClickListener(this::onClick);
|
||||
capacityMeasurementRel.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
capacityMeasureAdapter = new CapacityMeasureAdapter(getActivity());
|
||||
capacityMeasurementRel.setAdapter(capacityMeasureAdapter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
bolbean = new ArrayList<>();
|
||||
|
||||
initNetWorks(true);
|
||||
}
|
||||
|
||||
private void initNetWorks(boolean b) {
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MSG_LISt)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(MeasureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<MeasureBean>() {
|
||||
@Override
|
||||
public void onSuccess(MeasureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
//单选
|
||||
final List<MeasureBean.BodyBean.MultiChoiceBean> multiChoice = response.getBody().getMultiChoice();
|
||||
//多选
|
||||
final List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice1 = response.getBody().getSingleChoice();
|
||||
if (multiChoice != null) {
|
||||
for (int i = 0; i < multiChoice.size(); i++) {
|
||||
bolbean.add(new BolBean(multiChoice.get(i).getId(), multiChoice.get(i).getQuestion(), multiChoice.get(i).getOption(), true));
|
||||
}
|
||||
}
|
||||
if (singleChoice1 != null) {
|
||||
for (int i = 0; i < singleChoice1.size(); i++) {
|
||||
bolbean.add(new BolBean(singleChoice1.get(i).getId(), singleChoice1.get(i).getQuestion(), singleChoice1.get(i).getOption(), false));
|
||||
}
|
||||
}
|
||||
|
||||
if (bolbean != null) {
|
||||
capacityMeasureAdapter.setMeasureList(bolbean);
|
||||
}
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString()+ "sssssssssssss");
|
||||
//Toast.makeText(getActivity(), response.getMsg() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_measurement_finish:
|
||||
getActivity().finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
|
||||
/**
|
||||
* 发现-任务说明的Item点击进入Web页面
|
||||
*/
|
||||
public class TaskExWebFragment extends BaseFragment implements View.OnClickListener {
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_task_ex_web;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.activity.TaskExplainAdapter;
|
||||
import com.example.myapplication.adapter.TaskExplainAdapter;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
import com.example.myapplication.http.Callback;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@ -9,8 +10,9 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.TaskExplainAdapter;
|
||||
import com.example.myapplication.activity.TaskExplainAdapter2;
|
||||
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.adapter.TaskExplainAdapter2;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
import com.example.myapplication.http.Callback;
|
||||
@ -71,8 +73,10 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
taskExplainAdapter2.setOnItemClick(new TaskExplainAdapter2.OnItemClick2() {
|
||||
@Override
|
||||
public void onClick2(int pos) {
|
||||
|
||||
Toast.makeText(getContext(), "你猜"+pos, Toast.LENGTH_SHORT).show();
|
||||
final Intent taskExItem = new Intent(getActivity(), FragmentManagement.class);
|
||||
taskExItem.putExtra("tag",13);
|
||||
startActivity(taskExItem);
|
||||
// Toast.makeText(getContext(), "你猜"+pos, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2,9 +2,14 @@ package com.example.myapplication.http;
|
||||
|
||||
public class HttpInterface {
|
||||
//http://172.21.91.160:8000/api/user/list
|
||||
public static final String IP = "http://172.21.91.160:8000/api/1/";
|
||||
public static final String listTask = IP + "task/list";//任务专区,活动专区
|
||||
public static final String listEvent = IP + "task/list";//任务专区,活动专区
|
||||
public static final String listInfo = IP + "task/info";//任务说明
|
||||
public static final String listTaskExplain = IP + "task/info";//任务说明
|
||||
public static final String IP1 = "http://172.21.91.160:8000/api/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 MSG_CONTENT = IPm4 + "msg_content";//发现 -富文本详情页请求
|
||||
public static final String EXAM_CONTENT = IPm4 + "exam_content";//发现 -能力测评获取试题接口
|
||||
public static final String EXAM_SUBMIT = IPm4 + "exam_submit";//发现 -能力测评提交试卷 post
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
<path android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
|
@ -1,42 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
android:layout_height="100dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_tas_capacity"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:id="@+id/iv_tas_capacity"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tas_capacity_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="111111111"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_tas_capacity"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_tas_capacity"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_tas_capacity"
|
||||
android:layout_marginLeft="10dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_through"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_tas_capacity" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_results"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="成绩:通过"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginRight="8dp"/>
|
||||
app:layout_constraintTop_toTopOf="@id/tas_capacity_title">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_results"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="成绩:"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_capacity_through"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="通过"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_results"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_results"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_results" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="去测评>"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_through"
|
||||
app:layout_constraintRight_toRightOf="@id/tv_through"/>
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_results" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
58
app/src/main/res/layout/fragment_capacity_eva_web.xml
Normal file
58
app/src/main/res/layout/fragment_capacity_eva_web.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.CapacityMeasurementFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_capacity_measurement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimaryBlue"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_measurement_finish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/ic_baseline_arrow" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_capacity_measurement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="POI任务测试"
|
||||
android:textColor="@color/colorGray"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintLeft_toLeftOf="@id/rl_capacity_measurement"
|
||||
app:layout_constraintRight_toRightOf="@id/rl_capacity_measurement"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_capacity_measurement" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_login"
|
||||
android:text="提交"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/capacity_measurementRel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/btn"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_capacity_measurement" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -10,7 +10,7 @@
|
||||
android:id="@+id/rl_capacity_evaluation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:background="@color/colorPrimaryBlue"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -12,7 +12,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimaryBlue"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
13
app/src/main/res/layout/fragment_task_ex_web.xml
Normal file
13
app/src/main/res/layout/fragment_task_ex_web.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.TaskExWebFragment">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/bg"/>
|
||||
|
||||
</LinearLayout>
|
192
app/src/main/res/layout/measure_item.xml
Normal file
192
app/src/main/res/layout/measure_item.xml
Normal file
@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_measure_text1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1、以下哪种拍图做法正确?"
|
||||
android:layout_marginLeft="15dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_choose1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_measure_text1">
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_height="wrap_content">
|
||||
<RadioButton
|
||||
android:id="@+id/rb_tv_measureA"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:xxxx" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_tv_measureB"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项B:xxxx" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_tv_measureC"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项C:xxxx" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_tv_measureD"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项D:xxxx" />
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_measure_text2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2、以下哪张图片正确?"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_choose1"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_measure_text1"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/ll_choose2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_measure_text2"
|
||||
android:orientation="vertical">
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_measureA"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureA"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_measureB"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureB"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_measureC"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureC"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_measureD"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureD"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/ll_measureE"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureE"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/ll_measureF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureF"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_measureG"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<RadioButton
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选项A:"/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/select_check"
|
||||
android:id="@+id/iv_measureG"/>
|
||||
</LinearLayout>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -5,10 +5,11 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:id="@+id/tv_task_explain2"
|
||||
android:text="11111111"
|
||||
android:textSize="16sp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
@ -8,5 +8,6 @@
|
||||
<color name="colorGrey">#FAFAFA</color>
|
||||
<color name="colorWhite">#ffffff</color>
|
||||
<color name="colorTransparent">#7fffffff</color>
|
||||
<color name="colorGray">#666666</color>
|
||||
<color name="colorHui">#95CAF6</color>
|
||||
</resources>
|
@ -9,4 +9,6 @@
|
||||
|
||||
<string name="hello_first_fragment">Hello first fragment</string>
|
||||
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user