Commit 26d3505edd3b38756ec47212127cd323cd4ed10f
Exists in
yxb_dev
and in
2 other branches
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into yxb_dev
# Conflicts: # app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
Showing
34 changed files
with
744 additions
and
264 deletions
Show diff stats
app/build.gradle
| @@ -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 | ||
| @@ -101,6 +101,9 @@ | @@ -101,6 +101,9 @@ | ||
| 101 | android:screenOrientation="portrait" | 101 | android:screenOrientation="portrait" |
| 102 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 102 | android:windowSoftInputMode="adjustPan|stateHidden" /> |
| 103 | <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity"></activity> | 103 | <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity"></activity> |
| 104 | + <activity android:name=".ui.MainActivity" | ||
| 105 | + android:screenOrientation="portrait" | ||
| 106 | + /> | ||
| 104 | </application> | 107 | </application> |
| 105 | 108 | ||
| 106 | </manifest> | 109 | </manifest> |
| 107 | \ No newline at end of file | 110 | \ No newline at end of file |
app/src/main/java/com/shunzhi/parent/AppContext.java
| @@ -106,8 +106,8 @@ public class AppContext extends GlobalApplication { | @@ -106,8 +106,8 @@ public class AppContext extends GlobalApplication { | ||
| 106 | sendBroadcast(intent); | 106 | sendBroadcast(intent); |
| 107 | stopLocation(); | 107 | stopLocation(); |
| 108 | }else { | 108 | }else { |
| 109 | - Log.d("mlocation:","errorCode="+aMapLocation.getErrorCode()+"errorInfo="+aMapLocation.getErrorInfo()); | ||
| 110 | cityName="定位失败"; | 109 | cityName="定位失败"; |
| 110 | + Log.d("mlocation:","errorCode="+aMapLocation.getErrorCode()+"errorInfo="+aMapLocation.getErrorInfo()); | ||
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | } | 113 | } |
app/src/main/java/com/shunzhi/parent/bean/MyConsultBean.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/13. | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +public class MyConsultBean implements Serializable { | ||
| 10 | + | ||
| 11 | + public String consultTitle; | ||
| 12 | + | ||
| 13 | + public String consultContent; | ||
| 14 | + | ||
| 15 | + public String consultCounts; | ||
| 16 | + | ||
| 17 | + public String consultZhuanfaCounts; | ||
| 18 | + | ||
| 19 | + @Override | ||
| 20 | + public String toString() { | ||
| 21 | + return "MyConsultBean{" + | ||
| 22 | + "consultTitle='" + consultTitle + '\'' + | ||
| 23 | + ", consultContent='" + consultContent + '\'' + | ||
| 24 | + ", consultCounts='" + consultCounts + '\'' + | ||
| 25 | + ", consultZhuanfaCounts='" + consultZhuanfaCounts + '\'' + | ||
| 26 | + '}'; | ||
| 27 | + } | ||
| 28 | +} |
| @@ -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
| @@ -125,6 +125,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -125,6 +125,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | @Override | 127 | @Override |
| 128 | + | ||
| 128 | public void getUserInfo(final String mobile, int school_id, String captcha) { | 129 | public void getUserInfo(final String mobile, int school_id, String captcha) { |
| 129 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { | 130 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { |
| 130 | @Override | 131 | @Override |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultOneLevelActivity.java
| @@ -22,7 +22,7 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -22,7 +22,7 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
| 22 | 22 | ||
| 23 | EditText et_search; | 23 | EditText et_search; |
| 24 | 24 | ||
| 25 | - ImageView ivSearch,ivLocalAddress; | 25 | + ImageView ivSearch,ivBack; |
| 26 | @Override | 26 | @Override |
| 27 | protected void initView(Bundle savedInstanceState) { | 27 | protected void initView(Bundle savedInstanceState) { |
| 28 | 28 | ||
| @@ -34,10 +34,10 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -34,10 +34,10 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
| 34 | 34 | ||
| 35 | et_search=findViewById(R.id.et_search); | 35 | et_search=findViewById(R.id.et_search); |
| 36 | ivSearch=findViewById(R.id.ivSearch); | 36 | ivSearch=findViewById(R.id.ivSearch); |
| 37 | - ivLocalAddress=findViewById(R.id.ivLocalAddress); | 37 | + ivBack=findViewById(R.id.ivBack); |
| 38 | 38 | ||
| 39 | ivSearch.setOnClickListener(this); | 39 | ivSearch.setOnClickListener(this); |
| 40 | - ivLocalAddress.setOnClickListener(this); | 40 | + ivBack.setOnClickListener(this); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | @Override | 43 | @Override |
| @@ -51,7 +51,7 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -51,7 +51,7 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
| 51 | case R.id.ivSearch: | 51 | case R.id.ivSearch: |
| 52 | 52 | ||
| 53 | break; | 53 | break; |
| 54 | - case R.id.ivLocalAddress: | 54 | + case R.id.ivBack: |
| 55 | finish(); | 55 | finish(); |
| 56 | break; | 56 | break; |
| 57 | } | 57 | } |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
| 1 | package com.shunzhi.parent.ui.activity.consult; | 1 | package com.shunzhi.parent.ui.activity.consult; |
| 2 | 2 | ||
| 3 | -import android.support.v7.app.AppCompatActivity; | 3 | +import android.support.annotation.NonNull; |
| 4 | +import android.support.annotation.Nullable; | ||
| 4 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | +import android.support.v7.widget.LinearLayoutManager; | ||
| 7 | +import android.support.v7.widget.RecyclerView; | ||
| 8 | +import android.view.LayoutInflater; | ||
| 9 | +import android.view.View; | ||
| 10 | +import android.view.ViewGroup; | ||
| 11 | +import android.widget.EditText; | ||
| 12 | +import android.widget.ImageView; | ||
| 13 | +import android.widget.TextView; | ||
| 5 | 14 | ||
| 6 | -import com.share.mvpsdk.base.activity.BaseCompatActivity; | 15 | +import com.share.mvpsdk.base.BasePresenter; |
| 16 | +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | ||
| 17 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
| 18 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | ||
| 19 | +import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | ||
| 7 | import com.shunzhi.parent.R; | 20 | import com.shunzhi.parent.R; |
| 21 | +import com.shunzhi.parent.bean.MyConsultBean; | ||
| 8 | 22 | ||
| 9 | -public class ConsultTwoLevelActivity extends BaseCompatActivity { | 23 | +import java.util.ArrayList; |
| 24 | +import java.util.List; | ||
| 10 | 25 | ||
| 26 | +public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener { | ||
| 27 | + | ||
| 28 | + ImageView ivBack, ivSearch; | ||
| 29 | + | ||
| 30 | + EditText et_search; | ||
| 31 | + | ||
| 32 | + TextView tvContentName; | ||
| 33 | + | ||
| 34 | + RecyclerView recyclerView; | ||
| 35 | + | ||
| 36 | + MyTwoLevelAdapter myTwoLevelAdapter = null; | ||
| 37 | + | ||
| 38 | + List<MyConsultBean> myConsultBeanList = new ArrayList<>(); | ||
| 11 | 39 | ||
| 12 | @Override | 40 | @Override |
| 13 | protected void initView(Bundle savedInstanceState) { | 41 | protected void initView(Bundle savedInstanceState) { |
| 14 | - | 42 | + initViews(); |
| 15 | } | 43 | } |
| 16 | 44 | ||
| 17 | @Override | 45 | @Override |
| 18 | - protected int getLayoutId() { | 46 | + public int getLayoutId() { |
| 19 | return R.layout.activity_consult_two_level; | 47 | return R.layout.activity_consult_two_level; |
| 20 | } | 48 | } |
| 49 | + | ||
| 50 | + | ||
| 51 | + private void initViews() { | ||
| 52 | + | ||
| 53 | + ivBack = findViewById(R.id.ivBack); | ||
| 54 | + ivBack.setOnClickListener(this); | ||
| 55 | + | ||
| 56 | + et_search = findViewById(R.id.et_search); | ||
| 57 | + | ||
| 58 | + ivSearch = findViewById(R.id.ivSearch); | ||
| 59 | + ivSearch.setOnClickListener(this); | ||
| 60 | + | ||
| 61 | + tvContentName = findViewById(R.id.tvContentName); | ||
| 62 | + tvContentName.setText(""); | ||
| 63 | + | ||
| 64 | + recyclerView = findViewById(R.id.recyclerView); | ||
| 65 | + | ||
| 66 | + initRecyclerView(); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + private void initRecyclerView() { | ||
| 70 | + | ||
| 71 | + if (null == myTwoLevelAdapter) myTwoLevelAdapter = new MyTwoLevelAdapter(); | ||
| 72 | + for (int i = 0; i < 12; i++) { | ||
| 73 | + MyConsultBean myConsultBean = new MyConsultBean(); | ||
| 74 | + myConsultBean.consultCounts = i + ""; | ||
| 75 | + myConsultBean.consultContent = "咨询内容" + i; | ||
| 76 | + myConsultBean.consultTitle = "咨询标题" + i; | ||
| 77 | + myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
| 78 | + myConsultBeanList.add(myConsultBean); | ||
| 79 | + } | ||
| 80 | + myTwoLevelAdapter.addAll(myConsultBeanList); | ||
| 81 | + recyclerView.setAdapter(myTwoLevelAdapter); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + @NonNull | ||
| 85 | + @Override | ||
| 86 | + public BasePresenter initPresenter() { | ||
| 87 | + return null; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Override | ||
| 91 | + public void onClick(View view) { | ||
| 92 | + switch (view.getId()) { | ||
| 93 | + case R.id.ivBack: | ||
| 94 | + back(); | ||
| 95 | + break; | ||
| 96 | + case R.id.ivSearch: | ||
| 97 | + | ||
| 98 | + break; | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + | ||
| 103 | + private class MyTwoLevelAdapter extends BaseRecyclerViewAdapter { | ||
| 104 | + | ||
| 105 | + @Override | ||
| 106 | + public void onAttachedToRecyclerView(RecyclerView recyclerView) { | ||
| 107 | + super.onAttachedToRecyclerView(recyclerView); | ||
| 108 | + LinearLayoutManager layoutManager = new LinearLayoutManager(ConsultTwoLevelActivity.this); | ||
| 109 | + recyclerView.setLayoutManager(layoutManager); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + @Override | ||
| 113 | + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
| 114 | + View view = LayoutInflater.from(ConsultTwoLevelActivity.this).inflate(R.layout.layout_consult_content, parent, false); | ||
| 115 | + return new MyTwoLevelViewHolder(view); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + private class MyTwoLevelViewHolder extends BaseRecyclerViewHolder { | ||
| 119 | + | ||
| 120 | + TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; | ||
| 121 | + ImageView iv_consult; | ||
| 122 | + | ||
| 123 | + public MyTwoLevelViewHolder(View itemView) { | ||
| 124 | + super(itemView); | ||
| 125 | + | ||
| 126 | + tvConsultTitle = itemView.findViewById(R.id.tvConsultTitle); | ||
| 127 | + tvConsultContent = itemView.findViewById(R.id.tvConsultContent); | ||
| 128 | + tvPingLunNums = itemView.findViewById(R.id.tvPingLunNums); | ||
| 129 | + tvZhuanFaNums = itemView.findViewById(R.id.tvZhuanFaNums); | ||
| 130 | + iv_consult = itemView.findViewById(R.id.iv_consult); | ||
| 131 | + | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + @Override | ||
| 135 | + public void onBindViewHolder(Object object, int position) { | ||
| 136 | + | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + | ||
| 141 | + } | ||
| 142 | + | ||
| 21 | } | 143 | } |
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/ReportFragment.java
| @@ -3,34 +3,21 @@ package com.shunzhi.parent.ui.fragment; | @@ -3,34 +3,21 @@ package com.shunzhi.parent.ui.fragment; | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.net.Uri; | 4 | import android.net.Uri; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | -import android.support.annotation.NonNull; | ||
| 7 | -import android.support.annotation.Nullable; | ||
| 8 | import android.support.v4.app.Fragment; | 6 | import android.support.v4.app.Fragment; |
| 9 | import android.view.LayoutInflater; | 7 | import android.view.LayoutInflater; |
| 10 | import android.view.View; | 8 | import android.view.View; |
| 11 | import android.view.ViewGroup; | 9 | import android.view.ViewGroup; |
| 12 | 10 | ||
| 13 | -import com.share.mvpsdk.base.BasePresenter; | ||
| 14 | -import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | ||
| 15 | import com.shunzhi.parent.R; | 11 | import com.shunzhi.parent.R; |
| 16 | 12 | ||
| 17 | -public class ReportFragment extends BaseMVPCompatFragment { | ||
| 18 | - | 13 | +public class ReportFragment extends Fragment { |
| 19 | 14 | ||
| 20 | @Override | 15 | @Override |
| 21 | - public int getLayoutId() { | ||
| 22 | - return R.layout.fragment_report; | 16 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, |
| 17 | + Bundle savedInstanceState) { | ||
| 18 | + // Inflate the layout for this fragment | ||
| 19 | + return inflater.inflate(R.layout.fragment_report, container, false); | ||
| 23 | } | 20 | } |
| 24 | 21 | ||
| 25 | - @Override | ||
| 26 | - public void initUI(View view, @Nullable Bundle savedInstanceState) { | ||
| 27 | - | ||
| 28 | - } | ||
| 29 | 22 | ||
| 30 | - | ||
| 31 | - @NonNull | ||
| 32 | - @Override | ||
| 33 | - public BasePresenter initPresenter() { | ||
| 34 | - return null; | ||
| 35 | - } | ||
| 36 | } | 23 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| @@ -5,6 +5,7 @@ import android.net.Uri; | @@ -5,6 +5,7 @@ import android.net.Uri; | ||
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.support.annotation.NonNull; | 6 | import android.support.annotation.NonNull; |
| 7 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| 8 | +import android.support.design.widget.TabLayout; | ||
| 8 | import android.support.v4.app.Fragment; | 9 | import android.support.v4.app.Fragment; |
| 9 | import android.support.v7.widget.LinearLayoutManager; | 10 | import android.support.v7.widget.LinearLayoutManager; |
| 10 | import android.support.v7.widget.RecyclerView; | 11 | import android.support.v7.widget.RecyclerView; |
| @@ -13,6 +14,7 @@ import android.view.LayoutInflater; | @@ -13,6 +14,7 @@ import android.view.LayoutInflater; | ||
| 13 | import android.view.View; | 14 | import android.view.View; |
| 14 | import android.view.ViewGroup; | 15 | import android.view.ViewGroup; |
| 15 | import android.widget.ImageView; | 16 | import android.widget.ImageView; |
| 17 | +import android.widget.LinearLayout; | ||
| 16 | import android.widget.TextView; | 18 | import android.widget.TextView; |
| 17 | 19 | ||
| 18 | import com.bumptech.glide.Glide; | 20 | import com.bumptech.glide.Glide; |
| @@ -20,10 +22,15 @@ import com.share.mvpsdk.base.BasePresenter; | @@ -20,10 +22,15 @@ import com.share.mvpsdk.base.BasePresenter; | ||
| 20 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 22 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 21 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 23 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 22 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 24 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 25 | +import com.share.mvpsdk.utils.DisplayUtils; | ||
| 23 | import com.share.mvpsdk.utils.ToastUtils; | 26 | import com.share.mvpsdk.utils.ToastUtils; |
| 24 | import com.shunzhi.parent.AppContext; | 27 | import com.shunzhi.parent.AppContext; |
| 25 | import com.shunzhi.parent.R; | 28 | import com.shunzhi.parent.R; |
| 26 | 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; | ||
| 33 | +import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | ||
| 27 | import com.shunzhi.parent.views.TextAndImgShowView; | 34 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 28 | 35 | ||
| 29 | import java.io.ByteArrayOutputStream; | 36 | import java.io.ByteArrayOutputStream; |
| @@ -32,9 +39,9 @@ import java.io.InputStream; | @@ -32,9 +39,9 @@ import java.io.InputStream; | ||
| 32 | import java.util.ArrayList; | 39 | import java.util.ArrayList; |
| 33 | import java.util.List; | 40 | import java.util.List; |
| 34 | 41 | ||
| 35 | -public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements View.OnClickListener { | 42 | +public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter,ConsultOneContract.IConsultOneModel> |
| 43 | + implements View.OnClickListener,ConsultOneContract.IConsultOneView { | ||
| 36 | 44 | ||
| 37 | - TextAndImgShowView textAndImg1, textAndImg2, textAndImg3, textAndImg4; | ||
| 38 | 45 | ||
| 39 | RecyclerView recyclerViewGrally; | 46 | RecyclerView recyclerViewGrally; |
| 40 | 47 | ||
| @@ -42,6 +49,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements Vi | @@ -42,6 +49,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements Vi | ||
| 42 | 49 | ||
| 43 | List<GrallyBean> grallyBeanList = new ArrayList<>(); | 50 | List<GrallyBean> grallyBeanList = new ArrayList<>(); |
| 44 | 51 | ||
| 52 | + LinearLayout layout_control; | ||
| 53 | + | ||
| 45 | @Override | 54 | @Override |
| 46 | public int getLayoutId() { | 55 | public int getLayoutId() { |
| 47 | return R.layout.fragment_consult_one_level; | 56 | return R.layout.fragment_consult_one_level; |
| @@ -68,61 +77,29 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements Vi | @@ -68,61 +77,29 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements Vi | ||
| 68 | 77 | ||
| 69 | private void initViews(View view) { | 78 | private void initViews(View view) { |
| 70 | 79 | ||
| 71 | - textAndImg1 = view.findViewById(R.id.textAndImg1); | ||
| 72 | - textAndImg2 = view.findViewById(R.id.textAndImg2); | ||
| 73 | - textAndImg3 = view.findViewById(R.id.textAndImg3); | ||
| 74 | - textAndImg4 = view.findViewById(R.id.textAndImg4); | 80 | + layout_control=view.findViewById(R.id.layout_control); |
| 81 | + layout_control.measure(0,0); | ||
| 82 | + mPresenter.getTools(layout_control); | ||
| 75 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | 83 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
| 76 | 84 | ||
| 77 | - textAndImg1.setTextColor(R.color.textColor); | ||
| 78 | - textAndImg1.setText("政策咨询"); | ||
| 79 | - textAndImg1.setImgs(R.drawable.play, R.drawable.zczx); | ||
| 80 | - textAndImg1.setSelect(true); | ||
| 81 | - | ||
| 82 | - textAndImg2.setTextColor(R.color.textColor); | ||
| 83 | - textAndImg2.setText("公办/民办小学"); | ||
| 84 | - textAndImg2.setImgs(R.drawable.play, R.drawable.gbxx); | ||
| 85 | - textAndImg2.setSelect(true); | ||
| 86 | - | ||
| 87 | - textAndImg3.setTextColor(R.color.textColor); | ||
| 88 | - textAndImg3.setText("学校库"); | ||
| 89 | - textAndImg3.setImgs(R.drawable.play, R.drawable.xxk); | ||
| 90 | - textAndImg3.setSelect(true); | ||
| 91 | - | ||
| 92 | - textAndImg4.setTextColor(R.color.textColor); | ||
| 93 | - textAndImg4.setText("专题"); | ||
| 94 | - textAndImg4.setImgs(R.drawable.play, R.drawable.zhuanti); | ||
| 95 | - textAndImg4.setSelect(true); | ||
| 96 | - | ||
| 97 | - textAndImg1.setOnClickListener(this); | ||
| 98 | - textAndImg2.setOnClickListener(this); | ||
| 99 | - textAndImg3.setOnClickListener(this); | ||
| 100 | - textAndImg4.setOnClickListener(this); | ||
| 101 | initRecyclerView(); | 85 | initRecyclerView(); |
| 102 | } | 86 | } |
| 103 | 87 | ||
| 104 | @NonNull | 88 | @NonNull |
| 105 | @Override | 89 | @Override |
| 106 | public BasePresenter initPresenter() { | 90 | public BasePresenter initPresenter() { |
| 107 | - return null; | 91 | + return new ConsultOnePresenter(); |
| 108 | } | 92 | } |
| 109 | 93 | ||
| 110 | @Override | 94 | @Override |
| 111 | public void onClick(View view) { | 95 | public void onClick(View view) { |
| 112 | switch (view.getId()) { | 96 | switch (view.getId()) { |
| 113 | - case R.id.textAndImg1: | ||
| 114 | - | ||
| 115 | - break; | ||
| 116 | - case R.id.textAndImg2: | ||
| 117 | - | ||
| 118 | - break; | ||
| 119 | - case R.id.textAndImg3: | 97 | + } |
| 98 | + } | ||
| 120 | 99 | ||
| 121 | - break; | ||
| 122 | - case R.id.textAndImg4: | 100 | + @Override |
| 101 | + public void showTools() { | ||
| 123 | 102 | ||
| 124 | - break; | ||
| 125 | - } | ||
| 126 | } | 103 | } |
| 127 | 104 | ||
| 128 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GrallyBean> { | 105 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GrallyBean> { |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
| @@ -102,6 +102,13 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -102,6 +102,13 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
| 102 | tv_info.setText("已注册,直接登录"); | 102 | tv_info.setText("已注册,直接登录"); |
| 103 | tv_goto.setText("登录"); | 103 | tv_goto.setText("登录"); |
| 104 | } | 104 | } |
| 105 | + | ||
| 106 | + roundedImageView.setOnClickListener(new View.OnClickListener() { | ||
| 107 | + @Override | ||
| 108 | + public void onClick(View view) { | ||
| 109 | + startNewActivity(MainActivity.class); | ||
| 110 | + } | ||
| 111 | + }); | ||
| 105 | } | 112 | } |
| 106 | 113 | ||
| 107 | 114 |
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; |
| 7 | +import android.text.Layout; | ||
| 6 | import android.util.AttributeSet; | 8 | import android.util.AttributeSet; |
| 9 | +import android.util.Log; | ||
| 7 | import android.view.View; | 10 | import android.view.View; |
| 8 | import android.widget.FrameLayout; | 11 | import android.widget.FrameLayout; |
| 9 | import android.widget.ImageView; | 12 | import android.widget.ImageView; |
| 10 | import android.widget.LinearLayout; | 13 | import android.widget.LinearLayout; |
| 11 | import android.widget.TextView; | 14 | import android.widget.TextView; |
| 12 | 15 | ||
| 16 | +import com.share.mvpsdk.utils.DisplayUtils; | ||
| 13 | import com.shunzhi.parent.R; | 17 | import com.shunzhi.parent.R; |
| 14 | 18 | ||
| 15 | 19 | ||
| @@ -65,7 +69,16 @@ public class TextAndImgShowView extends LinearLayout { | @@ -65,7 +69,16 @@ public class TextAndImgShowView extends LinearLayout { | ||
| 65 | text.setText(content); | 69 | text.setText(content); |
| 66 | } | 70 | } |
| 67 | 71 | ||
| 68 | - public void setTextColor(int color){ | 72 | + public void setTextColor(int color) { |
| 69 | text.setTextColor(color); | 73 | text.setTextColor(color); |
| 70 | } | 74 | } |
| 75 | + | ||
| 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; | ||
| 82 | + layout.setLayoutParams(params); | ||
| 83 | + } | ||
| 71 | } | 84 | } |
33.9 KB
4.81 KB
33.9 KB
app/src/main/res/layout/activity_consult_two_level.xml
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | android:textColor="@color/textColor" | 16 | android:textColor="@color/textColor" |
| 17 | android:text="政策咨询" | 17 | android:text="政策咨询" |
| 18 | android:gravity="center" | 18 | android:gravity="center" |
| 19 | + android:id="@+id/tvContentName" | ||
| 19 | android:paddingTop="@dimen/size_dp_5" | 20 | android:paddingTop="@dimen/size_dp_5" |
| 20 | android:paddingBottom="@dimen/size_dp_5" | 21 | android:paddingBottom="@dimen/size_dp_5" |
| 21 | /> | 22 | /> |
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/fragment_zi_xun.xml
| @@ -28,71 +28,7 @@ | @@ -28,71 +28,7 @@ | ||
| 28 | android:textColor="@color/xueqing_blue" | 28 | android:textColor="@color/xueqing_blue" |
| 29 | android:textSize="@dimen/textSize16" /> | 29 | android:textSize="@dimen/textSize16" /> |
| 30 | 30 | ||
| 31 | - <LinearLayout | ||
| 32 | - android:layout_width="match_parent" | ||
| 33 | - android:layout_height="match_parent" | ||
| 34 | - android:layout_marginLeft="@dimen/size_dp_10" | ||
| 35 | - android:layout_marginRight="@dimen/size_dp_10" | ||
| 36 | - android:background="@color/white"> | ||
| 37 | - | ||
| 38 | - <LinearLayout | ||
| 39 | - android:layout_width="0dp" | ||
| 40 | - android:layout_height="match_parent" | ||
| 41 | - android:layout_weight="4" | ||
| 42 | - android:orientation="vertical" | ||
| 43 | - android:padding="@dimen/size_dp_5"> | ||
| 44 | - | ||
| 45 | - <TextView | ||
| 46 | - android:id="@+id/tvConsultTitle" | ||
| 47 | - android:layout_width="match_parent" | ||
| 48 | - android:layout_height="wrap_content" | ||
| 49 | - android:ellipsize="end" | ||
| 50 | - android:gravity="center_vertical" | ||
| 51 | - android:maxLines="2" | ||
| 52 | - android:text="学校初一段家长统一测试使用家长慧得到良好反馈评价" | ||
| 53 | - android:textColor="@color/textColor" | ||
| 54 | - android:textSize="@dimen/textSize14" /> | ||
| 55 | - | ||
| 56 | - <TextView | ||
| 57 | - android:id="@+id/tvConsultContent" | ||
| 58 | - android:layout_width="match_parent" | ||
| 59 | - android:layout_height="wrap_content" | ||
| 60 | - android:layout_marginTop="@dimen/size_dp_5" | ||
| 61 | - android:ellipsize="end" | ||
| 62 | - android:gravity="center_vertical" | ||
| 63 | - android:maxLines="2" | ||
| 64 | - android:singleLine="true" | ||
| 65 | - android:text="家长表示对孩子学习情况更加了解" | ||
| 66 | - android:textColor="@color/zxlx" | ||
| 67 | - android:textSize="@dimen/textSize14" /> | ||
| 68 | - | ||
| 69 | - <FrameLayout | ||
| 70 | - android:layout_width="match_parent" | ||
| 71 | - android:layout_height="wrap_content" | ||
| 72 | - android:layout_marginTop="@dimen/size_dp_5"> | ||
| 73 | - | ||
| 74 | - <TextView | ||
| 75 | - android:id="@+id/tvPingLunNums" | ||
| 76 | - style="@style/TextView_Wrap_16" | ||
| 77 | - android:layout_gravity="center_vertical" | ||
| 78 | - android:text="评论:30" | ||
| 79 | - android:textSize="@dimen/textSize14" /> | ||
| 80 | - | ||
| 81 | - <TextView | ||
| 82 | - android:id="@+id/tvZhuanFaNums" | ||
| 83 | - style="@style/TextView_Wrap_16" | ||
| 84 | - android:layout_gravity="right|center_vertical" | ||
| 85 | - android:text="转发:50" | ||
| 86 | - android:textSize="@dimen/textSize14" /> | ||
| 87 | - </FrameLayout> | ||
| 88 | - </LinearLayout> | ||
| 89 | - | ||
| 90 | - <ImageView | ||
| 91 | - android:layout_width="0dp" | ||
| 92 | - android:layout_height="match_parent" | ||
| 93 | - android:layout_weight="2" | ||
| 94 | - android:src="@color/xueqing_blue" /> | ||
| 95 | - </LinearLayout> | 31 | + <include layout="@layout/layout_consult_content"/> |
| 96 | 32 | ||
| 97 | </LinearLayout> | 33 | </LinearLayout> |
| 98 | 34 |
| @@ -0,0 +1,72 @@ | @@ -0,0 +1,72 @@ | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:layout_marginBottom="@dimen/size_dp_10" | ||
| 5 | + android:layout_height="wrap_content"> | ||
| 6 | + <LinearLayout | ||
| 7 | + android:layout_width="match_parent" | ||
| 8 | + android:layout_height="match_parent" | ||
| 9 | + android:layout_marginLeft="@dimen/size_dp_10" | ||
| 10 | + android:layout_marginRight="@dimen/size_dp_10" | ||
| 11 | + android:background="@color/white"> | ||
| 12 | + | ||
| 13 | + <LinearLayout | ||
| 14 | + android:layout_width="0dp" | ||
| 15 | + android:layout_height="match_parent" | ||
| 16 | + android:layout_weight="4" | ||
| 17 | + android:orientation="vertical" | ||
| 18 | + android:padding="@dimen/size_dp_5"> | ||
| 19 | + | ||
| 20 | + <TextView | ||
| 21 | + android:id="@+id/tvConsultTitle" | ||
| 22 | + android:layout_width="match_parent" | ||
| 23 | + android:layout_height="wrap_content" | ||
| 24 | + android:ellipsize="end" | ||
| 25 | + android:gravity="center_vertical" | ||
| 26 | + android:maxLines="2" | ||
| 27 | + android:text="学校初一段家长统一测试使用家长慧得到良好反馈评价" | ||
| 28 | + android:textColor="@color/textColor" | ||
| 29 | + android:textSize="@dimen/textSize14" /> | ||
| 30 | + | ||
| 31 | + <TextView | ||
| 32 | + android:id="@+id/tvConsultContent" | ||
| 33 | + android:layout_width="match_parent" | ||
| 34 | + android:layout_height="wrap_content" | ||
| 35 | + android:layout_marginTop="@dimen/size_dp_5" | ||
| 36 | + android:ellipsize="end" | ||
| 37 | + android:gravity="center_vertical" | ||
| 38 | + android:maxLines="2" | ||
| 39 | + android:singleLine="true" | ||
| 40 | + android:text="家长表示对孩子学习情况更加了解" | ||
| 41 | + android:textColor="@color/zxlx" | ||
| 42 | + android:textSize="@dimen/textSize14" /> | ||
| 43 | + | ||
| 44 | + <FrameLayout | ||
| 45 | + android:layout_width="match_parent" | ||
| 46 | + android:layout_height="wrap_content" | ||
| 47 | + android:layout_marginTop="@dimen/size_dp_5"> | ||
| 48 | + | ||
| 49 | + <TextView | ||
| 50 | + android:id="@+id/tvPingLunNums" | ||
| 51 | + style="@style/TextView_Wrap_16" | ||
| 52 | + android:layout_gravity="center_vertical" | ||
| 53 | + android:text="评论:30" | ||
| 54 | + android:textSize="@dimen/textSize14" /> | ||
| 55 | + | ||
| 56 | + <TextView | ||
| 57 | + android:id="@+id/tvZhuanFaNums" | ||
| 58 | + style="@style/TextView_Wrap_16" | ||
| 59 | + android:layout_gravity="right|center_vertical" | ||
| 60 | + android:text="转发:50" | ||
| 61 | + android:textSize="@dimen/textSize14" /> | ||
| 62 | + </FrameLayout> | ||
| 63 | + </LinearLayout> | ||
| 64 | + | ||
| 65 | + <ImageView | ||
| 66 | + android:id="@+id/iv_consult" | ||
| 67 | + android:layout_width="0dp" | ||
| 68 | + android:layout_height="match_parent" | ||
| 69 | + android:layout_weight="2" | ||
| 70 | + android:src="@color/xueqing_blue" /> | ||
| 71 | + </LinearLayout> | ||
| 72 | +</LinearLayout> | ||
| 0 | \ No newline at end of file | 73 | \ No newline at end of file |
app/src/main/res/layout/layout_search_back.xml
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | android:background="@color/titleColor"> | 5 | android:background="@color/titleColor"> |
| 6 | 6 | ||
| 7 | <ImageView | 7 | <ImageView |
| 8 | - android:id="@+id/ivLocalAddress" | 8 | + android:id="@+id/ivBack" |
| 9 | android:layout_width="wrap_content" | 9 | android:layout_width="wrap_content" |
| 10 | android:layout_height="match_parent" | 10 | android:layout_height="match_parent" |
| 11 | android:gravity="center" | 11 | android:gravity="center" |
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:padding="@dimen/size_dp_10"> | 6 | + android:scrollbars="none"> |
| 11 | 7 | ||
| 8 | + <HorizontalScrollView | ||
| 9 | + android:layout_width="match_parent" | ||
| 10 | + android:layout_height="wrap_content" | ||
| 11 | + android:scrollbars="none" | ||
| 12 | 12 | ||
| 13 | - <com.shunzhi.parent.views.TextAndImgShowView | ||
| 14 | - android:id="@+id/textAndImg1" | ||
| 15 | - 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" | ||
| 16 | android:layout_height="wrap_content" | 27 | android:layout_height="wrap_content" |
| 17 | - android:layout_weight="1" | ||
| 18 | - android:background="?android:selectableItemBackground"> | 28 | + android:orientation="horizontal"> |
| 19 | 29 | ||
| 20 | - </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"> | ||
| 21 | 36 | ||
| 22 | - <com.shunzhi.parent.views.TextAndImgShowView | ||
| 23 | - android:id="@+id/textAndImg2" | ||
| 24 | - android:layout_width="0dp" | ||
| 25 | - android:layout_height="wrap_content" | ||
| 26 | - android:layout_weight="1" | ||
| 27 | - android:background="?android:selectableItemBackground"> | 37 | + </com.shunzhi.parent.views.TextAndImgShowView> |
| 28 | 38 | ||
| 29 | - </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"> | ||
| 30 | 45 | ||
| 31 | - <com.shunzhi.parent.views.TextAndImgShowView | ||
| 32 | - android:id="@+id/textAndImg3" | ||
| 33 | - android:layout_width="0dp" | ||
| 34 | - android:layout_height="wrap_content" | ||
| 35 | - android:layout_weight="1" | ||
| 36 | - android:background="?android:selectableItemBackground"> | 46 | + </com.shunzhi.parent.views.TextAndImgShowView> |
| 37 | 47 | ||
| 38 | - </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"> | ||
| 39 | 54 | ||
| 40 | - <com.shunzhi.parent.views.TextAndImgShowView | ||
| 41 | - android:id="@+id/textAndImg4" | ||
| 42 | - android:layout_width="0dp" | ||
| 43 | - android:layout_height="wrap_content" | ||
| 44 | - android:layout_weight="1" | ||
| 45 | - android:background="?android:selectableItemBackground"> | 55 | + </com.shunzhi.parent.views.TextAndImgShowView> |
| 46 | 56 | ||
| 47 | - </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"> | ||
| 48 | 63 | ||
| 49 | -</LinearLayout> | ||
| 50 | \ 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> | ||
| 51 | \ 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; |