Commit 75be5d9a65c65f6e12a9ee2107a76f75ad924f1d

Authored by 陶汉栋
1 parent dcf53e4f

no message

Showing 27 changed files with 501 additions and 202 deletions   Show diff stats
app/build.gradle
@@ -5,7 +5,7 @@ android { @@ -5,7 +5,7 @@ android {
5 config { 5 config {
6 keyAlias 'key0' 6 keyAlias 'key0'
7 keyPassword '123456' 7 keyPassword '123456'
8 - storeFile file('E:/parentwork/app/parent.jks') 8 + storeFile file('../app/parent.jks')
9 storePassword '123456' 9 storePassword '123456'
10 } 10 }
11 } 11 }
@@ -24,6 +24,11 @@ android { @@ -24,6 +24,11 @@ android {
24 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 24 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25 signingConfig signingConfigs.config 25 signingConfig signingConfigs.config
26 } 26 }
  27 + debug {
  28 + signingConfig signingConfigs.config
  29 + }
  30 + }
  31 + productFlavors {
27 } 32 }
28 } 33 }
29 34
app/src/main/AndroidManifest.xml
@@ -48,9 +48,9 @@ @@ -48,9 +48,9 @@
48 <application 48 <application
49 android:name=".AppContext" 49 android:name=".AppContext"
50 android:allowBackup="true" 50 android:allowBackup="true"
51 - android:icon="@mipmap/ic_launcher" 51 + android:icon="@drawable/logo"
52 android:label="@string/app_name" 52 android:label="@string/app_name"
53 - android:roundIcon="@mipmap/ic_launcher_round" 53 + android:roundIcon="@drawable/logo"
54 android:supportsRtl="true" 54 android:supportsRtl="true"
55 android:theme="@style/Theme.AppCompat.Light.NoActionBar"> 55 android:theme="@style/Theme.AppCompat.Light.NoActionBar">
56 56
app/src/main/java/com/shunzhi/parent/AppContext.java
@@ -105,8 +105,8 @@ public class AppContext extends GlobalApplication { @@ -105,8 +105,8 @@ public class AppContext extends GlobalApplication {
105 sendBroadcast(intent); 105 sendBroadcast(intent);
106 stopLocation(); 106 stopLocation();
107 }else { 107 }else {
108 - Log.d("mlocation:","errorCode="+aMapLocation.getErrorCode()+"errorInfo="+aMapLocation.getErrorInfo());  
109 cityName="定位失败"; 108 cityName="定位失败";
  109 + Log.d("mlocation:","errorCode="+aMapLocation.getErrorCode()+"errorInfo="+aMapLocation.getErrorInfo());
110 } 110 }
111 111
112 } 112 }
app/src/main/java/com/shunzhi/parent/bean/ToolBean.java 0 → 100644
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
  1 +package com.shunzhi.parent.bean;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Created by ToaHanDong on 2018/3/14.
  7 + */
  8 +
  9 +public class ToolBean implements Serializable {
  10 +
  11 + public ToolBean(String toolImg,String toolName){
  12 + this.toolImg=toolImg;
  13 + this.toolName=toolName;
  14 + }
  15 +
  16 +
  17 + public String toolImg;
  18 +
  19 + public String toolName;
  20 +
  21 + @Override
  22 + public String toString() {
  23 + return "ToolBean{" +
  24 + "toolImg='" + toolImg + '\'' +
  25 + ", toolName='" + toolName + '\'' +
  26 + '}';
  27 + }
  28 +}
app/src/main/java/com/shunzhi/parent/contract/ceping/CepingContract.java 0 → 100644
@@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
  1 +package com.shunzhi.parent.contract.ceping;
  2 +
  3 +import android.view.View;
  4 +import android.widget.LinearLayout;
  5 +
  6 +import com.share.mvpsdk.base.BasePresenter;
  7 +import com.share.mvpsdk.base.IBaseFragment;
  8 +import com.share.mvpsdk.base.IBaseModel;
  9 +import com.shunzhi.parent.bean.ToolBean;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * Created by ToaHanDong on 2018/3/14.
  15 + */
  16 +
  17 +public interface CepingContract {
  18 +
  19 + abstract class CePingPresenter extends BasePresenter<ICePingModel,ICePingView>{
  20 + public abstract void getTools(LinearLayout view);
  21 + }
  22 +
  23 +
  24 + interface ICePingModel extends IBaseModel{
  25 + void getTools();
  26 + }
  27 +
  28 +
  29 + interface ICePingView extends IBaseFragment{
  30 + void getTools();
  31 + }
  32 +
  33 +}
app/src/main/java/com/shunzhi/parent/contract/consult/ConsultContract.java 0 → 100644
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
  1 +package com.shunzhi.parent.contract.consult;
  2 +
  3 +import android.widget.LinearLayout;
  4 +
  5 +import com.share.mvpsdk.base.BasePresenter;
  6 +import com.share.mvpsdk.base.IBaseFragment;
  7 +import com.share.mvpsdk.base.IBaseModel;
  8 +
  9 +/**
  10 + * Created by ToaHanDong on 2018/3/14.
  11 + */
  12 +
  13 +public interface ConsultContract {
  14 +
  15 + abstract class ConsultPresenter extends BasePresenter<IConsultModel,IConsultView>{
  16 + public abstract void getTools(LinearLayout linearLayout);
  17 + }
  18 +
  19 +
  20 + interface IConsultModel extends IBaseModel{
  21 + void getTools();
  22 + }
  23 +
  24 + interface IConsultView extends IBaseFragment{
  25 + void showTools();
  26 + }
  27 +
  28 +}
app/src/main/java/com/shunzhi/parent/contract/consult/consultone/ConsultOneContract.java 0 → 100644
@@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
  1 +package com.shunzhi.parent.contract.consult.consultone;
  2 +
  3 +import android.widget.LinearLayout;
  4 +
  5 +import com.share.mvpsdk.base.BasePresenter;
  6 +import com.share.mvpsdk.base.IBaseFragment;
  7 +import com.share.mvpsdk.base.IBaseModel;
  8 +
  9 +/**
  10 + * Created by ToaHanDong on 2018/3/14.
  11 + */
  12 +
  13 +public interface ConsultOneContract {
  14 +
  15 + abstract class ConsultOnePresenter extends BasePresenter<IConsultOneModel,IConsultOneView>{
  16 + public abstract void getTools(LinearLayout linearLayout);
  17 + }
  18 +
  19 + interface IConsultOneModel extends IBaseModel{
  20 + void getTools();
  21 + }
  22 +
  23 + interface IConsultOneView extends IBaseFragment{
  24 + void showTools();
  25 + }
  26 +
  27 +}
app/src/main/java/com/shunzhi/parent/model/CePingModel.java 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +package com.shunzhi.parent.model;
  2 +
  3 +import com.share.mvpsdk.base.BaseModel;
  4 +import com.shunzhi.parent.contract.ceping.CepingContract;
  5 +
  6 +/**
  7 + * Created by ToaHanDong on 2018/3/14.
  8 + */
  9 +//获取测评数据
  10 +public class CePingModel extends BaseModel implements CepingContract.ICePingModel {
  11 +
  12 +public static CePingModel newInstance(){
  13 + return new CePingModel();
  14 +}
  15 + @Override
  16 + public void getTools() {
  17 +
  18 + }
  19 +
  20 +}
app/src/main/java/com/shunzhi/parent/model/consult/ConsultModel.java 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +package com.shunzhi.parent.model.consult;
  2 +
  3 +import com.share.mvpsdk.base.BaseModel;
  4 +import com.shunzhi.parent.contract.consult.ConsultContract;
  5 +
  6 +/**
  7 + * Created by ToaHanDong on 2018/3/14.
  8 + */
  9 +
  10 +public class ConsultModel extends BaseModel implements ConsultContract.IConsultModel{
  11 +
  12 + @Override
  13 + public void getTools() {
  14 +
  15 + }
  16 +
  17 + public static ConsultContract.IConsultModel newInstance() {
  18 + return new ConsultModel();
  19 + }
  20 +}
app/src/main/java/com/shunzhi/parent/model/consult/consultone/ConsultOneModel.java 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +package com.shunzhi.parent.model.consult.consultone;
  2 +
  3 +import com.share.mvpsdk.base.BaseModel;
  4 +import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract;
  5 +
  6 +/**
  7 + * Created by ToaHanDong on 2018/3/14.
  8 + */
  9 +
  10 +public class ConsultOneModel extends BaseModel implements ConsultOneContract.IConsultOneModel{
  11 +
  12 + public static ConsultOneModel newInstance(){
  13 + return new ConsultOneModel();
  14 + }
  15 +
  16 + @Override
  17 + public void getTools() {
  18 +
  19 + }
  20 +}
app/src/main/java/com/shunzhi/parent/presenter/ceping/CePingPresenter.java 0 → 100644
@@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
  1 +package com.shunzhi.parent.presenter.ceping;
  2 +
  3 +import android.content.res.TypedArray;
  4 +import android.util.TypedValue;
  5 +import android.view.View;
  6 +import android.widget.LinearLayout;
  7 +
  8 +import com.shunzhi.parent.R;
  9 +import com.shunzhi.parent.bean.ToolBean;
  10 +import com.shunzhi.parent.contract.ceping.CepingContract;
  11 +import com.shunzhi.parent.model.CePingModel;
  12 +import com.shunzhi.parent.views.TextAndImgShowView;
  13 +
  14 +import java.util.ArrayList;
  15 +import java.util.List;
  16 +
  17 +/**
  18 + * Created by ToaHanDong on 2018/3/14.
  19 + */
  20 +
  21 +public class CePingPresenter extends CepingContract.CePingPresenter {
  22 + @Override
  23 + public void getTools(LinearLayout layout_control) {
  24 + List<ToolBean> toolBeanList=new ArrayList<>();
  25 + toolBeanList.add(new ToolBean(R.drawable.gxzt+"","高校直通"));
  26 + toolBeanList.add(new ToolBean(R.drawable.zycx+"","专业查询"));
  27 + toolBeanList.add(new ToolBean(R.drawable.cmyk+"","传媒艺考"));
  28 + toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜"));
  29 + toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜"));
  30 + toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜"));
  31 + toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜"));
  32 + toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜"));
  33 +
  34 + for (int i = 0; i < toolBeanList.size(); i++) {
  35 + TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity());
  36 + textAndImgShowView.setTextColor(R.color.textColor);
  37 + textAndImgShowView.setText(toolBeanList.get(i).toolName);
  38 + textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImg));
  39 + textAndImgShowView.setSelect(true);
  40 + textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control);
  41 + TypedValue typedValue=new TypedValue();
  42 + mIView.getBindActivity().getTheme().resolveAttribute(android.R.attr.selectableItemBackground,typedValue,true);
  43 + int[] sttrides=new int[]{android.R.attr.selectableItemBackground};
  44 + TypedArray typedArray=mIView.getBindActivity().getTheme().obtainStyledAttributes(sttrides);
  45 + textAndImgShowView.setBackground(typedArray.getDrawable(0));
  46 + textAndImgShowView.setOnClickListener(new View.OnClickListener() {
  47 + @Override
  48 + public void onClick(View view) {
  49 +
  50 + }
  51 + });
  52 + layout_control.addView(textAndImgShowView);
  53 + }
  54 + mIView.getTools();
  55 + }
  56 +
  57 + @Override
  58 + public CepingContract.ICePingModel getModel() {
  59 + return CePingModel.newInstance();
  60 + }
  61 +
  62 + @Override
  63 + public void onStart() {
  64 +
  65 + }
  66 +}
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java 0 → 100644
@@ -0,0 +1,62 @@ @@ -0,0 +1,62 @@
  1 +package com.shunzhi.parent.presenter.consult;
  2 +
  3 +import android.content.res.TypedArray;
  4 +import android.util.TypedValue;
  5 +import android.view.View;
  6 +import android.widget.LinearLayout;
  7 +
  8 +import com.shunzhi.parent.R;
  9 +import com.shunzhi.parent.bean.ToolBean;
  10 +import com.shunzhi.parent.contract.consult.ConsultContract;
  11 +import com.shunzhi.parent.model.consult.ConsultModel;
  12 +import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity;
  13 +import com.shunzhi.parent.views.TextAndImgShowView;
  14 +
  15 +import java.util.ArrayList;
  16 +import java.util.List;
  17 +
  18 +/**
  19 + * Created by ToaHanDong on 2018/3/14.
  20 + */
  21 +
  22 +public class ConsultPresenter extends ConsultContract.ConsultPresenter {
  23 + @Override
  24 + public void getTools(LinearLayout layout_control) {
  25 + List<ToolBean> toolBeanList=new ArrayList<>();
  26 + toolBeanList.add(new ToolBean(R.drawable.xiaoxue+"","小学"));
  27 + toolBeanList.add(new ToolBean(R.drawable.zhongxue+"","中学"));
  28 + toolBeanList.add(new ToolBean(R.drawable.gaozhong+"","高中"));
  29 + toolBeanList.add(new ToolBean(R.drawable.parent+"","家长"));
  30 + for (int i = 0; i < toolBeanList.size(); i++) {
  31 + TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity());
  32 + textAndImgShowView.setTextColor(R.color.textColor);
  33 + textAndImgShowView.setText(toolBeanList.get(i).toolName);
  34 + textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImg));
  35 + textAndImgShowView.setSelect(true);
  36 + textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control);
  37 + TypedValue typedValue=new TypedValue();
  38 + mIView.getBindActivity().getTheme().resolveAttribute(android.R.attr.selectableItemBackground,typedValue,true);
  39 + int[] sttrides=new int[]{android.R.attr.selectableItemBackground};
  40 + TypedArray typedArray=mIView.getBindActivity().getTheme().obtainStyledAttributes(sttrides);
  41 + textAndImgShowView.setBackground(typedArray.getDrawable(0));
  42 + textAndImgShowView.setOnClickListener(new View.OnClickListener() {
  43 + @Override
  44 + public void onClick(View view) {
  45 + ConsultOneLevelActivity.getInstance(mIView.getBindActivity());
  46 + }
  47 + });
  48 + layout_control.addView(textAndImgShowView);
  49 + }
  50 + mIView.showTools();
  51 + }
  52 +
  53 + @Override
  54 + public ConsultContract.IConsultModel getModel() {
  55 + return ConsultModel.newInstance();
  56 + }
  57 +
  58 + @Override
  59 + public void onStart() {
  60 +
  61 + }
  62 +}
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java 0 → 100644
@@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
  1 +package com.shunzhi.parent.presenter.consult.consultone;
  2 +
  3 +import android.widget.LinearLayout;
  4 +
  5 +import com.shunzhi.parent.R;
  6 +import com.shunzhi.parent.bean.ToolBean;
  7 +import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract;
  8 +import com.shunzhi.parent.model.consult.consultone.ConsultOneModel;
  9 +import com.shunzhi.parent.views.TextAndImgShowView;
  10 +
  11 +import java.util.ArrayList;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * Created by ToaHanDong on 2018/3/14.
  16 + */
  17 +
  18 +public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{
  19 + @Override
  20 + public void getTools(LinearLayout layout_control) {
  21 + List<ToolBean> toolBeanList=new ArrayList<>();
  22 + toolBeanList.add(new ToolBean(R.drawable.xiaoxue+"","政策咨询"));
  23 + toolBeanList.add(new ToolBean(R.drawable.gbxx+"","公办/民办小学"));
  24 + toolBeanList.add(new ToolBean(R.drawable.xsc+"","小升初"));
  25 + toolBeanList.add(new ToolBean(R.drawable.xxk+"","学校库"));
  26 + toolBeanList.add(new ToolBean(R.drawable.zhuanti+"","专题"));
  27 + for (int i = 0; i < toolBeanList.size(); i++) {
  28 + TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity());
  29 + textAndImgShowView.setTextColor(R.color.textColor);
  30 + textAndImgShowView.setText(toolBeanList.get(i).toolName);
  31 + textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImg));
  32 + textAndImgShowView.setSelect(true);
  33 + textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control);
  34 + layout_control.addView(textAndImgShowView);
  35 + }
  36 + mIView.showTools();
  37 + }
  38 +
  39 + @Override
  40 + public ConsultOneContract.IConsultOneModel getModel() {
  41 + return ConsultOneModel.newInstance();
  42 + }
  43 +
  44 + @Override
  45 + public void onStart() {
  46 +
  47 + }
  48 +}
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
@@ -119,7 +119,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre @@ -119,7 +119,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
119 119
120 @Override 120 @Override
121 public void getUserInfo() { 121 public void getUserInfo() {
122 - Log.d("77777", "getUserInfo="); 122 +// Log.d("77777", "getUserInfo=");
123 } 123 }
124 124
125 125
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
@@ -13,6 +13,7 @@ import android.widget.ImageView; @@ -13,6 +13,7 @@ import android.widget.ImageView;
13 import android.widget.TextView; 13 import android.widget.TextView;
14 14
15 import com.share.mvpsdk.base.BasePresenter; 15 import com.share.mvpsdk.base.BasePresenter;
  16 +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
16 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; 17 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter;
17 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; 18 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder;
18 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; 19 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
@@ -22,7 +23,7 @@ import com.shunzhi.parent.bean.MyConsultBean; @@ -22,7 +23,7 @@ import com.shunzhi.parent.bean.MyConsultBean;
22 import java.util.ArrayList; 23 import java.util.ArrayList;
23 import java.util.List; 24 import java.util.List;
24 25
25 -public class ConsultTwoLevelActivity extends BaseMVPCompatFragment implements View.OnClickListener { 26 +public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener {
26 27
27 ImageView ivBack, ivSearch; 28 ImageView ivBack, ivSearch;
28 29
@@ -37,31 +38,30 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatFragment implements Vi @@ -37,31 +38,30 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatFragment implements Vi
37 List<MyConsultBean> myConsultBeanList = new ArrayList<>(); 38 List<MyConsultBean> myConsultBeanList = new ArrayList<>();
38 39
39 @Override 40 @Override
40 - public int getLayoutId() {  
41 - return R.layout.activity_consult_two_level; 41 + protected void initView(Bundle savedInstanceState) {
  42 + initViews();
42 } 43 }
43 44
44 @Override 45 @Override
45 - public void initUI(View view, @Nullable Bundle savedInstanceState) {  
46 -  
47 - initViews(view);  
48 - 46 + public int getLayoutId() {
  47 + return R.layout.activity_consult_two_level;
49 } 48 }
50 49
51 - private void initViews(View view) {  
52 50
53 - ivBack = view.findViewById(R.id.ivBack); 51 + private void initViews() {
  52 +
  53 + ivBack = findViewById(R.id.ivBack);
54 ivBack.setOnClickListener(this); 54 ivBack.setOnClickListener(this);
55 55
56 - et_search = view.findViewById(R.id.et_search); 56 + et_search = findViewById(R.id.et_search);
57 57
58 - ivSearch = view.findViewById(R.id.ivSearch); 58 + ivSearch = findViewById(R.id.ivSearch);
59 ivSearch.setOnClickListener(this); 59 ivSearch.setOnClickListener(this);
60 60
61 - tvContentName = view.findViewById(R.id.tvContentName); 61 + tvContentName = findViewById(R.id.tvContentName);
62 tvContentName.setText(""); 62 tvContentName.setText("");
63 63
64 - recyclerView = view.findViewById(R.id.recyclerView); 64 + recyclerView = findViewById(R.id.recyclerView);
65 65
66 initRecyclerView(); 66 initRecyclerView();
67 } 67 }
@@ -105,13 +105,13 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatFragment implements Vi @@ -105,13 +105,13 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatFragment implements Vi
105 @Override 105 @Override
106 public void onAttachedToRecyclerView(RecyclerView recyclerView) { 106 public void onAttachedToRecyclerView(RecyclerView recyclerView) {
107 super.onAttachedToRecyclerView(recyclerView); 107 super.onAttachedToRecyclerView(recyclerView);
108 - LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); 108 + LinearLayoutManager layoutManager = new LinearLayoutManager(ConsultTwoLevelActivity.this);
109 recyclerView.setLayoutManager(layoutManager); 109 recyclerView.setLayoutManager(layoutManager);
110 } 110 }
111 111
112 @Override 112 @Override
113 public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 113 public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
114 - View view = LayoutInflater.from(getActivity()).inflate(R.layout.layout_consult_content, parent, false); 114 + View view = LayoutInflater.from(ConsultTwoLevelActivity.this).inflate(R.layout.layout_consult_content, parent, false);
115 return new MyTwoLevelViewHolder(view); 115 return new MyTwoLevelViewHolder(view);
116 } 116 }
117 117
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
@@ -11,27 +11,35 @@ import android.support.design.widget.FloatingActionButton; @@ -11,27 +11,35 @@ import android.support.design.widget.FloatingActionButton;
11 import android.view.View; 11 import android.view.View;
12 import android.widget.FrameLayout; 12 import android.widget.FrameLayout;
13 import android.widget.ImageView; 13 import android.widget.ImageView;
  14 +import android.widget.LinearLayout;
14 import android.widget.TextView; 15 import android.widget.TextView;
15 16
16 import com.share.mvpsdk.base.BasePresenter; 17 import com.share.mvpsdk.base.BasePresenter;
17 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; 18 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  19 +import com.share.mvpsdk.utils.DisplayUtils;
18 import com.share.mvpsdk.utils.ToastUtils; 20 import com.share.mvpsdk.utils.ToastUtils;
19 import com.shunzhi.parent.AppContext; 21 import com.shunzhi.parent.AppContext;
20 import com.shunzhi.parent.R; 22 import com.shunzhi.parent.R;
  23 +import com.shunzhi.parent.contract.ceping.CepingContract;
  24 +import com.shunzhi.parent.presenter.ceping.CePingPresenter;
21 import com.shunzhi.parent.views.TextAndImgShowView; 25 import com.shunzhi.parent.views.TextAndImgShowView;
22 26
23 -public class CePingFragment extends BaseMVPCompatFragment implements View.OnClickListener{ 27 +
  28 +public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingPresenter,CepingContract.ICePingModel> implements CepingContract.ICePingView
  29 + ,View.OnClickListener{
24 30
25 TextView tvLocalAddress; 31 TextView tvLocalAddress;
26 32
27 ImageView ivCamera; 33 ImageView ivCamera;
28 34
29 - TextAndImgShowView textAndImg1,textAndImg2,textAndImg3,textAndImg4,textAndImg_xqjc,textAndImg_zxlx; 35 + TextAndImgShowView textAndImg_xqjc,textAndImg_zxlx;
30 36
31 FrameLayout frame_hot1; 37 FrameLayout frame_hot1;
32 38
33 FloatingActionButton floatingActionButton; 39 FloatingActionButton floatingActionButton;
34 40
  41 + LinearLayout layout_control;
  42 +
35 @Override 43 @Override
36 public int getLayoutId() { 44 public int getLayoutId() {
37 return R.layout.fragment_ce_ping; 45 return R.layout.fragment_ce_ping;
@@ -39,36 +47,16 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic @@ -39,36 +47,16 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic
39 47
40 @Override 48 @Override
41 public void initUI(View view, @Nullable Bundle savedInstanceState) { 49 public void initUI(View view, @Nullable Bundle savedInstanceState) {
  50 +
42 ivCamera=view.findViewById(R.id.ivCamera); 51 ivCamera=view.findViewById(R.id.ivCamera);
43 tvLocalAddress=view.findViewById(R.id.tvLocalAddress); 52 tvLocalAddress=view.findViewById(R.id.tvLocalAddress);
44 - textAndImg1=view.findViewById(R.id.textAndImg1);  
45 - textAndImg2=view.findViewById(R.id.textAndImg2);  
46 - textAndImg3=view.findViewById(R.id.textAndImg3);  
47 - textAndImg4=view.findViewById(R.id.textAndImg4);  
48 textAndImg_xqjc=view.findViewById(R.id.textAndImg_xqjc); 53 textAndImg_xqjc=view.findViewById(R.id.textAndImg_xqjc);
49 textAndImg_zxlx=view.findViewById(R.id.textAndImg_zxlx); 54 textAndImg_zxlx=view.findViewById(R.id.textAndImg_zxlx);
50 frame_hot1=view.findViewById(R.id.frame_hot1); 55 frame_hot1=view.findViewById(R.id.frame_hot1);
  56 + layout_control=view.findViewById(R.id.layout_control);
51 floatingActionButton=view.findViewById(R.id.floatingActionButton); 57 floatingActionButton=view.findViewById(R.id.floatingActionButton);
52 58
53 - textAndImg1.setTextColor(R.color.textColor);  
54 - textAndImg1.setText("高校直通");  
55 - textAndImg1.setImgs(R.drawable.play,R.drawable.gxzt);  
56 - textAndImg1.setSelect(true);  
57 -  
58 - textAndImg2.setTextColor(R.color.textColor);  
59 - textAndImg2.setText("专业查询");  
60 - textAndImg2.setImgs(R.drawable.play,R.drawable.zycx);  
61 - textAndImg2.setSelect(true);  
62 -  
63 - textAndImg3.setTextColor(R.color.textColor);  
64 - textAndImg3.setText("传媒艺考");  
65 - textAndImg3.setImgs(R.drawable.play,R.drawable.cmyk);  
66 - textAndImg3.setSelect(true);  
67 -  
68 - textAndImg4.setTextColor(R.color.textColor);  
69 - textAndImg4.setText("排行榜");  
70 - textAndImg4.setImgs(R.drawable.play,R.drawable.phb);  
71 - textAndImg4.setSelect(true); 59 + addTools();
72 60
73 textAndImg_xqjc.setTextColor(R.color.white); 61 textAndImg_xqjc.setTextColor(R.color.white);
74 textAndImg_xqjc.setText("学情检测"); 62 textAndImg_xqjc.setText("学情检测");
@@ -84,6 +72,12 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic @@ -84,6 +72,12 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic
84 floatingActionButton.setRippleColor(getResources().getColor(R.color.white)); 72 floatingActionButton.setRippleColor(getResources().getColor(R.color.white));
85 } 73 }
86 74
  75 + private void addTools() {
  76 + layout_control.measure(0,0);
  77 + mPresenter.getTools(layout_control);
  78 +
  79 + }
  80 +
87 @Override 81 @Override
88 public void onResume() { 82 public void onResume() {
89 super.onResume(); 83 super.onResume();
@@ -94,10 +88,6 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic @@ -94,10 +88,6 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic
94 view.findViewById(R.id.frame_hot2).setOnClickListener(this); 88 view.findViewById(R.id.frame_hot2).setOnClickListener(this);
95 view.findViewById(R.id.frame_hot3).setOnClickListener(this); 89 view.findViewById(R.id.frame_hot3).setOnClickListener(this);
96 tvLocalAddress.setOnClickListener(this); 90 tvLocalAddress.setOnClickListener(this);
97 - textAndImg1.setOnClickListener(this);  
98 - textAndImg2.setOnClickListener(this);  
99 - textAndImg3.setOnClickListener(this);  
100 - textAndImg4.setOnClickListener(this);  
101 ivCamera.setOnClickListener(this); 91 ivCamera.setOnClickListener(this);
102 92
103 initBroadCast(); 93 initBroadCast();
@@ -114,7 +104,7 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic @@ -114,7 +104,7 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic
114 @NonNull 104 @NonNull
115 @Override 105 @Override
116 public BasePresenter initPresenter() { 106 public BasePresenter initPresenter() {
117 - return null; 107 + return new CePingPresenter();
118 } 108 }
119 109
120 110
@@ -133,18 +123,6 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic @@ -133,18 +123,6 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic
133 case R.id.tvLocalAddress: 123 case R.id.tvLocalAddress:
134 AppContext.getInstance().startLocation(); 124 AppContext.getInstance().startLocation();
135 break; 125 break;
136 - case R.id.textAndImg1:  
137 -  
138 - break;  
139 - case R.id.textAndImg2:  
140 -  
141 - break;  
142 - case R.id.textAndImg3:  
143 -  
144 - break;  
145 - case R.id.textAndImg4:  
146 -  
147 - break;  
148 case R.id.ivCamera: 126 case R.id.ivCamera:
149 ToastUtils.showToast("功能暂未上线"); 127 ToastUtils.showToast("功能暂未上线");
150 break; 128 break;
@@ -165,4 +143,9 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic @@ -165,4 +143,9 @@ public class CePingFragment extends BaseMVPCompatFragment implements View.OnClic
165 super.onDestroy(); 143 super.onDestroy();
166 if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver); 144 if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver);
167 } 145 }
  146 +
  147 + @Override
  148 + public void getTools() {
  149 +
  150 + }
168 } 151 }
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -12,6 +12,7 @@ import android.support.annotation.Nullable; @@ -12,6 +12,7 @@ import android.support.annotation.Nullable;
12 import android.util.Log; 12 import android.util.Log;
13 import android.view.View; 13 import android.view.View;
14 import android.widget.ImageView; 14 import android.widget.ImageView;
  15 +import android.widget.LinearLayout;
15 import android.widget.TextView; 16 import android.widget.TextView;
16 17
17 import com.bumptech.glide.Glide; 18 import com.bumptech.glide.Glide;
@@ -19,6 +20,8 @@ import com.share.mvpsdk.base.BasePresenter; @@ -19,6 +20,8 @@ import com.share.mvpsdk.base.BasePresenter;
19 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; 20 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
20 import com.shunzhi.parent.AppContext; 21 import com.shunzhi.parent.AppContext;
21 import com.shunzhi.parent.R; 22 import com.shunzhi.parent.R;
  23 +import com.shunzhi.parent.contract.consult.ConsultContract;
  24 +import com.shunzhi.parent.presenter.consult.ConsultPresenter;
22 import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; 25 import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity;
23 import com.shunzhi.parent.views.TextAndImgShowView; 26 import com.shunzhi.parent.views.TextAndImgShowView;
24 import com.stx.xhb.xbanner.XBanner; 27 import com.stx.xhb.xbanner.XBanner;
@@ -31,12 +34,11 @@ import java.util.List; @@ -31,12 +34,11 @@ import java.util.List;
31 34
32 import cn.jzvd.JZVideoPlayerStandard; 35 import cn.jzvd.JZVideoPlayerStandard;
33 36
34 -public class ConsultFragment extends BaseMVPCompatFragment implements View.OnClickListener { 37 +public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter,ConsultContract.IConsultModel> implements View.OnClickListener
  38 +,ConsultContract.IConsultView{
35 39
36 ImageView ivSearch; 40 ImageView ivSearch;
37 41
38 - TextAndImgShowView textAndImg1, textAndImg2, textAndImg3, textAndImg4;  
39 -  
40 XBanner xBanner; 42 XBanner xBanner;
41 43
42 List<String> imgesUrl = new ArrayList<>(); 44 List<String> imgesUrl = new ArrayList<>();
@@ -45,6 +47,7 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli @@ -45,6 +47,7 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli
45 47
46 TextView tvLocalAddress; 48 TextView tvLocalAddress;
47 49
  50 + LinearLayout layout_control;
48 @Override 51 @Override
49 public int getLayoutId() { 52 public int getLayoutId() {
50 return R.layout.fragment_zi_xun; 53 return R.layout.fragment_zi_xun;
@@ -54,38 +57,16 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli @@ -54,38 +57,16 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli
54 public void initUI(View view, @Nullable Bundle savedInstanceState) { 57 public void initUI(View view, @Nullable Bundle savedInstanceState) {
55 58
56 ivSearch = view.findViewById(R.id.ivSearch); 59 ivSearch = view.findViewById(R.id.ivSearch);
57 - textAndImg1 = view.findViewById(R.id.textAndImg1);  
58 - textAndImg2 = view.findViewById(R.id.textAndImg2);  
59 - textAndImg3 = view.findViewById(R.id.textAndImg3);  
60 - textAndImg4 = view.findViewById(R.id.textAndImg4);  
61 xBanner = view.findViewById(R.id.xBanner); 60 xBanner = view.findViewById(R.id.xBanner);
62 videoplayer = view.findViewById(R.id.videoplayer); 61 videoplayer = view.findViewById(R.id.videoplayer);
63 tvLocalAddress = view.findViewById(R.id.tvLocalAddress); 62 tvLocalAddress = view.findViewById(R.id.tvLocalAddress);
  63 + layout_control=view.findViewById(R.id.layout_control);
64 64
65 videoplayer.batteryLevel.setVisibility(View.GONE); 65 videoplayer.batteryLevel.setVisibility(View.GONE);
66 videoplayer.replayTextView.setVisibility(View.GONE); 66 videoplayer.replayTextView.setVisibility(View.GONE);
67 videoplayer.backButton.setVisibility(View.GONE); 67 videoplayer.backButton.setVisibility(View.GONE);
68 68
69 - textAndImg1.setTextColor(R.color.textColor);  
70 - textAndImg1.setText("小学");  
71 - textAndImg1.setImgs(R.drawable.play, R.drawable.xiaoxue);  
72 - textAndImg1.setSelect(true);  
73 -  
74 - textAndImg2.setTextColor(R.color.textColor);  
75 - textAndImg2.setText("中学");  
76 - textAndImg2.setImgs(R.drawable.play, R.drawable.zhongxue);  
77 - textAndImg2.setSelect(true);  
78 -  
79 - textAndImg3.setTextColor(R.color.textColor);  
80 - textAndImg3.setText("高中");  
81 - textAndImg3.setImgs(R.drawable.play, R.drawable.gaozhong);  
82 - textAndImg3.setSelect(true);  
83 -  
84 - textAndImg4.setTextColor(R.color.textColor);  
85 - textAndImg4.setText("家长");  
86 - textAndImg4.setImgs(R.drawable.play, R.drawable.parent);  
87 - textAndImg4.setSelect(true);  
88 - 69 + mPresenter.getTools(layout_control);
89 initBanners(); 70 initBanners();
90 71
91 initBroadCast(); 72 initBroadCast();
@@ -94,10 +75,6 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli @@ -94,10 +75,6 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli
94 } 75 }
95 76
96 private void initListeners() { 77 private void initListeners() {
97 - textAndImg1.setOnClickListener(this);  
98 - textAndImg2.setOnClickListener(this);  
99 - textAndImg3.setOnClickListener(this);  
100 - textAndImg4.setOnClickListener(this);  
101 ivSearch.setOnClickListener(this); 78 ivSearch.setOnClickListener(this);
102 tvLocalAddress.setOnClickListener(this); 79 tvLocalAddress.setOnClickListener(this);
103 } 80 }
@@ -127,7 +104,7 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli @@ -127,7 +104,7 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli
127 @NonNull 104 @NonNull
128 @Override 105 @Override
129 public BasePresenter initPresenter() { 106 public BasePresenter initPresenter() {
130 - return null; 107 + return new ConsultPresenter();
131 } 108 }
132 109
133 private byte[] InputStreamToByte(InputStream is) throws IOException { 110 private byte[] InputStreamToByte(InputStream is) throws IOException {
@@ -160,18 +137,6 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli @@ -160,18 +137,6 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli
160 case R.id.tvLocalAddress: 137 case R.id.tvLocalAddress:
161 AppContext.getInstance().startLocation(); 138 AppContext.getInstance().startLocation();
162 break; 139 break;
163 - case R.id.textAndImg1:  
164 - ConsultOneLevelActivity.getInstance(getActivity());  
165 - break;  
166 - case R.id.textAndImg2:  
167 - ConsultOneLevelActivity.getInstance(getActivity());  
168 - break;  
169 - case R.id.textAndImg3:  
170 - ConsultOneLevelActivity.getInstance(getActivity());  
171 - break;  
172 - case R.id.textAndImg4:  
173 - ConsultOneLevelActivity.getInstance(getActivity());  
174 - break;  
175 case R.id.ivSearch://搜索按钮 140 case R.id.ivSearch://搜索按钮
176 141
177 break; 142 break;
@@ -201,4 +166,9 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli @@ -201,4 +166,9 @@ public class ConsultFragment extends BaseMVPCompatFragment implements View.OnCli
201 super.onDestroy(); 166 super.onDestroy();
202 if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver); 167 if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver);
203 } 168 }
  169 +
  170 + @Override
  171 + public void showTools() {
  172 +
  173 + }
204 } 174 }
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
@@ -22,10 +22,14 @@ import com.share.mvpsdk.base.BasePresenter; @@ -22,10 +22,14 @@ import com.share.mvpsdk.base.BasePresenter;
22 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; 22 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter;
23 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; 23 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder;
24 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; 24 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  25 +import com.share.mvpsdk.utils.DisplayUtils;
25 import com.share.mvpsdk.utils.ToastUtils; 26 import com.share.mvpsdk.utils.ToastUtils;
26 import com.shunzhi.parent.AppContext; 27 import com.shunzhi.parent.AppContext;
27 import com.shunzhi.parent.R; 28 import com.shunzhi.parent.R;
28 import com.shunzhi.parent.bean.GrallyBean; 29 import com.shunzhi.parent.bean.GrallyBean;
  30 +import com.shunzhi.parent.contract.consult.ConsultContract;
  31 +import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract;
  32 +import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter;
29 import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; 33 import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity;
30 import com.shunzhi.parent.views.TextAndImgShowView; 34 import com.shunzhi.parent.views.TextAndImgShowView;
31 35
@@ -35,9 +39,9 @@ import java.io.InputStream; @@ -35,9 +39,9 @@ import java.io.InputStream;
35 import java.util.ArrayList; 39 import java.util.ArrayList;
36 import java.util.List; 40 import java.util.List;
37 41
38 -public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements View.OnClickListener { 42 +public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter,ConsultOneContract.IConsultOneModel>
  43 + implements View.OnClickListener,ConsultOneContract.IConsultOneView {
39 44
40 - TextAndImgShowView textAndImg1, textAndImg2, textAndImg3, textAndImg4;  
41 45
42 RecyclerView recyclerViewGrally; 46 RecyclerView recyclerViewGrally;
43 47
@@ -74,71 +78,28 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements Vi @@ -74,71 +78,28 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements Vi
74 private void initViews(View view) { 78 private void initViews(View view) {
75 79
76 layout_control=view.findViewById(R.id.layout_control); 80 layout_control=view.findViewById(R.id.layout_control);
77 - for (int i = 0; i < 10; i++) {  
78 - TextAndImgShowView textAndImgShowView=new TextAndImgShowView(getContext());  
79 - textAndImgShowView.setTextColor(R.color.textColor);  
80 - textAndImgShowView.setText("政策咨询");  
81 - textAndImgShowView.setImgs(R.drawable.play, R.drawable.zczx);  
82 - textAndImgShowView.setSelect(true);  
83 - textAndImgShowView.setWidth(1);  
84 - layout_control.addView(textAndImgShowView);  
85 - }  
86 -  
87 - textAndImg1 = view.findViewById(R.id.textAndImg1);  
88 - textAndImg2 = view.findViewById(R.id.textAndImg2);  
89 - textAndImg3 = view.findViewById(R.id.textAndImg3);  
90 - textAndImg4 = view.findViewById(R.id.textAndImg4); 81 + layout_control.measure(0,0);
  82 + mPresenter.getTools(layout_control);
91 recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); 83 recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally);
92 84
93 - textAndImg1.setTextColor(R.color.textColor);  
94 - textAndImg1.setText("政策咨询");  
95 - textAndImg1.setImgs(R.drawable.play, R.drawable.zczx);  
96 - textAndImg1.setSelect(true);  
97 -  
98 - textAndImg2.setTextColor(R.color.textColor);  
99 - textAndImg2.setText("公办/民办小学");  
100 - textAndImg2.setImgs(R.drawable.play, R.drawable.gbxx);  
101 - textAndImg2.setSelect(true);  
102 -  
103 - textAndImg3.setTextColor(R.color.textColor);  
104 - textAndImg3.setText("学校库");  
105 - textAndImg3.setImgs(R.drawable.play, R.drawable.xxk);  
106 - textAndImg3.setSelect(true);  
107 -  
108 - textAndImg4.setTextColor(R.color.textColor);  
109 - textAndImg4.setText("专题");  
110 - textAndImg4.setImgs(R.drawable.play, R.drawable.zhuanti);  
111 - textAndImg4.setSelect(true);  
112 -  
113 - textAndImg1.setOnClickListener(this);  
114 - textAndImg2.setOnClickListener(this);  
115 - textAndImg3.setOnClickListener(this);  
116 - textAndImg4.setOnClickListener(this);  
117 initRecyclerView(); 85 initRecyclerView();
118 } 86 }
119 87
120 @NonNull 88 @NonNull
121 @Override 89 @Override
122 public BasePresenter initPresenter() { 90 public BasePresenter initPresenter() {
123 - return null; 91 + return new ConsultOnePresenter();
124 } 92 }
125 93
126 @Override 94 @Override
127 public void onClick(View view) { 95 public void onClick(View view) {
128 switch (view.getId()) { 96 switch (view.getId()) {
129 - case R.id.textAndImg1:  
130 - startNewActivity(ConsultTwoLevelActivity.class);  
131 - break;  
132 - case R.id.textAndImg2:  
133 -  
134 - break;  
135 - case R.id.textAndImg3: 97 + }
  98 + }
136 99
137 - break;  
138 - case R.id.textAndImg4: 100 + @Override
  101 + public void showTools() {
139 102
140 - break;  
141 - }  
142 } 103 }
143 104
144 private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GrallyBean> { 105 private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GrallyBean> {
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
1 package com.shunzhi.parent.views; 1 package com.shunzhi.parent.views;
2 2
  3 +import android.app.Activity;
3 import android.content.Context; 4 import android.content.Context;
4 import android.support.annotation.DrawableRes; 5 import android.support.annotation.DrawableRes;
5 import android.support.annotation.Nullable; 6 import android.support.annotation.Nullable;
6 import android.text.Layout; 7 import android.text.Layout;
7 import android.util.AttributeSet; 8 import android.util.AttributeSet;
  9 +import android.util.Log;
8 import android.view.View; 10 import android.view.View;
9 import android.widget.FrameLayout; 11 import android.widget.FrameLayout;
10 import android.widget.ImageView; 12 import android.widget.ImageView;
@@ -67,13 +69,16 @@ public class TextAndImgShowView extends LinearLayout { @@ -67,13 +69,16 @@ public class TextAndImgShowView extends LinearLayout {
67 text.setText(content); 69 text.setText(content);
68 } 70 }
69 71
70 - public void setTextColor(int color){ 72 + public void setTextColor(int color) {
71 text.setTextColor(color); 73 text.setTextColor(color);
72 } 74 }
73 75
74 - public void setWidth(int width) {  
75 - LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);  
76 - params.width= DisplayUtils.px2dp(width); 76 + public void setWidth(Activity activity, View layout_control) {
  77 + Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth());
  78 + LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
  79 + params.width = (DisplayUtils.getScreenWidthPixels(activity) -
  80 + DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight()
  81 + )) / 4;
77 layout.setLayoutParams(params); 82 layout.setLayoutParams(params);
78 } 83 }
79 } 84 }
app/src/main/res/drawable-xhdpi/logo.png 0 → 100644

33.9 KB

app/src/main/res/drawable-xhdpi/xsc.png 0 → 100644

4.81 KB

app/src/main/res/drwable-xxhdpi/logo.png 0 → 100644

33.9 KB

app/src/main/res/layout/fragment_consult_one_level.xml
@@ -4,6 +4,9 @@ @@ -4,6 +4,9 @@
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 android:orientation="vertical" 5 android:orientation="vertical"
6 android:background="@color/bgColor" 6 android:background="@color/bgColor"
  7 + android:paddingTop="@dimen/size_dp_10"
  8 + android:paddingRight="@dimen/size_dp_10"
  9 + android:paddingLeft="@dimen/size_dp_10"
7 tools:context="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment"> 10 tools:context="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment">
8 11
9 <android.support.v7.widget.RecyclerView 12 <android.support.v7.widget.RecyclerView
@@ -11,20 +14,17 @@ @@ -11,20 +14,17 @@
11 android:layout_width="match_parent" 14 android:layout_width="match_parent"
12 android:layout_height="0dp" 15 android:layout_height="0dp"
13 android:layout_weight="1" 16 android:layout_weight="1"
14 - android:layout_marginRight="@dimen/size_dp_10"  
15 - android:layout_marginTop="@dimen/size_dp_10"  
16 - android:layout_marginLeft="@dimen/size_dp_10" 17 + android:layout_marginBottom="@dimen/size_dp_10"
17 ></android.support.v7.widget.RecyclerView> 18 ></android.support.v7.widget.RecyclerView>
18 19
19 <include layout="@layout/layout_textandimgshow"/> 20 <include layout="@layout/layout_textandimgshow"/>
20 21
21 <android.support.v7.widget.RecyclerView 22 <android.support.v7.widget.RecyclerView
  23 + android:layout_marginTop="@dimen/size_dp_10"
22 android:layout_width="match_parent" 24 android:layout_width="match_parent"
23 android:layout_height="0dp" 25 android:layout_height="0dp"
24 android:layout_weight="3" 26 android:layout_weight="3"
25 android:background="@color/white" 27 android:background="@color/white"
26 - android:layout_marginLeft="@dimen/size_dp_10"  
27 - android:layout_marginRight="@dimen/size_dp_10"  
28 ></android.support.v7.widget.RecyclerView> 28 ></android.support.v7.widget.RecyclerView>
29 29
30 </LinearLayout> 30 </LinearLayout>
app/src/main/res/layout/layout_consult_content.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
  4 + android:layout_marginBottom="@dimen/size_dp_10"
4 android:layout_height="wrap_content"> 5 android:layout_height="wrap_content">
5 <LinearLayout 6 <LinearLayout
6 android:layout_width="match_parent" 7 android:layout_width="match_parent"
app/src/main/res/layout/layout_textandimgshow.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 +<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="wrap_content" 4 android:layout_height="wrap_content"
5 - android:layout_margin="@dimen/size_dp_10"  
6 - android:layout_marginBottom="@dimen/size_dp_5"  
7 - android:layout_marginTop="@dimen/size_dp_5"  
8 - android:background="@color/white"  
9 android:orientation="horizontal" 5 android:orientation="horizontal"
10 - android:id="@+id/layout_control"  
11 - android:padding="@dimen/size_dp_10"> 6 + android:scrollbars="none">
12 7
  8 + <HorizontalScrollView
  9 + android:layout_width="match_parent"
  10 + android:layout_height="wrap_content"
  11 + android:scrollbars="none"
13 12
14 - <com.shunzhi.parent.views.TextAndImgShowView  
15 - android:id="@+id/textAndImg1"  
16 - android:layout_width="0dp" 13 + >
  14 + <LinearLayout
  15 + android:id="@+id/layout_control"
  16 + android:layout_width="match_parent"
  17 + android:layout_height="wrap_content"
  18 + android:layout_marginBottom="@dimen/size_dp_5"
  19 + android:layout_marginTop="@dimen/size_dp_5"
  20 + android:background="@color/white"
  21 + android:orientation="horizontal"
  22 + android:padding="@dimen/size_dp_10">
  23 +
  24 + <LinearLayout
  25 + android:visibility="gone"
  26 + android:layout_width="wrap_content"
17 android:layout_height="wrap_content" 27 android:layout_height="wrap_content"
18 - android:layout_weight="1"  
19 - android:background="?android:selectableItemBackground"> 28 + android:orientation="horizontal">
20 29
21 - </com.shunzhi.parent.views.TextAndImgShowView> 30 + <com.shunzhi.parent.views.TextAndImgShowView
  31 + android:id="@+id/textAndImg1"
  32 + android:layout_width="0dp"
  33 + android:layout_height="wrap_content"
  34 + android:layout_weight="1"
  35 + android:background="?android:selectableItemBackground">
22 36
23 - <com.shunzhi.parent.views.TextAndImgShowView  
24 - android:id="@+id/textAndImg2"  
25 - android:layout_width="0dp"  
26 - android:layout_height="wrap_content"  
27 - android:layout_weight="1"  
28 - android:background="?android:selectableItemBackground"> 37 + </com.shunzhi.parent.views.TextAndImgShowView>
29 38
30 - </com.shunzhi.parent.views.TextAndImgShowView> 39 + <com.shunzhi.parent.views.TextAndImgShowView
  40 + android:id="@+id/textAndImg2"
  41 + android:layout_width="0dp"
  42 + android:layout_height="wrap_content"
  43 + android:layout_weight="1"
  44 + android:background="?android:selectableItemBackground">
31 45
32 - <com.shunzhi.parent.views.TextAndImgShowView  
33 - android:id="@+id/textAndImg3"  
34 - android:layout_width="0dp"  
35 - android:layout_height="wrap_content"  
36 - android:layout_weight="1"  
37 - android:background="?android:selectableItemBackground"> 46 + </com.shunzhi.parent.views.TextAndImgShowView>
38 47
39 - </com.shunzhi.parent.views.TextAndImgShowView> 48 + <com.shunzhi.parent.views.TextAndImgShowView
  49 + android:id="@+id/textAndImg3"
  50 + android:layout_width="0dp"
  51 + android:layout_height="wrap_content"
  52 + android:layout_weight="1"
  53 + android:background="?android:selectableItemBackground">
40 54
41 - <com.shunzhi.parent.views.TextAndImgShowView  
42 - android:id="@+id/textAndImg4"  
43 - android:layout_width="0dp"  
44 - android:layout_height="wrap_content"  
45 - android:layout_weight="1"  
46 - android:background="?android:selectableItemBackground"> 55 + </com.shunzhi.parent.views.TextAndImgShowView>
47 56
48 - </com.shunzhi.parent.views.TextAndImgShowView> 57 + <com.shunzhi.parent.views.TextAndImgShowView
  58 + android:id="@+id/textAndImg4"
  59 + android:layout_width="0dp"
  60 + android:layout_height="wrap_content"
  61 + android:layout_weight="1"
  62 + android:background="?android:selectableItemBackground">
49 63
50 -</LinearLayout>  
51 \ No newline at end of file 64 \ No newline at end of file
  65 + </com.shunzhi.parent.views.TextAndImgShowView>
  66 + </LinearLayout>
  67 + </LinearLayout>
  68 + </HorizontalScrollView>
  69 +</android.support.design.widget.CoordinatorLayout>
52 \ No newline at end of file 70 \ No newline at end of file
mvpsdk/build.gradle
@@ -107,6 +107,9 @@ dependencies { @@ -107,6 +107,9 @@ dependencies {
107 //轮播图XBanner 107 //轮播图XBanner
108 compile 'com.xhb:xbanner:1.3.1' 108 compile 'com.xhb:xbanner:1.3.1'
109 109
  110 + //省市区联动
  111 + compile 'me.leefeng:citypicker:1.0'
  112 +
110 //悬浮窗 113 //悬浮窗
111 // compile 'com.github.yhaolpz:FloatWindow:1.0.8' 114 // compile 'com.github.yhaolpz:FloatWindow:1.0.8'
112 115
mvpsdk/src/main/java/com/share/mvpsdk/utils/DBUtils.java
@@ -2,6 +2,7 @@ package com.share.mvpsdk.utils; @@ -2,6 +2,7 @@ package com.share.mvpsdk.utils;
2 2
3 import android.content.ContentValues; 3 import android.content.ContentValues;
4 import android.content.Context; 4 import android.content.Context;
  5 +import android.content.SharedPreferences;
5 import android.database.Cursor; 6 import android.database.Cursor;
6 import android.database.sqlite.SQLiteDatabase; 7 import android.database.sqlite.SQLiteDatabase;
7 import android.database.sqlite.SQLiteOpenHelper; 8 import android.database.sqlite.SQLiteOpenHelper;