Commit 0118d64149b3e2c1da3b7087a9d19af158f8816d
1 parent
6a922153
Exists in
yxb_dev
and in
2 other branches
no message
Showing
17 changed files
with
116 additions
and
71 deletions
Show diff stats
app/src/main/AndroidManifest.xml
@@ -113,6 +113,7 @@ | @@ -113,6 +113,7 @@ | ||
113 | android:value="1d130afb822d8a1019e6592cbaf10bcc"/> | 113 | android:value="1d130afb822d8a1019e6592cbaf10bcc"/> |
114 | 114 | ||
115 | <activity android:name=".ui.activity.StartActivity" | 115 | <activity android:name=".ui.activity.StartActivity" |
116 | + android:launchMode="singleInstance" | ||
116 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden"> | 117 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden"> |
117 | <intent-filter> | 118 | <intent-filter> |
118 | <action android:name="android.intent.action.MAIN"/> | 119 | <action android:name="android.intent.action.MAIN"/> |
@@ -126,44 +127,61 @@ | @@ -126,44 +127,61 @@ | ||
126 | <!--android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />--> | 127 | <!--android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />--> |
127 | <activity | 128 | <activity |
128 | android:name=".ui.activity.MyChildActivity" | 129 | android:name=".ui.activity.MyChildActivity" |
130 | + android:launchMode="singleInstance" | ||
129 | android:screenOrientation="portrait"/> | 131 | android:screenOrientation="portrait"/> |
130 | <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"/> | 132 | <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"/> |
131 | <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> --> | 133 | <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> --> |
132 | <activity | 134 | <activity |
133 | android:name=".ui.MainActivity" | 135 | android:name=".ui.MainActivity" |
136 | + android:launchMode="singleInstance" | ||
137 | + android:windowSoftInputMode="adjustPan|stateAlwaysHidden" | ||
134 | android:screenOrientation="portrait"/> | 138 | android:screenOrientation="portrait"/> |
135 | <activity | 139 | <activity |
136 | android:name=".ui.activity.ChildDetialActivity" | 140 | android:name=".ui.activity.ChildDetialActivity" |
141 | + android:launchMode="singleInstance" | ||
137 | android:screenOrientation="portrait" /> | 142 | android:screenOrientation="portrait" /> |
138 | <activity | 143 | <activity |
139 | android:name=".ui.activity.binding.CreateChildInfoActivity" | 144 | android:name=".ui.activity.binding.CreateChildInfoActivity" |
145 | + android:launchMode="singleInstance" | ||
140 | android:screenOrientation="portrait" | 146 | android:screenOrientation="portrait" |
141 | android:windowSoftInputMode="adjustPan|stateHidden"/> | 147 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
142 | <activity | 148 | <activity |
143 | android:name=".ui.activity.binding.SelectSchoolActivity" | 149 | android:name=".ui.activity.binding.SelectSchoolActivity" |
150 | + android:launchMode="singleInstance" | ||
144 | android:screenOrientation="portrait" | 151 | android:screenOrientation="portrait" |
145 | android:windowSoftInputMode="adjustPan|stateHidden"/> | 152 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
146 | 153 | ||
147 | <activity android:name=".ui.activity.LoginAndRegistActivity" | 154 | <activity android:name=".ui.activity.LoginAndRegistActivity" |
155 | + android:launchMode="singleInstance" | ||
148 | android:screenOrientation="portrait" | 156 | android:screenOrientation="portrait" |
149 | /> | 157 | /> |
150 | <activity | 158 | <activity |
151 | android:name=".ui.activity.PersonInfoActivity" | 159 | android:name=".ui.activity.PersonInfoActivity" |
160 | + android:launchMode="singleInstance" | ||
152 | android:screenOrientation="portrait" | 161 | android:screenOrientation="portrait" |
153 | android:windowSoftInputMode="adjustPan|stateHidden"/> | 162 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
163 | + | ||
154 | <activity | 164 | <activity |
155 | android:name=".ui.activity.binding.CheckInfoActivity" | 165 | android:name=".ui.activity.binding.CheckInfoActivity" |
166 | + android:launchMode="singleInstance" | ||
156 | android:screenOrientation="portrait" | 167 | android:screenOrientation="portrait" |
157 | android:windowSoftInputMode="adjustPan|stateHidden"/> | 168 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
169 | + | ||
158 | <activity | 170 | <activity |
159 | android:name=".ui.activity.binding.InviteCodeActivity" | 171 | android:name=".ui.activity.binding.InviteCodeActivity" |
160 | - | 172 | + android:launchMode="singleInstance" |
161 | android:screenOrientation="portrait" /> | 173 | android:screenOrientation="portrait" /> |
174 | + | ||
162 | <activity | 175 | <activity |
163 | android:name=".ui.activity.mywebview.WebViewActivity" | 176 | android:name=".ui.activity.mywebview.WebViewActivity" |
177 | + android:launchMode="singleInstance" | ||
164 | android:screenOrientation="portrait" /> | 178 | android:screenOrientation="portrait" /> |
165 | - <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" /> | ||
166 | - <activity android:name=".ui.activity.orderdetail.OrderDetailActivity" /> | 179 | + |
180 | + <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" | ||
181 | + android:launchMode="singleInstance"/> | ||
182 | + | ||
183 | + <activity android:name=".ui.activity.orderdetail.OrderDetailActivity" | ||
184 | + android:launchMode="singleInstance"/> | ||
167 | </application> | 185 | </application> |
168 | 186 | ||
169 | </manifest> | 187 | </manifest> |
170 | \ No newline at end of file | 188 | \ No newline at end of file |
app/src/main/java/com/shunzhi/parent/AppConfig.java
@@ -38,6 +38,7 @@ public class AppConfig { | @@ -38,6 +38,7 @@ public class AppConfig { | ||
38 | public static String BASE_URL="http://60.190.202.57:1000/"; | 38 | public static String BASE_URL="http://60.190.202.57:1000/"; |
39 | public static String BASE_URL_IMG="http://60.190.202.57:1000"; | 39 | public static String BASE_URL_IMG="http://60.190.202.57:1000"; |
40 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | 40 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; |
41 | + public static String BASE_URL_FILE="http://60.190.202.57:8196"; | ||
41 | 42 | ||
42 | 43 | ||
43 | //默认日志保存的路径 | 44 | //默认日志保存的路径 |
app/src/main/java/com/shunzhi/parent/bean/ToolBean.java
@@ -34,8 +34,12 @@ public class ToolBean implements Serializable { | @@ -34,8 +34,12 @@ public class ToolBean implements Serializable { | ||
34 | @Override | 34 | @Override |
35 | public String toString() { | 35 | public String toString() { |
36 | return "ToolBean{" + | 36 | return "ToolBean{" + |
37 | - "toolImg='" + toolImage + '' + | 37 | + "toolImage='" + toolImage + '' + |
38 | ", toolName='" + toolName + '\'' + | 38 | ", toolName='" + toolName + '\'' + |
39 | + ", toolUrl='" + toolUrl + '\'' + | ||
40 | + ", toolId='" + toolId + '\'' + | ||
41 | + ", columnType='" + columnType + '\'' + | ||
42 | + ", orderById='" + orderById + '\'' + | ||
39 | '}'; | 43 | '}'; |
40 | } | 44 | } |
41 | } | 45 | } |
app/src/main/java/com/shunzhi/parent/presenter/ceping/CePingPresenter.java
1 | package com.shunzhi.parent.presenter.ceping; | 1 | package com.shunzhi.parent.presenter.ceping; |
2 | 2 | ||
3 | +import android.util.Log; | ||
3 | import android.view.View; | 4 | import android.view.View; |
4 | import android.widget.LinearLayout; | 5 | import android.widget.LinearLayout; |
5 | 6 | ||
@@ -18,6 +19,7 @@ import java.util.ArrayList; | @@ -18,6 +19,7 @@ import java.util.ArrayList; | ||
18 | import java.util.List; | 19 | import java.util.List; |
19 | 20 | ||
20 | import io.reactivex.functions.Consumer; | 21 | import io.reactivex.functions.Consumer; |
22 | +import timber.log.Timber; | ||
21 | 23 | ||
22 | /** | 24 | /** |
23 | * Created by ToaHanDong on 2018/3/14. | 25 | * Created by ToaHanDong on 2018/3/14. |
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
@@ -68,7 +68,6 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | @@ -68,7 +68,6 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | ||
68 | mRxManager.register(mIModel.getBanners(position, areaName).subscribe(new Consumer<JsonObject>() { | 68 | mRxManager.register(mIModel.getBanners(position, areaName).subscribe(new Consumer<JsonObject>() { |
69 | @Override | 69 | @Override |
70 | public void accept(JsonObject jsonObject) throws Exception { | 70 | public void accept(JsonObject jsonObject) throws Exception { |
71 | - Log.d("666666","getBanners="+jsonObject.toString()); | ||
72 | if (jsonObject.get("status").getAsString().equals("1")) { | 71 | if (jsonObject.get("status").getAsString().equals("1")) { |
73 | JsonArray jsonArray = jsonObject.getAsJsonArray("data"); | 72 | JsonArray jsonArray = jsonObject.getAsJsonArray("data"); |
74 | List<GuangGaoBean> guangGaoBeanList = new ArrayList<>(); | 73 | List<GuangGaoBean> guangGaoBeanList = new ArrayList<>(); |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
@@ -7,6 +7,7 @@ import android.os.Bundle; | @@ -7,6 +7,7 @@ import android.os.Bundle; | ||
7 | import android.support.v7.widget.RecyclerView; | 7 | import android.support.v7.widget.RecyclerView; |
8 | import android.view.View; | 8 | import android.view.View; |
9 | import android.widget.EditText; | 9 | import android.widget.EditText; |
10 | +import android.widget.FrameLayout; | ||
10 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
11 | import android.widget.TextView; | 12 | import android.widget.TextView; |
12 | 13 | ||
@@ -15,6 +16,7 @@ import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | @@ -15,6 +16,7 @@ import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | ||
15 | import com.shunzhi.parent.R; | 16 | import com.shunzhi.parent.R; |
16 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 17 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
17 | import com.shunzhi.parent.bean.MyConsultBean; | 18 | import com.shunzhi.parent.bean.MyConsultBean; |
19 | +import com.shunzhi.parent.ui.fragment.consult.ConsultTwoLevelFragment; | ||
18 | 20 | ||
19 | import java.util.ArrayList; | 21 | import java.util.ArrayList; |
20 | import java.util.List; | 22 | import java.util.List; |
@@ -32,6 +34,10 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -32,6 +34,10 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
32 | EditText et_search; | 34 | EditText et_search; |
33 | 35 | ||
34 | String channel; | 36 | String channel; |
37 | + | ||
38 | + FrameLayout frame_consult_two; | ||
39 | + | ||
40 | + ConsultTwoLevelFragment consultTwoLevelFragment=null; | ||
35 | @Override | 41 | @Override |
36 | protected void initView(Bundle savedInstanceState) { | 42 | protected void initView(Bundle savedInstanceState) { |
37 | initViews(); | 43 | initViews(); |
@@ -47,12 +53,20 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -47,12 +53,20 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
47 | channel=getIntent().getStringExtra("channel"); | 53 | channel=getIntent().getStringExtra("channel"); |
48 | ivBack = findViewById(R.id.ivBack); | 54 | ivBack = findViewById(R.id.ivBack); |
49 | ivBack.setOnClickListener(this); | 55 | ivBack.setOnClickListener(this); |
56 | + frame_consult_two=findViewById(R.id.frame_consult_two); | ||
50 | 57 | ||
51 | et_search = findViewById(R.id.et_search); | 58 | et_search = findViewById(R.id.et_search); |
52 | 59 | ||
53 | ivSearch = findViewById(R.id.ivSearch); | 60 | ivSearch = findViewById(R.id.ivSearch); |
54 | ivSearch.setOnClickListener(this); | 61 | ivSearch.setOnClickListener(this); |
55 | 62 | ||
63 | + consultTwoLevelFragment=new ConsultTwoLevelFragment(); | ||
64 | + Bundle bundle=new Bundle(); | ||
65 | + bundle.putString("channel",channel); | ||
66 | + consultTwoLevelFragment.setArguments(bundle); | ||
67 | + getSupportFragmentManager().beginTransaction().add(R.id.frame_consult_two,consultTwoLevelFragment) | ||
68 | + .show(consultTwoLevelFragment).commit(); | ||
69 | + | ||
56 | } | 70 | } |
57 | 71 | ||
58 | 72 |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
@@ -19,6 +19,7 @@ import android.widget.TextView; | @@ -19,6 +19,7 @@ import android.widget.TextView; | ||
19 | import com.share.mvpsdk.base.activity.BaseCompatActivity; | 19 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
20 | import com.share.mvpsdk.utils.AppUtils; | 20 | import com.share.mvpsdk.utils.AppUtils; |
21 | import com.share.mvpsdk.utils.NetworkConnectionUtils; | 21 | import com.share.mvpsdk.utils.NetworkConnectionUtils; |
22 | +import com.share.mvpsdk.utils.ToastUtils; | ||
22 | import com.share.mvpsdk.widgets.NestedScrollWebView; | 23 | import com.share.mvpsdk.widgets.NestedScrollWebView; |
23 | import com.shunzhi.parent.AppConfig; | 24 | import com.shunzhi.parent.AppConfig; |
24 | import com.shunzhi.parent.R; | 25 | import com.shunzhi.parent.R; |
@@ -110,6 +111,7 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -110,6 +111,7 @@ public class WebViewActivity extends BaseCompatActivity { | ||
110 | 111 | ||
111 | initWebView(); | 112 | initWebView(); |
112 | initWebSetting(nesteScrollWebView.getSettings()); | 113 | initWebSetting(nesteScrollWebView.getSettings()); |
114 | + ToastUtils.showToast(getIntent().getStringExtra("url")); | ||
113 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); | 115 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); |
114 | } | 116 | } |
115 | 117 |
app/src/main/java/com/shunzhi/parent/ui/activity/orderdetail/OrderDetailActivity.java
@@ -127,7 +127,7 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra | @@ -127,7 +127,7 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra | ||
127 | public void onItemClickListener(Object object, int position) { | 127 | public void onItemClickListener(Object object, int position) { |
128 | OrderDetailBeanList orderDetailBeanList= (OrderDetailBeanList) object; | 128 | OrderDetailBeanList orderDetailBeanList= (OrderDetailBeanList) object; |
129 | WebViewActivity.getInstance(OrderDetailActivity.this, | 129 | WebViewActivity.getInstance(OrderDetailActivity.this, |
130 | - AppConfig.BASE_URL_ORDER+"OrderDetail.aspx?orderid="+orderDetailBeanList.orderId,-1); | 130 | + AppConfig.BASE_URL_ORDER+"OrderDetail.aspx?orderid="+orderDetailBeanList.id,-1); |
131 | } | 131 | } |
132 | }); | 132 | }); |
133 | 133 |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
@@ -98,10 +98,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -98,10 +98,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
98 | @Override | 98 | @Override |
99 | public void onResume() { | 99 | public void onResume() { |
100 | super.onResume(); | 100 | super.onResume(); |
101 | - if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | 101 | +// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ |
102 | tvLocalAddress.setText(AppContext.getInstance().cityName); | 102 | tvLocalAddress.setText(AppContext.getInstance().cityName); |
103 | addTools(); | 103 | addTools(); |
104 | - } | 104 | +// } |
105 | } | 105 | } |
106 | 106 | ||
107 | private void initListeners(View view) { | 107 | private void initListeners(View view) { |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -133,11 +133,11 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -133,11 +133,11 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
133 | public void onResume() { | 133 | public void onResume() { |
134 | super.onResume(); | 134 | super.onResume(); |
135 | xBanner.startAutoPlay(); | 135 | xBanner.startAutoPlay(); |
136 | - if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | 136 | +// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ |
137 | tvLocalAddress.setText(AppContext.getInstance().cityName); | 137 | tvLocalAddress.setText(AppContext.getInstance().cityName); |
138 | mPresenter.getBanners("2", AppContext.getInstance().district); | 138 | mPresenter.getBanners("2", AppContext.getInstance().district); |
139 | mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | 139 | mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); |
140 | - } | 140 | +// } |
141 | } | 141 | } |
142 | 142 | ||
143 | @Override | 143 | @Override |
@@ -194,7 +194,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -194,7 +194,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
194 | @Override | 194 | @Override |
195 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { | 195 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
196 | for (int i = 0; i < guangGaoBeanList.size(); i++) { | 196 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
197 | - imgesUrl.add(AppConfig.BASE_URL_IMG + guangGaoBeanList.get(i).fileSrc); | 197 | + imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); |
198 | describeList.add(guangGaoBeanList.get(i).describe); | 198 | describeList.add(guangGaoBeanList.get(i).describe); |
199 | } | 199 | } |
200 | initBanners(); | 200 | initBanners(); |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
@@ -100,7 +100,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -100,7 +100,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
100 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { | 100 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
101 | @Override | 101 | @Override |
102 | public void loadBanner(XBanner banner, Object model, View view, int position) { | 102 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
103 | - Glide.with(getActivity()).load(imgUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | 103 | + Glide.with(getActivity()).load(AppConfig.BASE_URL_FILE+imgUrl.get(position)).placeholder(R.drawable.ic_launcher_background) |
104 | .into((ImageView) view); | 104 | .into((ImageView) view); |
105 | } | 105 | } |
106 | }); | 106 | }); |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
@@ -181,7 +181,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -181,7 +181,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
181 | 181 | ||
182 | @Override | 182 | @Override |
183 | public void onBindViewHolder(GuangGaoBean object, int position) { | 183 | public void onBindViewHolder(GuangGaoBean object, int position) { |
184 | - Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | 184 | + Glide.with(getActivity()).load(AppConfig.BASE_URL_FILE + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); |
185 | tv_grally_title.setText(object.describe + ""); | 185 | tv_grally_title.setText(object.describe + ""); |
186 | } | 186 | } |
187 | } | 187 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java
@@ -9,6 +9,8 @@ import android.widget.TextView; | @@ -9,6 +9,8 @@ import android.widget.TextView; | ||
9 | 9 | ||
10 | import com.share.mvpsdk.base.BasePresenter; | 10 | import com.share.mvpsdk.base.BasePresenter; |
11 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 11 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
12 | +import com.shunzhi.parent.AppConfig; | ||
13 | +import com.shunzhi.parent.AppContext; | ||
12 | import com.shunzhi.parent.R; | 14 | import com.shunzhi.parent.R; |
13 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 15 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
14 | import com.shunzhi.parent.bean.GuangGaoBean; | 16 | import com.shunzhi.parent.bean.GuangGaoBean; |
@@ -33,8 +35,8 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -33,8 +35,8 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
33 | 35 | ||
34 | MyConsultAdapter myConsultAdapter = null; | 36 | MyConsultAdapter myConsultAdapter = null; |
35 | 37 | ||
36 | - List<MyConsultBean> myConsultBeanList = new ArrayList<>(); | ||
37 | 38 | ||
39 | + String channel=""; | ||
38 | @Override | 40 | @Override |
39 | public int getLayoutId() { | 41 | public int getLayoutId() { |
40 | return R.layout.fragment_consult_two_level; | 42 | return R.layout.fragment_consult_two_level; |
@@ -46,25 +48,11 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -46,25 +48,11 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
46 | tvContentName.setText(""); | 48 | tvContentName.setText(""); |
47 | 49 | ||
48 | recyclerView = view.findViewById(R.id.recyclerView); | 50 | recyclerView = view.findViewById(R.id.recyclerView); |
51 | + channel=getArguments().getString("channel"); | ||
49 | 52 | ||
50 | -// initRecyclerView(); | 53 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel),0,1); |
51 | } | 54 | } |
52 | 55 | ||
53 | -// private void initRecyclerView() { | ||
54 | -// | ||
55 | -// if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
56 | -// for (int i = 0; i < 12; i++) { | ||
57 | -// MyConsultBean myConsultBean = new MyConsultBean(); | ||
58 | -// myConsultBean.consultCounts = i + ""; | ||
59 | -// myConsultBean.consultContent = "咨询内容" + i; | ||
60 | -// myConsultBean.consultTitle = "咨询标题" + i; | ||
61 | -// myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
62 | -// myConsultBeanList.add(myConsultBean); | ||
63 | -// } | ||
64 | -// myConsultAdapter.addAll(myConsultBeanList); | ||
65 | -// recyclerView.setAdapter(myConsultAdapter); | ||
66 | -// } | ||
67 | - | ||
68 | @NonNull | 56 | @NonNull |
69 | @Override | 57 | @Override |
70 | public BasePresenter initPresenter() { | 58 | public BasePresenter initPresenter() { |
@@ -83,7 +71,9 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -83,7 +71,9 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
83 | 71 | ||
84 | @Override | 72 | @Override |
85 | public void showConsultContent(List<ChannelContextBean> list) { | 73 | public void showConsultContent(List<ChannelContextBean> list) { |
86 | - | 74 | + if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); |
75 | + myConsultAdapter.addAll(list); | ||
76 | + recyclerView.setAdapter(myConsultAdapter); | ||
87 | } | 77 | } |
88 | 78 | ||
89 | @Override | 79 | @Override |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
@@ -14,6 +14,8 @@ import android.widget.TextView; | @@ -14,6 +14,8 @@ import android.widget.TextView; | ||
14 | 14 | ||
15 | import com.bumptech.glide.Glide; | 15 | import com.bumptech.glide.Glide; |
16 | import com.share.mvpsdk.utils.DisplayUtils; | 16 | import com.share.mvpsdk.utils.DisplayUtils; |
17 | +import com.shunzhi.parent.AppConfig; | ||
18 | +import com.shunzhi.parent.AppContext; | ||
17 | import com.shunzhi.parent.R; | 19 | import com.shunzhi.parent.R; |
18 | 20 | ||
19 | 21 | ||
@@ -55,6 +57,7 @@ public class TextAndImgShowView extends LinearLayout { | @@ -55,6 +57,7 @@ public class TextAndImgShowView extends LinearLayout { | ||
55 | } | 57 | } |
56 | 58 | ||
57 | public void addImgs(String imgUrl){ | 59 | public void addImgs(String imgUrl){ |
60 | + if (!imgUrl.startsWith("http"))imgUrl= AppConfig.BASE_URL_FILE+imgUrl; | ||
58 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); | 61 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); |
59 | } | 62 | } |
60 | 63 |
app/src/main/res/layout/activity_consult_two_level.xml
@@ -10,4 +10,10 @@ | @@ -10,4 +10,10 @@ | ||
10 | 10 | ||
11 | <include layout="@layout/layout_search_back"/> | 11 | <include layout="@layout/layout_search_back"/> |
12 | 12 | ||
13 | + <FrameLayout | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:layout_height="match_parent" | ||
16 | + android:id="@+id/frame_consult_two" | ||
17 | + ></FrameLayout> | ||
18 | + | ||
13 | </LinearLayout> | 19 | </LinearLayout> |
app/src/main/res/layout/fragment_zi_xun.xml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | android:orientation="vertical" | 6 | android:orientation="vertical" |
7 | tools:context="com.shunzhi.parent.ui.fragment.ConsultFragment"> | 7 | tools:context="com.shunzhi.parent.ui.fragment.ConsultFragment"> |
8 | 8 | ||
9 | - <include layout="@layout/layout_search"/> | 9 | + <include layout="@layout/layout_search" /> |
10 | 10 | ||
11 | <com.stx.xhb.xbanner.XBanner | 11 | <com.stx.xhb.xbanner.XBanner |
12 | android:id="@+id/xBanner" | 12 | android:id="@+id/xBanner" |
@@ -17,21 +17,20 @@ | @@ -17,21 +17,20 @@ | ||
17 | <LinearLayout | 17 | <LinearLayout |
18 | android:layout_width="match_parent" | 18 | android:layout_width="match_parent" |
19 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
20 | - android:paddingTop="@dimen/size_dp_10" | ||
21 | android:layout_marginLeft="@dimen/size_dp_10" | 20 | android:layout_marginLeft="@dimen/size_dp_10" |
22 | android:layout_marginRight="@dimen/size_dp_10" | 21 | android:layout_marginRight="@dimen/size_dp_10" |
23 | - > | 22 | + android:paddingTop="@dimen/size_dp_10"> |
24 | 23 | ||
25 | -<include layout="@layout/layout_textandimgshow" | ||
26 | - /> | 24 | + <include layout="@layout/layout_textandimgshow" /> |
27 | 25 | ||
28 | </LinearLayout> | 26 | </LinearLayout> |
27 | + | ||
29 | <LinearLayout | 28 | <LinearLayout |
30 | android:layout_width="match_parent" | 29 | android:layout_width="match_parent" |
31 | android:layout_height="wrap_content" | 30 | android:layout_height="wrap_content" |
31 | + android:orientation="vertical" | ||
32 | android:paddingLeft="@dimen/size_dp_10" | 32 | android:paddingLeft="@dimen/size_dp_10" |
33 | - android:paddingRight="@dimen/size_dp_10" | ||
34 | - android:orientation="vertical"> | 33 | + android:paddingRight="@dimen/size_dp_10"> |
35 | 34 | ||
36 | <TextView | 35 | <TextView |
37 | android:layout_width="match_parent" | 36 | android:layout_width="match_parent" |
@@ -44,12 +43,13 @@ | @@ -44,12 +43,13 @@ | ||
44 | <LinearLayout | 43 | <LinearLayout |
45 | android:layout_width="match_parent" | 44 | android:layout_width="match_parent" |
46 | android:layout_height="wrap_content"> | 45 | android:layout_height="wrap_content"> |
47 | - <android.support.v7.widget.RecyclerView | ||
48 | - android:id="@+id/recycler_content" | ||
49 | - android:layout_width="match_parent" | ||
50 | - android:layout_height="match_parent"> | ||
51 | 46 | ||
52 | - </android.support.v7.widget.RecyclerView> | 47 | + <android.support.v7.widget.RecyclerView |
48 | + android:id="@+id/recycler_content" | ||
49 | + android:layout_width="match_parent" | ||
50 | + android:layout_height="match_parent"> | ||
51 | + | ||
52 | + </android.support.v7.widget.RecyclerView> | ||
53 | </LinearLayout> | 53 | </LinearLayout> |
54 | </LinearLayout> | 54 | </LinearLayout> |
55 | 55 |
mvpsdk/src/main/java/com/share/mvpsdk/helper/RetrofitCreateHelper.java
@@ -24,12 +24,13 @@ import retrofit2.converter.gson.GsonConverterFactory; | @@ -24,12 +24,13 @@ import retrofit2.converter.gson.GsonConverterFactory; | ||
24 | public class RetrofitCreateHelper { | 24 | public class RetrofitCreateHelper { |
25 | private static final int TIMEOUT_READ = 20; | 25 | private static final int TIMEOUT_READ = 20; |
26 | private static final int TIMEOUT_CONNECTION = 10; | 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 | private static final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor() | 29 | private static final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor() |
30 | .setLevel(HttpLoggingInterceptor.Level.BODY); | 30 | .setLevel(HttpLoggingInterceptor.Level.BODY); |
31 | private static CacheInterceptor cacheInterceptor = new CacheInterceptor(); | 31 | private static CacheInterceptor cacheInterceptor = new CacheInterceptor(); |
32 | - private static OkHttpClient.Builder okhttpClientBuilder=null; | 32 | + private static OkHttpClient.Builder okhttpClientBuilder = null; |
33 | + | ||
33 | /*private static OkHttpClient okHttpClient = new OkHttpClient.Builder() | 34 | /*private static OkHttpClient okHttpClient = new OkHttpClient.Builder() |
34 | //SSL证书 | 35 | //SSL证书 |
35 | .sslSocketFactory(TrustManager.getUnsafeOkHttpClient()) | 36 | .sslSocketFactory(TrustManager.getUnsafeOkHttpClient()) |
@@ -47,33 +48,39 @@ public class RetrofitCreateHelper { | @@ -47,33 +48,39 @@ public class RetrofitCreateHelper { | ||
47 | //失败重连 | 48 | //失败重连 |
48 | .retryOnConnectionFailure(true) | 49 | .retryOnConnectionFailure(true) |
49 | .build();*/ | 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 | return retrofitCreateHelper; | 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 | public <T> T createApi(Class<T> clazz, String url) { | 82 | public <T> T createApi(Class<T> clazz, String url) { |
76 | - Authorization=token; | 83 | + Authorization = token; |
77 | Retrofit retrofit = new Retrofit.Builder() | 84 | Retrofit retrofit = new Retrofit.Builder() |
78 | .baseUrl(url) | 85 | .baseUrl(url) |
79 | .client(okhttpClientBuilder.build()) | 86 | .client(okhttpClientBuilder.build()) |
@@ -83,7 +90,7 @@ public class RetrofitCreateHelper { | @@ -83,7 +90,7 @@ public class RetrofitCreateHelper { | ||
83 | return retrofit.create(clazz); | 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 | // Authorization= StringUtils.getSign(); | 94 | // Authorization= StringUtils.getSign(); |
88 | // okHttpClient.newBuilder().addInterceptor(new Interceptor() { | 95 | // okHttpClient.newBuilder().addInterceptor(new Interceptor() { |
89 | // @Override | 96 | // @Override |
@@ -103,13 +110,13 @@ public class RetrofitCreateHelper { | @@ -103,13 +110,13 @@ public class RetrofitCreateHelper { | ||
103 | // .build(); | 110 | // .build(); |
104 | // return retrofit.create(clazz); | 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 | .client(okhttpClientBuilder.build()) | 120 | .client(okhttpClientBuilder.build()) |
114 | .baseUrl(url) | 121 | .baseUrl(url) |
115 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | 122 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) |
@@ -119,6 +126,5 @@ public class RetrofitCreateHelper { | @@ -119,6 +126,5 @@ public class RetrofitCreateHelper { | ||
119 | } | 126 | } |
120 | 127 | ||
121 | 128 | ||
122 | - | ||
123 | } | 129 | } |
124 | 130 |