Commit 50ca3597ab86709b5119bb16659286917aab12bf
Exists in
yxb_dev
and in
2 other branches
no message
Showing
71 changed files
with
1314 additions
and
678 deletions
Show diff stats
.idea/modules.xml
| ... | ... | @@ -4,8 +4,8 @@ |
| 4 | 4 | <modules> |
| 5 | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
| 6 | 6 | <module fileurl="file://$PROJECT_DIR$/mvpsdk/mvpsdk.iml" filepath="$PROJECT_DIR$/mvpsdk/mvpsdk.iml" /> |
| 7 | - <module fileurl="file://$PROJECT_DIR$/parentWorkHolper.iml" filepath="$PROJECT_DIR$/parentWorkHolper.iml" /> | |
| 8 | 7 | <module fileurl="file://E:\parentwork\parentWorkHolper.iml" filepath="E:\parentwork\parentWorkHolper.iml" /> |
| 8 | + <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> | |
| 9 | 9 | <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" /> |
| 10 | 10 | <module fileurl="file://$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" filepath="$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" /> |
| 11 | 11 | </modules> | ... | ... |
app/src/main/AndroidManifest.xml
| ... | ... | @@ -112,7 +112,8 @@ |
| 112 | 112 | android:name="com.amap.api.v2.apikey" |
| 113 | 113 | android:value="1d130afb822d8a1019e6592cbaf10bcc"/> |
| 114 | 114 | |
| 115 | - <activity android:name=".ui.MainActivity" | |
| 115 | + <activity android:name=".ui.activity.StartActivity" | |
| 116 | + android:launchMode="singleInstance" | |
| 116 | 117 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden"> |
| 117 | 118 | <intent-filter> |
| 118 | 119 | <action android:name="android.intent.action.MAIN"/> |
| ... | ... | @@ -130,40 +131,54 @@ |
| 130 | 131 | <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"/> |
| 131 | 132 | <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> --> |
| 132 | 133 | <activity |
| 133 | - android:name=".ui.activity.StartActivity" | |
| 134 | + android:name=".ui.MainActivity" | |
| 135 | + android:launchMode="singleInstance" | |
| 136 | + android:windowSoftInputMode="adjustPan|stateAlwaysHidden" | |
| 134 | 137 | android:screenOrientation="portrait"/> |
| 135 | 138 | <activity |
| 136 | 139 | android:name=".ui.activity.ChildDetialActivity" |
| 140 | + android:launchMode="singleInstance" | |
| 137 | 141 | android:screenOrientation="portrait" /> |
| 138 | 142 | <activity |
| 139 | 143 | android:name=".ui.activity.binding.CreateChildInfoActivity" |
| 144 | + android:launchMode="singleInstance" | |
| 140 | 145 | android:screenOrientation="portrait" |
| 141 | 146 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
| 142 | 147 | <activity |
| 143 | 148 | android:name=".ui.activity.binding.SelectSchoolActivity" |
| 144 | 149 | android:screenOrientation="portrait" |
| 145 | 150 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
| 146 | - android:windowSoftInputMode="adjustPan|stateHidden" /> | |
| 151 | + | |
| 147 | 152 | <activity android:name=".ui.activity.LoginAndRegistActivity" |
| 148 | 153 | android:screenOrientation="portrait" |
| 149 | 154 | /> |
| 150 | 155 | <activity |
| 151 | 156 | android:name=".ui.activity.PersonInfoActivity" |
| 157 | + android:launchMode="singleInstance" | |
| 152 | 158 | android:screenOrientation="portrait" |
| 153 | 159 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
| 160 | + | |
| 154 | 161 | <activity |
| 155 | 162 | android:name=".ui.activity.binding.CheckInfoActivity" |
| 163 | + android:launchMode="singleInstance" | |
| 156 | 164 | android:screenOrientation="portrait" |
| 157 | 165 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
| 166 | + | |
| 158 | 167 | <activity |
| 159 | 168 | android:name=".ui.activity.binding.InviteCodeActivity" |
| 160 | - | |
| 169 | + android:launchMode="singleInstance" | |
| 161 | 170 | android:screenOrientation="portrait" /> |
| 171 | + | |
| 162 | 172 | <activity |
| 163 | 173 | android:name=".ui.activity.mywebview.WebViewActivity" |
| 174 | + android:launchMode="singleInstance" | |
| 164 | 175 | android:screenOrientation="portrait" /> |
| 165 | - <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" /> | |
| 166 | - <activity android:name=".ui.activity.orderdetail.OrderDetailActivity" /> | |
| 176 | + | |
| 177 | + <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" | |
| 178 | + android:launchMode="singleInstance"/> | |
| 179 | + | |
| 180 | + <activity android:name=".ui.activity.orderdetail.OrderDetailActivity" | |
| 181 | + android:launchMode="singleInstance"/> | |
| 167 | 182 | </application> |
| 168 | 183 | |
| 169 | 184 | </manifest> |
| 170 | 185 | \ No newline at end of file | ... | ... |
app/src/main/java/com/shunzhi/parent/AppConfig.java
| ... | ... | @@ -22,7 +22,10 @@ public class AppConfig { |
| 22 | 22 | public static String USER_SEX = "user_sex"; |
| 23 | 23 | public static String USER_IMAGE = "user_image"; |
| 24 | 24 | public static String PARENT_ID = "parent_id"; |
| 25 | + | |
| 26 | + | |
| 25 | 27 | public static boolean ISLOGIN = false; |
| 28 | + public static boolean ISBINDING = false; | |
| 26 | 29 | |
| 27 | 30 | public static int BINDING_SUCCESS_HEZUO = 1; |
| 28 | 31 | public static int BINDING_SUCCESS_NOT = 2; |
| ... | ... | @@ -33,8 +36,8 @@ public class AppConfig { |
| 33 | 36 | |
| 34 | 37 | //http://campus.myjxt.com/ |
| 35 | 38 | public static String BASE_URL="http://60.190.202.57:1000/"; |
| 36 | - public static String BASE_URL_IMG="http://60.190.202.57:1000"; | |
| 37 | 39 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; |
| 40 | + public static String BASE_URL_FILE="http://60.190.202.57:8196"; | |
| 38 | 41 | |
| 39 | 42 | |
| 40 | 43 | //默认日志保存的路径 | ... | ... |
app/src/main/java/com/shunzhi/parent/AppContext.java
| ... | ... | @@ -3,11 +3,11 @@ package com.shunzhi.parent; |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.Intent; |
| 5 | 5 | import android.content.SharedPreferences; |
| 6 | -import android.util.Log; | |
| 7 | 6 | |
| 8 | 7 | import com.amap.api.location.AMapLocation; |
| 9 | 8 | import com.amap.api.location.AMapLocationClient; |
| 10 | 9 | import com.amap.api.location.AMapLocationClientOption; |
| 10 | +import com.amap.api.location.AMapLocationClientOption.AMapLocationMode; | |
| 11 | 11 | import com.amap.api.location.AMapLocationListener; |
| 12 | 12 | import com.netease.nimlib.sdk.NIMClient; |
| 13 | 13 | import com.netease.nimlib.sdk.SDKOptions; |
| ... | ... | @@ -161,7 +161,8 @@ public class AppContext extends GlobalApplication { |
| 161 | 161 | sendBroadcast(intent); |
| 162 | 162 | stopLocation(); |
| 163 | 163 | } else { |
| 164 | - cityName = "定位失败"; | |
| 164 | + cityName = "定位失败";district="定位失败"; | |
| 165 | + | |
| 165 | 166 | // Log.d("mlocation:","errorCode="+aMapLocation.getErrorCode()+"errorInfo="+aMapLocation.getErrorInfo()); |
| 166 | 167 | } |
| 167 | 168 | ... | ... |
app/src/main/java/com/shunzhi/parent/adapter/ChildAdapter.java
| ... | ... | @@ -11,9 +11,12 @@ import android.widget.TextView; |
| 11 | 11 | import com.google.gson.Gson; |
| 12 | 12 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 13 | 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 14 | +import com.shunzhi.parent.AppConfig; | |
| 15 | +import com.shunzhi.parent.AppContext; | |
| 14 | 16 | import com.shunzhi.parent.R; |
| 15 | 17 | import com.shunzhi.parent.bean.ChildBean; |
| 16 | 18 | import com.shunzhi.parent.ui.activity.ChildDetialActivity; |
| 19 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 17 | 20 | |
| 18 | 21 | /** |
| 19 | 22 | * Created by Administrator on 2018/3/9 0009. |
| ... | ... | @@ -37,26 +40,42 @@ public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean> { |
| 37 | 40 | private class MyViewHolder extends BaseRecyclerViewHolder<ChildBean> { |
| 38 | 41 | |
| 39 | 42 | TextView txt_childname, txt_childclass; |
| 43 | + TextView go_buy; | |
| 40 | 44 | |
| 41 | 45 | |
| 42 | 46 | public MyViewHolder(View view) { |
| 43 | 47 | super(view); |
| 44 | 48 | txt_childname = view.findViewById(R.id.txt_childname); |
| 45 | 49 | txt_childclass = view.findViewById(R.id.txt_childclass); |
| 50 | + go_buy = view.findViewById(R.id.go_buy); | |
| 51 | + | |
| 46 | 52 | } |
| 47 | 53 | |
| 48 | 54 | @Override |
| 49 | 55 | public void onBindViewHolder(final ChildBean object, int position) { |
| 50 | - txt_childname.setText(object.getStudentName()); | |
| 51 | - txt_childclass.setText(object.getSchoolName() + " " + object.getClassName()); | |
| 52 | - itemView.setOnClickListener(new View.OnClickListener() { | |
| 53 | - @Override | |
| 54 | - public void onClick(View v) { | |
| 55 | - Gson g = new Gson(); | |
| 56 | - String jsonString = g.toJson(object, ChildBean.class).toString(); | |
| 57 | - context.startActivity(new Intent().putExtra("childJson", jsonString).setClass(context, ChildDetialActivity.class)); | |
| 58 | - } | |
| 59 | - }); | |
| 56 | + try { | |
| 57 | + txt_childname.setText(object.getStudentName()); | |
| 58 | + txt_childclass.setText(object.getSchoolName() + " " + object.getClassName()); | |
| 59 | + itemView.setOnClickListener(new View.OnClickListener() { | |
| 60 | + @Override | |
| 61 | + public void onClick(View v) { | |
| 62 | + Gson g = new Gson(); | |
| 63 | + String jsonString = g.toJson(object, ChildBean.class).toString(); | |
| 64 | + context.startActivity(new Intent().putExtra("childJson", jsonString).setClass(context, ChildDetialActivity.class)); | |
| 65 | + } | |
| 66 | + }); | |
| 67 | + | |
| 68 | + go_buy.setOnClickListener(new View.OnClickListener() { | |
| 69 | + @Override | |
| 70 | + public void onClick(View v) { | |
| 71 | + WebViewActivity.getInstance(context, | |
| 72 | + AppConfig.BASE_URL_ORDER + "/ParentOrderCenter.aspx?userid=" + | |
| 73 | + AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID), AppConfig.ORDER_CENTER); | |
| 74 | + } | |
| 75 | + }); | |
| 76 | + } catch (Exception e) { | |
| 77 | + e.printStackTrace(); | |
| 78 | + } | |
| 60 | 79 | } |
| 61 | 80 | |
| 62 | 81 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/adapter/ContextAdapter.java
| ... | ... | @@ -1,66 +0,0 @@ |
| 1 | -package com.shunzhi.parent.adapter; | |
| 2 | - | |
| 3 | -import android.content.Context; | |
| 4 | -import android.view.LayoutInflater; | |
| 5 | -import android.view.View; | |
| 6 | -import android.view.ViewGroup; | |
| 7 | -import android.widget.ImageView; | |
| 8 | -import android.widget.TextView; | |
| 9 | - | |
| 10 | -import com.bumptech.glide.Glide; | |
| 11 | -import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | |
| 12 | -import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | |
| 13 | -import com.shunzhi.parent.R; | |
| 14 | -import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 15 | - | |
| 16 | -/** | |
| 17 | - * Created by lenovo on 2018/3/18. | |
| 18 | - */ | |
| 19 | - | |
| 20 | -public class ContextAdapter extends BaseRecyclerViewAdapter<ChannelContextBean>{ | |
| 21 | - Context context; | |
| 22 | - | |
| 23 | - public ContextAdapter(Context context) { | |
| 24 | - this.context = context; | |
| 25 | - } | |
| 26 | - | |
| 27 | - | |
| 28 | - @Override | |
| 29 | - public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | |
| 30 | - View view = LayoutInflater.from(context).inflate(R.layout.layout_consult_content, null); | |
| 31 | - return new MyViewHolder(view); | |
| 32 | - } | |
| 33 | - | |
| 34 | - private class MyViewHolder extends BaseRecyclerViewHolder<ChannelContextBean> { | |
| 35 | - TextView tvConsultTitle,tvConsultContent,tvPingLunNums,tvZhuanFaNums; | |
| 36 | - ImageView iv_consult; | |
| 37 | - | |
| 38 | - | |
| 39 | - public MyViewHolder(View view) { | |
| 40 | - super(view); | |
| 41 | - tvConsultContent=view.findViewById(R.id.tvConsultContent); | |
| 42 | - tvConsultTitle=view.findViewById(R.id.tvConsultTitle); | |
| 43 | - tvPingLunNums=view.findViewById(R.id.tvPingLunNums); | |
| 44 | - tvZhuanFaNums=view.findViewById(R.id.tvZhuanFaNums); | |
| 45 | - iv_consult=view.findViewById(R.id.iv_consult); | |
| 46 | - | |
| 47 | - } | |
| 48 | - | |
| 49 | - @Override | |
| 50 | - public void onBindViewHolder(final ChannelContextBean object, int position) { | |
| 51 | - tvConsultTitle.setText(object.getTitle()); | |
| 52 | - tvConsultContent.setText(object.getContent()); | |
| 53 | - Glide.with(context).load(object.getImage()).placeholder(R.color.xueqing_blue) | |
| 54 | - .into(iv_consult); | |
| 55 | - | |
| 56 | - | |
| 57 | - | |
| 58 | - | |
| 59 | - | |
| 60 | - } | |
| 61 | - | |
| 62 | - } | |
| 63 | - | |
| 64 | - | |
| 65 | - | |
| 66 | -} |
app/src/main/java/com/shunzhi/parent/adapter/MyConsultAdapter.java
| ... | ... | @@ -3,34 +3,41 @@ package com.shunzhi.parent.adapter; |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.support.v7.widget.LinearLayoutManager; |
| 5 | 5 | import android.support.v7.widget.RecyclerView; |
| 6 | +import android.util.Log; | |
| 6 | 7 | import android.view.LayoutInflater; |
| 7 | 8 | import android.view.View; |
| 8 | 9 | import android.view.ViewGroup; |
| 10 | +import android.widget.FrameLayout; | |
| 9 | 11 | import android.widget.ImageView; |
| 12 | +import android.widget.LinearLayout; | |
| 10 | 13 | import android.widget.TextView; |
| 11 | 14 | |
| 15 | +import com.bumptech.glide.Glide; | |
| 12 | 16 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 13 | 17 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 18 | +import com.shunzhi.parent.AppConfig; | |
| 19 | +import com.shunzhi.parent.AppContext; | |
| 14 | 20 | import com.shunzhi.parent.R; |
| 15 | -import com.shunzhi.parent.bean.MyConsultBean; | |
| 16 | -import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | |
| 21 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 22 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 23 | +import com.shunzhi.parent.util.GlideUtils; | |
| 17 | 24 | |
| 18 | 25 | /** |
| 19 | 26 | * Created by ToaHanDong on 2018/3/14. |
| 20 | 27 | */ |
| 21 | 28 | |
| 22 | -public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { | |
| 29 | +public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean> { | |
| 23 | 30 | |
| 24 | - private Context mContext=null; | |
| 31 | + private Context mContext = null; | |
| 25 | 32 | |
| 26 | - public MyConsultAdapter(Context context){ | |
| 27 | - mContext=context; | |
| 33 | + public MyConsultAdapter(Context context) { | |
| 34 | + mContext = context; | |
| 28 | 35 | } |
| 29 | 36 | |
| 30 | 37 | @Override |
| 31 | 38 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { |
| 32 | 39 | super.onAttachedToRecyclerView(recyclerView); |
| 33 | - LinearLayoutManager layoutManager=new LinearLayoutManager(mContext); | |
| 40 | + LinearLayoutManager layoutManager = new LinearLayoutManager(mContext); | |
| 34 | 41 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL); |
| 35 | 42 | recyclerView.setLayoutManager(layoutManager); |
| 36 | 43 | } |
| ... | ... | @@ -41,25 +48,52 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { |
| 41 | 48 | return new MyConsultViewHolder(view); |
| 42 | 49 | } |
| 43 | 50 | |
| 44 | - private class MyConsultViewHolder extends BaseRecyclerViewHolder<MyConsultBean>{ | |
| 51 | + private class MyConsultViewHolder extends BaseRecyclerViewHolder<ChannelContextBean> { | |
| 45 | 52 | |
| 46 | 53 | TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; |
| 47 | - ImageView iv_consult; | |
| 54 | + ImageView iv_consult, image_ad; | |
| 55 | + FrameLayout frame_ad; | |
| 56 | + LinearLayout normal_content; | |
| 57 | + | |
| 48 | 58 | public MyConsultViewHolder(View itemView) { |
| 49 | 59 | super(itemView); |
| 50 | - tvConsultTitle = itemView.findViewById(R.id.tvConsultTitle); | |
| 51 | 60 | tvConsultContent = itemView.findViewById(R.id.tvConsultContent); |
| 61 | + tvConsultTitle = itemView.findViewById(R.id.tvConsultTitle); | |
| 52 | 62 | tvPingLunNums = itemView.findViewById(R.id.tvPingLunNums); |
| 53 | 63 | tvZhuanFaNums = itemView.findViewById(R.id.tvZhuanFaNums); |
| 54 | 64 | iv_consult = itemView.findViewById(R.id.iv_consult); |
| 65 | + frame_ad = itemView.findViewById(R.id.frame_ad); | |
| 66 | + image_ad = itemView.findViewById(R.id.image_ad); | |
| 67 | + normal_content = itemView.findViewById(R.id.normal_content); | |
| 55 | 68 | } |
| 56 | 69 | |
| 57 | 70 | @Override |
| 58 | - public void onBindViewHolder(MyConsultBean object, int position) { | |
| 59 | - tvConsultContent.setText(object.consultContent); | |
| 60 | - tvConsultTitle.setText(object.consultTitle); | |
| 61 | - tvPingLunNums.setText(object.consultCounts); | |
| 62 | - tvZhuanFaNums.setText(object.consultZhuanfaCounts); | |
| 71 | + public void onBindViewHolder(final ChannelContextBean object, int position) { | |
| 72 | + if (object.getIsAds() == 1) { | |
| 73 | + frame_ad.setVisibility(View.VISIBLE); | |
| 74 | + normal_content.setVisibility(View.GONE); | |
| 75 | + GlideUtils.showImg(mContext,iv_consult,object.getImage()); | |
| 76 | + frame_ad.setOnClickListener(new View.OnClickListener() { | |
| 77 | + @Override | |
| 78 | + public void onClick(View v) { | |
| 79 | + WebViewActivity.getInstance(mContext,object.getUrl(), -1); | |
| 80 | + } | |
| 81 | + }); | |
| 82 | + } else { | |
| 83 | + frame_ad.setVisibility(View.GONE); | |
| 84 | + normal_content.setVisibility(View.VISIBLE); | |
| 85 | + tvConsultTitle.setText(object.getTitle()); | |
| 86 | + tvConsultContent.setText(object.getContent()); | |
| 87 | + GlideUtils.showImg(mContext,iv_consult,object.getImage()); | |
| 88 | + normal_content.setOnClickListener(new View.OnClickListener() { | |
| 89 | + @Override | |
| 90 | + public void onClick(View v) { | |
| 91 | + WebViewActivity.getInstance(mContext, AppConfig.BASE_URL_ORDER | |
| 92 | + +"InformationDetail.aspx?id="+object.getId()+"&areaname="+ AppContext.getInstance().district, -1); | |
| 93 | + } | |
| 94 | + }); | |
| 95 | + } | |
| 96 | + | |
| 63 | 97 | } |
| 64 | 98 | } |
| 65 | 99 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/api/Consult.java
| ... | ... | @@ -15,13 +15,18 @@ import retrofit2.http.Query; |
| 15 | 15 | |
| 16 | 16 | public interface Consult { |
| 17 | 17 | |
| 18 | - @GET("/api/ParentService/GetAds") | |
| 18 | + @GET("api/ParentService/GetAds") | |
| 19 | 19 | Observable<JsonObject> getBanners(@Query("position") String position, @Query("areaName") String areaName); |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | @FormUrlEncoded |
| 23 | - @POST("/api/ParentService/GetChannelInfo") | |
| 23 | + @POST("api/ParentService/GetChannelInfo") | |
| 24 | 24 | Observable<JsonObject> getConsultContent(@Field("areaName") String areaName, @Field("channel") int channel |
| 25 | 25 | , @Field("toFirstPage") int toFirstPage, @Field("pageIndex") int pageIndex); |
| 26 | 26 | |
| 27 | + @FormUrlEncoded | |
| 28 | + @POST("api/ParentService/GetInformationTopic") | |
| 29 | + Observable<JsonObject> getInformationTopic(@Field("keyword") String keyword,@Field("areaName") String areaName, @Field("channel") String channel | |
| 30 | + , @Field("toFirstPage") String toFirstPage, @Field("pageIndex") int pageIndex); | |
| 31 | + | |
| 27 | 32 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/ToolBean.java
| ... | ... | @@ -5,17 +5,17 @@ import java.io.Serializable; |
| 5 | 5 | /** |
| 6 | 6 | * Created by ToaHanDong on 2018/3/14. |
| 7 | 7 | * toolId (integer, optional): 工具ID , |
| 8 | - toolName (string, optional): 工具名称 , | |
| 9 | - toolImage (string, optional): 工具图片 , | |
| 10 | - toolUrl (string, optional): 工具链接 , | |
| 11 | - orderById (integer, optional): 工具排序 | |
| 8 | + * toolName (string, optional): 工具名称 , | |
| 9 | + * toolImage (string, optional): 工具图片 , | |
| 10 | + * toolUrl (string, optional): 工具链接 , | |
| 11 | + * orderById (integer, optional): 工具排序 | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | public class ToolBean implements Serializable { |
| 15 | 15 | |
| 16 | - public ToolBean(String toolImg,String toolName){ | |
| 17 | - this.toolImage=toolImg; | |
| 18 | - this.toolName=toolName; | |
| 16 | + public ToolBean(String toolImg, String toolName) { | |
| 17 | + this.toolImage = toolImg; | |
| 18 | + this.toolName = toolName; | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | |
| ... | ... | @@ -25,13 +25,21 @@ public class ToolBean implements Serializable { |
| 25 | 25 | |
| 26 | 26 | public String toolUrl; |
| 27 | 27 | |
| 28 | + public String toolId; | |
| 28 | 29 | |
| 30 | + public String columnType; | |
| 31 | + | |
| 32 | + public String orderById; | |
| 29 | 33 | |
| 30 | 34 | @Override |
| 31 | 35 | public String toString() { |
| 32 | 36 | return "ToolBean{" + |
| 33 | - "toolImg='" + toolImage + '' + | |
| 37 | + "toolImage='" + toolImage + '' + | |
| 34 | 38 | ", toolName='" + toolName + '\'' + |
| 39 | + ", toolUrl='" + toolUrl + '\'' + | |
| 40 | + ", toolId='" + toolId + '\'' + | |
| 41 | + ", columnType='" + columnType + '\'' + | |
| 42 | + ", orderById='" + orderById + '\'' + | |
| 35 | 43 | '}'; |
| 36 | 44 | } |
| 37 | 45 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/ceping/CepingContract.java
app/src/main/java/com/shunzhi/parent/contract/consult/consultone/ConsultOneContract.java
| ... | ... | @@ -7,6 +7,8 @@ import com.share.mvpsdk.base.BasePresenter; |
| 7 | 7 | import com.share.mvpsdk.base.IBaseFragment; |
| 8 | 8 | import com.share.mvpsdk.base.IBaseModel; |
| 9 | 9 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 10 | +import com.shunzhi.parent.bean.channel.ChannelBean; | |
| 11 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 10 | 12 | |
| 11 | 13 | import java.util.List; |
| 12 | 14 | |
| ... | ... | @@ -24,6 +26,8 @@ public interface ConsultOneContract { |
| 24 | 26 | public abstract void getBanners(String position,String areaName); |
| 25 | 27 | |
| 26 | 28 | public abstract void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex); |
| 29 | + | |
| 30 | + public abstract void getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); | |
| 27 | 31 | } |
| 28 | 32 | |
| 29 | 33 | interface IConsultOneModel extends IBaseModel{ |
| ... | ... | @@ -32,6 +36,8 @@ public interface ConsultOneContract { |
| 32 | 36 | Observable<JsonObject> getBanners(String position,String areaName); |
| 33 | 37 | |
| 34 | 38 | Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex); |
| 39 | + | |
| 40 | + Observable<JsonObject> getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); | |
| 35 | 41 | } |
| 36 | 42 | |
| 37 | 43 | interface IConsultOneView extends IBaseFragment{ |
| ... | ... | @@ -39,7 +45,9 @@ public interface ConsultOneContract { |
| 39 | 45 | |
| 40 | 46 | void showBanners(List<GuangGaoBean> guangGaoBeanList); |
| 41 | 47 | |
| 42 | - void showConsultContent(); | |
| 48 | + void showConsultContent(List<ChannelContextBean> list); | |
| 49 | + | |
| 50 | + void showChannel(List<ChannelBean> list); | |
| 43 | 51 | |
| 44 | 52 | |
| 45 | 53 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
| ... | ... | @@ -41,7 +41,7 @@ public interface MyChildContract { |
| 41 | 41 | |
| 42 | 42 | interface IMyChildView extends IBaseActivity { |
| 43 | 43 | void updateChildList(CurrentBean currentBean); |
| 44 | - void addChildSuccess(); | |
| 44 | + void addChildSuccess(String account,String password); | |
| 45 | 45 | void showClass(List<ChildClass>list); |
| 46 | 46 | void showError(String error); |
| 47 | 47 | ... | ... |
app/src/main/java/com/shunzhi/parent/model/consult/ConsultModel.java
| ... | ... | @@ -6,8 +6,6 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; |
| 6 | 6 | import com.share.mvpsdk.helper.RxHelper; |
| 7 | 7 | import com.shunzhi.parent.AppConfig; |
| 8 | 8 | import com.shunzhi.parent.api.Consult; |
| 9 | -import com.shunzhi.parent.api.LoginRegisterApi; | |
| 10 | -import com.shunzhi.parent.bean.UserInfo; | |
| 11 | 9 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 12 | 10 | |
| 13 | 11 | import io.reactivex.Observable; |
| ... | ... | @@ -32,8 +30,6 @@ public class ConsultModel extends BaseModel implements ConsultContract.IConsultM |
| 32 | 30 | |
| 33 | 31 | @Override |
| 34 | 32 | public Observable<JsonObject> getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex) { |
| 35 | -// return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | |
| 36 | -// .getConsultContent(areaName,channel,toFirstPage,pageIndex); | |
| 37 | 33 | return RetrofitCreateHelper.getInstance().createApi(Consult.class,AppConfig.BASE_URL).getConsultContent(areaName,channel,toFirstPage,pageIndex) |
| 38 | 34 | .compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
| 39 | 35 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/model/consult/consultone/ConsultOneModel.java
| ... | ... | @@ -5,8 +5,8 @@ import com.share.mvpsdk.base.BaseModel; |
| 5 | 5 | import com.share.mvpsdk.helper.RetrofitCreateHelper; |
| 6 | 6 | import com.share.mvpsdk.helper.RxHelper; |
| 7 | 7 | import com.shunzhi.parent.AppConfig; |
| 8 | +import com.shunzhi.parent.AppContext; | |
| 8 | 9 | import com.shunzhi.parent.api.Consult; |
| 9 | -import com.shunzhi.parent.bean.GuangGaoBean; | |
| 10 | 10 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 11 | 11 | |
| 12 | 12 | import io.reactivex.Observable; |
| ... | ... | @@ -35,6 +35,14 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo |
| 35 | 35 | @Override |
| 36 | 36 | public Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { |
| 37 | 37 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) |
| 38 | - .getConsultContent(areaName,channel,toFirstPage,pageIndex); | |
| 38 | + .getConsultContent(areaName,channel,toFirstPage,pageIndex).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
| 39 | 39 | } |
| 40 | + | |
| 41 | + @Override | |
| 42 | + public Observable<JsonObject> getInformationTopic(String keyword, String areaName, String channel, String toFirstPage, int pageIndex) { | |
| 43 | + return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | |
| 44 | + .getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
| 45 | + } | |
| 46 | + | |
| 47 | + | |
| 40 | 48 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/ceping/CePingPresenter.java
| 1 | 1 | package com.shunzhi.parent.presenter.ceping; |
| 2 | 2 | |
| 3 | +import android.util.Log; | |
| 3 | 4 | import android.view.View; |
| 4 | 5 | import android.widget.LinearLayout; |
| 5 | 6 | |
| ... | ... | @@ -14,7 +15,11 @@ import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
| 14 | 15 | import com.shunzhi.parent.util.AttrsUtils; |
| 15 | 16 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 16 | 17 | |
| 18 | +import java.util.ArrayList; | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 17 | 21 | import io.reactivex.functions.Consumer; |
| 22 | +import timber.log.Timber; | |
| 18 | 23 | |
| 19 | 24 | /** |
| 20 | 25 | * Created by ToaHanDong on 2018/3/14. |
| ... | ... | @@ -38,29 +43,36 @@ public class CePingPresenter extends CepingContract.CePingPresenter { |
| 38 | 43 | mRxManager.register(mIModel.getTools(areaName).subscribe(new Consumer<JsonObject>() { |
| 39 | 44 | @Override |
| 40 | 45 | public void accept(JsonObject jsonObject) throws Exception { |
| 46 | + | |
| 41 | 47 | if (jsonObject.get("status").getAsString().equals("1")){ |
| 42 | 48 | JsonArray jsonArray=jsonObject.getAsJsonArray("data"); |
| 43 | 49 | layout_control.removeAllViews(); |
| 50 | + List<ToolBean> toolBeanList=new ArrayList<>(); | |
| 44 | 51 | for (int i = 0; i < jsonArray.size(); i++) { |
| 45 | 52 | ToolBean toolBean=new Gson().fromJson(jsonArray.get(i).getAsJsonObject(),ToolBean.class); |
| 46 | - TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity()); | |
| 47 | - textAndImgShowView.setTextColor(R.color.textColor); | |
| 48 | - textAndImgShowView.setText(toolBean.toolName); | |
| 49 | - textAndImgShowView.addImgs(toolBean.toolImage); | |
| 50 | - textAndImgShowView.setSelect(true); | |
| 51 | - textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control); | |
| 52 | - textAndImgShowView.setBackground(AttrsUtils.getAttrs(mIView.getBindActivity()).getDrawable(0)); | |
| 53 | - textAndImgShowView.setTag(toolBean); | |
| 54 | - textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
| 55 | - @Override | |
| 56 | - public void onClick(View view) { | |
| 57 | - ToolBean toolBean1= (ToolBean) view.getTag(); | |
| 58 | - WebViewActivity.getInstance(mIView.getBindActivity(),toolBean1.toolUrl,-1); | |
| 59 | - } | |
| 60 | - }); | |
| 61 | - layout_control.addView(textAndImgShowView); | |
| 62 | - mIView.showTools(); | |
| 53 | + if (toolBean.columnType.equals("2")){ | |
| 54 | + TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity()); | |
| 55 | + textAndImgShowView.setTextColor(R.color.textColor); | |
| 56 | + textAndImgShowView.setText(toolBean.toolName); | |
| 57 | + textAndImgShowView.addImgs(toolBean.toolImage); | |
| 58 | + textAndImgShowView.setSelect(true); | |
| 59 | + textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control); | |
| 60 | + textAndImgShowView.setBackground(AttrsUtils.getAttrs(mIView.getBindActivity()).getDrawable(0)); | |
| 61 | + textAndImgShowView.setTag(toolBean); | |
| 62 | + textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
| 63 | + @Override | |
| 64 | + public void onClick(View view) { | |
| 65 | + ToolBean toolBean1= (ToolBean) view.getTag(); | |
| 66 | + WebViewActivity.getInstance(mIView.getBindActivity(),toolBean1.toolUrl,-1); | |
| 67 | + } | |
| 68 | + }); | |
| 69 | + layout_control.addView(textAndImgShowView); | |
| 70 | + } else if (toolBean.columnType.equals("1")){ | |
| 71 | + //活动 | |
| 72 | + toolBeanList.add(toolBean); | |
| 73 | + } | |
| 63 | 74 | } |
| 75 | + mIView.showTools(toolBeanList); | |
| 64 | 76 | }else { |
| 65 | 77 | |
| 66 | 78 | } |
| ... | ... | @@ -71,27 +83,5 @@ public class CePingPresenter extends CepingContract.CePingPresenter { |
| 71 | 83 | |
| 72 | 84 | } |
| 73 | 85 | })); |
| 74 | - /*List<ToolBean> toolBeanList=new ArrayList<>(); | |
| 75 | - toolBeanList.add(new ToolBean(R.drawable.gxzt+"","高校直通")); | |
| 76 | - toolBeanList.add(new ToolBean(R.drawable.zycx+"","专业查询")); | |
| 77 | - toolBeanList.add(new ToolBean(R.drawable.cmyk+"","传媒艺考")); | |
| 78 | - toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜")); | |
| 79 | - for (int i = 0; i < toolBeanList.size(); i++) { | |
| 80 | - TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity()); | |
| 81 | - textAndImgShowView.setTextColor(R.color.textColor); | |
| 82 | - textAndImgShowView.setText(toolBeanList.get(i).toolName); | |
| 83 | - textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImage)); | |
| 84 | - textAndImgShowView.setSelect(true); | |
| 85 | - textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control); | |
| 86 | - textAndImgShowView.setBackground(AttrsUtils.getAttrs(mIView.getBindActivity()).getDrawable(0)); | |
| 87 | - textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
| 88 | - @Override | |
| 89 | - public void onClick(View view) { | |
| 90 | - | |
| 91 | - } | |
| 92 | - }); | |
| 93 | - layout_control.addView(textAndImgShowView); | |
| 94 | - }*/ | |
| 95 | -// mIView.showTools(toolBeanList); | |
| 96 | 86 | } |
| 97 | 87 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
| 1 | 1 | package com.shunzhi.parent.presenter.consult; |
| 2 | 2 | |
| 3 | -import android.content.res.TypedArray; | |
| 4 | -import android.util.Log; | |
| 5 | -import android.util.TypedValue; | |
| 6 | 3 | import android.view.View; |
| 7 | 4 | import android.widget.LinearLayout; |
| 8 | 5 | |
| ... | ... | @@ -10,7 +7,6 @@ import com.google.gson.Gson; |
| 10 | 7 | import com.google.gson.JsonArray; |
| 11 | 8 | import com.google.gson.JsonObject; |
| 12 | 9 | import com.share.mvpsdk.utils.OkHttpExceptionUtil; |
| 13 | -import com.share.mvpsdk.utils.ToastUtils; | |
| 14 | 10 | import com.shunzhi.parent.R; |
| 15 | 11 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 16 | 12 | import com.shunzhi.parent.bean.ToolBean; |
| ... | ... | @@ -19,12 +15,9 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; |
| 19 | 15 | import com.shunzhi.parent.bean.channel.ChannelInfo; |
| 20 | 16 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 21 | 17 | import com.shunzhi.parent.model.consult.ConsultModel; |
| 22 | -import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | |
| 23 | 18 | import com.shunzhi.parent.util.AttrsUtils; |
| 24 | 19 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 25 | 20 | |
| 26 | -import org.json.JSONObject; | |
| 27 | - | |
| 28 | 21 | import java.util.ArrayList; |
| 29 | 22 | import java.util.List; |
| 30 | 23 | |
| ... | ... | @@ -54,7 +47,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
| 54 | 47 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 55 | 48 | @Override |
| 56 | 49 | public void onClick(View view) { |
| 57 | - ConsultOneLevelActivity.getInstance(mIView.getBindActivity()); | |
| 50 | +// ConsultOneLevelActivity.getInstance(mIView.getBindActivity()); | |
| 58 | 51 | } |
| 59 | 52 | }); |
| 60 | 53 | layout_control.addView(textAndImgShowView); |
| ... | ... | @@ -77,7 +70,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
| 77 | 70 | } |
| 78 | 71 | mIView.showBanners(guangGaoBeanList); |
| 79 | 72 | } else { |
| 80 | - ToastUtils.showToast(jsonObject.get("message").getAsString()); | |
| 73 | +// ToastUtils.showToast(jsonObject.get("message").getAsString()); | |
| 81 | 74 | } |
| 82 | 75 | } |
| 83 | 76 | }, new Consumer<Throwable>() { |
| ... | ... | @@ -93,7 +86,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
| 93 | 86 | mRxManager.register(mIModel.getContextChannel(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { |
| 94 | 87 | @Override |
| 95 | 88 | public void accept(JsonObject jsonObject) throws Exception { |
| 96 | - ToastUtils.showToast(jsonObject.toString()); | |
| 89 | +// ToastUtils.showToast(jsonObject.toString()); | |
| 97 | 90 | JsonObject json=jsonObject.getAsJsonObject("data"); |
| 98 | 91 | Gson g=new Gson(); |
| 99 | 92 | ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java
| 1 | 1 | package com.shunzhi.parent.presenter.consult.consultone; |
| 2 | 2 | |
| 3 | +import android.util.Log; | |
| 3 | 4 | import android.view.View; |
| 4 | 5 | import android.widget.LinearLayout; |
| 5 | 6 | |
| 6 | 7 | import com.google.gson.Gson; |
| 7 | 8 | import com.google.gson.JsonArray; |
| 8 | 9 | import com.google.gson.JsonObject; |
| 10 | +import com.share.mvpsdk.utils.OkHttpExceptionUtil; | |
| 9 | 11 | import com.share.mvpsdk.utils.ToastUtils; |
| 10 | 12 | import com.shunzhi.parent.R; |
| 11 | 13 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 12 | 14 | import com.shunzhi.parent.bean.ToolBean; |
| 15 | +import com.shunzhi.parent.bean.channel.ChannelBean; | |
| 16 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 17 | +import com.shunzhi.parent.bean.channel.ChannelInfo; | |
| 13 | 18 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 14 | 19 | import com.shunzhi.parent.model.consult.consultone.ConsultOneModel; |
| 15 | 20 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; |
| ... | ... | @@ -20,6 +25,7 @@ import java.util.ArrayList; |
| 20 | 25 | import java.util.List; |
| 21 | 26 | |
| 22 | 27 | import io.reactivex.functions.Consumer; |
| 28 | +import retrofit2.HttpException; | |
| 23 | 29 | |
| 24 | 30 | /** |
| 25 | 31 | * Created by ToaHanDong on 2018/3/14. |
| ... | ... | @@ -46,7 +52,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
| 46 | 52 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 47 | 53 | @Override |
| 48 | 54 | public void onClick(View view) { |
| 49 | - ConsultTwoLevelActivity.getInstance(mIView.getBindActivity()); | |
| 55 | +// ConsultTwoLevelActivity.getInstance(mIView.getBindActivity()); | |
| 50 | 56 | } |
| 51 | 57 | }); |
| 52 | 58 | } |
| ... | ... | @@ -67,7 +73,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
| 67 | 73 | } |
| 68 | 74 | mIView.showBanners(guangGaoBeanList); |
| 69 | 75 | }else { |
| 70 | - ToastUtils.showToast(jsonObject.get("message").getAsString()); | |
| 76 | +// ToastUtils.showToast(jsonObject.get("message").getAsString()); | |
| 71 | 77 | } |
| 72 | 78 | } |
| 73 | 79 | }, new Consumer<Throwable>() { |
| ... | ... | @@ -80,7 +86,48 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
| 80 | 86 | |
| 81 | 87 | @Override |
| 82 | 88 | public void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { |
| 89 | + mRxManager.register(mIModel.getConsultContent(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { | |
| 90 | + @Override | |
| 91 | + public void accept(JsonObject jsonObject) throws Exception { | |
| 92 | + JsonObject json=jsonObject.getAsJsonObject("data"); | |
| 93 | + Gson g=new Gson(); | |
| 94 | + ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | |
| 95 | +// Log.e("ssss-===",channelInfo.toString()); | |
| 96 | + List<ChannelContextBean> contextList = channelInfo.getChannelContent(); | |
| 97 | + List<ChannelBean> channelList = channelInfo.getSubchannel(); | |
| 98 | + mIView.showChannel(channelList); | |
| 99 | + mIView.showConsultContent(contextList); | |
| 100 | + } | |
| 101 | + }, new Consumer<Throwable>() { | |
| 102 | + @Override | |
| 103 | + public void accept(Throwable throwable) throws Exception { | |
| 104 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 105 | + } | |
| 106 | + })); | |
| 107 | + | |
| 108 | + | |
| 109 | + } | |
| 83 | 110 | |
| 111 | + @Override | |
| 112 | + public void getInformationTopic(String keyword, String areaName, String channel, String toFirstPage,int pageIndex) { | |
| 113 | + mRxManager.register(mIModel.getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).subscribe(new Consumer<JsonObject>() { | |
| 114 | + @Override | |
| 115 | + public void accept(JsonObject jsonObject) throws Exception { | |
| 116 | + JsonObject json=jsonObject.getAsJsonObject("data"); | |
| 117 | + Gson g=new Gson(); | |
| 118 | + ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | |
| 119 | +// Log.e("ssss-===",channelInfo.toString()); | |
| 120 | + List<ChannelContextBean> contextList = channelInfo.getChannelContent(); | |
| 121 | + List<ChannelBean> channelList = channelInfo.getSubchannel(); | |
| 122 | + mIView.showChannel(channelList); | |
| 123 | + mIView.showConsultContent(contextList); | |
| 124 | + } | |
| 125 | + }, new Consumer<Throwable>() { | |
| 126 | + @Override | |
| 127 | + public void accept(Throwable throwable) throws Exception { | |
| 128 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 129 | + } | |
| 130 | + })); | |
| 84 | 131 | } |
| 85 | 132 | |
| 86 | 133 | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| ... | ... | @@ -13,16 +13,19 @@ import com.shunzhi.parent.bean.CurrentBean; |
| 13 | 13 | import com.shunzhi.parent.bean.NIMLoginResultBean; |
| 14 | 14 | import com.shunzhi.parent.bean.UserInfo; |
| 15 | 15 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
| 16 | -import com.shunzhi.parent.manager.MessageManager; | |
| 17 | 16 | import com.shunzhi.parent.model.loginandregister.LoginAndRegisterModel; |
| 18 | 17 | import com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment; |
| 19 | 18 | import com.shunzhi.parent.util.Utils; |
| 20 | 19 | |
| 20 | +import org.json.JSONObject; | |
| 21 | + | |
| 21 | 22 | import java.util.regex.Matcher; |
| 22 | 23 | import java.util.regex.Pattern; |
| 23 | 24 | |
| 24 | 25 | import io.reactivex.functions.Consumer; |
| 26 | +import okhttp3.ResponseBody; | |
| 25 | 27 | import retrofit2.HttpException; |
| 28 | +import retrofit2.Response; | |
| 26 | 29 | import timber.log.Timber; |
| 27 | 30 | |
| 28 | 31 | /** |
| ... | ... | @@ -36,7 +39,8 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 36 | 39 | @Override |
| 37 | 40 | public void loginResult(final String loginName, final String loginPwd) { |
| 38 | 41 | if (!isMate(loginName, REGEX_MOBILE)) { |
| 39 | - ToastUtils.showToast("请输入正确的手机号!!"); | |
| 42 | + | |
| 43 | + mIView.showerror("请输入正确的手机号!!"); | |
| 40 | 44 | return; |
| 41 | 45 | } |
| 42 | 46 | |
| ... | ... | @@ -46,7 +50,6 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 46 | 50 | mRxManager.register(mIModel.getLoginResult(loginName, loginPwd).subscribe(new Consumer<JsonObject>() { |
| 47 | 51 | @Override |
| 48 | 52 | public void accept(JsonObject jsonObject) throws Exception { |
| 49 | - Timber.i("---=== loginResult :%s", jsonObject); | |
| 50 | 53 | try { |
| 51 | 54 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { |
| 52 | 55 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); |
| ... | ... | @@ -65,9 +68,21 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 65 | 68 | }, new Consumer<Throwable>() { |
| 66 | 69 | @Override |
| 67 | 70 | public void accept(Throwable throwable) throws Exception { |
| 68 | - if (null != throwable) | |
| 69 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 70 | -// ToastUtils.showToast(throwable.getMessage()); | |
| 71 | + Response response = ((HttpException) throwable).response(); | |
| 72 | + if (response == null) return; | |
| 73 | + ResponseBody responseBody = response.errorBody(); | |
| 74 | + if (responseBody == null) return; | |
| 75 | + try { | |
| 76 | + JSONObject json = new JSONObject(responseBody.string()); | |
| 77 | +// ToastUtils.showToast(json.optString("message")+"json="+json); | |
| 78 | + if (TextUtils.isEmpty(json.optString("error"))) { | |
| 79 | + mIView.showerror(json.optString("message")); | |
| 80 | + return; | |
| 81 | + } | |
| 82 | + mIView.showerror(json.optString("error")); | |
| 83 | + } catch (Exception e1) { | |
| 84 | + e1.printStackTrace(); | |
| 85 | + } | |
| 71 | 86 | } |
| 72 | 87 | })); |
| 73 | 88 | |
| ... | ... | @@ -89,7 +104,6 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 89 | 104 | @Override |
| 90 | 105 | public void accept(JsonObject jsonObject) throws Exception { |
| 91 | 106 | //TODO 注册成功返回 |
| 92 | - Log.e("1111", jsonObject.toString()); | |
| 93 | 107 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); |
| 94 | 108 | // AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); |
| 95 | 109 | mIView.getUserInfo(1); |
| ... | ... | @@ -97,8 +111,17 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 97 | 111 | }, new Consumer<Throwable>() { |
| 98 | 112 | @Override |
| 99 | 113 | public void accept(Throwable throwable) throws Exception { |
| 100 | - LoginAndRegistFragment.progressDialog.dismiss(); | |
| 101 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 114 | + Response response = ((HttpException) throwable).response(); | |
| 115 | + if (response == null) return; | |
| 116 | + ResponseBody responseBody = response.errorBody(); | |
| 117 | + if (responseBody == null) return; | |
| 118 | + try { | |
| 119 | + JSONObject json = new JSONObject(responseBody.string()); | |
| 120 | +// ToastUtils.showToast(json.optString("message")+"json="+json); | |
| 121 | + mIView.showerror(json.optString("message")); | |
| 122 | + } catch (Exception e1) { | |
| 123 | + e1.printStackTrace(); | |
| 124 | + } | |
| 102 | 125 | } |
| 103 | 126 | })); |
| 104 | 127 | |
| ... | ... | @@ -134,7 +157,6 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 134 | 157 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { |
| 135 | 158 | @Override |
| 136 | 159 | public void accept(UserInfo userInfo) throws Exception { |
| 137 | - Log.d("6666", "userInfo=" + userInfo.toString()); | |
| 138 | 160 | if (userInfo != null) { |
| 139 | 161 | CurrentBean currentBean = userInfo.getData(); |
| 140 | 162 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, currentBean.getMobile()); |
| ... | ... | @@ -143,9 +165,15 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 143 | 165 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_SEX, String.valueOf(currentBean.getSex())); |
| 144 | 166 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.PARENT_ID, String.valueOf(currentBean.getParentId())); |
| 145 | 167 | AppConfig.getAppConfig(AppContext.getContext()).set(AppConfig.USER_ID, currentBean.getUserid()); |
| 168 | + | |
| 169 | + if (currentBean.getStudentClass() != null && currentBean.getStudentClass().size() > 0) { | |
| 170 | + AppConfig.ISBINDING = true; | |
| 171 | + } | |
| 172 | + | |
| 146 | 173 | String account = currentBean.getUserid(); |
| 147 | 174 | String token = Utils.MD5(account); |
| 148 | 175 | nimLogin(account, token); |
| 176 | + | |
| 149 | 177 | mIView.getUserInfo(0); |
| 150 | 178 | |
| 151 | 179 | } else { |
| ... | ... | @@ -156,8 +184,19 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 156 | 184 | }, new Consumer<Throwable>() { |
| 157 | 185 | @Override |
| 158 | 186 | public void accept(Throwable throwable) throws Exception { |
| 159 | - LoginAndRegistFragment.progressDialog.dismiss(); | |
| 160 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 187 | + Response response = ((HttpException) throwable).response(); | |
| 188 | + if (response == null) return; | |
| 189 | + ResponseBody responseBody = response.errorBody(); | |
| 190 | + if (responseBody == null) return; | |
| 191 | + try { | |
| 192 | + JSONObject json = new JSONObject(responseBody.string()); | |
| 193 | +// ToastUtils.showToast(json.optString("message")+"json="+json); | |
| 194 | + mIView.showerror(json.optString("message")); | |
| 195 | + } catch (Exception e1) { | |
| 196 | + e1.printStackTrace(); | |
| 197 | + } | |
| 198 | + | |
| 199 | +// OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 161 | 200 | } |
| 162 | 201 | })); |
| 163 | 202 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
| 1 | 1 | package com.shunzhi.parent.presenter.mine; |
| 2 | 2 | |
| 3 | +import android.util.Log; | |
| 4 | + | |
| 3 | 5 | import com.google.gson.JsonObject; |
| 4 | 6 | import com.share.mvpsdk.utils.OkHttpExceptionUtil; |
| 5 | 7 | import com.share.mvpsdk.utils.ToastUtils; |
| ... | ... | @@ -47,14 +49,14 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { |
| 47 | 49 | }, new Consumer<Throwable>() { |
| 48 | 50 | @Override |
| 49 | 51 | public void accept(Throwable throwable) throws Exception { |
| 50 | - Response response = ((HttpException)throwable).response(); | |
| 51 | - if (response==null)return; | |
| 52 | + Response response = ((HttpException) throwable).response(); | |
| 53 | + if (response == null) return; | |
| 52 | 54 | ResponseBody responseBody = response.errorBody(); |
| 53 | - if (responseBody==null)return; | |
| 55 | + if (responseBody == null) return; | |
| 54 | 56 | try { |
| 55 | 57 | JSONObject json = new JSONObject(responseBody.string()); |
| 56 | 58 | mIView.showError(json.optString("message")); |
| 57 | - } catch (Exception e1) { | |
| 59 | + } catch (Exception e1) { | |
| 58 | 60 | e1.printStackTrace(); |
| 59 | 61 | } |
| 60 | 62 | |
| ... | ... | @@ -64,12 +66,18 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { |
| 64 | 66 | } |
| 65 | 67 | |
| 66 | 68 | @Override |
| 67 | - public void addChild( int sex , String studentName,int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | |
| 68 | - mRxManager.register(mIModel.addChildResult(sex,studentName,parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | |
| 69 | + public void addChild(int sex, String studentName, int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | |
| 70 | + mRxManager.register(mIModel.addChildResult(sex, studentName, parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | |
| 69 | 71 | @Override |
| 70 | 72 | public void accept(JsonObject jsonObject) throws Exception { |
| 71 | 73 | ToastUtils.showToast("绑定孩子成功"); |
| 72 | - mIView.addChildSuccess(); | |
| 74 | + if (jsonObject.get("data").toString().equals("null")) { | |
| 75 | + mIView.addChildSuccess("", ""); | |
| 76 | + } else { | |
| 77 | + JsonObject data = jsonObject.getAsJsonObject("data"); | |
| 78 | + mIView.addChildSuccess(data.get("account").getAsString(), data.get("password").getAsString()); | |
| 79 | + } | |
| 80 | + | |
| 73 | 81 | } |
| 74 | 82 | }, new Consumer<Throwable>() { |
| 75 | 83 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/mine/PersonInfoPrasenter.java
| ... | ... | @@ -34,7 +34,7 @@ public class PersonInfoPrasenter extends PersonInfoContract.PersonInfoPresenter |
| 34 | 34 | public void accept(JsonObject jsonObject) throws Exception { |
| 35 | 35 | try { |
| 36 | 36 | if(jsonObject!=null&&jsonObject.get("data").getAsBoolean()) { |
| 37 | - ToastUtils.showToast(jsonObject.toString()); | |
| 37 | +// ToastUtils.showToast(jsonObject.toString()); | |
| 38 | 38 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, parentName); |
| 39 | 39 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_SEX, String.valueOf(sex)); |
| 40 | 40 | mIView.updateInfo(); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/ChildDetialActivity.java
| ... | ... | @@ -3,6 +3,7 @@ package com.shunzhi.parent.ui.activity; |
| 3 | 3 | import android.os.Bundle; |
| 4 | 4 | import android.text.TextUtils; |
| 5 | 5 | import android.view.View; |
| 6 | +import android.widget.ImageView; | |
| 6 | 7 | import android.widget.TextView; |
| 7 | 8 | |
| 8 | 9 | import com.google.gson.Gson; |
| ... | ... | @@ -15,7 +16,8 @@ import com.shunzhi.parent.bean.ChildBean; |
| 15 | 16 | */ |
| 16 | 17 | |
| 17 | 18 | public class ChildDetialActivity extends BaseCompatActivity { |
| 18 | - TextView child_name, child_school, child_class, school_area, student_code,center_title,back; | |
| 19 | + TextView child_name, child_school, child_class, school_area, student_code,center_title; | |
| 20 | + ImageView back; | |
| 19 | 21 | |
| 20 | 22 | @Override |
| 21 | 23 | protected void initView(Bundle savedInstanceState) { | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/LoginAndRegistActivity.java
| 1 | 1 | package com.shunzhi.parent.ui.activity; |
| 2 | 2 | |
| 3 | 3 | import android.os.Bundle; |
| 4 | +import android.util.Log; | |
| 4 | 5 | |
| 5 | 6 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
| 6 | 7 | import com.shunzhi.parent.R; |
| ... | ... | @@ -18,6 +19,7 @@ public class LoginAndRegistActivity extends BaseCompatActivity { |
| 18 | 19 | protected void initView(Bundle savedInstanceState) { |
| 19 | 20 | if (savedInstanceState == null) { |
| 20 | 21 | type = getIntent().getStringExtra("type"); |
| 22 | + Log.e("aaa--==",type); | |
| 21 | 23 | mFragments[0] = LoginAndRegistFragment.getInstance(type); |
| 22 | 24 | loadRootFragment(R.id.frame, mFragments[0]); |
| 23 | 25 | } else { |
| ... | ... | @@ -26,6 +28,15 @@ public class LoginAndRegistActivity extends BaseCompatActivity { |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | 30 | @Override |
| 31 | + protected void onResume() { | |
| 32 | + super.onResume(); | |
| 33 | +// type = getIntent().getStringExtra("type"); | |
| 34 | +// Log.e("aaa--==",type); | |
| 35 | +// mFragments[0] = LoginAndRegistFragment.getInstance(type); | |
| 36 | +// loadRootFragment(R.id.frame, mFragments[0]); | |
| 37 | + } | |
| 38 | + | |
| 39 | + @Override | |
| 29 | 40 | protected int getLayoutId() { |
| 30 | 41 | return R.layout.activity_regist; |
| 31 | 42 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
| ... | ... | @@ -11,6 +11,7 @@ import android.view.LayoutInflater; |
| 11 | 11 | import android.view.View; |
| 12 | 12 | import android.view.ViewGroup; |
| 13 | 13 | import android.view.WindowManager; |
| 14 | +import android.widget.ImageView; | |
| 14 | 15 | import android.widget.PopupWindow; |
| 15 | 16 | import android.widget.TextView; |
| 16 | 17 | |
| ... | ... | @@ -26,6 +27,7 @@ import com.shunzhi.parent.bean.CurrentBean; |
| 26 | 27 | import com.shunzhi.parent.contract.mine.MyChildContract; |
| 27 | 28 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
| 28 | 29 | import com.shunzhi.parent.ui.activity.binding.SelectSchoolActivity; |
| 30 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 29 | 31 | import com.yanzhenjie.recyclerview.swipe.SwipeMenu; |
| 30 | 32 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuBridge; |
| 31 | 33 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuCreator; |
| ... | ... | @@ -43,7 +45,8 @@ import java.util.List; |
| 43 | 45 | public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel> |
| 44 | 46 | implements MyChildContract.IMyChildView, View.OnClickListener { |
| 45 | 47 | SwipeMenuRecyclerView child_recycle; |
| 46 | - TextView back, center_title, add_child; | |
| 48 | + TextView center_title, add_child, go_buy; | |
| 49 | + ImageView back; | |
| 47 | 50 | ChildAdapter childAdapter; |
| 48 | 51 | List<ChildBean> currlist = new ArrayList<>(); |
| 49 | 52 | |
| ... | ... | @@ -59,6 +62,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi |
| 59 | 62 | add_child = findViewById(R.id.add_child); |
| 60 | 63 | child_recycle = findViewById(R.id.child_recycle); |
| 61 | 64 | back = findViewById(R.id.back_top); |
| 65 | + | |
| 62 | 66 | center_title = findViewById(R.id.center_title); |
| 63 | 67 | center_title.setText("我的孩子"); |
| 64 | 68 | add_child.setOnClickListener(this); |
| ... | ... | @@ -119,6 +123,12 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi |
| 119 | 123 | finish(); |
| 120 | 124 | } else if (v == add_child) { |
| 121 | 125 | startActivity(new Intent().setClass(MyChildActivity.this, SelectSchoolActivity.class)); |
| 126 | + } else if (v == go_buy) { | |
| 127 | + Bundle bundle = new Bundle(); | |
| 128 | + bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" + | |
| 129 | + AppConfig.getAppConfig(this).get(AppConfig.USER_ID)); | |
| 130 | + bundle.putInt("type",AppConfig.ORDER_CENTER); | |
| 131 | + startNewActivity(WebViewActivity.class, bundle); | |
| 122 | 132 | } |
| 123 | 133 | } |
| 124 | 134 | |
| ... | ... | @@ -136,7 +146,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi |
| 136 | 146 | } |
| 137 | 147 | |
| 138 | 148 | @Override |
| 139 | - public void addChildSuccess() { | |
| 149 | + public void addChildSuccess(String account,String password) { | |
| 140 | 150 | |
| 141 | 151 | } |
| 142 | 152 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/PersonInfoActivity.java
| ... | ... | @@ -18,6 +18,7 @@ import com.shunzhi.parent.AppContext; |
| 18 | 18 | import com.shunzhi.parent.R; |
| 19 | 19 | import com.shunzhi.parent.contract.mine.PersonInfoContract; |
| 20 | 20 | import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter; |
| 21 | +import com.shunzhi.parent.util.GlideUtils; | |
| 21 | 22 | |
| 22 | 23 | /** |
| 23 | 24 | * Created by Administrator on 2018/3/10 0010. |
| ... | ... | @@ -56,9 +57,11 @@ public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract |
| 56 | 57 | private void initInfo() { |
| 57 | 58 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); |
| 58 | 59 | if (!TextUtils.isEmpty(url)) { |
| 59 | - Glide.with(this).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_image); | |
| 60 | + GlideUtils.showImg(this,user_image,url); | |
| 61 | +// Glide.with(this).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_image); | |
| 60 | 62 | } else { |
| 61 | - Glide.with(this).load(R.drawable.test).centerCrop().into(user_image); | |
| 63 | +// Glide.with(this).load(R.drawable.test).centerCrop().into(user_image); | |
| 64 | + GlideUtils.showImg(this,user_image,url); | |
| 62 | 65 | } |
| 63 | 66 | user_image.setCornerRadius(20); |
| 64 | 67 | user_image.setOval(true); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
| ... | ... | @@ -9,6 +9,7 @@ import android.view.LayoutInflater; |
| 9 | 9 | import android.view.View; |
| 10 | 10 | import android.view.ViewGroup; |
| 11 | 11 | import android.view.WindowManager; |
| 12 | +import android.widget.ImageView; | |
| 12 | 13 | import android.widget.LinearLayout; |
| 13 | 14 | import android.widget.PopupWindow; |
| 14 | 15 | import android.widget.TextView; |
| ... | ... | @@ -38,8 +39,9 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC |
| 38 | 39 | int school_id = 0, isNew, classId, studentId; |
| 39 | 40 | String captcha = ""; |
| 40 | 41 | LinearLayout iphone_layout; |
| 41 | - TextView child_name, child_sex, child_grade, child_class, add_child, user_mobile, back, center_title; | |
| 42 | + TextView child_name, child_sex, child_grade, child_class, add_child, user_mobile, center_title; | |
| 42 | 43 | ChildBean childBean; |
| 44 | + ImageView back; | |
| 43 | 45 | |
| 44 | 46 | @NonNull |
| 45 | 47 | @Override |
| ... | ... | @@ -99,6 +101,7 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC |
| 99 | 101 | right_btn.setOnClickListener(new View.OnClickListener() { |
| 100 | 102 | @Override |
| 101 | 103 | public void onClick(View v) { |
| 104 | + popupWindow.dismiss(); | |
| 102 | 105 | startActivity(new Intent().setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).setClass(CheckInfoActivity.this, MyChildActivity.class)); |
| 103 | 106 | finish(); |
| 104 | 107 | } |
| ... | ... | @@ -149,10 +152,10 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC |
| 149 | 152 | } |
| 150 | 153 | |
| 151 | 154 | @Override |
| 152 | - public void addChildSuccess() { | |
| 155 | + public void addChildSuccess(String account,String password) { | |
| 153 | 156 | // WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); |
| 154 | 157 | WebViewActivity.getInstance(CheckInfoActivity.this, |
| 155 | - AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+ | |
| 158 | + AppConfig.BASE_URL_ORDER+"/RecommendOrder.aspx?userid="+ | |
| 156 | 159 | AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_HEZUO); |
| 157 | 160 | finish(); |
| 158 | 161 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java
| ... | ... | @@ -9,6 +9,7 @@ import android.view.ContextMenu; |
| 9 | 9 | import android.view.MenuItem; |
| 10 | 10 | import android.view.View; |
| 11 | 11 | import android.widget.EditText; |
| 12 | +import android.widget.ImageView; | |
| 12 | 13 | import android.widget.TextView; |
| 13 | 14 | |
| 14 | 15 | import com.share.mvpsdk.base.BasePresenter; |
| ... | ... | @@ -35,8 +36,9 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 35 | 36 | implements MyChildContract.IMyChildView, View.OnClickListener { |
| 36 | 37 | |
| 37 | 38 | int type, school_id, sexId, gradeId, classId; |
| 38 | - TextView select_sex, select_grade, select_class, add_child, center_title, back; | |
| 39 | + TextView select_sex, select_grade, select_class, add_child, center_title; | |
| 39 | 40 | EditText child_name; |
| 41 | + ImageView back; | |
| 40 | 42 | Map<String, Integer> currMap = new ArrayMap<>(); |
| 41 | 43 | List<ChildClass> gradeList = new ArrayList<>(); |
| 42 | 44 | List<ChildClass> classList = new ArrayList<>(); |
| ... | ... | @@ -130,8 +132,9 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 130 | 132 | } |
| 131 | 133 | |
| 132 | 134 | @Override |
| 133 | - public void addChildSuccess() { | |
| 134 | - WebViewActivity.getInstance(CreateChildInfoActivity.this,AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_NOT); | |
| 135 | + public void addChildSuccess(String account,String password) { | |
| 136 | + WebViewActivity.startShow(CreateChildInfoActivity.this,AppConfig.BASE_URL_ORDER+"/RecommendOrder.aspx?userid="+ | |
| 137 | + AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_NOT,account,password,child_name.getText().toString()); | |
| 135 | 138 | finish(); |
| 136 | 139 | } |
| 137 | 140 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/InviteCodeActivity.java
| ... | ... | @@ -6,6 +6,7 @@ import android.support.annotation.NonNull; |
| 6 | 6 | import android.text.TextUtils; |
| 7 | 7 | import android.view.View; |
| 8 | 8 | import android.widget.EditText; |
| 9 | +import android.widget.ImageView; | |
| 9 | 10 | import android.widget.TextView; |
| 10 | 11 | |
| 11 | 12 | import com.share.mvpsdk.base.BasePresenter; |
| ... | ... | @@ -19,9 +20,10 @@ import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
| 19 | 20 | */ |
| 20 | 21 | |
| 21 | 22 | public class InviteCodeActivity extends BaseMVPCompatActivity { |
| 22 | - TextView add_child,center_title,back; | |
| 23 | + TextView add_child,center_title; | |
| 23 | 24 | EditText et_invite_code; |
| 24 | 25 | int school_id; |
| 26 | + ImageView back; | |
| 25 | 27 | |
| 26 | 28 | @NonNull |
| 27 | 29 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
| ... | ... | @@ -6,6 +6,7 @@ import android.support.annotation.NonNull; |
| 6 | 6 | import android.support.v7.widget.LinearLayoutManager; |
| 7 | 7 | import android.support.v7.widget.RecyclerView; |
| 8 | 8 | import android.view.View; |
| 9 | +import android.widget.ImageView; | |
| 9 | 10 | import android.widget.TextView; |
| 10 | 11 | |
| 11 | 12 | import com.share.mvpsdk.base.BasePresenter; |
| ... | ... | @@ -39,7 +40,8 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
| 39 | 40 | View.OnClickListener, SchoolListContract.ISchoolListView, CityPickerListener { |
| 40 | 41 | |
| 41 | 42 | private SideBar sideBar; |
| 42 | - private TextView dialog, go_next, tvLocalAddress, center_title, back; | |
| 43 | + private TextView dialog, go_next, tvLocalAddress, center_title; | |
| 44 | + ImageView back; | |
| 43 | 45 | private RecyclerView schoollist; |
| 44 | 46 | private List<String> list = new ArrayList<>(); |
| 45 | 47 | SchoolListAdapter schoolListAdapter; |
| ... | ... | @@ -69,7 +71,7 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
| 69 | 71 | go_next.setOnClickListener(this); |
| 70 | 72 | tvLocalAddress = findViewById(R.id.tvLocalAddress); |
| 71 | 73 | tvLocalAddress.setOnClickListener(this); |
| 72 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | |
| 74 | + tvLocalAddress.setText(AppContext.getInstance().district); | |
| 73 | 75 | setSchoolList(); |
| 74 | 76 | |
| 75 | 77 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultOneLevelActivity.java
| ... | ... | @@ -2,27 +2,38 @@ package com.shunzhi.parent.ui.activity.consult; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.Intent; |
| 5 | -import android.support.v7.app.AppCompatActivity; | |
| 5 | +import android.support.v4.app.FragmentTransaction; | |
| 6 | 6 | import android.os.Bundle; |
| 7 | 7 | import android.view.View; |
| 8 | 8 | import android.widget.EditText; |
| 9 | +import android.widget.FrameLayout; | |
| 9 | 10 | import android.widget.ImageView; |
| 10 | -import android.widget.TextView; | |
| 11 | 11 | |
| 12 | 12 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
| 13 | +import com.share.mvpsdk.utils.ToastUtils; | |
| 13 | 14 | import com.shunzhi.parent.R; |
| 15 | +import com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment; | |
| 14 | 16 | |
| 15 | -public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener{ | |
| 17 | +public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener { | |
| 16 | 18 | |
| 17 | - | |
| 18 | - public static void getInstance(Context context){ | |
| 19 | - Intent intent=new Intent(context,ConsultOneLevelActivity.class); | |
| 19 | + public static void getInstance(Context context, String channel) { | |
| 20 | + Intent intent = new Intent(context, ConsultOneLevelActivity.class); | |
| 21 | + intent.putExtra("channel", channel); | |
| 20 | 22 | context.startActivity(intent); |
| 21 | 23 | } |
| 22 | 24 | |
| 23 | 25 | EditText et_search; |
| 24 | 26 | |
| 25 | - ImageView ivSearch,ivBack; | |
| 27 | + ImageView ivSearch, ivBack; | |
| 28 | + | |
| 29 | + String channel = ""; | |
| 30 | + | |
| 31 | + FrameLayout frame_consult; | |
| 32 | + | |
| 33 | + FragmentTransaction fragmentTransaction = null; | |
| 34 | + | |
| 35 | + ConsultOneLevelFragment consultOneLevelFragment = null; | |
| 36 | + | |
| 26 | 37 | @Override |
| 27 | 38 | protected void initView(Bundle savedInstanceState) { |
| 28 | 39 | |
| ... | ... | @@ -32,12 +43,22 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. |
| 32 | 43 | |
| 33 | 44 | private void initViews() { |
| 34 | 45 | |
| 35 | - et_search=findViewById(R.id.et_search); | |
| 36 | - ivSearch=findViewById(R.id.ivSearch); | |
| 37 | - ivBack=findViewById(R.id.ivBack); | |
| 46 | + channel = getIntent().getStringExtra("channel"); | |
| 47 | + consultOneLevelFragment = new ConsultOneLevelFragment(); | |
| 48 | + et_search = findViewById(R.id.et_search); | |
| 49 | + ivSearch = findViewById(R.id.ivSearch); | |
| 50 | + ivBack = findViewById(R.id.ivBack); | |
| 51 | + frame_consult = findViewById(R.id.frame_consult); | |
| 38 | 52 | |
| 39 | 53 | ivSearch.setOnClickListener(this); |
| 40 | 54 | ivBack.setOnClickListener(this); |
| 55 | + | |
| 56 | + Bundle bundle = new Bundle(); | |
| 57 | + bundle.putString("channel", channel); | |
| 58 | + consultOneLevelFragment.setArguments(bundle); | |
| 59 | + fragmentTransaction = getSupportFragmentManager().beginTransaction(); | |
| 60 | + fragmentTransaction.add(R.id.frame_consult, consultOneLevelFragment) | |
| 61 | + .show(consultOneLevelFragment).commit(); | |
| 41 | 62 | } |
| 42 | 63 | |
| 43 | 64 | @Override |
| ... | ... | @@ -47,9 +68,9 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. |
| 47 | 68 | |
| 48 | 69 | @Override |
| 49 | 70 | public void onClick(View view) { |
| 50 | - switch (view.getId()){ | |
| 71 | + switch (view.getId()) { | |
| 51 | 72 | case R.id.ivSearch: |
| 52 | - | |
| 73 | + consultOneLevelFragment.showSearchContent(et_search.getText().toString()); | |
| 53 | 74 | break; |
| 54 | 75 | case R.id.ivBack: |
| 55 | 76 | finish(); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
| ... | ... | @@ -2,27 +2,26 @@ package com.shunzhi.parent.ui.activity.consult; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.Intent; |
| 5 | -import android.support.annotation.NonNull; | |
| 6 | 5 | import android.os.Bundle; |
| 7 | -import android.support.v7.widget.RecyclerView; | |
| 6 | +import android.support.annotation.NonNull; | |
| 7 | +import android.support.v4.app.FragmentTransaction; | |
| 8 | 8 | import android.view.View; |
| 9 | 9 | import android.widget.EditText; |
| 10 | +import android.widget.FrameLayout; | |
| 10 | 11 | import android.widget.ImageView; |
| 11 | -import android.widget.TextView; | |
| 12 | 12 | |
| 13 | 13 | import com.share.mvpsdk.base.BasePresenter; |
| 14 | 14 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; |
| 15 | +import com.share.mvpsdk.utils.ToastUtils; | |
| 15 | 16 | import com.shunzhi.parent.R; |
| 16 | -import com.shunzhi.parent.adapter.MyConsultAdapter; | |
| 17 | -import com.shunzhi.parent.bean.MyConsultBean; | |
| 18 | - | |
| 19 | -import java.util.ArrayList; | |
| 20 | -import java.util.List; | |
| 17 | +import com.shunzhi.parent.ui.fragment.consult.ConsultTwoLevelFragment; | |
| 21 | 18 | |
| 22 | 19 | public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener { |
| 23 | 20 | |
| 24 | - public static void getInstance(Context context){ | |
| 21 | + public static void getInstance(Context context,String channel,String titleName){ | |
| 25 | 22 | Intent intent=new Intent(context,ConsultTwoLevelActivity.class); |
| 23 | + intent.putExtra("channel",channel); | |
| 24 | + intent.putExtra("titleName",titleName); | |
| 26 | 25 | context.startActivity(intent); |
| 27 | 26 | } |
| 28 | 27 | |
| ... | ... | @@ -30,6 +29,13 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi |
| 30 | 29 | |
| 31 | 30 | EditText et_search; |
| 32 | 31 | |
| 32 | + String channel,titleName; | |
| 33 | + | |
| 34 | + FrameLayout frame_consult; | |
| 35 | + | |
| 36 | + ConsultTwoLevelFragment consultTwoLevelFragment; | |
| 37 | + | |
| 38 | + FragmentTransaction fragmentTransaction=null; | |
| 33 | 39 | |
| 34 | 40 | @Override |
| 35 | 41 | protected void initView(Bundle savedInstanceState) { |
| ... | ... | @@ -43,14 +49,28 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi |
| 43 | 49 | |
| 44 | 50 | |
| 45 | 51 | private void initViews() { |
| 46 | - | |
| 52 | + channel=getIntent().getStringExtra("channel"); | |
| 53 | + titleName=getIntent().getStringExtra("titleName"); | |
| 47 | 54 | ivBack = findViewById(R.id.ivBack); |
| 48 | 55 | ivBack.setOnClickListener(this); |
| 49 | 56 | |
| 50 | 57 | et_search = findViewById(R.id.et_search); |
| 58 | + consultTwoLevelFragment=new ConsultTwoLevelFragment(); | |
| 59 | + et_search=findViewById(R.id.et_search); | |
| 60 | + ivSearch=findViewById(R.id.ivSearch); | |
| 61 | + ivBack=findViewById(R.id.ivBack); | |
| 62 | + frame_consult=findViewById(R.id.frame_consult); | |
| 51 | 63 | |
| 52 | - ivSearch = findViewById(R.id.ivSearch); | |
| 53 | 64 | ivSearch.setOnClickListener(this); |
| 65 | + ivBack.setOnClickListener(this); | |
| 66 | + | |
| 67 | + Bundle bundle=new Bundle(); | |
| 68 | + bundle.putString("channel",channel); | |
| 69 | + bundle.putString("titleName",titleName); | |
| 70 | + consultTwoLevelFragment.setArguments(bundle); | |
| 71 | + fragmentTransaction=getSupportFragmentManager().beginTransaction(); | |
| 72 | + fragmentTransaction.add(R.id.frame_consult,consultTwoLevelFragment) | |
| 73 | + .show(consultTwoLevelFragment).commit(); | |
| 54 | 74 | |
| 55 | 75 | } |
| 56 | 76 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
| ... | ... | @@ -3,9 +3,7 @@ package com.shunzhi.parent.ui.activity.mywebview; |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.Intent; |
| 5 | 5 | import android.graphics.Bitmap; |
| 6 | -import android.os.Build; | |
| 7 | 6 | import android.os.Bundle; |
| 8 | -import android.support.v7.app.AppCompatActivity; | |
| 9 | 7 | import android.util.Log; |
| 10 | 8 | import android.view.View; |
| 11 | 9 | import android.webkit.JavascriptInterface; |
| ... | ... | @@ -13,6 +11,7 @@ import android.webkit.WebChromeClient; |
| 13 | 11 | import android.webkit.WebSettings; |
| 14 | 12 | import android.webkit.WebView; |
| 15 | 13 | import android.webkit.WebViewClient; |
| 14 | +import android.widget.ImageView; | |
| 16 | 15 | import android.widget.LinearLayout; |
| 17 | 16 | import android.widget.ProgressBar; |
| 18 | 17 | import android.widget.TextView; |
| ... | ... | @@ -20,15 +19,19 @@ import android.widget.TextView; |
| 20 | 19 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
| 21 | 20 | import com.share.mvpsdk.utils.AppUtils; |
| 22 | 21 | import com.share.mvpsdk.utils.NetworkConnectionUtils; |
| 22 | +import com.share.mvpsdk.utils.ToastUtils; | |
| 23 | 23 | import com.share.mvpsdk.widgets.NestedScrollWebView; |
| 24 | 24 | import com.shunzhi.parent.AppConfig; |
| 25 | 25 | import com.shunzhi.parent.R; |
| 26 | +import com.shunzhi.parent.ui.MainActivity; | |
| 26 | 27 | |
| 27 | 28 | public class WebViewActivity extends BaseCompatActivity { |
| 28 | 29 | |
| 29 | 30 | NestedScrollWebView nesteScrollWebView; |
| 30 | 31 | LinearLayout binding_success, binding_success2; |
| 31 | - TextView close,tv_info,zuoye,title_web; | |
| 32 | + ImageView close_btn; | |
| 33 | + TextView tv_info, zuoye, title_web; | |
| 34 | + | |
| 32 | 35 | int type; |
| 33 | 36 | |
| 34 | 37 | private ProgressBar pvWeb; |
| ... | ... | @@ -37,19 +40,47 @@ public class WebViewActivity extends BaseCompatActivity { |
| 37 | 40 | Intent intent = new Intent(context, WebViewActivity.class); |
| 38 | 41 | intent.putExtra("url", url); |
| 39 | 42 | intent.putExtra("type", type); |
| 43 | + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
| 44 | + context.startActivity(intent); | |
| 45 | + } | |
| 46 | + | |
| 47 | + public static void startShow(Context context, String url, int type, String account, String password, String name) { | |
| 48 | + Intent intent = new Intent(context, WebViewActivity.class); | |
| 49 | + intent.putExtra("url", url); | |
| 50 | + intent.putExtra("type", type); | |
| 51 | + intent.putExtra("account", account); | |
| 52 | + intent.putExtra("password", password); | |
| 53 | + intent.putExtra("name", name); | |
| 40 | 54 | context.startActivity(intent); |
| 41 | 55 | } |
| 42 | 56 | |
| 57 | + | |
| 43 | 58 | @Override |
| 44 | 59 | protected void initView(Bundle savedInstanceState) { |
| 45 | - binding_success=findViewById(R.id.binding_success1); | |
| 46 | - binding_success2=findViewById(R.id.binding_success2); | |
| 47 | - close = findViewById(R.id.close_btn); | |
| 60 | + | |
| 61 | +// binding_success = findViewById(R.id.binding_success); | |
| 62 | + | |
| 63 | + binding_success = findViewById(R.id.binding_success1); | |
| 64 | + | |
| 65 | + binding_success2 = findViewById(R.id.binding_success2); | |
| 66 | + close_btn = findViewById(R.id.close_btn); | |
| 48 | 67 | tv_info = findViewById(R.id.tv_info); |
| 49 | 68 | zuoye = findViewById(R.id.zuoye); |
| 50 | 69 | title_web = findViewById(R.id.title_web); |
| 51 | 70 | |
| 52 | - nesteScrollWebView = findViewById(R.id.webView); | |
| 71 | + | |
| 72 | + close_btn.setOnClickListener(new View.OnClickListener() { | |
| 73 | + @Override | |
| 74 | + public void onClick(View v) { | |
| 75 | + onBackPressedSupport(); | |
| 76 | + } | |
| 77 | + }); | |
| 78 | + | |
| 79 | + | |
| 80 | + nesteScrollWebView = findViewById(R.id.nesteScrollWebView); | |
| 81 | + | |
| 82 | +// nesteScrollWebView = findViewById(R.id.webView); | |
| 83 | + | |
| 53 | 84 | pvWeb = findViewById(R.id.pb_web); |
| 54 | 85 | type = getIntent().getIntExtra("type", 0); |
| 55 | 86 | if (type == AppConfig.BINDING_SUCCESS_HEZUO) { |
| ... | ... | @@ -61,15 +92,25 @@ public class WebViewActivity extends BaseCompatActivity { |
| 61 | 92 | binding_success.setVisibility(View.GONE); |
| 62 | 93 | binding_success2.setVisibility(View.VISIBLE); |
| 63 | 94 | title_web.setVisibility(View.GONE); |
| 95 | + String account = getIntent().getStringExtra("account"); | |
| 96 | + String name = getIntent().getStringExtra("name"); | |
| 97 | + String password = getIntent().getStringExtra("password"); | |
| 98 | + | |
| 99 | + tv_info.setText("生成孩子“" + name + "”账号为:" + account + ",初始密码为:" + password + "(与账号相同)。孩子可以下载“汇作业”app进行使用"); | |
| 64 | 100 | |
| 65 | 101 | } else if (type == AppConfig.ORDER_CENTER) { |
| 66 | 102 | binding_success.setVisibility(View.GONE); |
| 67 | 103 | binding_success2.setVisibility(View.GONE); |
| 68 | 104 | title_web.setVisibility(View.VISIBLE); |
| 69 | - }else { | |
| 105 | + | |
| 106 | + } else { | |
| 70 | 107 | binding_success.setVisibility(View.GONE); |
| 71 | 108 | binding_success2.setVisibility(View.GONE); |
| 72 | 109 | title_web.setVisibility(View.GONE); |
| 110 | + LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) nesteScrollWebView.getLayoutParams(); | |
| 111 | + lp.setMargins(0, 0, 0, 0); | |
| 112 | + nesteScrollWebView.setLayoutParams(lp); | |
| 113 | + | |
| 73 | 114 | } |
| 74 | 115 | |
| 75 | 116 | initWebView(); |
| ... | ... | @@ -79,7 +120,7 @@ public class WebViewActivity extends BaseCompatActivity { |
| 79 | 120 | |
| 80 | 121 | @Override |
| 81 | 122 | protected int getLayoutId() { |
| 82 | - return R.layout.activity_webview; | |
| 123 | + return R.layout.activity_web_view; | |
| 83 | 124 | } |
| 84 | 125 | |
| 85 | 126 | @Override |
| ... | ... | @@ -88,6 +129,9 @@ public class WebViewActivity extends BaseCompatActivity { |
| 88 | 129 | nesteScrollWebView.goBack(); |
| 89 | 130 | } else { |
| 90 | 131 | super.onBackPressedSupport(); |
| 132 | + if(type!=-1&&type!= AppConfig.ORDER_CENTER) { | |
| 133 | + startActivity(new Intent().setClass(this, MainActivity.class)); | |
| 134 | + } | |
| 91 | 135 | } |
| 92 | 136 | } |
| 93 | 137 | |
| ... | ... | @@ -111,6 +155,7 @@ public class WebViewActivity extends BaseCompatActivity { |
| 111 | 155 | }); |
| 112 | 156 | } |
| 113 | 157 | } |
| 158 | + | |
| 114 | 159 | // 调起支付宝并跳转到指定页面 |
| 115 | 160 | private void startAlipayActivity(String url) { |
| 116 | 161 | Intent intent; |
| ... | ... | @@ -133,7 +178,8 @@ public class WebViewActivity extends BaseCompatActivity { |
| 133 | 178 | nesteScrollWebView.setWebViewClient(new WebViewClient() { |
| 134 | 179 | @Override |
| 135 | 180 | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
| 136 | - if (url.startsWith("http"))view.loadUrl(url); | |
| 181 | + Log.d("666666", "url=" + url); | |
| 182 | + if (url.startsWith("http")) view.loadUrl(url); | |
| 137 | 183 | // if (url.contains("platformapi/startapp")) { |
| 138 | 184 | // startAlipayActivity(url); |
| 139 | 185 | // android 6.0 两种方式获取intent都可以跳转支付宝成功,7.1测试不成功 |
| ... | ... | @@ -154,11 +200,20 @@ public class WebViewActivity extends BaseCompatActivity { |
| 154 | 200 | // html加载完成之后,添加监听图片的点击js函数 |
| 155 | 201 | addWebImageClickListner(view); |
| 156 | 202 | // toolbar.setTitle(getToolbarTitle()); |
| 203 | + if (nesteScrollWebView.canGoBack()) { | |
| 204 | + binding_success.setVisibility(View.GONE); | |
| 205 | + binding_success2.setVisibility(View.GONE); | |
| 206 | + title_web.setVisibility(View.GONE); | |
| 207 | + } else { | |
| 208 | + | |
| 209 | + } | |
| 157 | 210 | } |
| 158 | 211 | |
| 159 | 212 | @Override |
| 160 | 213 | public void onPageStarted(WebView view, String url, Bitmap favicon) { |
| 161 | - view.getSettings().setJavaScriptEnabled(true); | |
| 214 | +// Log.d("666666","onPageStartedurl="+url); | |
| 215 | +// if (url.startsWith("http"))view.loadUrl(url); | |
| 216 | +// view.getSettings().setJavaScriptEnabled(true); | |
| 162 | 217 | super.onPageStarted(view, url, favicon); |
| 163 | 218 | } |
| 164 | 219 | |
| ... | ... | @@ -190,7 +245,6 @@ public class WebViewActivity extends BaseCompatActivity { |
| 190 | 245 | } |
| 191 | 246 | } |
| 192 | 247 | }); |
| 193 | - | |
| 194 | 248 | nesteScrollWebView.setOnLongClickListener(new View.OnLongClickListener() { |
| 195 | 249 | @Override |
| 196 | 250 | public boolean onLongClick(View v) { |
| ... | ... | @@ -209,6 +263,8 @@ public class WebViewActivity extends BaseCompatActivity { |
| 209 | 263 | } |
| 210 | 264 | |
| 211 | 265 | |
| 266 | + | |
| 267 | + | |
| 212 | 268 | /** |
| 213 | 269 | * 初始化WebSetting |
| 214 | 270 | * | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/orderdetail/OrderDetailActivity.java
| ... | ... | @@ -17,13 +17,16 @@ import com.share.mvpsdk.base.BasePresenter; |
| 17 | 17 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; |
| 18 | 18 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 19 | 19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 20 | +import com.share.mvpsdk.base.adapter.OnItemClickListener; | |
| 20 | 21 | import com.share.mvpsdk.utils.DateUtils; |
| 21 | 22 | import com.share.mvpsdk.utils.DisplayUtils; |
| 23 | +import com.shunzhi.parent.AppConfig; | |
| 22 | 24 | import com.shunzhi.parent.R; |
| 23 | 25 | import com.shunzhi.parent.bean.orderdetail.OrderDetailBean; |
| 24 | 26 | import com.shunzhi.parent.bean.orderdetail.OrderDetailBeanList; |
| 25 | 27 | import com.shunzhi.parent.contract.orderdetail.OrderDetailContract; |
| 26 | 28 | import com.shunzhi.parent.presenter.orederdetail.OrderDetailPresenter; |
| 29 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 27 | 30 | |
| 28 | 31 | import java.util.List; |
| 29 | 32 | |
| ... | ... | @@ -119,6 +122,14 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra |
| 119 | 122 | tvDate.setText(object.date); |
| 120 | 123 | |
| 121 | 124 | myOrderBeanListAdapter.addAll(object.orderList); |
| 125 | + myOrderBeanListAdapter.setOnItemClickListener(new OnItemClickListener() { | |
| 126 | + @Override | |
| 127 | + public void onItemClickListener(Object object, int position) { | |
| 128 | + OrderDetailBeanList orderDetailBeanList= (OrderDetailBeanList) object; | |
| 129 | + WebViewActivity.getInstance(OrderDetailActivity.this, | |
| 130 | + AppConfig.BASE_URL_ORDER+"OrderDetail.aspx?orderid="+orderDetailBeanList.id,-1); | |
| 131 | + } | |
| 132 | + }); | |
| 122 | 133 | |
| 123 | 134 | } |
| 124 | 135 | |
| ... | ... | @@ -145,30 +156,47 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra |
| 145 | 156 | |
| 146 | 157 | private TextView tvStartTIme_EndTime,tvProductName,tvPayState; |
| 147 | 158 | |
| 159 | + private ImageView ivState; | |
| 160 | + | |
| 148 | 161 | public MyOrderBeanListViewHolder(View itemView) { |
| 149 | 162 | super(itemView); |
| 150 | 163 | layout_order_list=itemView.findViewById(R.id.layout_order_list); |
| 151 | 164 | tvStartTIme_EndTime=itemView.findViewById(R.id.tvStartTIme_EndTime); |
| 152 | 165 | tvProductName=itemView.findViewById(R.id.tvProductName); |
| 153 | 166 | tvPayState=itemView.findViewById(R.id.tvPayState); |
| 167 | + ivState=itemView.findViewById(R.id.ivState); | |
| 154 | 168 | } |
| 155 | 169 | |
| 156 | 170 | @Override |
| 157 | - public void onBindViewHolder(OrderDetailBeanList object, int position) { | |
| 171 | + public void onBindViewHolder(final OrderDetailBeanList object, final int position) { | |
| 158 | 172 | tvStartTIme_EndTime.setText(object.saleStartTime.split(" ")[0]+"-"+ |
| 159 | 173 | object.saleEndTime.split(" ")[0]); |
| 160 | 174 | tvProductName.setText(object.productName); |
| 161 | 175 | switch (object.payState){ |
| 162 | 176 | case 0://待支付 |
| 163 | 177 | tvPayState.setText("待支付"); |
| 178 | + ivState.setBackgroundColor(getResources().getColor(R.color.md_red_500)); | |
| 164 | 179 | break; |
| 165 | 180 | case 1://支付成功 |
| 166 | 181 | tvPayState.setText("支付成功"); |
| 182 | + ivState.setImageDrawable(getResources().getDrawable(R.drawable.success)); | |
| 167 | 183 | break; |
| 168 | 184 | case 2://交易关闭 |
| 169 | 185 | tvPayState.setText("交易关闭"); |
| 186 | + ivState.setBackgroundColor(getResources().getColor(R.color.gray)); | |
| 187 | + break; | |
| 188 | + case 3: | |
| 189 | + tvPayState.setText("支付失败"); | |
| 190 | + ivState.setImageDrawable(getResources().getDrawable(R.drawable.close)); | |
| 170 | 191 | break; |
| 171 | 192 | } |
| 193 | + | |
| 194 | + layout_order_list.setOnClickListener(new View.OnClickListener() { | |
| 195 | + @Override | |
| 196 | + public void onClick(View view) { | |
| 197 | + onItemClickListener.onItemClickListener(object,position); | |
| 198 | + } | |
| 199 | + }); | |
| 172 | 200 | } |
| 173 | 201 | } |
| 174 | 202 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| ... | ... | @@ -9,41 +9,44 @@ import android.support.annotation.NonNull; |
| 9 | 9 | import android.support.annotation.Nullable; |
| 10 | 10 | import android.support.design.widget.FloatingActionButton; |
| 11 | 11 | import android.view.View; |
| 12 | -import android.widget.FrameLayout; | |
| 13 | 12 | import android.widget.ImageView; |
| 14 | 13 | import android.widget.LinearLayout; |
| 15 | 14 | import android.widget.TextView; |
| 16 | 15 | |
| 16 | +import com.bumptech.glide.Glide; | |
| 17 | 17 | import com.share.mvpsdk.base.BasePresenter; |
| 18 | 18 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 19 | 19 | import com.share.mvpsdk.utils.ToastUtils; |
| 20 | 20 | import com.shunzhi.parent.AppContext; |
| 21 | 21 | import com.shunzhi.parent.R; |
| 22 | +import com.shunzhi.parent.bean.ToolBean; | |
| 22 | 23 | import com.shunzhi.parent.contract.ceping.CepingContract; |
| 23 | 24 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; |
| 24 | 25 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
| 26 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 27 | +import com.shunzhi.parent.util.GlideUtils; | |
| 25 | 28 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 26 | 29 | |
| 30 | +import java.util.List; | |
| 31 | + | |
| 27 | 32 | import me.leefeng.citypicker.CityPicker; |
| 28 | 33 | import me.leefeng.citypicker.CityPickerListener; |
| 29 | 34 | |
| 30 | 35 | |
| 31 | -public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingPresenter,CepingContract.ICePingModel> implements CepingContract.ICePingView | |
| 32 | - ,View.OnClickListener,CityPickerListener{ | |
| 33 | - | |
| 34 | - TextView tvLocalAddress; | |
| 36 | +public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingPresenter, CepingContract.ICePingModel> implements CepingContract.ICePingView | |
| 37 | + , View.OnClickListener, CityPickerListener { | |
| 35 | 38 | |
| 36 | - ImageView ivCamera; | |
| 39 | + TextView tvLocalAddress, tvCourse1, tvCourse2, tvCourse3; | |
| 37 | 40 | |
| 38 | - TextAndImgShowView textAndImg_xqjc,textAndImg_zxlx; | |
| 41 | + ImageView ivCamera, ivCourse1, ivCourse2, ivCourse3; | |
| 39 | 42 | |
| 40 | - FrameLayout frame_hot1; | |
| 43 | + TextAndImgShowView textAndImg_xqjc, textAndImg_zxlx; | |
| 41 | 44 | |
| 42 | 45 | FloatingActionButton floatingActionButton; |
| 43 | 46 | |
| 44 | 47 | LinearLayout layout_control; |
| 45 | 48 | |
| 46 | - CityPicker cityPicker=null; | |
| 49 | + CityPicker cityPicker = null; | |
| 47 | 50 | |
| 48 | 51 | @Override |
| 49 | 52 | public int getLayoutId() { |
| ... | ... | @@ -53,25 +56,29 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 53 | 56 | @Override |
| 54 | 57 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 55 | 58 | |
| 56 | - ivCamera=view.findViewById(R.id.ivCamera); | |
| 57 | - tvLocalAddress=view.findViewById(R.id.tvLocalAddress); | |
| 58 | - textAndImg_xqjc=view.findViewById(R.id.textAndImg_xqjc); | |
| 59 | - textAndImg_zxlx=view.findViewById(R.id.textAndImg_zxlx); | |
| 60 | - frame_hot1=view.findViewById(R.id.frame_hot1); | |
| 61 | - layout_control=view.findViewById(R.id.layout_control); | |
| 62 | - floatingActionButton=view.findViewById(R.id.floatingActionButton); | |
| 59 | + ivCamera = view.findViewById(R.id.ivCamera); | |
| 60 | + tvLocalAddress = view.findViewById(R.id.tvLocalAddress); | |
| 61 | + textAndImg_xqjc = view.findViewById(R.id.textAndImg_xqjc); | |
| 62 | + textAndImg_zxlx = view.findViewById(R.id.textAndImg_zxlx); | |
| 63 | + layout_control = view.findViewById(R.id.layout_control); | |
| 64 | + floatingActionButton = view.findViewById(R.id.floatingActionButton); | |
| 65 | + tvCourse1 = view.findViewById(R.id.tvCourse1); | |
| 66 | + tvCourse2 = view.findViewById(R.id.tvCourse2); | |
| 67 | + tvCourse3 = view.findViewById(R.id.tvCourse3); | |
| 68 | + ivCourse1 = view.findViewById(R.id.ivCourse1); | |
| 69 | + ivCourse2 = view.findViewById(R.id.ivCourse2); | |
| 70 | + ivCourse3 = view.findViewById(R.id.ivCourse3); | |
| 63 | 71 | |
| 64 | 72 | addTools(); |
| 65 | 73 | |
| 66 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | |
| 67 | 74 | textAndImg_xqjc.setTextColor(R.color.white); |
| 68 | 75 | textAndImg_xqjc.setText("学情检测"); |
| 69 | - textAndImg_xqjc.setImgs(R.drawable.xqjc,R.drawable.xqjc); | |
| 76 | + textAndImg_xqjc.setImgs(R.drawable.xqjc, R.drawable.xqjc); | |
| 70 | 77 | textAndImg_xqjc.setSelect(true); |
| 71 | 78 | |
| 72 | 79 | textAndImg_zxlx.setText("专项训练"); |
| 73 | 80 | textAndImg_zxlx.setTextColor(R.color.white); |
| 74 | - textAndImg_zxlx.setImgs(R.drawable.zxlx,R.drawable.zxlx); | |
| 81 | + textAndImg_zxlx.setImgs(R.drawable.zxlx, R.drawable.zxlx); | |
| 75 | 82 | textAndImg_zxlx.setSelect(true); |
| 76 | 83 | |
| 77 | 84 | initListeners(view); |
| ... | ... | @@ -81,23 +88,21 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 81 | 88 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); |
| 82 | 89 | } |
| 83 | 90 | }); |
| 84 | -// floatingActionButton.setOnClickListeners(new DragFloatActionButton.OnClickListeners() { | |
| 85 | -// @Override | |
| 86 | -// public void onClicks() { | |
| 87 | -// ToastUtils.showToast("dfafdaf"); | |
| 88 | -// } | |
| 89 | -// }); | |
| 90 | 91 | } |
| 91 | 92 | |
| 92 | 93 | private void addTools() { |
| 93 | - layout_control.measure(0,0); | |
| 94 | - mPresenter.getTools(layout_control,AppContext.getInstance().district); | |
| 94 | + layout_control.measure(0, 0); | |
| 95 | + mPresenter.getTools(layout_control, AppContext.getInstance().district); | |
| 95 | 96 | |
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | @Override |
| 99 | 100 | public void onResume() { |
| 100 | 101 | super.onResume(); |
| 102 | +// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | |
| 103 | + tvLocalAddress.setText(AppContext.getInstance().district); | |
| 104 | + addTools(); | |
| 105 | +// } | |
| 101 | 106 | } |
| 102 | 107 | |
| 103 | 108 | private void initListeners(View view) { |
| ... | ... | @@ -112,9 +117,9 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 112 | 117 | |
| 113 | 118 | private void initBroadCast() { |
| 114 | 119 | |
| 115 | - IntentFilter intentFilter=new IntentFilter(); | |
| 116 | - intentFilter.addAction(AppContext.LOCATION_CITYNAME+""); | |
| 117 | - getActivity().registerReceiver(broadcastReceiver,intentFilter); | |
| 120 | + IntentFilter intentFilter = new IntentFilter(); | |
| 121 | + intentFilter.addAction(AppContext.LOCATION_CITYNAME + ""); | |
| 122 | + getActivity().registerReceiver(broadcastReceiver, intentFilter); | |
| 118 | 123 | |
| 119 | 124 | } |
| 120 | 125 | |
| ... | ... | @@ -124,23 +129,25 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 124 | 129 | return new CePingPresenter(); |
| 125 | 130 | } |
| 126 | 131 | |
| 127 | - | |
| 128 | 132 | @Override |
| 129 | 133 | public void onClick(View view) { |
| 130 | - switch (view.getId()){ | |
| 134 | + switch (view.getId()) { | |
| 131 | 135 | case R.id.frame_hot1://热门课程 |
| 132 | - ToastUtils.showToast("remen1"); | |
| 136 | + if (tvCourse1.getTag()!=null) | |
| 137 | + WebViewActivity.getInstance(getActivity(),tvCourse1.getTag().toString(),-1); | |
| 133 | 138 | break; |
| 134 | 139 | case R.id.frame_hot2: |
| 135 | - ToastUtils.showToast("remen2"); | |
| 140 | + if (tvCourse2.getTag()!=null) | |
| 141 | + WebViewActivity.getInstance(getActivity(),tvCourse2.getTag().toString(),-1); | |
| 136 | 142 | break; |
| 137 | 143 | case R.id.frame_hot3: |
| 138 | - ToastUtils.showToast("remen3"); | |
| 144 | + if (tvCourse3.getTag()!=null) | |
| 145 | + WebViewActivity.getInstance(getActivity(),tvCourse3.getTag().toString(),-1); | |
| 139 | 146 | break; |
| 140 | 147 | case R.id.tvLocalAddress: |
| 141 | 148 | // AppContext.getInstance().startLocation(); |
| 142 | - if (null==cityPicker)cityPicker=new CityPicker(getActivity(),this); | |
| 143 | - if (cityPicker.isShow())cityPicker.close(); | |
| 149 | + if (null == cityPicker) cityPicker = new CityPicker(getActivity(), this); | |
| 150 | + if (cityPicker.isShow()) cityPicker.close(); | |
| 144 | 151 | else cityPicker.show(); |
| 145 | 152 | break; |
| 146 | 153 | case R.id.ivCamera: |
| ... | ... | @@ -149,10 +156,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 149 | 156 | } |
| 150 | 157 | } |
| 151 | 158 | |
| 152 | - private BroadcastReceiver broadcastReceiver=new BroadcastReceiver() { | |
| 159 | + private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { | |
| 153 | 160 | @Override |
| 154 | 161 | public void onReceive(Context context, Intent intent) { |
| 155 | - if (intent.getAction().equals(AppContext.LOCATION_CITYNAME+"")){ | |
| 162 | + if (intent.getAction().equals(AppContext.LOCATION_CITYNAME + "")) { | |
| 156 | 163 | tvLocalAddress.setText(AppContext.getInstance().cityName); |
| 157 | 164 | } |
| 158 | 165 | } |
| ... | ... | @@ -161,19 +168,36 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 161 | 168 | @Override |
| 162 | 169 | public void onDestroy() { |
| 163 | 170 | super.onDestroy(); |
| 164 | - if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver); | |
| 165 | - if (null!=cityPicker)cityPicker.cancle(); | |
| 171 | + if (null != broadcastReceiver) getActivity().unregisterReceiver(broadcastReceiver); | |
| 172 | + if (null != cityPicker) cityPicker.cancle(); | |
| 166 | 173 | } |
| 167 | 174 | |
| 168 | 175 | @Override |
| 169 | 176 | public void getCity(String name) { |
| 170 | - tvLocalAddress.setText(name.split(" ")[1]); | |
| 171 | - mPresenter.getTools(layout_control,name.split(" ")[2]); | |
| 172 | - ToastUtils.showToast(name.split(" ")[2]); | |
| 177 | + tvLocalAddress.setText(name.split(" ")[2]); | |
| 178 | + mPresenter.getTools(layout_control, name.split(" ")[2]); | |
| 179 | + AppContext.getInstance().cityName=name.split(" ")[1]; | |
| 180 | + AppContext.getInstance().district=name.split(" ")[2]; | |
| 173 | 181 | } |
| 174 | 182 | |
| 175 | 183 | @Override |
| 176 | - public void showTools() { | |
| 184 | + public void showTools(List<ToolBean> toolBeanList) { | |
| 185 | + if (toolBeanList.size() > 0) { | |
| 186 | + tvCourse1.setText(toolBeanList.get(0).toolName); | |
| 187 | + GlideUtils.showImg(getActivity(),ivCourse1,toolBeanList.get(0).toolImage); | |
| 188 | + tvCourse1.setTag(toolBeanList.get(0).toolUrl); | |
| 189 | + } | |
| 177 | 190 | |
| 191 | + if (toolBeanList.size() > 1) { | |
| 192 | + tvCourse2.setText(toolBeanList.get(1).toolName); | |
| 193 | + GlideUtils.showImg(getActivity(),ivCourse2,toolBeanList.get(1).toolImage); | |
| 194 | + tvCourse2.setTag(toolBeanList.get(1).toolUrl); | |
| 195 | + } | |
| 196 | + | |
| 197 | + if (toolBeanList.size() > 2) { | |
| 198 | + tvCourse3.setText(toolBeanList.get(2).toolName); | |
| 199 | + GlideUtils.showImg(getActivity(),ivCourse3,toolBeanList.get(2).toolImage); | |
| 200 | + tvCourse3.setTag(toolBeanList.get(2).toolUrl); | |
| 201 | + } | |
| 178 | 202 | } |
| 179 | 203 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
| ... | ... | @@ -8,26 +8,28 @@ import android.os.Bundle; |
| 8 | 8 | import android.support.annotation.NonNull; |
| 9 | 9 | import android.support.annotation.Nullable; |
| 10 | 10 | import android.support.v7.widget.LinearLayoutManager; |
| 11 | -import android.support.v7.widget.RecyclerView; | |
| 12 | 11 | import android.view.View; |
| 13 | 12 | import android.widget.ImageView; |
| 14 | 13 | import android.widget.LinearLayout; |
| 15 | 14 | import android.widget.TextView; |
| 16 | 15 | |
| 17 | 16 | import com.bumptech.glide.Glide; |
| 17 | +import com.jcodecraeer.xrecyclerview.XRecyclerView; | |
| 18 | 18 | import com.share.mvpsdk.base.BasePresenter; |
| 19 | 19 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 20 | 20 | import com.shunzhi.parent.AppConfig; |
| 21 | 21 | import com.shunzhi.parent.AppContext; |
| 22 | 22 | import com.shunzhi.parent.R; |
| 23 | -import com.shunzhi.parent.adapter.ContextAdapter; | |
| 23 | +import com.shunzhi.parent.adapter.MyConsultAdapter; | |
| 24 | 24 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 25 | 25 | import com.shunzhi.parent.bean.channel.ChannelBean; |
| 26 | 26 | import com.shunzhi.parent.bean.channel.ChannelContextBean; |
| 27 | 27 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 28 | 28 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
| 29 | 29 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; |
| 30 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 30 | 31 | import com.shunzhi.parent.util.AttrsUtils; |
| 32 | +import com.shunzhi.parent.util.GlideUtils; | |
| 31 | 33 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 32 | 34 | import com.stx.xhb.xbanner.XBanner; |
| 33 | 35 | |
| ... | ... | @@ -45,9 +47,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 45 | 47 | |
| 46 | 48 | XBanner xBanner; |
| 47 | 49 | |
| 48 | - RecyclerView recycler_context; | |
| 50 | + XRecyclerView recycler_context; | |
| 49 | 51 | |
| 50 | - ContextAdapter contextAdapter; | |
| 52 | + MyConsultAdapter contextAdapter; | |
| 51 | 53 | |
| 52 | 54 | List<String> imgesUrl = new ArrayList<>(); |
| 53 | 55 | List<String> describeList = new ArrayList<>(); |
| ... | ... | @@ -61,6 +63,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 61 | 63 | |
| 62 | 64 | CityPicker cityPicker = null; |
| 63 | 65 | |
| 66 | + int pageIndex = 1; | |
| 67 | + boolean first = true; | |
| 68 | + | |
| 64 | 69 | @Override |
| 65 | 70 | public int getLayoutId() { |
| 66 | 71 | return R.layout.fragment_zi_xun; |
| ... | ... | @@ -69,7 +74,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 69 | 74 | @Override |
| 70 | 75 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 71 | 76 | |
| 72 | - | |
| 73 | 77 | recycler_context = view.findViewById(R.id.recycler_content); |
| 74 | 78 | initRecycler(); |
| 75 | 79 | |
| ... | ... | @@ -78,15 +82,12 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 78 | 82 | videoplayer = view.findViewById(R.id.videoplayer); |
| 79 | 83 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); |
| 80 | 84 | layout_control = view.findViewById(R.id.layout_control); |
| 81 | - | |
| 82 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | |
| 85 | + tvLocalAddress.setText(AppContext.getInstance().district); | |
| 83 | 86 | videoplayer.batteryLevel.setVisibility(View.GONE); |
| 84 | 87 | videoplayer.replayTextView.setVisibility(View.GONE); |
| 85 | 88 | videoplayer.backButton.setVisibility(View.GONE); |
| 86 | 89 | |
| 87 | -// mPresenter.getTools(layout_control); | |
| 88 | - mPresenter.getBanners("2", "余杭区"); | |
| 89 | - mPresenter.getContextChannel("余杭区", 0, 1, 1); | |
| 90 | + mPresenter.getBanners("2", AppContext.getInstance().district); | |
| 90 | 91 | |
| 91 | 92 | initBroadCast(); |
| 92 | 93 | |
| ... | ... | @@ -95,8 +96,26 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 95 | 96 | |
| 96 | 97 | private void initRecycler() { |
| 97 | 98 | recycler_context.setLayoutManager(new LinearLayoutManager(getActivity())); |
| 98 | - contextAdapter = new ContextAdapter(getActivity()); | |
| 99 | + recycler_context.setLoadingListener(new XRecyclerView.LoadingListener() { | |
| 100 | + @Override | |
| 101 | + public void onRefresh() { | |
| 102 | + //refresh data here | |
| 103 | + pageIndex = 1; | |
| 104 | + contextList.clear(); | |
| 105 | + mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); | |
| 106 | + recycler_context.refreshComplete(); | |
| 107 | + } | |
| 99 | 108 | |
| 109 | + @Override | |
| 110 | + public void onLoadMore() { | |
| 111 | + // load more data here | |
| 112 | + pageIndex = pageIndex + 1; | |
| 113 | + mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); | |
| 114 | + recycler_context.refreshComplete(); | |
| 115 | + } | |
| 116 | + }); | |
| 117 | + pageIndex = 1; | |
| 118 | + mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); | |
| 100 | 119 | } |
| 101 | 120 | |
| 102 | 121 | private void initListeners() { |
| ... | ... | @@ -109,8 +128,14 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 109 | 128 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
| 110 | 129 | @Override |
| 111 | 130 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
| 112 | - Glide.with(getActivity()).load(imgesUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | |
| 113 | - .into((ImageView) view); | |
| 131 | + GlideUtils.showImg(getActivity(),(ImageView) view,imgesUrl.get(position)); | |
| 132 | + } | |
| 133 | + }); | |
| 134 | + | |
| 135 | + xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { | |
| 136 | + @Override | |
| 137 | + public void onItemClick(XBanner banner, int position) { | |
| 138 | + WebViewActivity.getInstance(getContext(), describeList.get(position), -1); | |
| 114 | 139 | } |
| 115 | 140 | }); |
| 116 | 141 | |
| ... | ... | @@ -149,7 +174,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 149 | 174 | } |
| 150 | 175 | } |
| 151 | 176 | |
| 152 | - | |
| 153 | 177 | private void initBroadCast() { |
| 154 | 178 | |
| 155 | 179 | IntentFilter intentFilter = new IntentFilter(); |
| ... | ... | @@ -162,7 +186,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 162 | 186 | @Override |
| 163 | 187 | public void onReceive(Context context, Intent intent) { |
| 164 | 188 | if (intent.getAction().equals(AppContext.LOCATION_CITYNAME + "")) { |
| 165 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | |
| 189 | + tvLocalAddress.setText(AppContext.getInstance().district); | |
| 166 | 190 | } |
| 167 | 191 | } |
| 168 | 192 | }; |
| ... | ... | @@ -181,50 +205,63 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 181 | 205 | |
| 182 | 206 | @Override |
| 183 | 207 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
| 208 | + describeList.clear(); | |
| 209 | + imgesUrl.clear(); | |
| 184 | 210 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
| 185 | - imgesUrl.add(AppConfig.BASE_URL_IMG + guangGaoBeanList.get(i).fileSrc); | |
| 211 | + imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); | |
| 186 | 212 | describeList.add(guangGaoBeanList.get(i).describe); |
| 187 | 213 | } |
| 188 | 214 | initBanners(); |
| 189 | 215 | } |
| 190 | 216 | |
| 191 | 217 | @Override |
| 192 | - public void showChannel(List<ChannelBean> list) { | |
| 193 | - for (int i = 0; i < list.size(); i++) { | |
| 194 | - TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | |
| 195 | - textAndImgShowView.setTextColor(R.color.textColor); | |
| 196 | - textAndImgShowView.setText(list.get(i).getChannelName()); | |
| 197 | -// textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(list.get(i).getChannelImage())); | |
| 198 | - textAndImgShowView.addImgs(list.get(i).getChannelImage()); | |
| 199 | - textAndImgShowView.setSelect(true); | |
| 200 | - textAndImgShowView.setWidth(getActivity(), layout_control); | |
| 201 | - textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | |
| 202 | - textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
| 203 | - @Override | |
| 204 | - public void onClick(View view) { | |
| 205 | - ConsultOneLevelActivity.getInstance(getActivity()); | |
| 206 | - } | |
| 207 | - }); | |
| 208 | - layout_control.addView(textAndImgShowView); | |
| 218 | + public void showChannel(final List<ChannelBean> list) { | |
| 219 | + if (first) { | |
| 220 | + layout_control.removeAllViews(); | |
| 221 | + for (int i = 0; i < list.size(); i++) { | |
| 222 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | |
| 223 | + textAndImgShowView.setTextColor(R.color.textColor); | |
| 224 | + textAndImgShowView.setText(list.get(i).getChannelName()); | |
| 225 | + textAndImgShowView.addImgs(list.get(i).getChannelImage()); | |
| 226 | + textAndImgShowView.setSelect(true); | |
| 227 | + textAndImgShowView.setWidth(getActivity(), layout_control); | |
| 228 | + textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | |
| 229 | + textAndImgShowView.setTag(list.get(i)); | |
| 230 | + textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
| 231 | + @Override | |
| 232 | + public void onClick(View view) { | |
| 233 | + ChannelBean channelBean = (ChannelBean) view.getTag(); | |
| 234 | + ConsultOneLevelActivity.getInstance(getActivity(), channelBean.getId() + ""); | |
| 235 | + } | |
| 236 | + }); | |
| 237 | + layout_control.addView(textAndImgShowView); | |
| 238 | + } | |
| 239 | + first = false; | |
| 209 | 240 | } |
| 210 | 241 | |
| 211 | 242 | |
| 212 | - | |
| 213 | - | |
| 214 | 243 | } |
| 215 | 244 | |
| 216 | 245 | @Override |
| 217 | 246 | public void showContext(List<ChannelContextBean> list) { |
| 218 | - contextList.clear(); | |
| 219 | 247 | contextList.addAll(list); |
| 220 | - contextAdapter.addAll(contextList); | |
| 221 | - recycler_context.setAdapter(contextAdapter); | |
| 222 | - | |
| 223 | - | |
| 248 | + if (contextAdapter == null) { | |
| 249 | + contextAdapter = new MyConsultAdapter(getActivity()); | |
| 250 | + contextAdapter.addAll(contextList); | |
| 251 | + recycler_context.setAdapter(contextAdapter); | |
| 252 | + } else { | |
| 253 | + contextAdapter.addAll(contextList); | |
| 254 | + contextAdapter.notifyDataSetChanged(); | |
| 255 | + } | |
| 224 | 256 | } |
| 225 | 257 | |
| 226 | 258 | @Override |
| 227 | 259 | public void getCity(String name) { |
| 228 | - tvLocalAddress.setText(name.split(" ")[1]); | |
| 260 | + first=true; | |
| 261 | + tvLocalAddress.setText(name.split(" ")[2]); | |
| 262 | + mPresenter.getBanners("2", name.split(" ")[2]); | |
| 263 | + mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); | |
| 264 | + AppContext.getInstance().cityName = name.split(" ")[1]; | |
| 265 | + AppContext.getInstance().district = name.split(" ")[2]; | |
| 229 | 266 | } |
| 230 | 267 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
| 1 | 1 | package com.shunzhi.parent.ui.fragment; |
| 2 | 2 | |
| 3 | +import android.app.AlertDialog; | |
| 4 | +import android.content.DialogInterface; | |
| 3 | 5 | import android.content.Intent; |
| 4 | 6 | import android.os.Bundle; |
| 5 | 7 | import android.support.annotation.NonNull; |
| ... | ... | @@ -9,11 +11,10 @@ import android.view.View; |
| 9 | 11 | import android.widget.LinearLayout; |
| 10 | 12 | import android.widget.TextView; |
| 11 | 13 | |
| 12 | -import com.bumptech.glide.Glide; | |
| 13 | 14 | import com.makeramen.roundedimageview.RoundedImageView; |
| 14 | 15 | import com.share.mvpsdk.base.BasePresenter; |
| 15 | 16 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 16 | -import com.share.mvpsdk.utils.ToastUtils; | |
| 17 | +import com.share.mvpsdk.utils.CacheUtils; | |
| 17 | 18 | import com.shunzhi.parent.AppConfig; |
| 18 | 19 | import com.shunzhi.parent.AppContext; |
| 19 | 20 | import com.shunzhi.parent.R; |
| ... | ... | @@ -25,12 +26,13 @@ import com.shunzhi.parent.ui.activity.MyChildActivity; |
| 25 | 26 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; |
| 26 | 27 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
| 27 | 28 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; |
| 29 | +import com.shunzhi.parent.util.GlideUtils; | |
| 28 | 30 | |
| 29 | 31 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
| 30 | 32 | implements MineContract.IMineView, View.OnClickListener { |
| 31 | - LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; | |
| 33 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order, layout_cache, layout_about,layoutAdvice; | |
| 32 | 34 | RoundedImageView user_photo; |
| 33 | - TextView user_name, user_mobile; | |
| 35 | + TextView user_name, user_mobile, tvExit, binding_state; | |
| 34 | 36 | |
| 35 | 37 | @NonNull |
| 36 | 38 | @Override |
| ... | ... | @@ -49,6 +51,12 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
| 49 | 51 | personinfo = view.findViewById(R.id.personinfo); |
| 50 | 52 | layout_order = view.findViewById(R.id.layout_order); |
| 51 | 53 | layout_orderDetail = view.findViewById(R.id.layout_orderDetail); |
| 54 | + layout_cache = view.findViewById(R.id.layout_cache); | |
| 55 | + layout_about = view.findViewById(R.id.layout_about); | |
| 56 | + layoutAdvice=view.findViewById(R.id.layoutAdvice); | |
| 57 | + layoutAdvice.setOnClickListener(this); | |
| 58 | + layout_about.setOnClickListener(this); | |
| 59 | + layout_cache.setOnClickListener(this); | |
| 52 | 60 | childlayout.setOnClickListener(this); |
| 53 | 61 | personinfo.setOnClickListener(this); |
| 54 | 62 | layout_order.setOnClickListener(this); |
| ... | ... | @@ -56,17 +64,22 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
| 56 | 64 | user_photo = view.findViewById(R.id.user_photo); |
| 57 | 65 | user_name = view.findViewById(R.id.user_name); |
| 58 | 66 | user_mobile = view.findViewById(R.id.user_mobile); |
| 67 | + tvExit = view.findViewById(R.id.tvExit); | |
| 68 | + tvExit.setOnClickListener(this); | |
| 69 | + binding_state = view.findViewById(R.id.binding_state); | |
| 70 | + if (AppConfig.ISBINDING) { | |
| 71 | + binding_state.setText(""); | |
| 72 | + } | |
| 59 | 73 | |
| 60 | 74 | } |
| 61 | 75 | |
| 62 | - private void setPersonInfo() { | |
| 76 | + private void setPersonInfo() { | |
| 63 | 77 | if (AppConfig.ISLOGIN) { |
| 64 | 78 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); |
| 65 | - ToastUtils.showToast(url); | |
| 66 | 79 | if (!TextUtils.isEmpty(url)) { |
| 67 | - Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | |
| 80 | + GlideUtils.showImg(getContext(),user_photo,url); | |
| 68 | 81 | } else { |
| 69 | - Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | |
| 82 | + GlideUtils.showImg(getContext(),user_photo,url); | |
| 70 | 83 | user_photo.setCornerRadius(20); |
| 71 | 84 | } |
| 72 | 85 | user_photo.setCornerRadius(20); |
| ... | ... | @@ -74,6 +87,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
| 74 | 87 | user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); |
| 75 | 88 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); |
| 76 | 89 | user_mobile.setVisibility(View.VISIBLE); |
| 90 | + }else { | |
| 91 | + user_name.setVisibility(View.VISIBLE); | |
| 92 | + user_mobile.setVisibility(View.GONE); | |
| 77 | 93 | } |
| 78 | 94 | } |
| 79 | 95 | |
| ... | ... | @@ -97,14 +113,66 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
| 97 | 113 | Bundle bundle = new Bundle(); |
| 98 | 114 | bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" + |
| 99 | 115 | AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID)); |
| 100 | - bundle.putInt("type",AppConfig.ORDER_CENTER); | |
| 116 | + bundle.putInt("type", AppConfig.ORDER_CENTER); | |
| 101 | 117 | startNewActivity(WebViewActivity.class, bundle); |
| 102 | 118 | break; |
| 119 | + case R.id.tvExit: | |
| 120 | + clearUerinfo(); | |
| 121 | + break; | |
| 122 | + case R.id.layout_cache: | |
| 123 | + clearMyCache(); | |
| 124 | + break; | |
| 125 | + case R.id.layout_about: | |
| 126 | + WebViewActivity.getInstance(getActivity(),AppConfig.BASE_URL_ORDER+"About.html",-1); | |
| 127 | + break; | |
| 128 | + case R.id.layoutAdvice: | |
| 129 | + WebViewActivity.getInstance(getActivity(),AppConfig.BASE_URL_ORDER+"FeedBack.aspx?userid="+AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID),-1); | |
| 130 | + break; | |
| 103 | 131 | default: |
| 104 | 132 | break; |
| 105 | 133 | } |
| 106 | 134 | } |
| 107 | 135 | |
| 136 | + private void clearMyCache() { | |
| 137 | + | |
| 138 | + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); | |
| 139 | + try { | |
| 140 | + builder.setMessage("清理缓存" + CacheUtils.getCacheSize(getActivity()) + "") | |
| 141 | + .setPositiveButton("取消", new DialogInterface.OnClickListener() { | |
| 142 | + @Override | |
| 143 | + public void onClick(DialogInterface dialogInterface, int i) { | |
| 144 | + dialogInterface.dismiss(); | |
| 145 | + } | |
| 146 | + }) | |
| 147 | + .setNegativeButton("确定", new DialogInterface.OnClickListener() { | |
| 148 | + @Override | |
| 149 | + public void onClick(DialogInterface dialogInterface, int i) { | |
| 150 | + try { | |
| 151 | + CacheUtils.clearCache(getActivity()); | |
| 152 | + } catch (Exception e) { | |
| 153 | + e.printStackTrace(); | |
| 154 | + } | |
| 155 | + dialogInterface.dismiss(); | |
| 156 | + } | |
| 157 | + }); | |
| 158 | + } catch (Exception e) { | |
| 159 | + e.printStackTrace(); | |
| 160 | + } | |
| 161 | + builder.create().show(); | |
| 162 | + } | |
| 163 | + | |
| 164 | + private void clearUerinfo() { | |
| 165 | + if(AppConfig.ISLOGIN) { | |
| 166 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); | |
| 167 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); | |
| 168 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, ""); | |
| 169 | + AppConfig.ISLOGIN = false; | |
| 170 | + setPersonInfo(); | |
| 171 | + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | |
| 172 | + getActivity().finish(); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + | |
| 108 | 176 | @Override |
| 109 | 177 | public void onResume() { |
| 110 | 178 | super.onResume(); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
| ... | ... | @@ -36,7 +36,7 @@ public class ReportFragment extends BaseMVPCompatFragment<ReportContract.ReportP |
| 36 | 36 | |
| 37 | 37 | MaterialCalendarView calendarView_month_mode; |
| 38 | 38 | |
| 39 | - TextView tvDate,tvShaiXuan; | |
| 39 | + TextView tvDate,tvShaiXuan,tvNoData; | |
| 40 | 40 | |
| 41 | 41 | ShaiXuanPop shaiXuanPop=null; |
| 42 | 42 | |
| ... | ... | @@ -57,6 +57,7 @@ public class ReportFragment extends BaseMVPCompatFragment<ReportContract.ReportP |
| 57 | 57 | calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode); |
| 58 | 58 | tvDate = view.findViewById(R.id.tvDate); |
| 59 | 59 | tvShaiXuan=view.findViewById(R.id.tvShaiXuan); |
| 60 | + tvNoData=view.findViewById(R.id.tvNoData); | |
| 60 | 61 | |
| 61 | 62 | LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); |
| 62 | 63 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL); |
| ... | ... | @@ -117,6 +118,7 @@ public class ReportFragment extends BaseMVPCompatFragment<ReportContract.ReportP |
| 117 | 118 | @Override |
| 118 | 119 | public void showReports(List<String> stringList) { |
| 119 | 120 | if (null!=shaiXuanPop){ |
| 121 | + if (stringList.size()>0)tvNoData.setVisibility(View.GONE); | |
| 120 | 122 | shaiXuanPop.setDatas(stringList); |
| 121 | 123 | shaiXuanPop.show(tvShaiXuan); |
| 122 | 124 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
| ... | ... | @@ -5,13 +5,16 @@ import android.support.annotation.NonNull; |
| 5 | 5 | import android.support.annotation.Nullable; |
| 6 | 6 | import android.support.v4.view.ViewPager; |
| 7 | 7 | import android.text.TextUtils; |
| 8 | +import android.util.Log; | |
| 8 | 9 | import android.view.View; |
| 9 | 10 | import android.widget.ImageView; |
| 11 | +import android.widget.TextView; | |
| 10 | 12 | |
| 11 | 13 | import com.bumptech.glide.Glide; |
| 12 | 14 | import com.share.mvpsdk.base.BasePresenter; |
| 13 | 15 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 14 | 16 | import com.shunzhi.parent.AppConfig; |
| 17 | +import com.shunzhi.parent.AppContext; | |
| 15 | 18 | import com.shunzhi.parent.R; |
| 16 | 19 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 17 | 20 | import com.shunzhi.parent.bean.channel.ChannelBean; |
| ... | ... | @@ -19,6 +22,7 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; |
| 19 | 22 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 20 | 23 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
| 21 | 24 | import com.shunzhi.parent.ui.MainActivity; |
| 25 | +import com.shunzhi.parent.util.GlideUtils; | |
| 22 | 26 | import com.stx.xhb.xbanner.XBanner; |
| 23 | 27 | |
| 24 | 28 | import java.util.ArrayList; |
| ... | ... | @@ -29,6 +33,8 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 29 | 33 | |
| 30 | 34 | XBanner xBanner; |
| 31 | 35 | |
| 36 | + TextView tvJump; | |
| 37 | + | |
| 32 | 38 | @Override |
| 33 | 39 | public int getLayoutId() { |
| 34 | 40 | return R.layout.fragment_start; |
| ... | ... | @@ -36,11 +42,24 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 36 | 42 | |
| 37 | 43 | @Override |
| 38 | 44 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 45 | + | |
| 39 | 46 | xBanner = view.findViewById(R.id.xBanner); |
| 47 | + tvJump=view.findViewById(R.id.tvJump); | |
| 48 | + | |
| 40 | 49 | if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START))) { |
| 41 | - mPresenter.getBanners("0","杭州"); | |
| 50 | + mPresenter.getBanners("0", "余杭区"); | |
| 42 | 51 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); |
| 43 | - } else mPresenter.getBanners("1","杭州"); | |
| 52 | + } else mPresenter.getBanners("1","余杭区"); | |
| 53 | + | |
| 54 | + | |
| 55 | + tvJump.setOnClickListener(new View.OnClickListener() { | |
| 56 | + @Override | |
| 57 | + public void onClick(View view) { | |
| 58 | + startNewActivity(MainActivity.class); | |
| 59 | + getActivity().finish(); | |
| 60 | + } | |
| 61 | + }); | |
| 62 | + | |
| 44 | 63 | } |
| 45 | 64 | |
| 46 | 65 | @NonNull |
| ... | ... | @@ -70,42 +89,27 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 70 | 89 | } |
| 71 | 90 | |
| 72 | 91 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
| 92 | + try { | |
| 73 | 93 | final List<String> imgUrl = new ArrayList<>(); |
| 74 | 94 | List<String> describeList = new ArrayList<>(); |
| 75 | 95 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
| 76 | - imgUrl.add(guangGaoBeanList.get(i).fileSrc); | |
| 96 | + imgUrl.add(AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc); | |
| 77 | 97 | describeList.add(guangGaoBeanList.get(i).describe); |
| 78 | 98 | } |
| 79 | 99 | xBanner.setData(imgUrl, describeList); |
| 80 | - xBanner.setmAutoPlayAble(false); | |
| 81 | - xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); | |
| 82 | - | |
| 100 | + xBanner.stopAutoPlay(); | |
| 101 | + xBanner.setmAutoPalyTime(10000); | |
| 102 | +// xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); | |
| 83 | 103 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
| 84 | 104 | @Override |
| 85 | 105 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
| 86 | - Glide.with(getActivity()).load(imgUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | |
| 87 | - .into((ImageView) view); | |
| 106 | + GlideUtils.showImg(getActivity(),(ImageView) view,imgUrl.get(position)); | |
| 88 | 107 | } |
| 89 | 108 | }); |
| 90 | 109 | |
| 91 | - xBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { | |
| 92 | - @Override | |
| 93 | - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | |
| 94 | - if (position == imgUrl.size() - 1) { | |
| 95 | - startNewActivity(MainActivity.class); | |
| 96 | - } | |
| 97 | - } | |
| 98 | - | |
| 99 | - @Override | |
| 100 | - public void onPageSelected(int position) { | |
| 101 | - | |
| 102 | - } | |
| 103 | - | |
| 104 | - @Override | |
| 105 | - public void onPageScrollStateChanged(int state) { | |
| 106 | - | |
| 107 | - } | |
| 108 | - }); | |
| 109 | 110 | |
| 111 | + }catch (Exception e){ | |
| 112 | + e.printStackTrace(); | |
| 113 | + } | |
| 110 | 114 | } |
| 111 | 115 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| ... | ... | @@ -5,7 +5,6 @@ import android.support.annotation.NonNull; |
| 5 | 5 | import android.support.annotation.Nullable; |
| 6 | 6 | import android.support.v7.widget.LinearLayoutManager; |
| 7 | 7 | import android.support.v7.widget.RecyclerView; |
| 8 | -import android.util.Log; | |
| 9 | 8 | import android.view.LayoutInflater; |
| 10 | 9 | import android.view.View; |
| 11 | 10 | import android.view.ViewGroup; |
| ... | ... | @@ -14,19 +13,25 @@ import android.widget.ImageView; |
| 14 | 13 | import android.widget.LinearLayout; |
| 15 | 14 | import android.widget.TextView; |
| 16 | 15 | |
| 17 | -import com.bumptech.glide.Glide; | |
| 16 | +import com.jcodecraeer.xrecyclerview.XRecyclerView; | |
| 18 | 17 | import com.share.mvpsdk.base.BasePresenter; |
| 19 | 18 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 20 | 19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 21 | 20 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 22 | 21 | import com.share.mvpsdk.utils.DisplayUtils; |
| 23 | -import com.shunzhi.parent.AppConfig; | |
| 22 | +import com.shunzhi.parent.AppContext; | |
| 24 | 23 | import com.shunzhi.parent.R; |
| 25 | 24 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 26 | 25 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 27 | -import com.shunzhi.parent.bean.MyConsultBean; | |
| 26 | +import com.shunzhi.parent.bean.channel.ChannelBean; | |
| 27 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 28 | 28 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 29 | 29 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
| 30 | +import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | |
| 31 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 32 | +import com.shunzhi.parent.util.AttrsUtils; | |
| 33 | +import com.shunzhi.parent.util.GlideUtils; | |
| 34 | +import com.shunzhi.parent.views.TextAndImgShowView; | |
| 30 | 35 | |
| 31 | 36 | import java.util.ArrayList; |
| 32 | 37 | import java.util.List; |
| ... | ... | @@ -34,7 +39,8 @@ import java.util.List; |
| 34 | 39 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, |
| 35 | 40 | ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView { |
| 36 | 41 | |
| 37 | - RecyclerView recyclerViewGrally, recyclerViewConsultOne; | |
| 42 | + RecyclerView recyclerViewGrally; | |
| 43 | + XRecyclerView recyclerViewConsultOne; | |
| 38 | 44 | |
| 39 | 45 | MyGrallyAdapter myGrallyAdapter = null; |
| 40 | 46 | |
| ... | ... | @@ -42,7 +48,12 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 42 | 48 | |
| 43 | 49 | LinearLayout layout_control; |
| 44 | 50 | |
| 45 | - List<MyConsultBean> myConsultBeanList = null; | |
| 51 | + | |
| 52 | + List<ChannelContextBean> myConsultBeanList = new ArrayList<>(); | |
| 53 | + | |
| 54 | + String channel = ""; | |
| 55 | + int pageIndex; | |
| 56 | + | |
| 46 | 57 | |
| 47 | 58 | @Override |
| 48 | 59 | public int getLayoutId() { |
| ... | ... | @@ -51,55 +62,44 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 51 | 62 | |
| 52 | 63 | @Override |
| 53 | 64 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 54 | - initViews(view); | |
| 65 | + initViews(view); | |
| 55 | 66 | } |
| 56 | 67 | |
| 57 | - private void initRecyclerView(List<GuangGaoBean> guangGaoBeanList) { | |
| 68 | + private void initViews(View view) { | |
| 69 | + channel = getArguments().getString("channel"); | |
| 70 | + layout_control = view.findViewById(R.id.layout_control); | |
| 71 | + layout_control.measure(0, 0); | |
| 72 | + recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | |
| 73 | + recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | |
| 58 | 74 | |
| 59 | - if (null == myGrallyAdapter) myGrallyAdapter = new MyGrallyAdapter(); | |
| 60 | - myGrallyAdapter.addAll(guangGaoBeanList); | |
| 61 | - recyclerViewGrally.setAdapter(myGrallyAdapter); | |
| 62 | - recyclerViewGrally.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
| 75 | + recyclerViewConsultOne.setLayoutManager(new LinearLayoutManager(getActivity())); | |
| 76 | + recyclerViewConsultOne.setLoadingListener(new XRecyclerView.LoadingListener() { | |
| 63 | 77 | @Override |
| 64 | - public void onScrollStateChanged(RecyclerView recyclerView, int newState) { | |
| 65 | - super.onScrollStateChanged(recyclerView, newState); | |
| 78 | + public void onRefresh() { | |
| 79 | + //refresh data here | |
| 80 | + pageIndex = 1; | |
| 81 | + myConsultBeanList.clear(); | |
| 82 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | |
| 83 | + recyclerViewConsultOne.refreshComplete(); | |
| 66 | 84 | } |
| 67 | 85 | |
| 68 | 86 | @Override |
| 69 | - public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
| 70 | - super.onScrolled(recyclerView, dx, dy); | |
| 87 | + public void onLoadMore() { | |
| 88 | + // load more data here | |
| 89 | + pageIndex = pageIndex + 1; | |
| 90 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | |
| 91 | + recyclerViewConsultOne.refreshComplete(); | |
| 71 | 92 | } |
| 72 | 93 | }); |
| 94 | + pageIndex = 1; | |
| 95 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | |
| 73 | 96 | |
| 74 | - } | |
| 75 | - | |
| 76 | - private void initViews(View view) { | |
| 97 | + mPresenter.getBanners("4", AppContext.getInstance().district); | |
| 77 | 98 | |
| 78 | - layout_control = view.findViewById(R.id.layout_control); | |
| 79 | - layout_control.measure(0, 0); | |
| 80 | - mPresenter.getTools(layout_control); | |
| 81 | - recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | |
| 82 | - recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | |
| 83 | - | |
| 84 | - mPresenter.getBanners("3","杭州"); | |
| 85 | - initRecyclerViewConsult(); | |
| 86 | 99 | } |
| 87 | 100 | |
| 88 | - private void initRecyclerViewConsult() { | |
| 89 | - if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | |
| 90 | - if (null == myConsultBeanList) myConsultBeanList = new ArrayList<>(); | |
| 91 | - else myConsultBeanList.clear(); | |
| 92 | - for (int i = 0; i < 12; i++) { | |
| 93 | - MyConsultBean myConsultBean = new MyConsultBean(); | |
| 94 | - myConsultBean.consultCounts = i + ""; | |
| 95 | - myConsultBean.consultContent = "咨询内容" + i; | |
| 96 | - myConsultBean.consultTitle = "咨询标题" + i; | |
| 97 | - myConsultBean.consultZhuanfaCounts = "转发:" + i; | |
| 98 | - myConsultBeanList.add(myConsultBean); | |
| 99 | - } | |
| 100 | - myConsultAdapter.addAll(myConsultBeanList); | |
| 101 | - recyclerViewConsultOne.setAdapter(myConsultAdapter); | |
| 102 | - | |
| 101 | + public void showSearchContent(String keyword) { | |
| 102 | + mPresenter.getInformationTopic(keyword, AppContext.getInstance().district, channel, "0", 1); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | @NonNull |
| ... | ... | @@ -121,12 +121,62 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 121 | 121 | |
| 122 | 122 | @Override |
| 123 | 123 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
| 124 | - Log.d("6666","imgesUrl="+guangGaoBeanList); | |
| 125 | 124 | initRecyclerView(guangGaoBeanList); |
| 126 | 125 | } |
| 127 | 126 | |
| 127 | + private void initRecyclerView(List<GuangGaoBean> guangGaoBeanList) { | |
| 128 | + | |
| 129 | + if (null == myGrallyAdapter) myGrallyAdapter = new MyGrallyAdapter(); | |
| 130 | + myGrallyAdapter.addAll(guangGaoBeanList); | |
| 131 | + recyclerViewGrally.setAdapter(myGrallyAdapter); | |
| 132 | + recyclerViewGrally.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
| 133 | + @Override | |
| 134 | + public void onScrollStateChanged(RecyclerView recyclerView, int newState) { | |
| 135 | + super.onScrollStateChanged(recyclerView, newState); | |
| 136 | + } | |
| 137 | + | |
| 138 | + @Override | |
| 139 | + public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
| 140 | + super.onScrolled(recyclerView, dx, dy); | |
| 141 | + } | |
| 142 | + }); | |
| 143 | + | |
| 144 | + } | |
| 145 | + | |
| 146 | + @Override | |
| 147 | + public void showConsultContent(List<ChannelContextBean> list) { | |
| 148 | + myConsultBeanList.addAll(list); | |
| 149 | + if (myConsultAdapter == null) { | |
| 150 | + myConsultAdapter = new MyConsultAdapter(getActivity()); | |
| 151 | + myConsultAdapter.addAll(myConsultBeanList); | |
| 152 | + recyclerViewConsultOne.setAdapter(myConsultAdapter); | |
| 153 | + } else { | |
| 154 | + myConsultAdapter.addAll(myConsultBeanList); | |
| 155 | + myConsultAdapter.notifyDataSetChanged(); | |
| 156 | + } | |
| 157 | + } | |
| 158 | + | |
| 128 | 159 | @Override |
| 129 | - public void showConsultContent() { | |
| 160 | + public void showChannel(List<ChannelBean> list) { | |
| 161 | + layout_control.removeAllViews(); | |
| 162 | + for (int i = 0; i < list.size(); i++) { | |
| 163 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | |
| 164 | + textAndImgShowView.setTextColor(R.color.textColor); | |
| 165 | + textAndImgShowView.setText(list.get(i).getChannelName()); | |
| 166 | + textAndImgShowView.addImgs(list.get(i).getChannelImage()); | |
| 167 | + textAndImgShowView.setSelect(true); | |
| 168 | + textAndImgShowView.setWidth(getActivity(), layout_control); | |
| 169 | + textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | |
| 170 | + textAndImgShowView.setTag(list.get(i)); | |
| 171 | + textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
| 172 | + @Override | |
| 173 | + public void onClick(View view) { | |
| 174 | + ChannelBean channelBean = (ChannelBean) view.getTag(); | |
| 175 | + ConsultTwoLevelActivity.getInstance(getActivity(), channelBean.getId() + "", channelBean.getChannelName()); | |
| 176 | + } | |
| 177 | + }); | |
| 178 | + layout_control.addView(textAndImgShowView); | |
| 179 | + } | |
| 130 | 180 | } |
| 131 | 181 | |
| 132 | 182 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { |
| ... | ... | @@ -162,10 +212,15 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 162 | 212 | } |
| 163 | 213 | |
| 164 | 214 | @Override |
| 165 | - public void onBindViewHolder(GuangGaoBean object, int position) { | |
| 166 | - Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | |
| 167 | -// iv_grally.setImageResource(R.drawable.ic_launcher_background); | |
| 168 | - tv_grally_title.setText(object.describe+""); | |
| 215 | + public void onBindViewHolder(final GuangGaoBean object, int position) { | |
| 216 | + GlideUtils.showImg(mContext, iv_grally, object.fileSrc); | |
| 217 | + tv_grally_title.setText(object.describe + ""); | |
| 218 | + iv_grally.setOnClickListener(new View.OnClickListener() { | |
| 219 | + @Override | |
| 220 | + public void onClick(View v) { | |
| 221 | + WebViewActivity.getInstance(mContext, object.url, -1); | |
| 222 | + } | |
| 223 | + }); | |
| 169 | 224 | } |
| 170 | 225 | } |
| 171 | 226 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java
| 1 | 1 | package com.shunzhi.parent.ui.fragment.consult; |
| 2 | 2 | |
| 3 | -import android.content.Context; | |
| 4 | -import android.net.Uri; | |
| 5 | 3 | import android.os.Bundle; |
| 6 | 4 | import android.support.annotation.NonNull; |
| 7 | 5 | import android.support.annotation.Nullable; |
| 8 | -import android.support.v4.app.Fragment; | |
| 9 | -import android.support.v7.widget.RecyclerView; | |
| 10 | -import android.view.LayoutInflater; | |
| 6 | +import android.support.v7.widget.LinearLayoutManager; | |
| 11 | 7 | import android.view.View; |
| 12 | -import android.view.ViewGroup; | |
| 13 | 8 | import android.widget.TextView; |
| 14 | 9 | |
| 10 | +import com.jcodecraeer.xrecyclerview.XRecyclerView; | |
| 15 | 11 | import com.share.mvpsdk.base.BasePresenter; |
| 16 | 12 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 13 | +import com.shunzhi.parent.AppContext; | |
| 17 | 14 | import com.shunzhi.parent.R; |
| 18 | 15 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 19 | 16 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 20 | -import com.shunzhi.parent.bean.MyConsultBean; | |
| 17 | +import com.shunzhi.parent.bean.channel.ChannelBean; | |
| 18 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 21 | 19 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 22 | 20 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
| 23 | 21 | |
| ... | ... | @@ -32,11 +30,14 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 32 | 30 | |
| 33 | 31 | TextView tvContentName; |
| 34 | 32 | |
| 35 | - RecyclerView recyclerView; | |
| 33 | + XRecyclerView recyclerView; | |
| 36 | 34 | |
| 37 | 35 | MyConsultAdapter myConsultAdapter = null; |
| 38 | 36 | |
| 39 | - List<MyConsultBean> myConsultBeanList = new ArrayList<>(); | |
| 37 | + List<ChannelContextBean> myConsultBeanList = new ArrayList<>(); | |
| 38 | + | |
| 39 | + int pageIndex = 1; | |
| 40 | + String channel = "", titleName; | |
| 40 | 41 | |
| 41 | 42 | @Override |
| 42 | 43 | public int getLayoutId() { |
| ... | ... | @@ -46,26 +47,34 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 46 | 47 | @Override |
| 47 | 48 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 48 | 49 | tvContentName = view.findViewById(R.id.tvContentName); |
| 49 | - tvContentName.setText(""); | |
| 50 | - | |
| 50 | + tvContentName.setText(getArguments().getString("titleName")); | |
| 51 | + channel = getArguments().getString("channel"); | |
| 51 | 52 | recyclerView = view.findViewById(R.id.recyclerView); |
| 52 | 53 | |
| 53 | - initRecyclerView(); | |
| 54 | - } | |
| 55 | - | |
| 56 | - private void initRecyclerView() { | |
| 57 | - | |
| 58 | - if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | |
| 59 | - for (int i = 0; i < 12; i++) { | |
| 60 | - MyConsultBean myConsultBean = new MyConsultBean(); | |
| 61 | - myConsultBean.consultCounts = i + ""; | |
| 62 | - myConsultBean.consultContent = "咨询内容" + i; | |
| 63 | - myConsultBean.consultTitle = "咨询标题" + i; | |
| 64 | - myConsultBean.consultZhuanfaCounts = "转发:" + i; | |
| 65 | - myConsultBeanList.add(myConsultBean); | |
| 66 | - } | |
| 67 | - myConsultAdapter.addAll(myConsultBeanList); | |
| 68 | - recyclerView.setAdapter(myConsultAdapter); | |
| 54 | +// mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, 1); | |
| 55 | + recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); | |
| 56 | + recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { | |
| 57 | + @Override | |
| 58 | + public void onRefresh() { | |
| 59 | + //refresh data here | |
| 60 | + pageIndex = 1; | |
| 61 | + myConsultBeanList.clear(); | |
| 62 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | |
| 63 | + recyclerView.refreshComplete(); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Override | |
| 67 | + public void onLoadMore() { | |
| 68 | + // load more data here | |
| 69 | + pageIndex = pageIndex + 1; | |
| 70 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | |
| 71 | + recyclerView.refreshComplete(); | |
| 72 | + } | |
| 73 | + }); | |
| 74 | + pageIndex = 1; | |
| 75 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | |
| 76 | + | |
| 77 | +// initRecyclerView(); | |
| 69 | 78 | } |
| 70 | 79 | |
| 71 | 80 | @NonNull |
| ... | ... | @@ -80,15 +89,23 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 80 | 89 | } |
| 81 | 90 | |
| 82 | 91 | @Override |
| 92 | + public void showConsultContent(List<ChannelContextBean> list) { | |
| 93 | + myConsultBeanList.clear(); | |
| 94 | + myConsultBeanList.addAll(list); | |
| 95 | + if (myConsultAdapter == null) myConsultAdapter = new MyConsultAdapter(getActivity()); | |
| 96 | + if (null == recyclerView.getAdapter()) recyclerView.setAdapter(myConsultAdapter); | |
| 97 | + myConsultAdapter.addAll(myConsultBeanList); | |
| 98 | + } | |
| 99 | + | |
| 100 | + @Override | |
| 83 | 101 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
| 84 | 102 | |
| 85 | 103 | } |
| 86 | 104 | |
| 87 | - /** | |
| 88 | - * 显示咨询内容 | |
| 89 | - */ | |
| 90 | 105 | @Override |
| 91 | - public void showConsultContent() { | |
| 106 | + public void showChannel(List<ChannelBean> list) { | |
| 92 | 107 | |
| 93 | 108 | } |
| 109 | + | |
| 110 | + | |
| 94 | 111 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
| ... | ... | @@ -7,6 +7,7 @@ import android.support.annotation.Nullable; |
| 7 | 7 | import android.text.Editable; |
| 8 | 8 | import android.text.TextUtils; |
| 9 | 9 | import android.text.TextWatcher; |
| 10 | +import android.util.Log; | |
| 10 | 11 | import android.view.Gravity; |
| 11 | 12 | import android.view.LayoutInflater; |
| 12 | 13 | import android.view.View; |
| ... | ... | @@ -30,9 +31,6 @@ import com.shunzhi.parent.ui.MainActivity; |
| 30 | 31 | import com.shunzhi.parent.ui.activity.LoginAndRegistActivity; |
| 31 | 32 | import com.shunzhi.parent.views.MyProcessDialog; |
| 32 | 33 | |
| 33 | -import java.util.Calendar; | |
| 34 | -import java.util.Date; | |
| 35 | - | |
| 36 | 34 | |
| 37 | 35 | public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
| 38 | 36 | implements LoginAndRegisterContract.ILoginView, View.OnClickListener { |
| ... | ... | @@ -100,7 +98,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 100 | 98 | phoneNumber.addTextChangedListener(textWatcher); |
| 101 | 99 | idCode.addTextChangedListener(textWatcher); |
| 102 | 100 | password.addTextChangedListener(textWatcher); |
| 103 | - mPresenter.loginResult("18358585335", "575335"); | |
| 101 | +// mPresenter.loginResult("18358585335", "575335"); | |
| 104 | 102 | |
| 105 | 103 | passwordLayout_new = view.findViewById(R.id.passwordLayout_new); |
| 106 | 104 | et_password_new = view.findViewById(R.id.et_password_new); |
| ... | ... | @@ -129,12 +127,12 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 129 | 127 | back_login.setVisibility(View.VISIBLE); |
| 130 | 128 | } |
| 131 | 129 | |
| 132 | - roundedImageView.setOnClickListener(new View.OnClickListener() { | |
| 133 | - @Override | |
| 134 | - public void onClick(View view) { | |
| 135 | - mPresenter.loginResult("18358585335", "123456"); | |
| 136 | - } | |
| 137 | - }); | |
| 130 | +// roundedImageView.setOnClickListener(new View.OnClickListener() { | |
| 131 | +// @Override | |
| 132 | +// public void onClick(View view) { | |
| 133 | +// mPresenter.loginResult("18358575337", "575337"); | |
| 134 | +// } | |
| 135 | +// }); | |
| 138 | 136 | } |
| 139 | 137 | |
| 140 | 138 | |
| ... | ... | @@ -182,6 +180,12 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 182 | 180 | } |
| 183 | 181 | |
| 184 | 182 | @Override |
| 183 | + public void showerror(String error) { | |
| 184 | + progressDialog.dismiss(); | |
| 185 | +// ToastUtils.showToast(error); | |
| 186 | + } | |
| 187 | + | |
| 188 | + @Override | |
| 185 | 189 | public void onClick(View v) { |
| 186 | 190 | if (v == loginAndRegister) { |
| 187 | 191 | progressDialog.show(); | ... | ... |
app/src/main/java/com/shunzhi/parent/util/GlideUtils.java
0 → 100644
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +package com.shunzhi.parent.util; | |
| 2 | + | |
| 3 | +import android.content.Context; | |
| 4 | +import android.text.TextUtils; | |
| 5 | +import android.widget.ImageView; | |
| 6 | + | |
| 7 | +import com.bumptech.glide.Glide; | |
| 8 | +import com.shunzhi.parent.AppConfig; | |
| 9 | +import com.shunzhi.parent.R; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * Created by ToaHanDong on 2018/3/21. | |
| 13 | + */ | |
| 14 | + | |
| 15 | +public class GlideUtils { | |
| 16 | + | |
| 17 | + public static void showImg(Context context, ImageView imageView,String url){ | |
| 18 | + if (!TextUtils.isEmpty(url)){ | |
| 19 | + if (url.startsWith("http")) | |
| 20 | + Glide.with(context).load(url).placeholder(R.color.xueqing_blue) | |
| 21 | + .into(imageView); | |
| 22 | + else Glide.with(context).load(AppConfig.BASE_URL_FILE+url).placeholder(R.color.xueqing_blue) | |
| 23 | + .into(imageView); | |
| 24 | + }else { | |
| 25 | + Glide.with(context).load(url).placeholder(R.color.xueqing_blue).centerCrop().into(imageView); | |
| 26 | + } | |
| 27 | + } | |
| 28 | + | |
| 29 | +} | ... | ... |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
| ... | ... | @@ -14,7 +14,10 @@ import android.widget.TextView; |
| 14 | 14 | |
| 15 | 15 | import com.bumptech.glide.Glide; |
| 16 | 16 | import com.share.mvpsdk.utils.DisplayUtils; |
| 17 | +import com.shunzhi.parent.AppConfig; | |
| 18 | +import com.shunzhi.parent.AppContext; | |
| 17 | 19 | import com.shunzhi.parent.R; |
| 20 | +import com.shunzhi.parent.util.GlideUtils; | |
| 18 | 21 | |
| 19 | 22 | |
| 20 | 23 | /** |
| ... | ... | @@ -55,6 +58,8 @@ public class TextAndImgShowView extends LinearLayout { |
| 55 | 58 | } |
| 56 | 59 | |
| 57 | 60 | public void addImgs(String imgUrl){ |
| 61 | +// Log.d("66666","imgUrl="+imgUrl); | |
| 62 | + if (!imgUrl.startsWith("http"))imgUrl= AppConfig.BASE_URL_FILE+imgUrl; | |
| 58 | 63 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); |
| 59 | 64 | } |
| 60 | 65 | |
| ... | ... | @@ -78,7 +83,7 @@ public class TextAndImgShowView extends LinearLayout { |
| 78 | 83 | } |
| 79 | 84 | |
| 80 | 85 | public void setWidth(Activity activity, View layout_control) { |
| 81 | - Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); | |
| 86 | +// Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); | |
| 82 | 87 | LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
| 83 | 88 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - |
| 84 | 89 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() | ... | ... |
app/src/main/res/drawable-xhdpi/logo.png
app/src/main/res/drawable/rudiobtn_unclick.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <stroke android:color="#00000000" android:width="1dp"/> |
| 4 | - <solid android:color="#D2D2D2" /> | |
| 4 | + <solid android:color="@color/bottomline" /> | |
| 5 | 5 | <corners android:radius="5dp"/> |
| 6 | 6 | </shape> |
| 7 | 7 | \ No newline at end of file | ... | ... |
app/src/main/res/drwable-xxhdpi/logo.png
app/src/main/res/layout/activity_consult_one_level.xml
| ... | ... | @@ -10,11 +10,10 @@ |
| 10 | 10 | <include layout="@layout/layout_search_back"/> |
| 11 | 11 | |
| 12 | 12 | |
| 13 | - <fragment | |
| 14 | - android:id="@+id/MyFragment" | |
| 13 | + <FrameLayout | |
| 15 | 14 | android:layout_width="match_parent" |
| 16 | 15 | android:layout_height="match_parent" |
| 17 | - android:name="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment" | |
| 18 | - /> | |
| 16 | + android:id="@+id/frame_consult" | |
| 17 | + ></FrameLayout> | |
| 19 | 18 | |
| 20 | 19 | </LinearLayout> | ... | ... |
app/src/main/res/layout/activity_consult_two_level.xml
| ... | ... | @@ -9,5 +9,9 @@ |
| 9 | 9 | tools:context="com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity"> |
| 10 | 10 | |
| 11 | 11 | <include layout="@layout/layout_search_back"/> |
| 12 | - | |
| 12 | + <FrameLayout | |
| 13 | + android:layout_width="match_parent" | |
| 14 | + android:layout_height="match_parent" | |
| 15 | + android:id="@+id/frame_consult" | |
| 16 | + ></FrameLayout> | |
| 13 | 17 | </LinearLayout> | ... | ... |
app/src/main/res/layout/activity_mychild.xml
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | <LinearLayout |
| 3 | 3 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 4 | 4 | android:layout_width="match_parent" |
| 5 | + android:background="@color/bgColor" | |
| 5 | 6 | android:layout_height="match_parent" |
| 6 | 7 | android:orientation="vertical" |
| 7 | 8 | > |
| ... | ... | @@ -24,6 +25,7 @@ |
| 24 | 25 | android:text="添加绑定账号" |
| 25 | 26 | android:textColor="@color/white" |
| 26 | 27 | android:textSize="@dimen/txtsize_title" |
| 28 | + android:layout_marginBottom="@dimen/size_dp_10" | |
| 27 | 29 | android:gravity="center" |
| 28 | 30 | android:background="@drawable/rudiobtn" |
| 29 | 31 | /> | ... | ... |
app/src/main/res/layout/activity_select_school.xml
app/src/main/res/layout/activity_web_view.xml
| ... | ... | @@ -7,6 +7,111 @@ |
| 7 | 7 | android:orientation="vertical" |
| 8 | 8 | android:background="@color/bgColor" |
| 9 | 9 | tools:context="com.shunzhi.parent.ui.activity.mywebview.WebViewActivity"> |
| 10 | + | |
| 11 | + <RelativeLayout | |
| 12 | + android:layout_width="match_parent" | |
| 13 | + android:background="@color/back_top" | |
| 14 | + android:layout_height="?android:actionBarSize" | |
| 15 | + android:orientation="horizontal" | |
| 16 | + > | |
| 17 | + <ImageView | |
| 18 | + android:id="@+id/close_btn" | |
| 19 | + android:layout_width="wrap_content" | |
| 20 | + android:layout_height="match_parent" | |
| 21 | + android:gravity="center" | |
| 22 | + android:paddingLeft="@dimen/size_dp_15" | |
| 23 | + android:src="@drawable/back" | |
| 24 | + android:paddingRight="@dimen/size_dp_15" | |
| 25 | + android:textColor="@color/textColor" | |
| 26 | + android:textSize="@dimen/textSize16" /> | |
| 27 | + <TextView | |
| 28 | + android:id="@+id/title_web" | |
| 29 | + android:layout_width="wrap_content" | |
| 30 | + android:layout_height="wrap_content" | |
| 31 | + android:text="订购中心" | |
| 32 | + android:textSize="@dimen/txtsize_title" | |
| 33 | + android:layout_centerInParent="true" | |
| 34 | + android:visibility="gone" | |
| 35 | + android:textColor="@color/textColor" | |
| 36 | + | |
| 37 | + /> | |
| 38 | + | |
| 39 | + </RelativeLayout> | |
| 40 | + | |
| 41 | + <LinearLayout | |
| 42 | + android:id="@+id/binding_success1" | |
| 43 | + android:layout_width="match_parent" | |
| 44 | + android:layout_height="wrap_content" | |
| 45 | + android:gravity="center" | |
| 46 | + android:background="@color/white" | |
| 47 | + android:layout_marginLeft="20dp" | |
| 48 | + android:padding="30dp" | |
| 49 | + android:layout_marginRight="20dp" | |
| 50 | + | |
| 51 | + > | |
| 52 | + | |
| 53 | + <ImageView | |
| 54 | + android:layout_width="40dp" | |
| 55 | + android:layout_height="40dp" | |
| 56 | + android:background="@drawable/success_big" /> | |
| 57 | + | |
| 58 | + <TextView | |
| 59 | + android:layout_width="wrap_content" | |
| 60 | + android:layout_height="match_parent" | |
| 61 | + android:layout_marginLeft="20dp" | |
| 62 | + android:text="绑定成功" | |
| 63 | + android:gravity="center" | |
| 64 | + android:textColor="@color/textColor" | |
| 65 | + android:textSize="@dimen/txtsize_headline" /> | |
| 66 | + | |
| 67 | + </LinearLayout> | |
| 68 | + <LinearLayout | |
| 69 | + android:id="@+id/binding_success2" | |
| 70 | + android:visibility="gone" | |
| 71 | + android:layout_width="match_parent" | |
| 72 | + android:layout_height="wrap_content" | |
| 73 | + android:gravity="center" | |
| 74 | + android:background="@color/white" | |
| 75 | + android:layout_marginLeft="20dp" | |
| 76 | + android:padding="30dp" | |
| 77 | + android:orientation="vertical" | |
| 78 | + android:layout_marginRight="20dp" | |
| 79 | + | |
| 80 | + > | |
| 81 | + <TextView | |
| 82 | + android:id="@+id/tv_info" | |
| 83 | + android:layout_width="wrap_content" | |
| 84 | + android:layout_height="match_parent" | |
| 85 | + android:layout_marginLeft="20dp" | |
| 86 | + android:text="生成孩子“汇作业”账号为:sz1803081515,初始密码为:sz1803081515(与账号相同)。孩子可以下载“汇作业”app进行使用" | |
| 87 | + android:gravity="center" | |
| 88 | + android:textColor="@color/textColor" | |
| 89 | + android:textSize="@dimen/txtsize_headline" /> | |
| 90 | + <LinearLayout | |
| 91 | + android:layout_width="match_parent" | |
| 92 | + android:layout_height="wrap_content" | |
| 93 | + android:layout_marginTop="10dp" | |
| 94 | + android:gravity="center" | |
| 95 | + > | |
| 96 | + <TextView | |
| 97 | + android:layout_width="wrap_content" | |
| 98 | + android:layout_height="match_parent" | |
| 99 | + android:layout_marginLeft="20dp" | |
| 100 | + android:text="下载地址:" | |
| 101 | + android:textColor="@color/textColor" | |
| 102 | + android:textSize="@dimen/txtsize_headline" /> | |
| 103 | + <TextView | |
| 104 | + android:id="@+id/zuoye" | |
| 105 | + android:layout_width="wrap_content" | |
| 106 | + android:layout_height="match_parent" | |
| 107 | + android:layout_marginLeft="20dp" | |
| 108 | + android:text="汇作业" | |
| 109 | + android:gravity="center" | |
| 110 | + android:textColor="@color/textBlue" | |
| 111 | + android:textSize="@dimen/txtsize_headline" /> | |
| 112 | + </LinearLayout> | |
| 113 | + | |
| 114 | + </LinearLayout> | |
| 10 | 115 | <ProgressBar |
| 11 | 116 | android:id="@+id/pb_web" |
| 12 | 117 | style="?android:attr/progressBarStyleHorizontal" |
| ... | ... | @@ -17,6 +122,10 @@ |
| 17 | 122 | <com.share.mvpsdk.widgets.NestedScrollWebView |
| 18 | 123 | android:layout_width="match_parent" |
| 19 | 124 | android:layout_height="match_parent" |
| 20 | - android:id="@+id/nesteScrollWebView"/> | |
| 125 | + android:layout_marginLeft="20dp" | |
| 126 | + android:layout_marginRight="20dp" | |
| 127 | + android:layout_marginTop="10dp" | |
| 128 | + android:id="@+id/nesteScrollWebView" | |
| 129 | + ></com.share.mvpsdk.widgets.NestedScrollWebView> | |
| 21 | 130 | |
| 22 | 131 | </LinearLayout> | ... | ... |
app/src/main/res/layout/activity_webview.xml
| ... | ... | @@ -1,126 +0,0 @@ |
| 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_height="match_parent" | |
| 5 | - android:orientation="vertical" | |
| 6 | - android:background="@color/bgColor"> | |
| 7 | - <RelativeLayout | |
| 8 | - android:layout_width="match_parent" | |
| 9 | - android:background="@color/back_top" | |
| 10 | - android:layout_height="?android:actionBarSize" | |
| 11 | - android:orientation="horizontal" | |
| 12 | - > | |
| 13 | - <TextView | |
| 14 | - android:id="@+id/close_btn" | |
| 15 | - android:layout_width="30dp" | |
| 16 | - android:layout_height="30dp" | |
| 17 | - android:layout_marginLeft="10dp" | |
| 18 | - android:layout_centerVertical="true" | |
| 19 | - android:background="@drawable/close" | |
| 20 | - /> | |
| 21 | - <TextView | |
| 22 | - android:id="@+id/title_web" | |
| 23 | - android:layout_width="wrap_content" | |
| 24 | - android:layout_height="wrap_content" | |
| 25 | - android:text="订购中心" | |
| 26 | - android:textSize="@dimen/txtsize_title" | |
| 27 | - android:layout_centerInParent="true" | |
| 28 | - android:visibility="gone" | |
| 29 | - android:textColor="@color/textColor" | |
| 30 | - | |
| 31 | - /> | |
| 32 | - | |
| 33 | - </RelativeLayout> | |
| 34 | - | |
| 35 | - <ProgressBar | |
| 36 | - android:id="@+id/pb_web" | |
| 37 | - style="?android:attr/progressBarStyleHorizontal" | |
| 38 | - android:layout_width="match_parent" | |
| 39 | - android:layout_height="3dp" | |
| 40 | - android:progressDrawable="@drawable/web_progress_bar_bg" | |
| 41 | - android:visibility="gone"/> | |
| 42 | - | |
| 43 | - <LinearLayout | |
| 44 | - android:id="@+id/binding_success1" | |
| 45 | - android:layout_width="match_parent" | |
| 46 | - android:layout_height="wrap_content" | |
| 47 | - android:gravity="center" | |
| 48 | - android:background="@color/white" | |
| 49 | - android:layout_marginLeft="20dp" | |
| 50 | - android:padding="30dp" | |
| 51 | - android:layout_marginRight="20dp" | |
| 52 | - | |
| 53 | - > | |
| 54 | - | |
| 55 | - <ImageView | |
| 56 | - android:layout_width="40dp" | |
| 57 | - android:layout_height="40dp" | |
| 58 | - android:background="@drawable/success_big" /> | |
| 59 | - | |
| 60 | - <TextView | |
| 61 | - android:layout_width="wrap_content" | |
| 62 | - android:layout_height="match_parent" | |
| 63 | - android:layout_marginLeft="20dp" | |
| 64 | - android:text="绑定成功" | |
| 65 | - android:gravity="center" | |
| 66 | - android:textColor="@color/textColor" | |
| 67 | - android:textSize="@dimen/txtsize_headline" /> | |
| 68 | - | |
| 69 | - </LinearLayout> | |
| 70 | - <LinearLayout | |
| 71 | - android:id="@+id/binding_success2" | |
| 72 | - android:visibility="gone" | |
| 73 | - android:layout_width="match_parent" | |
| 74 | - android:layout_height="wrap_content" | |
| 75 | - android:gravity="center" | |
| 76 | - android:background="@color/white" | |
| 77 | - android:layout_marginLeft="20dp" | |
| 78 | - android:padding="30dp" | |
| 79 | - android:orientation="vertical" | |
| 80 | - android:layout_marginRight="20dp" | |
| 81 | - | |
| 82 | - > | |
| 83 | - <TextView | |
| 84 | - android:id="@+id/tv_info" | |
| 85 | - android:layout_width="wrap_content" | |
| 86 | - android:layout_height="match_parent" | |
| 87 | - android:layout_marginLeft="20dp" | |
| 88 | - android:text="生成孩子“汇作业”账号为:sz1803081515,初始密码为:sz1803081515(与账号相同)。孩子可以下载“汇作业”app进行使用" | |
| 89 | - android:gravity="center" | |
| 90 | - android:textColor="@color/textColor" | |
| 91 | - android:textSize="@dimen/txtsize_headline" /> | |
| 92 | - <LinearLayout | |
| 93 | - android:layout_width="match_parent" | |
| 94 | - android:layout_height="wrap_content" | |
| 95 | - android:layout_marginTop="10dp" | |
| 96 | - android:gravity="center" | |
| 97 | - > | |
| 98 | - <TextView | |
| 99 | - android:layout_width="wrap_content" | |
| 100 | - android:layout_height="match_parent" | |
| 101 | - android:layout_marginLeft="20dp" | |
| 102 | - android:text="下载地址:" | |
| 103 | - android:textColor="@color/textColor" | |
| 104 | - android:textSize="@dimen/txtsize_headline" /> | |
| 105 | - <TextView | |
| 106 | - android:id="@+id/zuoye" | |
| 107 | - android:layout_width="wrap_content" | |
| 108 | - android:layout_height="match_parent" | |
| 109 | - android:layout_marginLeft="20dp" | |
| 110 | - android:text="汇作业" | |
| 111 | - android:gravity="center" | |
| 112 | - android:textColor="@color/textBlue" | |
| 113 | - android:textSize="@dimen/txtsize_headline" /> | |
| 114 | - </LinearLayout> | |
| 115 | - | |
| 116 | - </LinearLayout> | |
| 117 | - <com.share.mvpsdk.widgets.NestedScrollWebView | |
| 118 | - android:id="@+id/webView" | |
| 119 | - android:layout_height="match_parent" | |
| 120 | - android:layout_width="match_parent" | |
| 121 | - android:layout_marginTop="20dp" | |
| 122 | - android:layout_marginRight="20dp" | |
| 123 | - android:layout_marginLeft="20dp" | |
| 124 | - /> | |
| 125 | - | |
| 126 | -</LinearLayout> |
app/src/main/res/layout/dialog_view.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | - android:layout_width="300dp" | |
| 3 | + android:layout_width="260dp" | |
| 4 | 4 | android:layout_gravity="center" |
| 5 | 5 | android:layout_height="wrap_content" |
| 6 | 6 | android:background="#00000000" |
| ... | ... | @@ -8,11 +8,12 @@ |
| 8 | 8 | |
| 9 | 9 | <TextView |
| 10 | 10 | android:id="@+id/dialog_info" |
| 11 | - android:layout_width="300dp" | |
| 12 | - android:layout_height="200dp" | |
| 11 | + android:layout_width="260dp" | |
| 12 | + android:layout_height="180dp" | |
| 13 | 13 | android:gravity="center" |
| 14 | - android:textSize="@dimen/txtsize_headline" | |
| 14 | + android:textSize="@dimen/sp_18" | |
| 15 | 15 | android:layout_gravity="center" |
| 16 | + android:padding="@dimen/size_dp_10" | |
| 16 | 17 | android:background="@drawable/rudiobtn_white" /> |
| 17 | 18 | |
| 18 | 19 | <LinearLayout |
| ... | ... | @@ -22,22 +23,22 @@ |
| 22 | 23 | |
| 23 | 24 | <TextView |
| 24 | 25 | android:id="@+id/cancel_btn" |
| 25 | - android:layout_width="140dp" | |
| 26 | + android:layout_width="120dp" | |
| 26 | 27 | android:layout_height="40dp" |
| 27 | 28 | android:gravity="center" |
| 28 | 29 | android:textColor="@color/white" |
| 29 | - android:textSize="@dimen/txtsize_title" | |
| 30 | + android:textSize="@dimen/sp_16" | |
| 30 | 31 | android:background="@drawable/rudiobtn" |
| 31 | 32 | android:text="取消" /> |
| 32 | 33 | |
| 33 | 34 | <TextView |
| 34 | 35 | android:id="@+id/right_btn" |
| 35 | 36 | android:layout_marginLeft="20dp" |
| 36 | - android:layout_width="140dp" | |
| 37 | + android:layout_width="120dp" | |
| 37 | 38 | android:layout_height="40dp" |
| 38 | 39 | android:gravity="center" |
| 39 | 40 | android:textColor="@color/white" |
| 40 | - android:textSize="@dimen/txtsize_title" | |
| 41 | + android:textSize="@dimen/sp_16" | |
| 41 | 42 | android:background="@drawable/rudiobtn" |
| 42 | 43 | android:text="确定" /> |
| 43 | 44 | </LinearLayout> | ... | ... |
app/src/main/res/layout/fragment_ce_ping.xml
| ... | ... | @@ -164,8 +164,15 @@ |
| 164 | 164 | android:layout_height="match_parent" |
| 165 | 165 | android:layout_marginRight="@dimen/size_dp_5" |
| 166 | 166 | android:layout_weight="1" |
| 167 | + android:onClick="onClick" | |
| 167 | 168 | android:background="@drawable/shape_xueqing_radius8"> |
| 168 | - | |
| 169 | + <ImageView | |
| 170 | + android:layout_margin="@dimen/size_dp_8" | |
| 171 | + android:layout_width="match_parent" | |
| 172 | + android:layout_height="match_parent" | |
| 173 | + android:scaleType="fitXY" | |
| 174 | + android:id="@+id/ivCourse1" | |
| 175 | + /> | |
| 169 | 176 | <LinearLayout |
| 170 | 177 | android:layout_width="wrap_content" |
| 171 | 178 | android:layout_height="wrap_content" |
| ... | ... | @@ -175,6 +182,7 @@ |
| 175 | 182 | android:orientation="vertical"> |
| 176 | 183 | |
| 177 | 184 | <TextView |
| 185 | + android:id="@+id/tvCourse1" | |
| 178 | 186 | android:layout_width="wrap_content" |
| 179 | 187 | android:layout_height="wrap_content" |
| 180 | 188 | android:text="热门课程" |
| ... | ... | @@ -209,8 +217,15 @@ |
| 209 | 217 | android:layout_marginBottom="@dimen/size_dp_5" |
| 210 | 218 | android:layout_marginRight="@dimen/size_dp_5" |
| 211 | 219 | android:layout_weight="1" |
| 220 | + android:onClick="onClick" | |
| 212 | 221 | android:background="@drawable/shape_xueqing_radius8"> |
| 213 | - | |
| 222 | + <ImageView | |
| 223 | + android:layout_margin="@dimen/size_dp_8" | |
| 224 | + android:layout_width="match_parent" | |
| 225 | + android:layout_height="match_parent" | |
| 226 | + android:scaleType="fitXY" | |
| 227 | + android:id="@+id/ivCourse2" | |
| 228 | + /> | |
| 214 | 229 | <LinearLayout |
| 215 | 230 | android:layout_width="wrap_content" |
| 216 | 231 | android:layout_height="wrap_content" |
| ... | ... | @@ -220,6 +235,7 @@ |
| 220 | 235 | android:orientation="vertical"> |
| 221 | 236 | |
| 222 | 237 | <TextView |
| 238 | + android:id="@+id/tvCourse2" | |
| 223 | 239 | android:layout_width="wrap_content" |
| 224 | 240 | android:layout_height="wrap_content" |
| 225 | 241 | android:text="热门课程" |
| ... | ... | @@ -247,8 +263,15 @@ |
| 247 | 263 | android:layout_marginRight="@dimen/size_dp_5" |
| 248 | 264 | android:layout_marginTop="@dimen/size_dp_5" |
| 249 | 265 | android:layout_weight="1" |
| 266 | + android:onClick="onClick" | |
| 250 | 267 | android:background="@drawable/shape_xueqing_radius8"> |
| 251 | - | |
| 268 | + <ImageView | |
| 269 | + android:layout_margin="@dimen/size_dp_8" | |
| 270 | + android:layout_width="match_parent" | |
| 271 | + android:layout_height="match_parent" | |
| 272 | + android:scaleType="fitXY" | |
| 273 | + android:id="@+id/ivCourse3" | |
| 274 | + /> | |
| 252 | 275 | <LinearLayout |
| 253 | 276 | android:layout_width="wrap_content" |
| 254 | 277 | android:layout_height="wrap_content" |
| ... | ... | @@ -258,6 +281,7 @@ |
| 258 | 281 | android:orientation="vertical"> |
| 259 | 282 | |
| 260 | 283 | <TextView |
| 284 | + android:id="@+id/tvCourse3" | |
| 261 | 285 | android:layout_width="wrap_content" |
| 262 | 286 | android:layout_height="wrap_content" |
| 263 | 287 | android:text="热门课程" | ... | ... |
app/src/main/res/layout/fragment_consult_one_level.xml
| ... | ... | @@ -19,12 +19,12 @@ |
| 19 | 19 | |
| 20 | 20 | <include layout="@layout/layout_textandimgshow"/> |
| 21 | 21 | |
| 22 | - <android.support.v7.widget.RecyclerView | |
| 22 | + <com.jcodecraeer.xrecyclerview.XRecyclerView | |
| 23 | 23 | android:layout_marginTop="@dimen/size_dp_10" |
| 24 | 24 | android:layout_width="match_parent" |
| 25 | 25 | android:layout_height="0dp" |
| 26 | 26 | android:layout_weight="3" |
| 27 | 27 | android:id="@+id/recyclerViewConsultOne" |
| 28 | - ></android.support.v7.widget.RecyclerView> | |
| 28 | + ></com.jcodecraeer.xrecyclerview.XRecyclerView> | |
| 29 | 29 | |
| 30 | 30 | </LinearLayout> | ... | ... |
app/src/main/res/layout/fragment_consult_two_level.xml
| ... | ... | @@ -17,12 +17,14 @@ |
| 17 | 17 | android:paddingBottom="@dimen/size_dp_5" |
| 18 | 18 | /> |
| 19 | 19 | |
| 20 | - <android.support.v7.widget.RecyclerView | |
| 20 | + <com.jcodecraeer.xrecyclerview.XRecyclerView | |
| 21 | 21 | android:layout_marginLeft="@dimen/size_dp_10" |
| 22 | 22 | android:layout_marginRight="@dimen/size_dp_10" |
| 23 | 23 | android:id="@+id/recyclerView" |
| 24 | 24 | android:layout_width="match_parent" |
| 25 | - android:layout_height="match_parent"></android.support.v7.widget.RecyclerView> | |
| 25 | + android:layout_height="match_parent"> | |
| 26 | + | |
| 27 | + </com.jcodecraeer.xrecyclerview.XRecyclerView> | |
| 26 | 28 | |
| 27 | 29 | |
| 28 | 30 | </LinearLayout> | ... | ... |
app/src/main/res/layout/fragment_login_and_regist.xml
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | xmlns:tools="http://schemas.android.com/tools" |
| 4 | 4 | android:layout_width="match_parent" |
| 5 | 5 | android:layout_height="match_parent" |
| 6 | + android:background="@color/white" | |
| 6 | 7 | tools:context="com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment"> |
| 7 | 8 | |
| 8 | 9 | |
| ... | ... | @@ -20,7 +21,7 @@ |
| 20 | 21 | android:layout_width="60dp" |
| 21 | 22 | android:layout_height="20dp" |
| 22 | 23 | android:visibility="invisible" |
| 23 | - android:src="@drawable/arrow_left" | |
| 24 | + android:src="@drawable/back" | |
| 24 | 25 | /> |
| 25 | 26 | </LinearLayout> |
| 26 | 27 | |
| ... | ... | @@ -59,6 +60,7 @@ |
| 59 | 60 | android:text="" |
| 60 | 61 | android:maxLength="11" |
| 61 | 62 | android:textColorHint="@color/hintTextColor" |
| 63 | + android:textColor="@color/textColor" | |
| 62 | 64 | android:textSize="@dimen/sp_16" /> |
| 63 | 65 | |
| 64 | 66 | <TextView |
| ... | ... | @@ -86,6 +88,7 @@ |
| 86 | 88 | android:background="@null" |
| 87 | 89 | android:hint="请输入验证码" |
| 88 | 90 | android:textColorHint="@color/hintTextColor" |
| 91 | + android:textColor="@color/textColor" | |
| 89 | 92 | android:textSize="@dimen/sp_16" /> |
| 90 | 93 | |
| 91 | 94 | <TextView |
| ... | ... | @@ -197,6 +200,7 @@ |
| 197 | 200 | android:layout_height="wrap_content" |
| 198 | 201 | android:layout_marginTop="40dp" |
| 199 | 202 | android:background="@drawable/rudiobtn_unclick" |
| 203 | + android:enabled="false" | |
| 200 | 204 | android:gravity="center" |
| 201 | 205 | android:paddingBottom="10dp" |
| 202 | 206 | android:paddingTop="10dp" | ... | ... |
app/src/main/res/layout/fragment_mine.xml
| ... | ... | @@ -99,7 +99,7 @@ |
| 99 | 99 | <LinearLayout |
| 100 | 100 | android:layout_width="match_parent" |
| 101 | 101 | android:gravity="center_vertical" |
| 102 | - android:layout_height="40dp"> | |
| 102 | + android:layout_height="?android:actionBarSize"> | |
| 103 | 103 | |
| 104 | 104 | <TextView |
| 105 | 105 | android:layout_width="25dp" |
| ... | ... | @@ -136,7 +136,7 @@ |
| 136 | 136 | <LinearLayout |
| 137 | 137 | android:id="@+id/layout_orderDetail" |
| 138 | 138 | android:layout_width="match_parent" |
| 139 | - android:layout_height="40dp" | |
| 139 | + android:layout_height="?android:actionBarSize" | |
| 140 | 140 | android:gravity="center_vertical" |
| 141 | 141 | |
| 142 | 142 | > |
| ... | ... | @@ -167,7 +167,7 @@ |
| 167 | 167 | <LinearLayout |
| 168 | 168 | android:id="@+id/layout_order" |
| 169 | 169 | android:layout_width="match_parent" |
| 170 | - android:layout_height="40dp" | |
| 170 | + android:layout_height="?android:actionBarSize" | |
| 171 | 171 | android:gravity="center_vertical" |
| 172 | 172 | > |
| 173 | 173 | |
| ... | ... | @@ -197,7 +197,7 @@ |
| 197 | 197 | <LinearLayout |
| 198 | 198 | android:id="@+id/childlayout" |
| 199 | 199 | android:layout_width="match_parent" |
| 200 | - android:layout_height="40dp" | |
| 200 | + android:layout_height="?android:actionBarSize" | |
| 201 | 201 | android:gravity="center_vertical" |
| 202 | 202 | > |
| 203 | 203 | |
| ... | ... | @@ -217,6 +217,7 @@ |
| 217 | 217 | android:textSize="@dimen/txtsize_title" /> |
| 218 | 218 | |
| 219 | 219 | <TextView |
| 220 | + android:id="@+id/binding_state" | |
| 220 | 221 | android:layout_width="80dp" |
| 221 | 222 | android:layout_height="wrap_content" |
| 222 | 223 | android:layout_gravity="center_vertical" |
| ... | ... | @@ -238,9 +239,10 @@ |
| 238 | 239 | android:orientation="vertical"> |
| 239 | 240 | |
| 240 | 241 | <LinearLayout |
| 242 | + android:id="@+id/layoutAdvice" | |
| 241 | 243 | android:layout_width="match_parent" |
| 242 | 244 | android:gravity="center_vertical" |
| 243 | - android:layout_height="40dp"> | |
| 245 | + android:layout_height="?android:actionBarSize"> | |
| 244 | 246 | |
| 245 | 247 | <TextView |
| 246 | 248 | android:layout_width="25dp" |
| ... | ... | @@ -267,8 +269,9 @@ |
| 267 | 269 | android:background="@color/bottomline" /> |
| 268 | 270 | |
| 269 | 271 | <LinearLayout |
| 272 | + android:id="@+id/layout_cache" | |
| 270 | 273 | android:layout_width="match_parent" |
| 271 | - android:layout_height="40dp" | |
| 274 | + android:layout_height="?android:actionBarSize" | |
| 272 | 275 | android:gravity="center_vertical" |
| 273 | 276 | |
| 274 | 277 | > |
| ... | ... | @@ -296,11 +299,12 @@ |
| 296 | 299 | android:layout_marginLeft="15dp" |
| 297 | 300 | android:layout_marginRight="15dp" |
| 298 | 301 | android:background="@color/bottomline" /> |
| 302 | + | |
| 299 | 303 | <LinearLayout |
| 304 | + android:id="@+id/layout_about" | |
| 300 | 305 | android:layout_width="match_parent" |
| 301 | - android:layout_height="40dp" | |
| 302 | - android:gravity="center_vertical" | |
| 303 | - > | |
| 306 | + android:layout_height="?android:actionBarSize" | |
| 307 | + android:gravity="center_vertical"> | |
| 304 | 308 | |
| 305 | 309 | <TextView |
| 306 | 310 | android:layout_width="25dp" |
| ... | ... | @@ -320,7 +324,19 @@ |
| 320 | 324 | </LinearLayout> |
| 321 | 325 | </LinearLayout> |
| 322 | 326 | |
| 323 | - | |
| 327 | + <TextView | |
| 328 | + android:id="@+id/tvExit" | |
| 329 | + android:layout_width="match_parent" | |
| 330 | + android:layout_height="?android:actionBarSize" | |
| 331 | + android:layout_gravity="center_vertical" | |
| 332 | + android:gravity="center" | |
| 333 | + android:layout_weight="1" | |
| 334 | + android:layout_marginTop="@dimen/size_dp_15" | |
| 335 | + android:layout_marginBottom="@dimen/size_dp_15" | |
| 336 | + android:background="@drawable/shape_xueqing_radius8" | |
| 337 | + android:text="退出登录" | |
| 338 | + android:textColor="@color/white" | |
| 339 | + android:textSize="@dimen/size_dp_16" /> | |
| 324 | 340 | |
| 325 | 341 | </LinearLayout> |
| 326 | 342 | </ScrollView> | ... | ... |
app/src/main/res/layout/fragment_report.xml
| ... | ... | @@ -15,12 +15,13 @@ |
| 15 | 15 | android:padding="10dp"> |
| 16 | 16 | |
| 17 | 17 | <TextView |
| 18 | + android:id="@+id/tvName" | |
| 18 | 19 | android:layout_width="wrap_content" |
| 19 | 20 | android:layout_height="wrap_content" |
| 20 | 21 | android:layout_gravity="center_vertical" |
| 21 | 22 | android:drawablePadding="10dp" |
| 22 | 23 | android:drawableRight="@drawable/pull" |
| 23 | - android:text="马铂骞" | |
| 24 | + android:text="" | |
| 24 | 25 | android:textColor="@color/textColor" |
| 25 | 26 | android:textSize="@dimen/textSize16" /> |
| 26 | 27 | |
| ... | ... | @@ -46,6 +47,17 @@ |
| 46 | 47 | android:textSize="@dimen/textSize16" /> |
| 47 | 48 | </LinearLayout> |
| 48 | 49 | |
| 50 | + <TextView | |
| 51 | + android:layout_width="match_parent" | |
| 52 | + android:layout_height="match_parent" | |
| 53 | + android:textSize="@dimen/size_dp_16" | |
| 54 | + android:textColor="@color/xueqing_blue" | |
| 55 | + android:text="没有绑定孩子,\n请去个人中心绑定孩子" | |
| 56 | + android:gravity="center" | |
| 57 | + android:lineSpacingExtra="@dimen/size_dp_5" | |
| 58 | + android:id="@+id/tvNoData" | |
| 59 | + /> | |
| 60 | + | |
| 49 | 61 | <LinearLayout |
| 50 | 62 | android:layout_width="match_parent" |
| 51 | 63 | android:layout_height="match_parent" | ... | ... |
app/src/main/res/layout/fragment_start.xml
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | xmlns:tools="http://schemas.android.com/tools" |
| 3 | 3 | android:layout_width="match_parent" |
| 4 | 4 | android:layout_height="match_parent" |
| 5 | + android:background="@color/bgColor" | |
| 5 | 6 | tools:context="com.shunzhi.parent.ui.fragment.StartFragment"> |
| 6 | 7 | |
| 7 | 8 | <com.stx.xhb.xbanner.XBanner |
| ... | ... | @@ -9,4 +10,17 @@ |
| 9 | 10 | android:layout_height="match_parent" |
| 10 | 11 | android:id="@+id/xBanner" |
| 11 | 12 | ></com.stx.xhb.xbanner.XBanner> |
| 13 | + | |
| 14 | + <TextView | |
| 15 | + android:id="@+id/tvJump" | |
| 16 | + android:layout_width="wrap_content" | |
| 17 | + android:layout_height="wrap_content" | |
| 18 | + android:text="跳过" | |
| 19 | + android:textColor="@color/white" | |
| 20 | + android:textSize="@dimen/size_dp_16" | |
| 21 | + android:padding="@dimen/size_dp_10" | |
| 22 | + android:layout_gravity="right" | |
| 23 | + android:layout_margin="@dimen/size_dp_10" | |
| 24 | + android:background="@drawable/shape_xueqing_radius8" | |
| 25 | + /> | |
| 12 | 26 | </FrameLayout> | ... | ... |
app/src/main/res/layout/fragment_zi_xun.xml
| ... | ... | @@ -14,20 +14,17 @@ |
| 14 | 14 | android:layout_height="0dp" |
| 15 | 15 | android:layout_weight="2"></com.stx.xhb.xbanner.XBanner> |
| 16 | 16 | |
| 17 | - <LinearLayout | |
| 18 | - android:layout_width="wrap_content" | |
| 19 | - android:layout_height="wrap_content" | |
| 20 | - android:layout_marginLeft="@dimen/size_dp_10" | |
| 21 | - android:layout_marginRight="@dimen/size_dp_10" | |
| 22 | - > | |
| 17 | + | |
| 23 | 18 | <include layout="@layout/layout_textandimgshow" |
| 24 | 19 | /> |
| 25 | - </LinearLayout> | |
| 20 | + | |
| 21 | + | |
| 26 | 22 | <LinearLayout |
| 27 | 23 | android:layout_width="match_parent" |
| 28 | - android:layout_height="wrap_content" | |
| 24 | + android:layout_height="0dp" | |
| 29 | 25 | android:paddingLeft="@dimen/size_dp_10" |
| 30 | 26 | android:paddingRight="@dimen/size_dp_10" |
| 27 | + android:layout_weight="3" | |
| 31 | 28 | android:orientation="vertical"> |
| 32 | 29 | |
| 33 | 30 | <TextView |
| ... | ... | @@ -41,18 +38,19 @@ |
| 41 | 38 | <LinearLayout |
| 42 | 39 | android:layout_width="match_parent" |
| 43 | 40 | android:layout_height="wrap_content"> |
| 44 | - <android.support.v7.widget.RecyclerView | |
| 45 | - android:id="@+id/recycler_content" | |
| 46 | - android:layout_width="match_parent" | |
| 47 | - android:layout_height="match_parent"> | |
| 48 | 41 | |
| 49 | - </android.support.v7.widget.RecyclerView> | |
| 42 | + <com.jcodecraeer.xrecyclerview.XRecyclerView | |
| 43 | + android:id="@+id/recycler_content" | |
| 44 | + android:layout_width="match_parent" | |
| 45 | + android:layout_height="wrap_content"> | |
| 46 | + </com.jcodecraeer.xrecyclerview.XRecyclerView> | |
| 50 | 47 | </LinearLayout> |
| 51 | 48 | </LinearLayout> |
| 52 | 49 | |
| 53 | 50 | |
| 54 | 51 | <FrameLayout |
| 55 | 52 | android:layout_width="match_parent" |
| 53 | + android:visibility="gone" | |
| 56 | 54 | android:layout_height="0dp" |
| 57 | 55 | android:layout_margin="@dimen/size_dp_10" |
| 58 | 56 | android:layout_weight="2"> |
| ... | ... | @@ -60,7 +58,8 @@ |
| 60 | 58 | <cn.jzvd.JZVideoPlayerStandard |
| 61 | 59 | android:id="@+id/videoplayer" |
| 62 | 60 | android:layout_width="match_parent" |
| 63 | - android:layout_height="match_parent"></cn.jzvd.JZVideoPlayerStandard> | |
| 61 | + android:layout_height="match_parent" | |
| 62 | + ></cn.jzvd.JZVideoPlayerStandard> | |
| 64 | 63 | |
| 65 | 64 | <TextView |
| 66 | 65 | android:id="@+id/tvVideoTitle" | ... | ... |
app/src/main/res/layout/item_childlist.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | 3 | android:layout_width="match_parent" |
| 4 | + android:background="@color/white" | |
| 5 | + android:divider="@color/divider_gray" | |
| 6 | + android:layout_marginTop="@dimen/size_dp_10" | |
| 4 | 7 | android:layout_height="wrap_content"> |
| 5 | 8 | |
| 6 | 9 | <LinearLayout | ... | ... |
app/src/main/res/layout/item_order_list.xml
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | android:layout_width="match_parent" |
| 4 | 4 | android:orientation="vertical" |
| 5 | 5 | android:elevation="@dimen/size_dp_5" |
| 6 | + android:layout_margin="@dimen/size_dp_5" | |
| 6 | 7 | android:background="@drawable/shape_xueqing_radius8" |
| 7 | 8 | android:id="@+id/layout_order_list" |
| 8 | 9 | android:layout_height="wrap_content"> |
| ... | ... | @@ -44,20 +45,35 @@ |
| 44 | 45 | android:background="@drawable/shape_radius8_whit" |
| 45 | 46 | android:layout_width="match_parent" |
| 46 | 47 | android:layout_height="wrap_content"> |
| 48 | + <LinearLayout | |
| 49 | + android:paddingBottom="@dimen/size_dp_5" | |
| 50 | + android:paddingTop="@dimen/size_dp_5" | |
| 51 | + android:layout_gravity="center" | |
| 52 | + android:gravity="center" | |
| 53 | + android:layout_width="wrap_content" | |
| 54 | + android:layout_height="wrap_content"> | |
| 55 | + | |
| 56 | + | |
| 57 | + <ImageView | |
| 58 | + android:id="@+id/ivState" | |
| 59 | + android:layout_width="@dimen/size_dp_20" | |
| 60 | + android:layout_height="@dimen/size_dp_20" | |
| 61 | + android:src="@drawable/success" | |
| 62 | + android:layout_marginRight="@dimen/size_dp_5" | |
| 63 | + /> | |
| 64 | + | |
| 65 | + <TextView | |
| 66 | + android:id="@+id/tvPayState" | |
| 67 | + android:layout_gravity="center" | |
| 68 | + android:drawablePadding="@dimen/size_dp_5" | |
| 69 | + android:layout_width="wrap_content" | |
| 70 | + android:layout_height="wrap_content" | |
| 71 | + android:text="订购成功" | |
| 72 | + android:textColor="@color/xueqing_blue" | |
| 73 | + android:textSize="@dimen/textSize16" | |
| 74 | + android:gravity="center" | |
| 75 | + /> | |
| 76 | + </LinearLayout> | |
| 47 | 77 | |
| 48 | - <TextView | |
| 49 | - android:id="@+id/tvPayState" | |
| 50 | - android:layout_gravity="center" | |
| 51 | - android:drawablePadding="@dimen/size_dp_5" | |
| 52 | - android:layout_width="wrap_content" | |
| 53 | - android:layout_height="wrap_content" | |
| 54 | - android:text="订购成功" | |
| 55 | - android:textColor="@color/xueqing_blue" | |
| 56 | - android:textSize="@dimen/textSize16" | |
| 57 | - android:gravity="center" | |
| 58 | - android:paddingBottom="@dimen/size_dp_5" | |
| 59 | - android:paddingTop="@dimen/size_dp_5" | |
| 60 | - android:drawableLeft="@drawable/order_success" | |
| 61 | - /> | |
| 62 | 78 | </FrameLayout> |
| 63 | 79 | </LinearLayout> |
| 64 | 80 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/layout_consult_content.xml
| ... | ... | @@ -2,9 +2,11 @@ |
| 2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | 3 | android:layout_width="match_parent" |
| 4 | 4 | android:layout_height="wrap_content" |
| 5 | - android:layout_marginBottom="@dimen/size_dp_10"> | |
| 5 | + android:layout_marginBottom="@dimen/size_dp_10" | |
| 6 | + android:orientation="vertical"> | |
| 6 | 7 | |
| 7 | 8 | <LinearLayout |
| 9 | + android:id="@+id/normal_content" | |
| 8 | 10 | android:layout_width="match_parent" |
| 9 | 11 | android:layout_height="match_parent" |
| 10 | 12 | android:background="@drawable/report_white"> |
| ... | ... | @@ -77,4 +79,19 @@ |
| 77 | 79 | android:layout_weight="2" |
| 78 | 80 | android:src="@color/xueqing_blue" /> |
| 79 | 81 | </LinearLayout> |
| 82 | + | |
| 83 | + <FrameLayout | |
| 84 | + android:id="@+id/frame_ad" | |
| 85 | + android:layout_width="match_parent" | |
| 86 | + android:layout_height="match_parent" | |
| 87 | + android:visibility="gone" | |
| 88 | + > | |
| 89 | + | |
| 90 | + <ImageView | |
| 91 | + android:id="@+id/image_ad" | |
| 92 | + android:layout_width="match_parent" | |
| 93 | + android:layout_height="match_parent" | |
| 94 | + android:src="@drawable/backgroud_top" /> | |
| 95 | + | |
| 96 | + </FrameLayout> | |
| 80 | 97 | </LinearLayout> |
| 81 | 98 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/top.xml
| ... | ... | @@ -5,12 +5,16 @@ |
| 5 | 5 | android:background="@color/back_top" |
| 6 | 6 | android:padding="10dp"> |
| 7 | 7 | |
| 8 | - <TextView | |
| 8 | + <ImageView | |
| 9 | 9 | android:id="@+id/back_top" |
| 10 | - android:layout_width="30dp" | |
| 11 | - android:layout_height="30dp" | |
| 12 | - android:layout_gravity="center_vertical" | |
| 13 | - android:background="@drawable/arrow_left" /> | |
| 10 | + android:layout_width="wrap_content" | |
| 11 | + android:layout_height="match_parent" | |
| 12 | + android:gravity="center" | |
| 13 | + android:paddingLeft="@dimen/size_dp_15" | |
| 14 | + android:src="@drawable/back" | |
| 15 | + android:paddingRight="@dimen/size_dp_15" | |
| 16 | + android:textColor="@color/textColor" | |
| 17 | + android:textSize="@dimen/textSize16" /> | |
| 14 | 18 | |
| 15 | 19 | <TextView |
| 16 | 20 | android:id="@+id/center_title" |
| ... | ... | @@ -19,7 +23,7 @@ |
| 19 | 23 | android:layout_weight="1" |
| 20 | 24 | android:text="主题" |
| 21 | 25 | android:gravity="center" |
| 22 | - android:textColor="@color/textColor" | |
| 26 | + android:textColor="@color/white" | |
| 23 | 27 | android:textSize="@dimen/textSize16" /> |
| 24 | 28 | <TextView |
| 25 | 29 | android:layout_width="30dp" | ... | ... |
app/src/main/res/values/colors.xml
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <color name="colorAccent">#FF4081</color> |
| 6 | 6 | |
| 7 | 7 | |
| 8 | - <color name="hintTextColor">#C1C1C1</color> | |
| 8 | + <color name="hintTextColor">#494947</color> | |
| 9 | 9 | <color name="bottomline">#B8B8B9</color> |
| 10 | 10 | <color name="bg_main">#F0EFF5</color> |
| 11 | 11 | <color name="textRed">#FC5B6A</color> | ... | ... |
app/src/main/res/values/strings.xml
mvpsdk/build.gradle
mvpsdk/src/main/java/com/share/mvpsdk/helper/RetrofitCreateHelper.java
| ... | ... | @@ -24,12 +24,13 @@ import retrofit2.converter.gson.GsonConverterFactory; |
| 24 | 24 | public class RetrofitCreateHelper { |
| 25 | 25 | private static final int TIMEOUT_READ = 20; |
| 26 | 26 | private static final int TIMEOUT_CONNECTION = 10; |
| 27 | - private static String Authorization="",token=""; | |
| 28 | - private static RetrofitCreateHelper retrofitCreateHelper=null; | |
| 27 | + private static String Authorization = "", token = ""; | |
| 28 | + private static RetrofitCreateHelper retrofitCreateHelper = null; | |
| 29 | 29 | private static final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor() |
| 30 | 30 | .setLevel(HttpLoggingInterceptor.Level.BODY); |
| 31 | 31 | private static CacheInterceptor cacheInterceptor = new CacheInterceptor(); |
| 32 | - private static OkHttpClient.Builder okhttpClientBuilder=null; | |
| 32 | + private static OkHttpClient.Builder okhttpClientBuilder = null; | |
| 33 | + | |
| 33 | 34 | /*private static OkHttpClient okHttpClient = new OkHttpClient.Builder() |
| 34 | 35 | //SSL证书 |
| 35 | 36 | .sslSocketFactory(TrustManager.getUnsafeOkHttpClient()) |
| ... | ... | @@ -47,33 +48,39 @@ public class RetrofitCreateHelper { |
| 47 | 48 | //失败重连 |
| 48 | 49 | .retryOnConnectionFailure(true) |
| 49 | 50 | .build();*/ |
| 50 | - public static RetrofitCreateHelper getInstance(){ | |
| 51 | - if (null==retrofitCreateHelper){ | |
| 52 | - synchronized (RetrofitCreateHelper.class){ | |
| 53 | - if (null==retrofitCreateHelper)retrofitCreateHelper=new RetrofitCreateHelper(); | |
| 51 | + public static RetrofitCreateHelper getInstance() { | |
| 52 | + if (null == retrofitCreateHelper) { | |
| 53 | + synchronized (RetrofitCreateHelper.class) { | |
| 54 | + if (null == retrofitCreateHelper) retrofitCreateHelper = new RetrofitCreateHelper(); | |
| 54 | 55 | } |
| 55 | 56 | } |
| 56 | 57 | return retrofitCreateHelper; |
| 57 | 58 | } |
| 58 | 59 | |
| 59 | - public RetrofitCreateHelper(){ | |
| 60 | - if (null==okhttpClientBuilder)okhttpClientBuilder=new OkHttpClient.Builder(); | |
| 61 | - okhttpClientBuilder.connectTimeout(10000,TimeUnit.SECONDS); | |
| 62 | - okhttpClientBuilder.addInterceptor(new Interceptor() { | |
| 63 | - @Override | |
| 64 | - public Response intercept(Chain chain) throws IOException { | |
| 65 | - Request original = chain.request(); | |
| 66 | - Request.Builder requestBuilder = original.newBuilder().header("Authorization", Authorization); | |
| 67 | - Request request = requestBuilder.build(); | |
| 68 | - return chain.proceed(request); | |
| 60 | + public RetrofitCreateHelper() { | |
| 61 | + try { | |
| 62 | + if (null == okhttpClientBuilder) { | |
| 63 | + okhttpClientBuilder = new OkHttpClient.Builder(); | |
| 64 | + okhttpClientBuilder.connectTimeout(10000, TimeUnit.SECONDS); | |
| 65 | + okhttpClientBuilder.addInterceptor(new Interceptor() { | |
| 66 | + @Override | |
| 67 | + public Response intercept(Chain chain) throws IOException { | |
| 68 | + Request original = chain.request(); | |
| 69 | + Request.Builder requestBuilder = original.newBuilder().header("Authorization", Authorization); | |
| 70 | + Request request = requestBuilder.build(); | |
| 71 | + return chain.proceed(request); | |
| 72 | + } | |
| 73 | + }); | |
| 74 | + okhttpClientBuilder.addNetworkInterceptor(cacheInterceptor); | |
| 75 | + okhttpClientBuilder.addInterceptor(interceptor); | |
| 69 | 76 | } |
| 70 | - }); | |
| 71 | - okhttpClientBuilder.addNetworkInterceptor(cacheInterceptor); | |
| 72 | - okhttpClientBuilder.addInterceptor(interceptor); | |
| 77 | + } catch (Exception e) { | |
| 78 | + e.printStackTrace(); | |
| 79 | + } | |
| 73 | 80 | } |
| 74 | 81 | |
| 75 | 82 | public <T> T createApi(Class<T> clazz, String url) { |
| 76 | - Authorization=token; | |
| 83 | + Authorization = token; | |
| 77 | 84 | Retrofit retrofit = new Retrofit.Builder() |
| 78 | 85 | .baseUrl(url) |
| 79 | 86 | .client(okhttpClientBuilder.build()) |
| ... | ... | @@ -83,7 +90,7 @@ public class RetrofitCreateHelper { |
| 83 | 90 | return retrofit.create(clazz); |
| 84 | 91 | } |
| 85 | 92 | |
| 86 | -// public static <T> T loginApi(Class<T> clazz, String url) { | |
| 93 | + // public static <T> T loginApi(Class<T> clazz, String url) { | |
| 87 | 94 | // Authorization= StringUtils.getSign(); |
| 88 | 95 | // okHttpClient.newBuilder().addInterceptor(new Interceptor() { |
| 89 | 96 | // @Override |
| ... | ... | @@ -103,13 +110,13 @@ public class RetrofitCreateHelper { |
| 103 | 110 | // .build(); |
| 104 | 111 | // return retrofit.create(clazz); |
| 105 | 112 | // } |
| 106 | - public void setAuthorization(String Authorization){ | |
| 107 | - this.token=Authorization; | |
| 113 | + public void setAuthorization(String Authorization) { | |
| 114 | + this.token = Authorization; | |
| 108 | 115 | } |
| 109 | 116 | |
| 110 | - public <T> T login(Class<T> clazz,String url){ | |
| 111 | - Authorization= StringUtils.getSign(); | |
| 112 | - Retrofit retrofit=new Retrofit.Builder() | |
| 117 | + public <T> T login(Class<T> clazz, String url) { | |
| 118 | + Authorization = StringUtils.getSign(); | |
| 119 | + Retrofit retrofit = new Retrofit.Builder() | |
| 113 | 120 | .client(okhttpClientBuilder.build()) |
| 114 | 121 | .baseUrl(url) |
| 115 | 122 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) |
| ... | ... | @@ -119,6 +126,5 @@ public class RetrofitCreateHelper { |
| 119 | 126 | } |
| 120 | 127 | |
| 121 | 128 | |
| 122 | - | |
| 123 | 129 | } |
| 124 | 130 | ... | ... |
mvpsdk/src/main/java/com/share/mvpsdk/utils/CacheUtils.java
| ... | ... | @@ -96,6 +96,11 @@ public class CacheUtils { |
| 96 | 96 | cleanCustomCache(filepath); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | + public static void clearCache(Context context)throws Exception{ | |
| 100 | + File file=new File("/data/data/"+ context.getPackageName()); | |
| 101 | + cleanCustomCache(file.toString()); | |
| 102 | + } | |
| 103 | + | |
| 99 | 104 | public static String getCacheSize(Context context) throws Exception { |
| 100 | 105 | File file=new File("/data/data/"+ context.getPackageName()); |
| 101 | 106 | return getFormatSize(getFolderSize(file)); | ... | ... |