Commit ec9c6c5dc85de7728b4c1563b304f5cfc0cdd7c1
Exists in
yxb_dev
and in
2 other branches
Merge branch 'developer' of http://git.shunzhi.net/taohd/parentwork into developer
# Conflicts: # app/src/main/AndroidManifest.xml
Showing
27 changed files
with
279 additions
and
136 deletions
Show diff stats
app/src/main/AndroidManifest.xml
... | ... | @@ -129,7 +129,9 @@ |
129 | 129 | <activity |
130 | 130 | android:name=".ui.activity.MyChildActivity" |
131 | 131 | android:screenOrientation="portrait"/> |
132 | - <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"/> | |
132 | + <activity android:name=".ui.activity.consult.ConsultOneLevelActivity" | |
133 | + android:windowSoftInputMode="adjustPan|stateAlwaysHidden" | |
134 | + /> | |
133 | 135 | <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> --> |
134 | 136 | <activity |
135 | 137 | android:name=".ui.MainActivity" |
... | ... | @@ -170,8 +172,9 @@ |
170 | 172 | android:name=".ui.activity.mywebview.WebViewActivity" |
171 | 173 | android:launchMode="singleInstance" |
172 | 174 | android:screenOrientation="portrait"/> |
173 | - <activity | |
174 | - android:name=".ui.activity.consult.ConsultTwoLevelActivity" | |
175 | + | |
176 | + <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" | |
177 | + android:windowSoftInputMode="adjustPan|stateAlwaysHidden" | |
175 | 178 | android:launchMode="singleInstance"/> |
176 | 179 | <activity |
177 | 180 | android:name=".ui.activity.orderdetail.OrderDetailActivity" | ... | ... |
app/src/main/java/com/shunzhi/parent/adapter/MyConsultAdapter.java
... | ... | @@ -84,6 +84,8 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean |
84 | 84 | normal_content.setVisibility(View.VISIBLE); |
85 | 85 | tvConsultTitle.setText(object.getTitle()); |
86 | 86 | tvConsultContent.setText(object.getContent()); |
87 | + tvPingLunNums.setText("评论:"+object.getTalkNum()+""); | |
88 | + tvZhuanFaNums.setText("转发:"+object.getForwardingNum()+""); | |
87 | 89 | GlideUtils.showImg(mContext,iv_consult,object.getImage()); |
88 | 90 | normal_content.setOnClickListener(new View.OnClickListener() { |
89 | 91 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/consult/ConsultContract.java
... | ... | @@ -26,6 +26,8 @@ public interface ConsultContract { |
26 | 26 | public abstract void getBanners(String position, String areaName); |
27 | 27 | |
28 | 28 | public abstract void getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex); |
29 | + | |
30 | + public abstract void getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); | |
29 | 31 | } |
30 | 32 | |
31 | 33 | |
... | ... | @@ -35,6 +37,8 @@ public interface ConsultContract { |
35 | 37 | Observable<JsonObject> getBanners(String position, String areaName); |
36 | 38 | |
37 | 39 | Observable<JsonObject> getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex); |
40 | + | |
41 | + Observable<JsonObject> getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); | |
38 | 42 | } |
39 | 43 | |
40 | 44 | interface IConsultView extends IBaseFragment { | ... | ... |
app/src/main/java/com/shunzhi/parent/model/consult/ConsultModel.java
... | ... | @@ -34,6 +34,12 @@ public class ConsultModel extends BaseModel implements ConsultContract.IConsultM |
34 | 34 | .compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
35 | 35 | } |
36 | 36 | |
37 | + @Override | |
38 | + public Observable<JsonObject> getInformationTopic(String keyword, String areaName, String channel, String toFirstPage, int pageIndex) { | |
39 | + return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | |
40 | + .getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
41 | + } | |
42 | + | |
37 | 43 | public static ConsultContract.IConsultModel newInstance() { |
38 | 44 | return new ConsultModel(); |
39 | 45 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
1 | 1 | package com.shunzhi.parent.presenter.consult; |
2 | 2 | |
3 | +import android.util.Log; | |
3 | 4 | import android.view.View; |
4 | 5 | import android.widget.LinearLayout; |
5 | 6 | |
... | ... | @@ -95,9 +96,6 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
95 | 96 | mIView.showChannel(channelList); |
96 | 97 | mIView.showContext(contextList); |
97 | 98 | |
98 | - | |
99 | - | |
100 | - | |
101 | 99 | } |
102 | 100 | }, new Consumer<Throwable>() { |
103 | 101 | @Override |
... | ... | @@ -111,6 +109,30 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
111 | 109 | } |
112 | 110 | |
113 | 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 | + List<ChannelContextBean> channelList = new ArrayList<>(); | |
119 | + JsonArray jsonArray=json.getAsJsonArray("channelList"); | |
120 | + for (int i = 0; i < jsonArray.size(); i++) { | |
121 | + ChannelContextBean channelBean=g.fromJson(jsonArray.get(i),ChannelContextBean.class); | |
122 | + channelList.add(channelBean); | |
123 | + } | |
124 | + mIView.showContext(channelList); | |
125 | + } | |
126 | + }, new Consumer<Throwable>() { | |
127 | + @Override | |
128 | + public void accept(Throwable throwable) throws Exception { | |
129 | +// Log.d("66666","getInformationTopic="+throwable); | |
130 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
131 | + } | |
132 | + })); | |
133 | + } | |
134 | + | |
135 | + @Override | |
114 | 136 | public ConsultContract.IConsultModel getModel() { |
115 | 137 | return ConsultModel.newInstance(); |
116 | 138 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java
... | ... | @@ -101,6 +101,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
101 | 101 | }, new Consumer<Throwable>() { |
102 | 102 | @Override |
103 | 103 | public void accept(Throwable throwable) throws Exception { |
104 | +// Log.d("66666","getConsultContent="+throwable); | |
104 | 105 | OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); |
105 | 106 | } |
106 | 107 | })); |
... | ... | @@ -113,18 +114,22 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
113 | 114 | mRxManager.register(mIModel.getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).subscribe(new Consumer<JsonObject>() { |
114 | 115 | @Override |
115 | 116 | public void accept(JsonObject jsonObject) throws Exception { |
117 | + Log.d("66666","getInformationTopic="+jsonObject.toString()); | |
116 | 118 | JsonObject json=jsonObject.getAsJsonObject("data"); |
117 | 119 | 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); | |
120 | + List<ChannelContextBean> channelList = new ArrayList<>(); | |
121 | + JsonArray jsonArray=json.getAsJsonArray("channelList"); | |
122 | + for (int i = 0; i < jsonArray.size(); i++) { | |
123 | + ChannelContextBean channelBean=g.fromJson(jsonArray.get(i),ChannelContextBean.class); | |
124 | + channelList.add(channelBean); | |
125 | + } | |
126 | + Log.d("66666","channelList="+channelList.toString()); | |
127 | + mIView.showConsultContent(channelList); | |
124 | 128 | } |
125 | 129 | }, new Consumer<Throwable>() { |
126 | 130 | @Override |
127 | 131 | public void accept(Throwable throwable) throws Exception { |
132 | +// Log.d("66666","getInformationTopic="+throwable); | |
128 | 133 | OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); |
129 | 134 | } |
130 | 135 | })); | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
1 | 1 | package com.shunzhi.parent.presenter.loginandregister; |
2 | 2 | |
3 | 3 | import android.text.TextUtils; |
4 | -import android.util.Log; | |
5 | 4 | |
6 | 5 | import com.google.gson.JsonObject; |
7 | 6 | import com.share.mvpsdk.helper.RetrofitCreateHelper; |
... | ... | @@ -26,7 +25,6 @@ import io.reactivex.functions.Consumer; |
26 | 25 | import okhttp3.ResponseBody; |
27 | 26 | import retrofit2.HttpException; |
28 | 27 | import retrofit2.Response; |
29 | -import timber.log.Timber; | |
30 | 28 | |
31 | 29 | /** |
32 | 30 | * Created by Administrator on 2018/3/6 0006. |
... | ... | @@ -174,7 +172,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
174 | 172 | String token = Utils.MD5(account); |
175 | 173 | nimLogin(account, token); |
176 | 174 | |
177 | - mIView.getUserInfo(0); | |
175 | +// mIView.getUserInfo(0); | |
178 | 176 | |
179 | 177 | } else { |
180 | 178 | LoginAndRegistFragment.progressDialog.dismiss(); | ... | ... |
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; | |
5 | 4 | |
6 | 5 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
7 | 6 | import com.shunzhi.parent.R; |
... | ... | @@ -19,9 +18,10 @@ public class LoginAndRegistActivity extends BaseCompatActivity { |
19 | 18 | protected void initView(Bundle savedInstanceState) { |
20 | 19 | if (savedInstanceState == null) { |
21 | 20 | type = getIntent().getStringExtra("type"); |
22 | - Log.e("aaa--==",type); | |
23 | - mFragments[0] = LoginAndRegistFragment.getInstance(type); | |
24 | - loadRootFragment(R.id.frame, mFragments[0]); | |
21 | + if (null!=type){ | |
22 | + mFragments[0] = LoginAndRegistFragment.getInstance(type); | |
23 | + loadRootFragment(R.id.frame, mFragments[0]); | |
24 | + } | |
25 | 25 | } else { |
26 | 26 | mFragments[0] = findFragment(LoginAndRegistFragment.class); |
27 | 27 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
... | ... | @@ -45,7 +45,7 @@ import java.util.List; |
45 | 45 | public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel> |
46 | 46 | implements MyChildContract.IMyChildView, View.OnClickListener { |
47 | 47 | SwipeMenuRecyclerView child_recycle; |
48 | - TextView center_title, add_child, go_buy; | |
48 | + TextView center_title, add_child, go_buy; | |
49 | 49 | ImageView back; |
50 | 50 | ChildAdapter childAdapter; |
51 | 51 | List<ChildBean> currlist = new ArrayList<>(); |
... | ... | @@ -127,7 +127,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi |
127 | 127 | Bundle bundle = new Bundle(); |
128 | 128 | bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" + |
129 | 129 | AppConfig.getAppConfig(this).get(AppConfig.USER_ID)); |
130 | - bundle.putInt("type",AppConfig.ORDER_CENTER); | |
130 | + bundle.putInt("type", AppConfig.ORDER_CENTER); | |
131 | 131 | startNewActivity(WebViewActivity.class, bundle); |
132 | 132 | } |
133 | 133 | } |
... | ... | @@ -146,7 +146,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi |
146 | 146 | } |
147 | 147 | |
148 | 148 | @Override |
149 | - public void addChildSuccess(String account,String password) { | |
149 | + public void addChildSuccess(String account, String password) { | |
150 | 150 | |
151 | 151 | } |
152 | 152 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
... | ... | @@ -19,7 +19,6 @@ import android.widget.TextView; |
19 | 19 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
20 | 20 | import com.share.mvpsdk.utils.AppUtils; |
21 | 21 | import com.share.mvpsdk.utils.NetworkConnectionUtils; |
22 | -import com.share.mvpsdk.utils.ToastUtils; | |
23 | 22 | import com.share.mvpsdk.widgets.NestedScrollWebView; |
24 | 23 | import com.shunzhi.parent.AppConfig; |
25 | 24 | import com.shunzhi.parent.R; |
... | ... | @@ -40,7 +39,6 @@ public class WebViewActivity extends BaseCompatActivity { |
40 | 39 | Intent intent = new Intent(context, WebViewActivity.class); |
41 | 40 | intent.putExtra("url", url); |
42 | 41 | intent.putExtra("type", type); |
43 | - intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
44 | 42 | context.startActivity(intent); |
45 | 43 | } |
46 | 44 | |
... | ... | @@ -116,6 +114,7 @@ public class WebViewActivity extends BaseCompatActivity { |
116 | 114 | initWebView(); |
117 | 115 | initWebSetting(nesteScrollWebView.getSettings()); |
118 | 116 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); |
117 | + Log.d("66666","getIntent().getStringExtra(\"url\")="+getIntent().getStringExtra("url")); | |
119 | 118 | } |
120 | 119 | |
121 | 120 | @Override |
... | ... | @@ -178,7 +177,6 @@ public class WebViewActivity extends BaseCompatActivity { |
178 | 177 | nesteScrollWebView.setWebViewClient(new WebViewClient() { |
179 | 178 | @Override |
180 | 179 | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
181 | - Log.d("666666", "url=" + url); | |
182 | 180 | if (url.startsWith("http")) view.loadUrl(url); |
183 | 181 | // if (url.contains("platformapi/startapp")) { |
184 | 182 | // startAlipayActivity(url); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
... | ... | @@ -13,7 +13,6 @@ import android.widget.ImageView; |
13 | 13 | import android.widget.LinearLayout; |
14 | 14 | import android.widget.TextView; |
15 | 15 | |
16 | -import com.bumptech.glide.Glide; | |
17 | 16 | import com.share.mvpsdk.base.BasePresenter; |
18 | 17 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
19 | 18 | import com.share.mvpsdk.utils.ToastUtils; |
... | ... | @@ -74,11 +73,13 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
74 | 73 | textAndImg_xqjc.setTextColor(R.color.white); |
75 | 74 | textAndImg_xqjc.setText("学情检测"); |
76 | 75 | textAndImg_xqjc.setImgs(R.drawable.xqjc, R.drawable.xqjc); |
76 | + textAndImg_xqjc.setOnClickListener(this); | |
77 | 77 | textAndImg_xqjc.setSelect(true); |
78 | 78 | |
79 | 79 | textAndImg_zxlx.setText("专项训练"); |
80 | 80 | textAndImg_zxlx.setTextColor(R.color.white); |
81 | 81 | textAndImg_zxlx.setImgs(R.drawable.zxlx, R.drawable.zxlx); |
82 | + textAndImg_zxlx.setOnClickListener(this); | |
82 | 83 | textAndImg_zxlx.setSelect(true); |
83 | 84 | |
84 | 85 | initListeners(view); |
... | ... | @@ -100,8 +101,8 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
100 | 101 | public void onResume() { |
101 | 102 | super.onResume(); |
102 | 103 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ |
103 | - tvLocalAddress.setText(AppContext.getInstance().district); | |
104 | - addTools(); | |
104 | + tvLocalAddress.setText(AppContext.getInstance().district); | |
105 | +// addTools(); | |
105 | 106 | // } |
106 | 107 | } |
107 | 108 | |
... | ... | @@ -133,16 +134,16 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
133 | 134 | public void onClick(View view) { |
134 | 135 | switch (view.getId()) { |
135 | 136 | case R.id.frame_hot1://热门课程 |
136 | - if (tvCourse1.getTag()!=null) | |
137 | - WebViewActivity.getInstance(getActivity(),tvCourse1.getTag().toString(),-1); | |
137 | + if (tvCourse1.getTag() != null) | |
138 | + WebViewActivity.getInstance(getActivity(), tvCourse1.getTag().toString(), -1); | |
138 | 139 | break; |
139 | 140 | case R.id.frame_hot2: |
140 | - if (tvCourse2.getTag()!=null) | |
141 | - WebViewActivity.getInstance(getActivity(),tvCourse2.getTag().toString(),-1); | |
141 | + if (tvCourse2.getTag() != null) | |
142 | + WebViewActivity.getInstance(getActivity(), tvCourse2.getTag().toString(), -1); | |
142 | 143 | break; |
143 | 144 | case R.id.frame_hot3: |
144 | - if (tvCourse3.getTag()!=null) | |
145 | - WebViewActivity.getInstance(getActivity(),tvCourse3.getTag().toString(),-1); | |
145 | + if (tvCourse3.getTag() != null) | |
146 | + WebViewActivity.getInstance(getActivity(), tvCourse3.getTag().toString(), -1); | |
146 | 147 | break; |
147 | 148 | case R.id.tvLocalAddress: |
148 | 149 | // AppContext.getInstance().startLocation(); |
... | ... | @@ -153,6 +154,14 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
153 | 154 | case R.id.ivCamera: |
154 | 155 | ToastUtils.showToast("功能暂未上线"); |
155 | 156 | break; |
157 | + case R.id.textAndImg_xqjc: | |
158 | + ToastUtils.showToast("功能暂未上线"); | |
159 | + break; | |
160 | + case R.id.textAndImg_zxlx: | |
161 | + ToastUtils.showToast("功能暂未上线"); | |
162 | + break; | |
163 | + default: | |
164 | + break; | |
156 | 165 | } |
157 | 166 | } |
158 | 167 | |
... | ... | @@ -160,7 +169,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
160 | 169 | @Override |
161 | 170 | public void onReceive(Context context, Intent intent) { |
162 | 171 | if (intent.getAction().equals(AppContext.LOCATION_CITYNAME + "")) { |
163 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | |
172 | + tvLocalAddress.setText(AppContext.getInstance().district); | |
164 | 173 | } |
165 | 174 | } |
166 | 175 | }; |
... | ... | @@ -176,27 +185,27 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
176 | 185 | public void getCity(String name) { |
177 | 186 | tvLocalAddress.setText(name.split(" ")[2]); |
178 | 187 | mPresenter.getTools(layout_control, name.split(" ")[2]); |
179 | - AppContext.getInstance().cityName=name.split(" ")[1]; | |
180 | - AppContext.getInstance().district=name.split(" ")[2]; | |
188 | + AppContext.getInstance().cityName = name.split(" ")[1]; | |
189 | + AppContext.getInstance().district = name.split(" ")[2]; | |
181 | 190 | } |
182 | 191 | |
183 | 192 | @Override |
184 | 193 | public void showTools(List<ToolBean> toolBeanList) { |
185 | 194 | if (toolBeanList.size() > 0) { |
186 | 195 | tvCourse1.setText(toolBeanList.get(0).toolName); |
187 | - GlideUtils.showImg(getActivity(),ivCourse1,toolBeanList.get(0).toolImage); | |
196 | + GlideUtils.showImg(getActivity(), ivCourse1, toolBeanList.get(0).toolImage); | |
188 | 197 | tvCourse1.setTag(toolBeanList.get(0).toolUrl); |
189 | 198 | } |
190 | 199 | |
191 | 200 | if (toolBeanList.size() > 1) { |
192 | 201 | tvCourse2.setText(toolBeanList.get(1).toolName); |
193 | - GlideUtils.showImg(getActivity(),ivCourse2,toolBeanList.get(1).toolImage); | |
202 | + GlideUtils.showImg(getActivity(), ivCourse2, toolBeanList.get(1).toolImage); | |
194 | 203 | tvCourse2.setTag(toolBeanList.get(1).toolUrl); |
195 | 204 | } |
196 | 205 | |
197 | 206 | if (toolBeanList.size() > 2) { |
198 | 207 | tvCourse3.setText(toolBeanList.get(2).toolName); |
199 | - GlideUtils.showImg(getActivity(),ivCourse3,toolBeanList.get(2).toolImage); | |
208 | + GlideUtils.showImg(getActivity(), ivCourse3, toolBeanList.get(2).toolImage); | |
200 | 209 | tvCourse3.setTag(toolBeanList.get(2).toolUrl); |
201 | 210 | } |
202 | 211 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
... | ... | @@ -8,12 +8,13 @@ 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.text.TextUtils; | |
11 | 12 | import android.view.View; |
13 | +import android.widget.EditText; | |
12 | 14 | import android.widget.ImageView; |
13 | 15 | import android.widget.LinearLayout; |
14 | 16 | import android.widget.TextView; |
15 | 17 | |
16 | -import com.bumptech.glide.Glide; | |
17 | 18 | import com.jcodecraeer.xrecyclerview.XRecyclerView; |
18 | 19 | import com.share.mvpsdk.base.BasePresenter; |
19 | 20 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
... | ... | @@ -53,6 +54,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
53 | 54 | |
54 | 55 | List<String> imgesUrl = new ArrayList<>(); |
55 | 56 | List<String> describeList = new ArrayList<>(); |
57 | + List<GuangGaoBean> guanggaoList = new ArrayList<>(); | |
56 | 58 | List<ChannelContextBean> contextList = new ArrayList<>(); |
57 | 59 | |
58 | 60 | JZVideoPlayerStandard videoplayer; |
... | ... | @@ -63,6 +65,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
63 | 65 | |
64 | 66 | CityPicker cityPicker = null; |
65 | 67 | |
68 | + EditText et_search; | |
69 | + | |
66 | 70 | int pageIndex = 1; |
67 | 71 | boolean first = true; |
68 | 72 | |
... | ... | @@ -82,6 +86,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
82 | 86 | videoplayer = view.findViewById(R.id.videoplayer); |
83 | 87 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); |
84 | 88 | layout_control = view.findViewById(R.id.layout_control); |
89 | + et_search=view.findViewById(R.id.et_search); | |
85 | 90 | tvLocalAddress.setText(AppContext.getInstance().district); |
86 | 91 | videoplayer.batteryLevel.setVisibility(View.GONE); |
87 | 92 | videoplayer.replayTextView.setVisibility(View.GONE); |
... | ... | @@ -135,10 +140,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
135 | 140 | xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { |
136 | 141 | @Override |
137 | 142 | public void onItemClick(XBanner banner, int position) { |
138 | - WebViewActivity.getInstance(getContext(), describeList.get(position), -1); | |
143 | + WebViewActivity.getInstance(getContext(), imgesUrl.get(position), -1); | |
139 | 144 | } |
140 | 145 | }); |
141 | - | |
142 | 146 | } |
143 | 147 | |
144 | 148 | @NonNull |
... | ... | @@ -169,7 +173,10 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
169 | 173 | else cityPicker.show(); |
170 | 174 | break; |
171 | 175 | case R.id.ivSearch://搜索按钮 |
172 | - | |
176 | + if (!TextUtils.isEmpty(et_search.getText().toString())){ | |
177 | + contextList.clear(); | |
178 | + mPresenter.getInformationTopic(et_search.getText().toString(),AppContext.getInstance().district,"0","1",1); | |
179 | + } | |
173 | 180 | break; |
174 | 181 | } |
175 | 182 | } |
... | ... | @@ -207,6 +214,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
207 | 214 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
208 | 215 | describeList.clear(); |
209 | 216 | imgesUrl.clear(); |
217 | + guanggaoList=guangGaoBeanList; | |
210 | 218 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
211 | 219 | imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); |
212 | 220 | describeList.add(guangGaoBeanList.get(i).describe); |
... | ... | @@ -239,7 +247,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
239 | 247 | first = false; |
240 | 248 | } |
241 | 249 | |
242 | - | |
243 | 250 | } |
244 | 251 | |
245 | 252 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
... | ... | @@ -30,7 +30,9 @@ import com.shunzhi.parent.util.GlideUtils; |
30 | 30 | |
31 | 31 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
32 | 32 | implements MineContract.IMineView, View.OnClickListener { |
33 | - LinearLayout childlayout, personinfo, layout_orderDetail, layout_order, layout_cache, layout_about,layoutAdvice; | |
33 | + | |
34 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order, layout_cache, layout_about, layout_feedback,top_layout,layout_afterLogin; | |
35 | + | |
34 | 36 | RoundedImageView user_photo; |
35 | 37 | TextView user_name, user_mobile, tvExit, binding_state; |
36 | 38 | |
... | ... | @@ -48,14 +50,16 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
48 | 50 | @Override |
49 | 51 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
50 | 52 | childlayout = view.findViewById(R.id.childlayout); |
53 | + layout_afterLogin = view.findViewById(R.id.layout_afterLogin); | |
54 | + top_layout = view.findViewById(R.id.top_layout); | |
51 | 55 | personinfo = view.findViewById(R.id.personinfo); |
52 | 56 | layout_order = view.findViewById(R.id.layout_order); |
53 | 57 | layout_orderDetail = view.findViewById(R.id.layout_orderDetail); |
54 | 58 | layout_cache = view.findViewById(R.id.layout_cache); |
55 | 59 | layout_about = view.findViewById(R.id.layout_about); |
56 | - layoutAdvice=view.findViewById(R.id.layoutAdvice); | |
57 | - layoutAdvice.setOnClickListener(this); | |
60 | + layout_feedback = view.findViewById(R.id.layout_feedback); | |
58 | 61 | layout_about.setOnClickListener(this); |
62 | + layout_feedback.setOnClickListener(this); | |
59 | 63 | layout_cache.setOnClickListener(this); |
60 | 64 | childlayout.setOnClickListener(this); |
61 | 65 | personinfo.setOnClickListener(this); |
... | ... | @@ -65,8 +69,10 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
65 | 69 | user_name = view.findViewById(R.id.user_name); |
66 | 70 | user_mobile = view.findViewById(R.id.user_mobile); |
67 | 71 | tvExit = view.findViewById(R.id.tvExit); |
72 | + tvExit.setVisibility(View.GONE); | |
68 | 73 | tvExit.setOnClickListener(this); |
69 | 74 | binding_state = view.findViewById(R.id.binding_state); |
75 | + layout_afterLogin.setVisibility(View.GONE); | |
70 | 76 | if (AppConfig.ISBINDING) { |
71 | 77 | binding_state.setText(""); |
72 | 78 | } |
... | ... | @@ -77,19 +83,25 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
77 | 83 | if (AppConfig.ISLOGIN) { |
78 | 84 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); |
79 | 85 | if (!TextUtils.isEmpty(url)) { |
80 | - GlideUtils.showImg(getContext(),user_photo,url); | |
86 | + GlideUtils.showImg(getContext(), user_photo, url); | |
81 | 87 | } else { |
82 | - GlideUtils.showImg(getContext(),user_photo,url); | |
88 | + GlideUtils.showImg(getContext(), user_photo, url); | |
83 | 89 | user_photo.setCornerRadius(20); |
84 | 90 | } |
85 | 91 | user_photo.setCornerRadius(20); |
86 | 92 | user_photo.setOval(true); |
87 | 93 | user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); |
88 | 94 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); |
95 | + top_layout.setBackgroundResource(R.drawable.backgroud_top); | |
89 | 96 | user_mobile.setVisibility(View.VISIBLE); |
90 | - }else { | |
97 | + layout_afterLogin.setVisibility(View.VISIBLE); | |
98 | + tvExit.setVisibility(View.VISIBLE); | |
99 | + | |
100 | + } else { | |
91 | 101 | user_name.setVisibility(View.VISIBLE); |
92 | 102 | user_mobile.setVisibility(View.GONE); |
103 | + layout_afterLogin.setVisibility(View.GONE); | |
104 | + tvExit.setVisibility(View.GONE); | |
93 | 105 | } |
94 | 106 | } |
95 | 107 | |
... | ... | @@ -123,10 +135,12 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
123 | 135 | clearMyCache(); |
124 | 136 | break; |
125 | 137 | case R.id.layout_about: |
126 | - WebViewActivity.getInstance(getActivity(),AppConfig.BASE_URL_ORDER+"About.html",-1); | |
138 | + WebViewActivity.getInstance(getActivity(), AppConfig.BASE_URL_ORDER + "About.html", -1); | |
127 | 139 | 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); | |
140 | + | |
141 | + case R.id.layout_feedback: | |
142 | + WebViewActivity.getInstance(getActivity(), AppConfig.BASE_URL_ORDER + "FeedBack.aspx?userid=" + AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID), -1); | |
143 | + | |
130 | 144 | break; |
131 | 145 | default: |
132 | 146 | break; |
... | ... | @@ -162,7 +176,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
162 | 176 | } |
163 | 177 | |
164 | 178 | private void clearUerinfo() { |
165 | - if(AppConfig.ISLOGIN) { | |
179 | + if (AppConfig.ISLOGIN) { | |
166 | 180 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); |
167 | 181 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); |
168 | 182 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, ""); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
... | ... | @@ -3,14 +3,12 @@ package com.shunzhi.parent.ui.fragment; |
3 | 3 | import android.os.Bundle; |
4 | 4 | import android.support.annotation.NonNull; |
5 | 5 | import android.support.annotation.Nullable; |
6 | -import android.support.v4.view.ViewPager; | |
7 | 6 | import android.text.TextUtils; |
8 | 7 | import android.util.Log; |
9 | 8 | import android.view.View; |
10 | 9 | import android.widget.ImageView; |
11 | 10 | import android.widget.TextView; |
12 | 11 | |
13 | -import com.bumptech.glide.Glide; | |
14 | 12 | import com.share.mvpsdk.base.BasePresenter; |
15 | 13 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
16 | 14 | import com.shunzhi.parent.AppConfig; |
... | ... | @@ -28,6 +26,8 @@ import com.stx.xhb.xbanner.XBanner; |
28 | 26 | import java.util.ArrayList; |
29 | 27 | import java.util.List; |
30 | 28 | |
29 | +import cn.jzvd.JZVideoPlayerStandard; | |
30 | + | |
31 | 31 | public class StartFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter, ConsultContract.IConsultModel> |
32 | 32 | implements ConsultContract.IConsultView { |
33 | 33 | |
... | ... | @@ -35,6 +35,10 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
35 | 35 | |
36 | 36 | TextView tvJump; |
37 | 37 | |
38 | + boolean isQidong = false; | |
39 | + | |
40 | + JZVideoPlayerStandard jiecaoVideo; | |
41 | + | |
38 | 42 | @Override |
39 | 43 | public int getLayoutId() { |
40 | 44 | return R.layout.fragment_start; |
... | ... | @@ -44,13 +48,30 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
44 | 48 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
45 | 49 | |
46 | 50 | xBanner = view.findViewById(R.id.xBanner); |
47 | - tvJump=view.findViewById(R.id.tvJump); | |
48 | - | |
49 | - if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START))) { | |
50 | - mPresenter.getBanners("0", "余杭区"); | |
51 | + tvJump = view.findViewById(R.id.tvJump); | |
52 | + jiecaoVideo = view.findViewById(R.id.jiecaoVideo); | |
53 | + jiecaoVideo.tinyBackImageView.setVisibility(View.GONE); | |
54 | + jiecaoVideo.backButton.setVisibility(View.GONE); | |
55 | + jiecaoVideo.replayTextView.setVisibility(View.GONE); | |
56 | + jiecaoVideo.batteryLevel.setVisibility(View.GONE); | |
57 | + jiecaoVideo.thumbImageView.setVisibility(View.GONE); | |
58 | + jiecaoVideo.loadingProgressBar.setVisibility(View.GONE); | |
59 | + | |
60 | + isQidong = TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START)); | |
61 | + if (isQidong) { | |
62 | + jiecaoVideo.setVisibility(View.VISIBLE); | |
63 | + xBanner.setVisibility(View.GONE); | |
51 | 64 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); |
52 | - } else mPresenter.getBanners("1","余杭区"); | |
65 | +// mPresenter.getBanners("0", AppContext.getInstance().district==""?"余杭区":AppContext.getInstance().district); | |
66 | + mPresenter.getBanners("0", "余杭区"); | |
67 | + } else { | |
68 | + jiecaoVideo.setVisibility(View.GONE); | |
69 | + xBanner.setVisibility(View.VISIBLE); | |
70 | + mPresenter.getBanners("1", "余杭区"); | |
71 | +// mPresenter.getBanners("1", AppContext.getInstance().district==""?"余杭区":AppContext.getInstance().district); | |
72 | + } | |
53 | 73 | |
74 | + tvJump=view.findViewById(R.id.tvJump); | |
54 | 75 | |
55 | 76 | tvJump.setOnClickListener(new View.OnClickListener() { |
56 | 77 | @Override |
... | ... | @@ -90,26 +111,43 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
90 | 111 | |
91 | 112 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
92 | 113 | try { |
93 | - final List<String> imgUrl = new ArrayList<>(); | |
94 | - List<String> describeList = new ArrayList<>(); | |
95 | - for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
96 | - imgUrl.add(AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc); | |
97 | - describeList.add(guangGaoBeanList.get(i).describe); | |
98 | - } | |
99 | - xBanner.setData(imgUrl, describeList); | |
100 | - xBanner.stopAutoPlay(); | |
101 | - xBanner.setmAutoPalyTime(10000); | |
114 | + Log.d("66666","initBannes"+guangGaoBeanList); | |
115 | + if (isQidong) { | |
116 | + String fileUrl = "", describe = ""; | |
117 | + for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
118 | + if (guangGaoBeanList.get(i).fileSrc.contains(".mp4")) { | |
119 | + fileUrl = AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc; | |
120 | + describe = guangGaoBeanList.get(i).describe; | |
121 | + } | |
122 | + } | |
123 | + jiecaoVideo.setUp(fileUrl, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, describe); | |
124 | + jiecaoVideo.startVideo(); | |
125 | + } else { | |
126 | + final List<String> imgUrl = new ArrayList<>(); | |
127 | + List<String> describeList = new ArrayList<>(); | |
128 | + for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
129 | + imgUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); | |
130 | + describeList.add(guangGaoBeanList.get(i).describe); | |
131 | + } | |
132 | + xBanner.setData(imgUrl, describeList); | |
133 | + xBanner.stopAutoPlay(); | |
134 | + xBanner.setmAutoPalyTime(10000); | |
102 | 135 | // xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); |
103 | - xBanner.setmAdapter(new XBanner.XBannerAdapter() { | |
104 | - @Override | |
105 | - public void loadBanner(XBanner banner, Object model, View view, int position) { | |
106 | - GlideUtils.showImg(getActivity(),(ImageView) view,imgUrl.get(position)); | |
136 | + xBanner.setmAdapter(new XBanner.XBannerAdapter() { | |
137 | + @Override | |
138 | + public void loadBanner(XBanner banner, Object model, View view, int position) { | |
139 | + GlideUtils.showImg(getActivity(), (ImageView) view, imgUrl.get(position)); | |
140 | + } | |
141 | + }); | |
107 | 142 | } |
108 | - }); | |
109 | 143 | |
110 | - | |
111 | - }catch (Exception e){ | |
144 | + } catch (Exception e) { | |
112 | 145 | e.printStackTrace(); |
113 | 146 | } |
114 | 147 | } |
148 | + | |
149 | + @Override | |
150 | + public void onDestroy() { | |
151 | + super.onDestroy(); | |
152 | + } | |
115 | 153 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
... | ... | @@ -5,6 +5,7 @@ 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.text.TextUtils; | |
8 | 9 | import android.view.LayoutInflater; |
9 | 10 | import android.view.View; |
10 | 11 | import android.view.ViewGroup; |
... | ... | @@ -19,6 +20,7 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
19 | 20 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
20 | 21 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
21 | 22 | import com.share.mvpsdk.utils.DisplayUtils; |
23 | +import com.share.mvpsdk.utils.ToastUtils; | |
22 | 24 | import com.shunzhi.parent.AppContext; |
23 | 25 | import com.shunzhi.parent.R; |
24 | 26 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
... | ... | @@ -94,12 +96,15 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
94 | 96 | pageIndex = 1; |
95 | 97 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); |
96 | 98 | |
97 | - mPresenter.getBanners("4", AppContext.getInstance().district); | |
99 | + mPresenter.getBanners("3", AppContext.getInstance().district); | |
98 | 100 | |
99 | 101 | } |
100 | 102 | |
101 | 103 | public void showSearchContent(String keyword) { |
102 | - mPresenter.getInformationTopic(keyword, AppContext.getInstance().district, channel, "0", 1); | |
104 | + if (!TextUtils.isEmpty(keyword)){ | |
105 | + myConsultBeanList.clear(); | |
106 | + mPresenter.getInformationTopic(keyword, AppContext.getInstance().district, channel, "0", 1); | |
107 | + } | |
103 | 108 | } |
104 | 109 | |
105 | 110 | @NonNull |
... | ... | @@ -145,37 +150,42 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
145 | 150 | |
146 | 151 | @Override |
147 | 152 | 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 | - } | |
153 | +// Log.d("66666", "ChannelContextBean=" + list); | |
154 | + if (null != list) { | |
155 | + myConsultBeanList.addAll(list); | |
156 | + if (myConsultAdapter == null) { | |
157 | + myConsultAdapter = new MyConsultAdapter(getActivity()); | |
158 | + myConsultAdapter.addAll(myConsultBeanList); | |
159 | + recyclerViewConsultOne.setAdapter(myConsultAdapter); | |
160 | + } else { | |
161 | + myConsultAdapter.addAll(myConsultBeanList); | |
162 | + myConsultAdapter.notifyDataSetChanged(); | |
163 | + } | |
164 | + }else ToastUtils.showToast("没有数据"); | |
157 | 165 | } |
158 | 166 | |
159 | 167 | @Override |
160 | 168 | 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); | |
169 | + if (null != list) { | |
170 | + layout_control.removeAllViews(); | |
171 | + for (int i = 0; i < list.size(); i++) { | |
172 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | |
173 | + textAndImgShowView.setTextColor(R.color.textColor); | |
174 | + textAndImgShowView.setText(list.get(i).getChannelName()); | |
175 | + textAndImgShowView.addImgs(list.get(i).getChannelImage()); | |
176 | + textAndImgShowView.setSelect(true); | |
177 | + textAndImgShowView.setWidth(getActivity(), layout_control); | |
178 | + textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | |
179 | + textAndImgShowView.setTag(list.get(i)); | |
180 | + textAndImgShowView.setOnClickListener(new View.OnClickListener() { | |
181 | + @Override | |
182 | + public void onClick(View view) { | |
183 | + ChannelBean channelBean = (ChannelBean) view.getTag(); | |
184 | + ConsultTwoLevelActivity.getInstance(getActivity(), channelBean.getId() + "", channelBean.getChannelName()); | |
185 | + } | |
186 | + }); | |
187 | + layout_control.addView(textAndImgShowView); | |
188 | + } | |
179 | 189 | } |
180 | 190 | } |
181 | 191 | |
... | ... | @@ -212,13 +222,14 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
212 | 222 | } |
213 | 223 | |
214 | 224 | @Override |
215 | - public void onBindViewHolder(final GuangGaoBean object, int position) { | |
225 | + public void onBindViewHolder(final GuangGaoBean object, final int position) { | |
216 | 226 | GlideUtils.showImg(mContext, iv_grally, object.fileSrc); |
217 | 227 | tv_grally_title.setText(object.describe + ""); |
218 | 228 | iv_grally.setOnClickListener(new View.OnClickListener() { |
219 | 229 | @Override |
220 | 230 | public void onClick(View v) { |
221 | - WebViewActivity.getInstance(mContext, object.url, -1); | |
231 | +// WebViewActivity.getInstance(mContext, object.url, -1); | |
232 | + WebViewActivity.getInstance(getActivity(), object.url, -1); | |
222 | 233 | } |
223 | 234 | }); |
224 | 235 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java
... | ... | @@ -4,6 +4,7 @@ import android.os.Bundle; |
4 | 4 | import android.support.annotation.NonNull; |
5 | 5 | import android.support.annotation.Nullable; |
6 | 6 | import android.support.v7.widget.LinearLayoutManager; |
7 | +import android.text.TextUtils; | |
7 | 8 | import android.view.View; |
8 | 9 | import android.widget.TextView; |
9 | 10 | |
... | ... | @@ -90,7 +91,6 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
90 | 91 | |
91 | 92 | @Override |
92 | 93 | public void showConsultContent(List<ChannelContextBean> list) { |
93 | - myConsultBeanList.clear(); | |
94 | 94 | myConsultBeanList.addAll(list); |
95 | 95 | if (myConsultAdapter == null) myConsultAdapter = new MyConsultAdapter(getActivity()); |
96 | 96 | if (null == recyclerView.getAdapter()) recyclerView.setAdapter(myConsultAdapter); |
... | ... | @@ -108,4 +108,12 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | + public void showSearch(String s) { | |
112 | + | |
113 | + if (!TextUtils.isEmpty(s)){ | |
114 | + myConsultBeanList.clear(); | |
115 | + mPresenter.getInformationTopic(s,AppContext.getInstance().district,channel,"0",1); | |
116 | + } | |
117 | + | |
118 | + } | |
111 | 119 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
... | ... | @@ -5,7 +5,6 @@ import android.content.Context; |
5 | 5 | import android.support.annotation.DrawableRes; |
6 | 6 | import android.support.annotation.Nullable; |
7 | 7 | import android.util.AttributeSet; |
8 | -import android.util.Log; | |
9 | 8 | import android.view.View; |
10 | 9 | import android.widget.FrameLayout; |
11 | 10 | import android.widget.ImageView; |
... | ... | @@ -15,9 +14,7 @@ import android.widget.TextView; |
15 | 14 | import com.bumptech.glide.Glide; |
16 | 15 | import com.share.mvpsdk.utils.DisplayUtils; |
17 | 16 | import com.shunzhi.parent.AppConfig; |
18 | -import com.shunzhi.parent.AppContext; | |
19 | 17 | import com.shunzhi.parent.R; |
20 | -import com.shunzhi.parent.util.GlideUtils; | |
21 | 18 | |
22 | 19 | |
23 | 20 | /** |
... | ... | @@ -84,10 +81,12 @@ public class TextAndImgShowView extends LinearLayout { |
84 | 81 | |
85 | 82 | public void setWidth(Activity activity, View layout_control) { |
86 | 83 | // Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); |
87 | - LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | |
84 | + LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT); | |
88 | 85 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - |
89 | 86 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() |
90 | 87 | )) / 4; |
91 | 88 | layout.setLayoutParams(params); |
89 | + LayoutParams params1 = new LayoutParams(52,52); | |
90 | + image.setLayoutParams(params1); | |
92 | 91 | } |
93 | 92 | } | ... | ... |
516 Bytes
app/src/main/res/layout/fragment_mine.xml
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | android:paddingTop="20dp" |
18 | 18 | android:layout_width="match_parent" |
19 | 19 | android:layout_height="180dp" |
20 | - android:background="@drawable/backgroud_top" | |
20 | + android:background="@color/back_top" | |
21 | 21 | android:orientation="vertical"> |
22 | 22 | |
23 | 23 | <TextView |
... | ... | @@ -91,6 +91,7 @@ |
91 | 91 | android:orientation="vertical"> |
92 | 92 | |
93 | 93 | <LinearLayout |
94 | + android:id="@+id/layout_afterLogin" | |
94 | 95 | android:layout_width="match_parent" |
95 | 96 | android:layout_height="wrap_content" |
96 | 97 | android:background="@color/white" |
... | ... | @@ -103,17 +104,17 @@ |
103 | 104 | |
104 | 105 | <TextView |
105 | 106 | android:layout_width="25dp" |
106 | - android:layout_height="20dp" | |
107 | + android:layout_height="30dp" | |
107 | 108 | android:layout_marginLeft="15dp" |
108 | 109 | android:layout_marginRight="30dp" |
109 | - android:background="@drawable/tiaoxing" /> | |
110 | + android:background="@drawable/xiaoxi" /> | |
110 | 111 | |
111 | 112 | <TextView |
112 | 113 | android:layout_width="wrap_content" |
113 | 114 | android:layout_height="wrap_content" |
114 | 115 | android:layout_gravity="center_vertical" |
115 | 116 | android:layout_weight="1" |
116 | - android:text="我的订阅消息" | |
117 | + android:text="消息" | |
117 | 118 | android:textSize="@dimen/txtsize_title" /> |
118 | 119 | |
119 | 120 | <TextView |
... | ... | @@ -239,7 +240,7 @@ |
239 | 240 | android:orientation="vertical"> |
240 | 241 | |
241 | 242 | <LinearLayout |
242 | - android:id="@+id/layoutAdvice" | |
243 | + android:id="@+id/layout_feedback" | |
243 | 244 | android:layout_width="match_parent" |
244 | 245 | android:gravity="center_vertical" |
245 | 246 | android:layout_height="?android:actionBarSize"> | ... | ... |
app/src/main/res/layout/fragment_report.xml
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | android:drawablePadding="10dp" |
23 | 23 | android:drawableRight="@drawable/pull" |
24 | 24 | android:text="" |
25 | + android:visibility="gone" | |
25 | 26 | android:textColor="@color/textColor" |
26 | 27 | android:textSize="@dimen/textSize16" /> |
27 | 28 | |
... | ... | @@ -32,7 +33,7 @@ |
32 | 33 | android:layout_weight="1" |
33 | 34 | android:gravity="center_horizontal" |
34 | 35 | android:id="@+id/tvDate" |
35 | - android:text="2018年3月" | |
36 | + android:text="报告" | |
36 | 37 | android:textColor="@color/white" |
37 | 38 | android:textSize="@dimen/textSize18" /> |
38 | 39 | |
... | ... | @@ -42,6 +43,7 @@ |
42 | 43 | android:layout_height="wrap_content" |
43 | 44 | android:layout_gravity="center_vertical" |
44 | 45 | android:drawableRight="@drawable/screen" |
46 | + android:visibility="gone" | |
45 | 47 | android:text="筛选" |
46 | 48 | android:textColor="@color/textColor" |
47 | 49 | android:textSize="@dimen/textSize16" /> |
... | ... | @@ -52,7 +54,7 @@ |
52 | 54 | android:layout_height="match_parent" |
53 | 55 | android:textSize="@dimen/size_dp_16" |
54 | 56 | android:textColor="@color/xueqing_blue" |
55 | - android:text="没有绑定孩子,\n请去个人中心绑定孩子" | |
57 | + android:text="功能暂不开放" | |
56 | 58 | android:gravity="center" |
57 | 59 | android:lineSpacingExtra="@dimen/size_dp_5" |
58 | 60 | android:id="@+id/tvNoData" |
... | ... | @@ -61,6 +63,7 @@ |
61 | 63 | <LinearLayout |
62 | 64 | android:layout_width="match_parent" |
63 | 65 | android:layout_height="match_parent" |
66 | + android:visibility="gone" | |
64 | 67 | android:orientation="vertical"> |
65 | 68 | |
66 | 69 | <!--<include layout="@layout/layout_week" /> android:layout_below="@+id/linearlayout"--> | ... | ... |
app/src/main/res/layout/fragment_start.xml
... | ... | @@ -11,6 +11,11 @@ |
11 | 11 | android:id="@+id/xBanner" |
12 | 12 | ></com.stx.xhb.xbanner.XBanner> |
13 | 13 | |
14 | + <cn.jzvd.JZVideoPlayerStandard | |
15 | + android:id="@+id/jiecaoVideo" | |
16 | + android:layout_width="match_parent" | |
17 | + android:layout_height="match_parent"></cn.jzvd.JZVideoPlayerStandard> | |
18 | + | |
14 | 19 | <TextView |
15 | 20 | android:id="@+id/tvJump" |
16 | 21 | android:layout_width="wrap_content" | ... | ... |
app/src/main/res/layout/layout_consult_content.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:layout_height="wrap_content" | |
4 | + android:layout_height="@dimen/size_dp_100" | |
5 | 5 | android:layout_marginBottom="@dimen/size_dp_10" |
6 | 6 | android:orientation="vertical"> |
7 | 7 | |
... | ... | @@ -17,15 +17,16 @@ |
17 | 17 | android:layout_weight="4" |
18 | 18 | android:elevation="@dimen/size_dp_3" |
19 | 19 | android:orientation="vertical" |
20 | - android:padding="@dimen/size_dp_5"> | |
20 | + android:padding="@dimen/size_dp_4"> | |
21 | 21 | |
22 | 22 | <TextView |
23 | 23 | android:id="@+id/tvConsultTitle" |
24 | 24 | android:layout_width="match_parent" |
25 | - android:layout_height="wrap_content" | |
25 | + android:layout_height="0dp" | |
26 | + android:layout_weight="2" | |
26 | 27 | android:ellipsize="end" |
27 | - android:gravity="center_vertical" | |
28 | 28 | android:maxLines="2" |
29 | + android:layout_gravity="top" | |
29 | 30 | android:text="学校初一段家长统一测试使用家长慧得到良好反馈评价" |
30 | 31 | android:textColor="@color/textColor" |
31 | 32 | android:textSize="@dimen/textSize14" /> |
... | ... | @@ -33,9 +34,11 @@ |
33 | 34 | <TextView |
34 | 35 | android:id="@+id/tvConsultContent" |
35 | 36 | android:layout_width="match_parent" |
36 | - android:layout_height="wrap_content" | |
37 | + android:layout_height="0dp" | |
38 | + android:layout_weight="1" | |
37 | 39 | android:layout_marginTop="@dimen/size_dp_5" |
38 | 40 | android:ellipsize="end" |
41 | + android:layout_gravity="center_vertical" | |
39 | 42 | android:gravity="center_vertical" |
40 | 43 | android:maxLines="2" |
41 | 44 | android:singleLine="true" |
... | ... | @@ -44,15 +47,19 @@ |
44 | 47 | android:textSize="@dimen/textSize14" /> |
45 | 48 | |
46 | 49 | <FrameLayout |
50 | + android:layout_gravity="bottom" | |
47 | 51 | android:layout_width="match_parent" |
48 | - android:layout_height="wrap_content" | |
52 | + android:layout_height="0dp" | |
53 | + android:layout_weight="1" | |
49 | 54 | android:layout_marginTop="@dimen/size_dp_5"> |
50 | 55 | |
51 | 56 | <RelativeLayout |
57 | + android:layout_gravity="bottom" | |
52 | 58 | android:layout_width="match_parent" |
53 | 59 | android:layout_height="wrap_content"> |
54 | 60 | |
55 | 61 | <TextView |
62 | + android:layout_centerVertical="true" | |
56 | 63 | android:id="@+id/tvPingLunNums" |
57 | 64 | style="@style/TextView_Wrap_16" |
58 | 65 | android:layout_gravity="center_vertical" |
... | ... | @@ -72,12 +79,15 @@ |
72 | 79 | </LinearLayout> |
73 | 80 | |
74 | 81 | <ImageView |
82 | + android:layout_gravity="center" | |
75 | 83 | android:id="@+id/iv_consult" |
76 | 84 | android:layout_width="0dp" |
77 | 85 | android:layout_height="match_parent" |
78 | - android:layout_margin="@dimen/size_dp_2" | |
86 | + android:layout_margin="@dimen/size_dp_4" | |
79 | 87 | android:layout_weight="2" |
88 | + android:scaleType="fitXY" | |
80 | 89 | android:src="@color/xueqing_blue" /> |
90 | + | |
81 | 91 | </LinearLayout> |
82 | 92 | |
83 | 93 | <FrameLayout | ... | ... |
app/src/main/res/layout/text_and_img_show.xml
... | ... | @@ -16,8 +16,8 @@ |
16 | 16 | |
17 | 17 | <ImageView |
18 | 18 | android:id="@+id/image" |
19 | - android:layout_width="wrap_content" | |
20 | - android:layout_height="wrap_content" | |
19 | + android:layout_width="@dimen/size_dp_50" | |
20 | + android:layout_height="@dimen/size_dp_50" | |
21 | 21 | android:scaleType="fitXY" |
22 | 22 | /> |
23 | 23 | ... | ... |
app/src/main/res/menu/bottom_navigationview.xml
... | ... | @@ -3,13 +3,13 @@ |
3 | 3 | |
4 | 4 | <item android:id="@+id/menu_item_index" |
5 | 5 | android:icon="@drawable/selector_ceping" |
6 | - android:title="测评" | |
6 | + android:title="慧测慧练" | |
7 | 7 | ></item> |
8 | 8 | |
9 | 9 | |
10 | 10 | <item android:id="@+id/menu_item_consult" |
11 | 11 | android:icon="@drawable/selector_consult" |
12 | - android:title="咨询频道" | |
12 | + android:title="资讯频道" | |
13 | 13 | ></item> |
14 | 14 | |
15 | 15 | ... | ... |
app/src/main/res/values/colors.xml
... | ... | @@ -9,9 +9,9 @@ |
9 | 9 | <color name="bottomline">#B8B8B9</color> |
10 | 10 | <color name="bg_main">#F0EFF5</color> |
11 | 11 | <color name="textRed">#FC5B6A</color> |
12 | - <color name="back_top">#C6DAFF</color> | |
12 | + <color name="back_top">#A6DAFF</color> | |
13 | 13 | <color name="textBlue">#ACC9FC</color> |
14 | - <color name="titleColor">#C6DAFF</color> | |
14 | + <color name="titleColor">#A6DAFF</color> | |
15 | 15 | <color name="bgColor">#F0EFF5</color> |
16 | 16 | <color name="textColor">#494947</color> |
17 | 17 | <color name="xueqing_blue">#ABC9FF</color> | ... | ... |
app/src/main/res/values/strings.xml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <!-- TODO: Remove or change this placeholder text --> |
5 | 5 | <string name="hello_blank_fragment">Hello blank fragment</string> |
6 | 6 | |
7 | - <string name="ceping">测评</string> | |
7 | + <string name="ceping">慧测慧练</string> | |
8 | 8 | <string name="consult_huati">咨询话题</string> |
9 | 9 | <string name="order_detail">订单详情</string> |
10 | 10 | </resources> | ... | ... |