parent
5ad85c5a4b
commit
7756d1d62c
@ -4,22 +4,22 @@
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:name=".api.UserApplication"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
|
||||
<activity android:name=".activity.LoginActivity">
|
||||
|
||||
</activity>
|
||||
<activity android:name=".activity.HomeActivity">
|
||||
|
||||
</activity>
|
||||
<activity android:name=".activity.ManagementFragment"></activity>
|
||||
<!-- <meta-data
|
||||
android:name="design_width_in_dp"
|
||||
android:value="480"/>
|
||||
<meta-data
|
||||
android:name="design_height_in_dp"
|
||||
android:value="800"/>-->
|
||||
<activity android:name=".activity.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@ -27,7 +27,10 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".activity.LoginActivity"></activity>
|
||||
<activity android:name=".activity.HomeActivity"></activity>
|
||||
<activity android:name=".activity.WebActivity"></activity>
|
||||
<activity android:name=".activity.FragmentManagement"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -1,11 +1,14 @@
|
||||
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.CapacityEvaluationFragment;
|
||||
import com.example.myapplication.fragment.CapacityEvaluationFragment2;
|
||||
import com.example.myapplication.fragment.EventPrefectureFragment;
|
||||
import com.example.myapplication.fragment.FindFragment;
|
||||
import com.example.myapplication.fragment.ForgetPawFragment;
|
||||
import com.example.myapplication.fragment.MineFragment;
|
||||
@ -27,7 +30,7 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
* fragment 管理作用:
|
||||
*/
|
||||
|
||||
public class ManagementFragment extends BaseActivity {
|
||||
public class FragmentManagement extends BaseActivity {
|
||||
private FragmentManager fragmentManager;
|
||||
private int fourthly_tag;
|
||||
private MineFragment mineFragment;//我的fragment
|
||||
@ -38,6 +41,7 @@ public class ManagementFragment extends BaseActivity {
|
||||
private CapacityEvaluationFragment capacityEvaluationFragment;//发现-能力测评fragment
|
||||
|
||||
private TaskExplainFragment taskExplainFragment;//发现-任务说明的fragment
|
||||
private EventPrefectureFragment eventPrefectureFragment;//发现-活动专区的fragment
|
||||
private TaskExplainFragment2 taskExplainFragment2;//发现-任务说明2的fragment
|
||||
|
||||
private CapacityEvaluationFragment2 capacityEvaluationFragment2;//发现-能力测评2的fragment
|
||||
@ -46,6 +50,7 @@ public class ManagementFragment extends BaseActivity {
|
||||
private ForgetPawFragment forgetPawFragment;//忘记密码fragment
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.management_fragment;
|
||||
@ -72,6 +77,7 @@ public class ManagementFragment extends BaseActivity {
|
||||
fragmentTransaction.hide(recordFragment);
|
||||
if (treasureFragment != null)
|
||||
fragmentTransaction.hide(treasureFragment);
|
||||
if (taskPrefectureFragment!=null)
|
||||
|
||||
if (taskPrefectureFragment != null)
|
||||
fragmentTransaction.hide(taskPrefectureFragment);
|
||||
@ -89,6 +95,8 @@ public class ManagementFragment extends BaseActivity {
|
||||
fragmentTransaction.hide(registerFragment);
|
||||
if (forgetPawFragment != null)
|
||||
fragmentTransaction.hide(forgetPawFragment);
|
||||
if (eventPrefectureFragment != null)
|
||||
fragmentTransaction.hide(eventPrefectureFragment);
|
||||
|
||||
}
|
||||
|
||||
@ -163,6 +171,14 @@ public class ManagementFragment extends BaseActivity {
|
||||
fragmentTransaction.show(taskExplainFragment);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (eventPrefectureFragment == null) {
|
||||
eventPrefectureFragment = new EventPrefectureFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, eventPrefectureFragment);
|
||||
} else {
|
||||
fragmentTransaction.show(eventPrefectureFragment);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (taskExplainFragment2 == null) {
|
||||
taskExplainFragment2 = new TaskExplainFragment2();
|
||||
@ -221,6 +237,9 @@ public class ManagementFragment extends BaseActivity {
|
||||
case 8:
|
||||
taskExplainFragment.onActivityResult(requestCode, resultCode, data);
|
||||
break;
|
||||
case 9:
|
||||
eventPrefectureFragment.onActivityResult(requestCode,resultCode,data);
|
||||
break;
|
||||
case 10:
|
||||
taskExplainFragment2.onActivityResult(requestCode, resultCode, data);
|
||||
break;
|
||||
@ -235,10 +254,9 @@ public class ManagementFragment extends BaseActivity {
|
||||
}
|
||||
|
||||
private void setZtlTextColor() {
|
||||
ImmersionBar.with(this)
|
||||
.statusBarDarkFont(true, 0.2f) //原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持状态栏字体变色,会使当前状态栏加上透明度,否则不执行透明度
|
||||
ImmersionBar.with(this).statusBarDarkFont(true, 0.2f)
|
||||
//原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持状态栏字体变色,会使当前状态栏加上透明度,否则不执行透明度
|
||||
.init();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -22,10 +22,13 @@ import com.google.android.material.tabs.TabLayout;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
public class HomeActivity extends BaseActivity{
|
||||
private NoSlideViewPager mViewPager;
|
||||
private TabLayout mTab;
|
||||
private final String[] name = {"寻宝", "记录", "发现", "我的"};
|
||||
private final String[] names = {"寻宝", "记录", "发现", "我的"};
|
||||
private final int[] pic = {R.mipmap.map_select,R.mipmap.task_select,R.mipmap.article_select,R.mipmap.mine_select};
|
||||
private final int[] pic1 = {R.mipmap.map,R.mipmap.task,R.mipmap.article,R.mipmap.mine};
|
||||
|
||||
@ -64,10 +67,10 @@ public class HomeActivity extends BaseActivity{
|
||||
mViewPager.setCanScroll(true);
|
||||
mViewPager.setNoScrollAnim(false);
|
||||
mTab.setupWithViewPager(mViewPager);
|
||||
mTab.getTabAt(0).setText(name[0]).setIcon(pic[0]);
|
||||
mTab.getTabAt(1).setText(name[1]).setIcon(pic1[1]);
|
||||
mTab.getTabAt(2).setText(name[2]).setIcon(pic1[2]);
|
||||
mTab.getTabAt(3).setText(name[3]).setIcon(pic1[3]);
|
||||
mTab.getTabAt(0).setText(names[0]).setIcon(pic[0]);
|
||||
mTab.getTabAt(1).setText(names[1]).setIcon(pic1[1]);
|
||||
mTab.getTabAt(2).setText(names[2]).setIcon(pic1[2]);
|
||||
mTab.getTabAt(3).setText(names[3]).setIcon(pic1[3]);
|
||||
mTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
//禁止table layout效果
|
||||
@Override
|
||||
|
@ -46,12 +46,12 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_register:
|
||||
Intent register = new Intent(this, ManagementFragment.class);
|
||||
Intent register = new Intent(this, FragmentManagement.class);
|
||||
register.putExtra("tag", 5);
|
||||
startActivity(register);
|
||||
break;
|
||||
case R.id.tv_forget_paw:
|
||||
Intent forgetPaw = new Intent(this, ManagementFragment.class);
|
||||
Intent forgetPaw = new Intent(this, FragmentManagement.class);
|
||||
forgetPaw.putExtra("tag", 6);
|
||||
startActivity(forgetPaw);
|
||||
break;
|
||||
|
@ -10,6 +10,9 @@ import android.os.CountDownTimer;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseActivity;
|
||||
|
||||
/**
|
||||
* 启动页
|
||||
*/
|
||||
public class MainActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,49 @@
|
||||
package com.example.myapplication.activity;
|
||||
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseActivity;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
|
||||
/**
|
||||
* 详情页
|
||||
*/
|
||||
public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private ImageView ivIcon;
|
||||
private WebView nWebView;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_web;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ImmersionBar.with(this)
|
||||
.statusBarDarkFont(true, 0.2f)
|
||||
//原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持状态栏字体变色,会使当前状态栏加上透明度,否则不执行透明度
|
||||
.init();
|
||||
nWebView = findViewById(R.id.news_webView);
|
||||
ivIcon = findViewById(R.id.iv_icon);
|
||||
ivIcon.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.iv_icon:
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -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.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.bean.EventPrefectureBean;
|
||||
import com.example.myapplication.bean.TaskExplainBean;
|
||||
|
||||
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 Context context;
|
||||
|
||||
public EventPrefectureAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setDataBeans(List<EventPrefectureBean.BodyBean.DataBean> dataBeans) {
|
||||
this.dataBeans.addAll(dataBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View mView = LayoutInflater.from(context).inflate(R.layout.event_prefecture_item, parent, false);
|
||||
return new ViewHolder(mView);
|
||||
}
|
||||
|
||||
@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());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (clickItem!=null){
|
||||
clickItem.item(dataBean.getId());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataBeans.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvTitle;
|
||||
TextView tvDest;
|
||||
TextView tvTime;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvTitle=itemView.findViewById(R.id.tv_title);
|
||||
tvDest=itemView.findViewById(R.id.tv_dest);
|
||||
tvTime=itemView.findViewById(R.id.tv_time);
|
||||
}
|
||||
}
|
||||
clickItem clickItem;
|
||||
|
||||
public void setClickItem(EventPrefectureAdapter.clickItem clickItem) {
|
||||
this.clickItem = clickItem;
|
||||
}
|
||||
|
||||
public interface clickItem{
|
||||
void item(int aInt);
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.example.myapplication.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.bean.TaskExplainBean;
|
||||
|
||||
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 Context context;
|
||||
|
||||
public TaskPrefectureAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setDataBeans(List<TaskExplainBean.BodyBean.DataBean> dataBeans) {
|
||||
this.dataBeans.addAll(dataBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
TaskExplainBean.BodyBean.DataBean dataBean = dataBeans.get(position);
|
||||
holder.tvTitle.setText(dataBean.getTitle());
|
||||
holder.tvDest.setText(dataBean.getSubtitle());
|
||||
holder.tvTime.setText(dataBean.getCreatetime());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (clickItem!=null){
|
||||
clickItem.item(dataBean.getId());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataBeans.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvTitle;
|
||||
TextView tvDest;
|
||||
TextView tvTime;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvTitle=itemView.findViewById(R.id.tv_title);
|
||||
tvDest=itemView.findViewById(R.id.tv_dest);
|
||||
tvTime=itemView.findViewById(R.id.tv_time);
|
||||
}
|
||||
}
|
||||
clickItem clickItem;
|
||||
|
||||
public void setClickItem(TaskPrefectureAdapter.clickItem clickItem) {
|
||||
this.clickItem = clickItem;
|
||||
}
|
||||
|
||||
public interface clickItem{
|
||||
void item(int aInt);
|
||||
}
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package com.example.myapplication.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -28,15 +31,32 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
ImmersionBar.with(this).init();
|
||||
Collector.addActivity(this);
|
||||
setContentView(getLayout());
|
||||
|
||||
initMVP();
|
||||
initView();
|
||||
initData();
|
||||
initListener();
|
||||
}
|
||||
private static void setCustomDensity(Application application, Activity activity) {
|
||||
final DisplayMetrics appDisplayMetrics = application.getResources().getDisplayMetrics();
|
||||
// 以设计DP为360为例,获得目标Density
|
||||
final float targetDensity = (float) (appDisplayMetrics.widthPixels / 360.0);
|
||||
final float targetScaledDensity = targetDensity * (appDisplayMetrics.scaledDensity / appDisplayMetrics.density);
|
||||
final int targetDensityDpi = (int)(targetDensity * 160);
|
||||
//设置application的Density
|
||||
appDisplayMetrics.density = targetDensity;
|
||||
appDisplayMetrics.scaledDensity = targetScaledDensity;
|
||||
appDisplayMetrics.densityDpi = targetDensityDpi;
|
||||
//设置activity的Density
|
||||
final DisplayMetrics activityDisplayMetrics = activity.getResources().getDisplayMetrics();
|
||||
activityDisplayMetrics.density = targetDensity;
|
||||
activityDisplayMetrics.scaledDensity = targetScaledDensity;
|
||||
activityDisplayMetrics.densityDpi = targetDensityDpi;
|
||||
}
|
||||
|
||||
protected void toast(String mag){
|
||||
Toast.makeText(UserApplication.getUserApplication(), mag, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
protected void initMVP() {
|
||||
}
|
||||
public void showLoadingDialog() {
|
||||
|
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@ -25,19 +26,21 @@ public abstract class BaseFragment extends Fragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mView = LayoutInflater.from(getActivity()).inflate(getLayout(), container, false);
|
||||
initMvp();
|
||||
initView();
|
||||
initData();
|
||||
|
||||
View mView= LayoutInflater.from(getActivity()).inflate(getLayout(), container, false);
|
||||
return mView;
|
||||
|
||||
}
|
||||
|
||||
protected void initMvp() {
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
initMvp();
|
||||
initData();
|
||||
initView();
|
||||
}
|
||||
|
||||
protected <T extends View> T findViewById(@IdRes int id){
|
||||
return getView().findViewById(id);
|
||||
}
|
||||
protected abstract int getLayout();
|
||||
public void showLoadingDialog() {
|
||||
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||
@ -67,18 +70,15 @@ public abstract class BaseFragment extends Fragment {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
}
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
protected void initMvp() { }
|
||||
|
||||
protected void initView() {
|
||||
protected void initData() { }
|
||||
|
||||
|
||||
}
|
||||
protected void initView() { }
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ package com.example.myapplication.bean;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务专区bean
|
||||
* 活动专区
|
||||
*/
|
||||
public class TaskZoneBean {
|
||||
public class EventPrefectureBean {
|
||||
/**
|
||||
* msg : 成功
|
||||
* body : {"rownum":0,"data":[{"Subtitle":"说明0","createtime":"2021-05-26 15:33:51","src":"","id":0,"title":"标题0"},{"Subtitle":"说明1","createtime":"2021-05-26 15:33:51","src":"","id":1,"title":"标题1"},{"Subtitle":"说明2","createtime":"2021-05-26 15:33:51","src":"","id":2,"title":"标题2"},{"Subtitle":"说明3","createtime":"2021-05-26 15:33:51","src":"","id":3,"title":"标题3"},{"Subtitle":"说明4","createtime":"2021-05-26 15:33:51","src":"","id":4,"title":"标题4"},{"Subtitle":"说明5","createtime":"2021-05-26 15:33:51","src":"","id":5,"title":"标题5"},{"Subtitle":"说明6","createtime":"2021-05-26 15:33:51","src":"","id":6,"title":"标题6"},{"Subtitle":"说明7","createtime":"2021-05-26 15:33:51","src":"","id":7,"title":"标题7"},{"Subtitle":"说明8","createtime":"2021-05-26 15:33:51","src":"","id":8,"title":"标题8"},{"Subtitle":"说明9","createtime":"2021-05-26 15:33:51","src":"","id":9,"title":"标题9"}],"numFound":100,"rows":10}
|
||||
@ -51,7 +51,7 @@ public class TaskZoneBean {
|
||||
private int rownum;
|
||||
private int numFound;
|
||||
private int rows;
|
||||
private List<DataBean> data;
|
||||
private List<BodyBean.DataBean> data;
|
||||
|
||||
public int getRownum() {
|
||||
return rownum;
|
||||
@ -77,11 +77,11 @@ public class TaskZoneBean {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
public List<BodyBean.DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
public void setData(List<BodyBean.DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
@ -0,0 +1,144 @@
|
||||
package com.example.myapplication.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务说明点击
|
||||
*/
|
||||
public class TaskExplainBean {
|
||||
/**
|
||||
* msg : 成功
|
||||
* body : {"rownum":0,"data":[{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":11,"title":"标题11"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":12,"title":"标题12"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":13,"title":"标题13"}],"numFound":100,"rows":10}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private BodyBean body;
|
||||
private int 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 int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
/**
|
||||
* rownum : 0
|
||||
* data : [{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":11,"title":"标题11"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":12,"title":"标题12"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":13,"title":"标题13"}]
|
||||
* 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 :
|
||||
* createtime :
|
||||
* src : http://10.130.23.166:8080/cbt/img/blue.png
|
||||
* id : 11
|
||||
* title : 标题11
|
||||
*/
|
||||
|
||||
private String Subtitle;
|
||||
private String createtime;
|
||||
private String src;
|
||||
private int id;
|
||||
private String title;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3,12 +3,12 @@ package com.example.myapplication.bean;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务说明点击
|
||||
* 任务专区bean
|
||||
*/
|
||||
public class TaskSpecificationBean {
|
||||
/**
|
||||
* msg : 成功
|
||||
* body : {"rownum":0,"data":[{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":11,"title":"标题11"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":12,"title":"标题12"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":13,"title":"标题13"}],"numFound":100,"rows":10}
|
||||
* body : {"rownum":0,"data":[{"Subtitle":"说明0","createtime":"2021-05-26 15:33:51","src":"","id":0,"title":"标题0"},{"Subtitle":"说明1","createtime":"2021-05-26 15:33:51","src":"","id":1,"title":"标题1"},{"Subtitle":"说明2","createtime":"2021-05-26 15:33:51","src":"","id":2,"title":"标题2"},{"Subtitle":"说明3","createtime":"2021-05-26 15:33:51","src":"","id":3,"title":"标题3"},{"Subtitle":"说明4","createtime":"2021-05-26 15:33:51","src":"","id":4,"title":"标题4"},{"Subtitle":"说明5","createtime":"2021-05-26 15:33:51","src":"","id":5,"title":"标题5"},{"Subtitle":"说明6","createtime":"2021-05-26 15:33:51","src":"","id":6,"title":"标题6"},{"Subtitle":"说明7","createtime":"2021-05-26 15:33:51","src":"","id":7,"title":"标题7"},{"Subtitle":"说明8","createtime":"2021-05-26 15:33:51","src":"","id":8,"title":"标题8"},{"Subtitle":"说明9","createtime":"2021-05-26 15:33:51","src":"","id":9,"title":"标题9"}],"numFound":100,"rows":10}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
@ -43,7 +43,7 @@ public class TaskSpecificationBean {
|
||||
public static class BodyBean {
|
||||
/**
|
||||
* rownum : 0
|
||||
* data : [{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":11,"title":"标题11"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":12,"title":"标题12"},{"Subtitle":"","createtime":"","src":"http://10.130.23.166:8080/cbt/img/blue.png","id":13,"title":"标题13"}]
|
||||
* data : [{"Subtitle":"说明0","createtime":"2021-05-26 15:33:51","src":"","id":0,"title":"标题0"},{"Subtitle":"说明1","createtime":"2021-05-26 15:33:51","src":"","id":1,"title":"标题1"},{"Subtitle":"说明2","createtime":"2021-05-26 15:33:51","src":"","id":2,"title":"标题2"},{"Subtitle":"说明3","createtime":"2021-05-26 15:33:51","src":"","id":3,"title":"标题3"},{"Subtitle":"说明4","createtime":"2021-05-26 15:33:51","src":"","id":4,"title":"标题4"},{"Subtitle":"说明5","createtime":"2021-05-26 15:33:51","src":"","id":5,"title":"标题5"},{"Subtitle":"说明6","createtime":"2021-05-26 15:33:51","src":"","id":6,"title":"标题6"},{"Subtitle":"说明7","createtime":"2021-05-26 15:33:51","src":"","id":7,"title":"标题7"},{"Subtitle":"说明8","createtime":"2021-05-26 15:33:51","src":"","id":8,"title":"标题8"},{"Subtitle":"说明9","createtime":"2021-05-26 15:33:51","src":"","id":9,"title":"标题9"}]
|
||||
* numFound : 100
|
||||
* rows : 10
|
||||
*/
|
||||
@ -87,11 +87,11 @@ public class TaskSpecificationBean {
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* Subtitle :
|
||||
* createtime :
|
||||
* src : http://10.130.23.166:8080/cbt/img/blue.png
|
||||
* id : 11
|
||||
* title : 标题11
|
||||
* Subtitle : 说明0
|
||||
* createtime : 2021-05-26 15:33:51
|
||||
* src :
|
||||
* id : 0
|
||||
* title : 标题0
|
||||
*/
|
||||
|
||||
private String Subtitle;
|
||||
|
@ -1,5 +0,0 @@
|
||||
package com.example.myapplication.bean;
|
||||
|
||||
public class TaskSpecificationInfo {
|
||||
|
||||
}
|
@ -11,7 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.CapacityEvaluationAdapter;
|
||||
import com.example.myapplication.activity.ManagementFragment;
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
import com.example.myapplication.http.Callback;
|
||||
@ -44,8 +44,8 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivEvaluationTaskFinish = mView.findViewById(R.id.iv_evaluation_task_finish);
|
||||
capacityEvaluationRecycler = mView.findViewById(R.id.capacity_evaluation_recycler);
|
||||
ivEvaluationTaskFinish =findViewById(R.id.iv_evaluation_task_finish);
|
||||
capacityEvaluationRecycler = findViewById(R.id.capacity_evaluation_recycler);
|
||||
ivEvaluationTaskFinish.setOnClickListener(this::onClick);
|
||||
capacityEvaluationRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
capacityEvaluationRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
@ -71,7 +71,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
capacityEvaluationAdapter.setOnCapacityClick(new CapacityEvaluationAdapter.OnCapacityClick() {
|
||||
@Override
|
||||
public void onClick(int id) {
|
||||
Intent itemIntent = new Intent(getActivity(), ManagementFragment.class);
|
||||
Intent itemIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
itemIntent.putExtra("tag", 12);
|
||||
startActivity(itemIntent);
|
||||
//Toast.makeText(getContext(), "哈哈,成功了"+id, Toast.LENGTH_SHORT).show();
|
||||
|
@ -0,0 +1,161 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
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.activity.WebActivity;
|
||||
import com.example.myapplication.adapter.EventPrefectureAdapter;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.EventPrefectureBean;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发现-活动专区
|
||||
*/
|
||||
public class EventPrefectureFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView ivEventTask;
|
||||
private XRecyclerView eventRecycler;
|
||||
private List<EventPrefectureBean.BodyBean.DataBean> taskExplainBean;
|
||||
private EventPrefectureAdapter eventPrefectureAdapter;
|
||||
private int page = 1;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.event_prefecture_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
taskExplainBean = new ArrayList<>();
|
||||
initNetwork(true);
|
||||
}
|
||||
|
||||
private void initNetwork(boolean b) {
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listEvent)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(EventPrefectureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<EventPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(EventPrefectureBean eventPrefectureBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
eventPrefectureAdapter.setDataBeans(eventPrefectureBean.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: " + eventPrefectureBean.getMsg() + "sssssssssssss");
|
||||
//initEventPrefecture(eventPrefectureBean,b);
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivEventTask = findViewById(R.id.iv_event_task);
|
||||
ivEventTask.setOnClickListener(this::onClick);
|
||||
eventRecycler = findViewById(R.id.event_recycler);
|
||||
eventRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
eventRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
eventRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
eventRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
eventRecycler.setPullRefreshEnabled(false);
|
||||
eventRecycler.setLoadingMoreEnabled(false);
|
||||
eventPrefectureAdapter = new EventPrefectureAdapter(getActivity());
|
||||
eventRecycler.setAdapter(eventPrefectureAdapter);
|
||||
eventRecycler.getDefaultFootView().setNoMoreHint("已全部加载完毕");
|
||||
eventRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
|
||||
}
|
||||
});
|
||||
eventPrefectureAdapter.setClickItem(new EventPrefectureAdapter.clickItem() {
|
||||
@Override
|
||||
public void item(int aInt) {
|
||||
Intent intent = new Intent(getContext(), WebActivity.class);
|
||||
intent.putExtra("id",aInt);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_event_task:
|
||||
getActivity().finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -4,8 +4,9 @@ import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.ManagementFragment;
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
|
||||
|
||||
@ -13,13 +14,12 @@ import com.example.myapplication.base.BaseFragment;
|
||||
* 发现的Fragment
|
||||
* 2021-5-25
|
||||
*/
|
||||
public class FindFragment extends BaseFragment implements View.OnClickListener {
|
||||
public class FindFragment extends BaseFragment implements View.OnClickListener{
|
||||
|
||||
private LinearLayout linear_task_prefecture;//任务专区
|
||||
private LinearLayout linear_task_explain;//任务说明
|
||||
private LinearLayout linearRight;
|
||||
private LinearLayout linearEnd;
|
||||
private LinearLayout linearTaskExplain;
|
||||
private LinearLayout linear_event_prefecture;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -29,13 +29,13 @@ public class FindFragment extends BaseFragment implements View.OnClickListener {
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
linear_task_prefecture = mView.findViewById(R.id.linear_task_prefecture);
|
||||
linear_event_prefecture = findViewById(R.id.linear_event_prefecture);
|
||||
linear_event_prefecture.setOnClickListener(this::onClick);
|
||||
linear_task_prefecture =findViewById(R.id.linear_task_prefecture);
|
||||
linear_task_prefecture.setOnClickListener(this::onClick);
|
||||
linear_task_explain = mView.findViewById(R.id.linear_task_explain);
|
||||
linear_task_explain =findViewById(R.id.linear_task_explain);
|
||||
linear_task_explain.setOnClickListener(this::onClick);
|
||||
linearRight = mView.findViewById(R.id.linear_right);
|
||||
linearRight.setOnClickListener(this::onClick);
|
||||
linearEnd = mView.findViewById(R.id.linear_end);
|
||||
linearEnd = findViewById(R.id.linear_end);
|
||||
linearEnd.setOnClickListener(this::onClick);
|
||||
|
||||
}
|
||||
@ -49,17 +49,22 @@ public class FindFragment extends BaseFragment implements View.OnClickListener {
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.linear_task_prefecture:
|
||||
Intent prefectureIntent = new Intent(getActivity(), ManagementFragment.class);
|
||||
Intent prefectureIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
prefectureIntent.putExtra("tag", 7);
|
||||
startActivity(prefectureIntent);
|
||||
break;
|
||||
case R.id.linear_task_explain:
|
||||
Intent explainIntent = new Intent(getActivity(), ManagementFragment.class);
|
||||
Intent explainIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
explainIntent.putExtra("tag", 8);
|
||||
startActivity(explainIntent);
|
||||
break;
|
||||
case R.id.linear_event_prefecture:
|
||||
Intent eventIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
eventIntent.putExtra("tag",9);
|
||||
startActivity(eventIntent);
|
||||
break;
|
||||
case R.id.linear_end:
|
||||
Intent endIntent = new Intent(getActivity(), ManagementFragment.class);
|
||||
Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
endIntent.putExtra("tag", 11);
|
||||
startActivity(endIntent);
|
||||
break;
|
||||
|
@ -1,18 +1,7 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.ListBean;
|
||||
import com.example.myapplication.bean.TaskSpecificationBean;
|
||||
import com.example.myapplication.http.Callback;
|
||||
import com.example.myapplication.http.HttpInterface;
|
||||
import com.example.myapplication.http.OkGoBuilder;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* 记录的Fragment
|
||||
@ -33,24 +22,7 @@ public class RecordFragment extends BaseFragment {
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if (isVisibleToUser) {
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listTask)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskSpecificationBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskSpecificationBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskSpecificationBean gl, int id) {
|
||||
Toast.makeText(getActivity(),gl.getMsg()+"sssssssssssssssssss", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: "+e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
@ -4,7 +4,6 @@ import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
@ -12,7 +11,7 @@ import com.example.myapplication.base.BaseFragment;
|
||||
/**
|
||||
* 注册页面
|
||||
*/
|
||||
public class RegisterFragment extends BaseFragment implements View.OnClickListener{
|
||||
public class RegisterFragment extends BaseFragment {
|
||||
|
||||
|
||||
private EditText etRegisterPhone;
|
||||
@ -35,19 +34,22 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivFinish =mView.findViewById(R.id.iv_finish);
|
||||
etRegisterPhone = mView.findViewById(R.id.et_register_phone);
|
||||
etRegisterNote = mView.findViewById(R.id.et_register_note);
|
||||
registerGetNote = mView.findViewById(R.id.register_get_note);
|
||||
etRegisterReferrer = mView.findViewById(R.id.et_register_referrer);
|
||||
etRegisterPaw = mView.findViewById(R.id.et_register_paw);
|
||||
etRegisterConfirmPaw = mView.findViewById(R.id.et_register_confirm_paw);
|
||||
ivRegisterCheck = mView.findViewById(R.id.iv_register_check);
|
||||
haveGoLogin = mView.findViewById(R.id.have_go_login);
|
||||
tvRegister = mView.findViewById(R.id.tv_register);
|
||||
|
||||
ivFinish.setOnClickListener(this::onClick);
|
||||
registerGetNote.setOnClickListener(this::onClick);
|
||||
ivFinish =findViewById(R.id.iv_finish);
|
||||
etRegisterPhone =findViewById(R.id.et_register_phone);
|
||||
etRegisterNote = findViewById(R.id.et_register_note);
|
||||
registerGetNote = findViewById(R.id.register_get_note);
|
||||
etRegisterReferrer = findViewById(R.id.et_register_referrer);
|
||||
etRegisterPaw =findViewById(R.id.et_register_paw);
|
||||
etRegisterConfirmPaw = findViewById(R.id.et_register_confirm_paw);
|
||||
ivRegisterCheck = findViewById(R.id.iv_register_check);
|
||||
haveGoLogin = findViewById(R.id.have_go_login);
|
||||
tvRegister =findViewById(R.id.tv_register);
|
||||
ivFinish.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getActivity().finish();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -57,17 +59,4 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
super.initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.iv_finish:
|
||||
getActivity().finish();
|
||||
break;
|
||||
case R.id.register_get_note:
|
||||
Toast.makeText(getActivity(), "获取验证码", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.ManagementFragment;
|
||||
import com.example.myapplication.activity.FragmentManagement;
|
||||
import com.example.myapplication.activity.TaskExplainAdapter;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.TaskExplainInfo;
|
||||
@ -42,8 +42,8 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivFindTaskExplain = mView.findViewById(R.id.iv_find_task_explain);
|
||||
taskExplainRecycle = mView.findViewById(R.id.task_explain_recycler);
|
||||
ivFindTaskExplain = findViewById(R.id.iv_find_task_explain);
|
||||
taskExplainRecycle =findViewById(R.id.task_explain_recycler);
|
||||
ivFindTaskExplain.setOnClickListener(this::onClick);
|
||||
|
||||
taskExplainRecycle.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
@ -71,7 +71,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
taskExplainAdapter.setOnItemClick(new TaskExplainAdapter.OnItemClick() {
|
||||
@Override
|
||||
public void onClick(int pos) {
|
||||
Intent itemIntent = new Intent(getActivity(), ManagementFragment.class);
|
||||
Intent itemIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
itemIntent.putExtra("tag", 10);
|
||||
startActivity(itemIntent);
|
||||
//Toast.makeText(getContext(), "你猜"+pos, Toast.LENGTH_SHORT).show();
|
||||
|
@ -43,8 +43,8 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivTaskExplain2 = mView.findViewById(R.id.iv_task_explain2_finish);
|
||||
taskExplain2Recycler = mView.findViewById(R.id.task_explain2_recycler);
|
||||
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));
|
||||
|
@ -1,12 +1,30 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
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.activity.WebActivity;
|
||||
import com.example.myapplication.adapter.TaskPrefectureAdapter;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.example.myapplication.bean.TaskExplainBean;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发现-任务专区
|
||||
*/
|
||||
@ -14,7 +32,9 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
|
||||
private ImageView mIvFindTask;
|
||||
private XRecyclerView taskRecycler;
|
||||
|
||||
private List<TaskExplainBean.BodyBean.DataBean> dataBeanList;
|
||||
private TaskPrefectureAdapter taskPrefectureAdapter;
|
||||
private int page=1;
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.task_prefecture_fragment;
|
||||
@ -23,14 +43,109 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
mIvFindTask = mView.findViewById(R.id.iv_find_task);
|
||||
mIvFindTask = findViewById(R.id.iv_find_task);
|
||||
mIvFindTask.setOnClickListener(this::onClick);
|
||||
taskRecycler = mView.findViewById(R.id.task_recycler);
|
||||
taskRecycler = findViewById(R.id.task_recycler);
|
||||
taskRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
taskRecycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL));
|
||||
taskRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
taskRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
taskRecycler.setPullRefreshEnabled(false);
|
||||
taskRecycler.setLoadingMoreEnabled(false);
|
||||
taskPrefectureAdapter = new TaskPrefectureAdapter(getActivity());
|
||||
taskRecycler.setAdapter(taskPrefectureAdapter);
|
||||
taskRecycler.getDefaultFootView().setNoMoreHint("已全部加载完毕");
|
||||
taskRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
|
||||
}
|
||||
});
|
||||
taskPrefectureAdapter.setClickItem(new TaskPrefectureAdapter.clickItem() {
|
||||
@Override
|
||||
public void item(int id) {
|
||||
Intent intent = new Intent(getContext(), WebActivity.class);
|
||||
intent.putExtra("id",id);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
dataBeanList=new ArrayList<>();
|
||||
initNetwork(true);
|
||||
|
||||
}
|
||||
|
||||
private void initNetwork(boolean start) {
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.listTask)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskExplainBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskExplainBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainBean taskSpecificationBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
taskPrefectureAdapter.setDataBeans(taskSpecificationBean.getBody().getData());
|
||||
Log.d("TAG", "onSuccess: "+taskSpecificationBean.getMsg()+"");
|
||||
//initTaskSpecification(taskSpecificationBean,start);
|
||||
}
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,5 +4,7 @@ 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";//任务说明
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
package com.example.myapplication.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
public class CustomScrollView extends ScrollView {
|
||||
private GestureDetector mGestureDetector;
|
||||
OnTouchListener mGestureListener;
|
||||
|
||||
public CustomScrollView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mGestureDetector = new GestureDetector(new YScrollDetector());
|
||||
setFadingEdgeLength(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
return super.onInterceptTouchEvent(ev) && mGestureDetector.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
// 如果水平滑动返回false
|
||||
class YScrollDetector extends GestureDetector.SimpleOnGestureListener {
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
if(Math.abs(distanceY) > Math.abs(distanceX)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11.67,3.87L9.9,2.1 0,12l9.9,9.9 1.77,-1.77L3.54,12z"/>
|
||||
<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"/>
|
||||
</vector>
|
||||
|
10
app/src/main/res/drawable/ic_baseline_arrow_back.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_arrow_back.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11.67,3.87L9.9,2.1 0,12l9.9,9.9 1.77,-1.77L3.54,12z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/icon_arrow.xml
Normal file
5
app/src/main/res/drawable/icon_arrow.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<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="M11.67,3.87L9.9,2.1 0,12l9.9,9.9 1.77,-1.77L3.54,12z"/>
|
||||
</vector>
|
BIN
app/src/main/res/drawable/icon_capacity_evaluation.png
Normal file
BIN
app/src/main/res/drawable/icon_capacity_evaluation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 937 B |
BIN
app/src/main/res/drawable/icon_event_prefecture.png
Normal file
BIN
app/src/main/res/drawable/icon_event_prefecture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable/icon_task_prefecture.png
Normal file
BIN
app/src/main/res/drawable/icon_task_prefecture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
BIN
app/src/main/res/drawable/icon_task_specification.png
Normal file
BIN
app/src/main/res/drawable/icon_task_specification.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 847 B |
51
app/src/main/res/layout/activity_web.xml
Normal file
51
app/src/main/res/layout/activity_web.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_web"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#1BA5F1"
|
||||
android:paddingTop="@dimen/top_pind_sp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:src="@drawable/ic_baseline_arrow"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
||||
android:layout_marginLeft="15dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="webView"
|
||||
android:layout_toRightOf="@id/iv_icon"
|
||||
android:textColor="#fff" />
|
||||
</RelativeLayout>
|
||||
|
||||
<com.example.myapplication.util.CustomScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/news_webView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="26dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.example.myapplication.util.CustomScrollView>
|
||||
</LinearLayout>
|
42
app/src/main/res/layout/event_prefecture_fragment.xml
Normal file
42
app/src/main/res/layout/event_prefecture_fragment.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_event"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#1BA5F1"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_event_task"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/icon_arrow"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_event"
|
||||
android:layout_width="wrap_content"
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:layout_toRightOf="@id/iv_find_task"
|
||||
android:text="活动专区" />
|
||||
</LinearLayout>
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/event_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_event" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
40
app/src/main/res/layout/event_prefecture_item.xml
Normal file
40
app/src/main/res/layout/event_prefecture_item.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/text_style_title"
|
||||
android:text="标题"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_dest"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题"
|
||||
style="@style/text_style"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="少时诵诗书所所"
|
||||
android:layout_marginRight="15dp"
|
||||
style="@style/text_style_time"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -15,168 +15,182 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_find"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:gravity="center"
|
||||
android:text="发现"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="17sp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:textStyle="bold" />
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:textColor="#fff"
|
||||
android:text="发现" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear1"
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="250dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardUseCompatPadding="false"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_find">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:background="#4A4A4A" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:text="最新公告" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear1">
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_task_prefecture"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="#8E8787"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear1">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="任务专区"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_right"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="150dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="#D6BFBF"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear1">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="活动专区"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear2">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:background="#4A4A4A" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:text="帮助中心" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#ACAAAA"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linear4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear3" />
|
||||
<LinearLayout
|
||||
android:id="@+id/linear4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view">
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_task_explain"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear1">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/ic_launcher"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="任务说明"
|
||||
/>
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:background="#CCCBCB" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textSize="18sp"
|
||||
android:text="最新公告" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#E4E4E4"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_task_prefecture"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/icon_task_prefecture" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_event_prefecture"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/icon_event_prefecture" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_end"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="100dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linear1">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/ic_launcher"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="能力测评"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginTop="20dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardUseCompatPadding="false"
|
||||
app:cardElevation="0dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardView">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:background="#CCCBCB" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textSize="18sp"
|
||||
android:text="帮助中心" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#E4E4E4" />
|
||||
<LinearLayout
|
||||
android:id="@+id/linear4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_task_explain"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/icon_task_specification"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="任务说明"
|
||||
android:textSize="12sp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_end"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/icon_capacity_evaluation"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="能力测评"
|
||||
android:textSize="12sp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -10,7 +10,7 @@
|
||||
android:id="@+id/rl_find"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:background="#1BA5F1"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -23,20 +23,15 @@
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/ic_baseline_arrow"
|
||||
android:src="@drawable/icon_arrow"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_find"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:layout_toRightOf="@id/iv_find_task"
|
||||
android:gravity="center"
|
||||
android:text="任务专区"
|
||||
android:textColor="#000"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold" />
|
||||
android:text="任务专区" />
|
||||
</LinearLayout>
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/task_recycler"
|
||||
|
38
app/src/main/res/layout/task_prefecture_item.xml
Normal file
38
app/src/main/res/layout/task_prefecture_item.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?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:background="?android:attr/selectableItemBackground"
|
||||
android:layout_height="100dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/text_style_title"
|
||||
android:text="标题"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_dest"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题"
|
||||
style="@style/text_style"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="少时诵诗书所所"
|
||||
android:layout_marginRight="15dp"
|
||||
style="@style/text_style_time"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">navinfo</string>
|
||||
<string name="app_name">mapp</string>
|
||||
<string name="title_activity_home">HomeActivity</string>
|
||||
<!-- Strings used for fragments for navigation -->
|
||||
<string name="first_fragment_label">First Fragment</string>
|
||||
@ -9,6 +9,4 @@
|
||||
|
||||
<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>
|
@ -20,5 +20,26 @@
|
||||
<item name="colorControlNormal">@android:color/darker_gray</item>
|
||||
<item name="colorControlActivated">@android:color/darker_gray</item>
|
||||
</style>
|
||||
|
||||
<style name="text_style_title">
|
||||
<item name="android:layout_marginTop">15dp</item>
|
||||
<item name="android:layout_marginLeft">15dp</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">#333</item>
|
||||
</style>
|
||||
<style name="text_style_toolbar_title">
|
||||
<item name="android:layout_height">45dp</item>
|
||||
<item name="android:layout_marginLeft">15dp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">17sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">#fff</item>
|
||||
</style>
|
||||
<style name="text_style">
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
<style name="text_style_time">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">#EDBCBABA</item>
|
||||
</style>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user