Commit ae079afc548e0d852fc6f8c1535e410e4ee4084d
Exists in
yxb_dev
and in
2 other branches
Merge branch 'developer' into yxb_dev
# Conflicts: # app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java # app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java # app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java # app/src/main/res/layout/activity_consult_two_level.xml # app/src/main/res/layout/fragment_zi_xun.xml
Showing
17 changed files
with
155 additions
and
82 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/ConsultOneLevelActivity.java
@@ -3,39 +3,37 @@ package com.shunzhi.parent.ui.activity.consult; | @@ -3,39 +3,37 @@ package com.shunzhi.parent.ui.activity.consult; | ||
3 | import android.content.Context; | 3 | import android.content.Context; |
4 | import android.content.Intent; | 4 | import android.content.Intent; |
5 | import android.support.v4.app.FragmentTransaction; | 5 | import android.support.v4.app.FragmentTransaction; |
6 | -import android.support.v7.app.AppCompatActivity; | ||
7 | import android.os.Bundle; | 6 | import android.os.Bundle; |
8 | import android.view.View; | 7 | import android.view.View; |
9 | import android.widget.EditText; | 8 | import android.widget.EditText; |
10 | import android.widget.FrameLayout; | 9 | import android.widget.FrameLayout; |
11 | import android.widget.ImageView; | 10 | import android.widget.ImageView; |
12 | -import android.widget.TextView; | ||
13 | 11 | ||
14 | import com.share.mvpsdk.base.activity.BaseCompatActivity; | 12 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
15 | import com.share.mvpsdk.utils.ToastUtils; | 13 | import com.share.mvpsdk.utils.ToastUtils; |
16 | import com.shunzhi.parent.R; | 14 | import com.shunzhi.parent.R; |
17 | import com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment; | 15 | import com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment; |
18 | 16 | ||
19 | -public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener{ | 17 | +public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener { |
20 | 18 | ||
21 | - | ||
22 | - public static void getInstance(Context context,String channel){ | ||
23 | - Intent intent=new Intent(context,ConsultOneLevelActivity.class); | ||
24 | - intent.putExtra("channel",channel); | 19 | + public static void getInstance(Context context, String channel) { |
20 | + Intent intent = new Intent(context, ConsultOneLevelActivity.class); | ||
21 | + intent.putExtra("channel", channel); | ||
25 | context.startActivity(intent); | 22 | context.startActivity(intent); |
26 | } | 23 | } |
27 | 24 | ||
28 | EditText et_search; | 25 | EditText et_search; |
29 | 26 | ||
30 | - ImageView ivSearch,ivBack; | 27 | + ImageView ivSearch, ivBack; |
31 | 28 | ||
32 | - String channel=""; | 29 | + String channel = ""; |
33 | 30 | ||
34 | FrameLayout frame_consult; | 31 | FrameLayout frame_consult; |
35 | 32 | ||
36 | - FragmentTransaction fragmentTransaction=null; | 33 | + FragmentTransaction fragmentTransaction = null; |
34 | + | ||
35 | + ConsultOneLevelFragment consultOneLevelFragment = null; | ||
37 | 36 | ||
38 | - ConsultOneLevelFragment consultOneLevelFragment=null; | ||
39 | @Override | 37 | @Override |
40 | protected void initView(Bundle savedInstanceState) { | 38 | protected void initView(Bundle savedInstanceState) { |
41 | 39 | ||
@@ -45,22 +43,22 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -45,22 +43,22 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
45 | 43 | ||
46 | private void initViews() { | 44 | private void initViews() { |
47 | 45 | ||
48 | - channel=getIntent().getStringExtra("channel"); | ||
49 | - consultOneLevelFragment=new ConsultOneLevelFragment(); | ||
50 | - et_search=findViewById(R.id.et_search); | ||
51 | - ivSearch=findViewById(R.id.ivSearch); | ||
52 | - ivBack=findViewById(R.id.ivBack); | ||
53 | - frame_consult=findViewById(R.id.frame_consult); | 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); | ||
54 | 52 | ||
55 | ivSearch.setOnClickListener(this); | 53 | ivSearch.setOnClickListener(this); |
56 | ivBack.setOnClickListener(this); | 54 | ivBack.setOnClickListener(this); |
57 | 55 | ||
58 | - Bundle bundle=new Bundle(); | ||
59 | - bundle.putString("channel",channel); | 56 | + Bundle bundle = new Bundle(); |
57 | + bundle.putString("channel", channel); | ||
60 | consultOneLevelFragment.setArguments(bundle); | 58 | consultOneLevelFragment.setArguments(bundle); |
61 | - ToastUtils.showToast("channel="+channel); | ||
62 | - fragmentTransaction=getSupportFragmentManager().beginTransaction(); | ||
63 | - fragmentTransaction.add(R.id.frame_consult,consultOneLevelFragment) | 59 | +// ToastUtils.showToast("channel=" + channel); |
60 | + fragmentTransaction = getSupportFragmentManager().beginTransaction(); | ||
61 | + fragmentTransaction.add(R.id.frame_consult, consultOneLevelFragment) | ||
64 | .show(consultOneLevelFragment).commit(); | 62 | .show(consultOneLevelFragment).commit(); |
65 | } | 63 | } |
66 | 64 | ||
@@ -71,9 +69,9 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -71,9 +69,9 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
71 | 69 | ||
72 | @Override | 70 | @Override |
73 | public void onClick(View view) { | 71 | public void onClick(View view) { |
74 | - switch (view.getId()){ | 72 | + switch (view.getId()) { |
75 | case R.id.ivSearch: | 73 | case R.id.ivSearch: |
76 | - | 74 | + consultOneLevelFragment.showSearchContent(et_search.getText().toString()); |
77 | break; | 75 | break; |
78 | case R.id.ivBack: | 76 | case R.id.ivBack: |
79 | finish(); | 77 | finish(); |
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
@@ -70,7 +70,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -70,7 +70,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
70 | 70 | ||
71 | addTools(); | 71 | addTools(); |
72 | 72 | ||
73 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
74 | textAndImg_xqjc.setTextColor(R.color.white); | 73 | textAndImg_xqjc.setTextColor(R.color.white); |
75 | textAndImg_xqjc.setText("学情检测"); | 74 | textAndImg_xqjc.setText("学情检测"); |
76 | textAndImg_xqjc.setImgs(R.drawable.xqjc, R.drawable.xqjc); | 75 | textAndImg_xqjc.setImgs(R.drawable.xqjc, R.drawable.xqjc); |
@@ -99,6 +98,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -99,6 +98,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
99 | @Override | 98 | @Override |
100 | public void onResume() { | 99 | public void onResume() { |
101 | super.onResume(); | 100 | super.onResume(); |
101 | +// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | ||
102 | + tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
103 | + addTools(); | ||
104 | +// } | ||
102 | } | 105 | } |
103 | 106 | ||
104 | private void initListeners(View view) { | 107 | private void initListeners(View view) { |
@@ -125,7 +128,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -125,7 +128,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
125 | return new CePingPresenter(); | 128 | return new CePingPresenter(); |
126 | } | 129 | } |
127 | 130 | ||
128 | - | ||
129 | @Override | 131 | @Override |
130 | public void onClick(View view) { | 132 | public void onClick(View view) { |
131 | switch (view.getId()) { | 133 | switch (view.getId()) { |
@@ -175,7 +177,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -175,7 +177,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
175 | mPresenter.getTools(layout_control, name.split(" ")[2]); | 177 | mPresenter.getTools(layout_control, name.split(" ")[2]); |
176 | AppContext.getInstance().cityName=name.split(" ")[1]; | 178 | AppContext.getInstance().cityName=name.split(" ")[1]; |
177 | AppContext.getInstance().district=name.split(" ")[2]; | 179 | AppContext.getInstance().district=name.split(" ")[2]; |
178 | -// ToastUtils.showToast(name.split(" ")[2]); | ||
179 | } | 180 | } |
180 | 181 | ||
181 | @Override | 182 | @Override |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -158,6 +158,11 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -158,6 +158,11 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
158 | public void onResume() { | 158 | public void onResume() { |
159 | super.onResume(); | 159 | super.onResume(); |
160 | xBanner.startAutoPlay(); | 160 | xBanner.startAutoPlay(); |
161 | +// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | ||
162 | + tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
163 | + mPresenter.getBanners("2", AppContext.getInstance().district); | ||
164 | + mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | ||
165 | +// } | ||
161 | } | 166 | } |
162 | 167 | ||
163 | @Override | 168 | @Override |
@@ -214,7 +219,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -214,7 +219,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
214 | @Override | 219 | @Override |
215 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { | 220 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
216 | for (int i = 0; i < guangGaoBeanList.size(); i++) { | 221 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
217 | - imgesUrl.add(AppConfig.BASE_URL_IMG + guangGaoBeanList.get(i).fileSrc); | 222 | + imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); |
218 | describeList.add(guangGaoBeanList.get(i).describe); | 223 | describeList.add(guangGaoBeanList.get(i).describe); |
219 | } | 224 | } |
220 | initBanners(); | 225 | initBanners(); |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
1 | package com.shunzhi.parent.ui.fragment; | 1 | package com.shunzhi.parent.ui.fragment; |
2 | 2 | ||
3 | +import android.app.AlertDialog; | ||
4 | +import android.content.DialogInterface; | ||
3 | import android.content.Intent; | 5 | import android.content.Intent; |
4 | import android.os.Bundle; | 6 | import android.os.Bundle; |
5 | import android.support.annotation.NonNull; | 7 | import android.support.annotation.NonNull; |
@@ -13,6 +15,7 @@ import com.bumptech.glide.Glide; | @@ -13,6 +15,7 @@ import com.bumptech.glide.Glide; | ||
13 | import com.makeramen.roundedimageview.RoundedImageView; | 15 | import com.makeramen.roundedimageview.RoundedImageView; |
14 | import com.share.mvpsdk.base.BasePresenter; | 16 | import com.share.mvpsdk.base.BasePresenter; |
15 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 17 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
18 | +import com.share.mvpsdk.utils.CacheUtils; | ||
16 | import com.share.mvpsdk.utils.ToastUtils; | 19 | import com.share.mvpsdk.utils.ToastUtils; |
17 | import com.shunzhi.parent.AppConfig; | 20 | import com.shunzhi.parent.AppConfig; |
18 | import com.shunzhi.parent.AppContext; | 21 | import com.shunzhi.parent.AppContext; |
@@ -26,9 +29,11 @@ import com.shunzhi.parent.ui.activity.PersonInfoActivity; | @@ -26,9 +29,11 @@ import com.shunzhi.parent.ui.activity.PersonInfoActivity; | ||
26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 29 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
27 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | 30 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; |
28 | 31 | ||
32 | +import static java.util.ResourceBundle.clearCache; | ||
33 | + | ||
29 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 34 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
30 | implements MineContract.IMineView, View.OnClickListener { | 35 | implements MineContract.IMineView, View.OnClickListener { |
31 | - LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; | 36 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order,layout_cache; |
32 | RoundedImageView user_photo; | 37 | RoundedImageView user_photo; |
33 | TextView user_name, user_mobile, tvExit,binding_state; | 38 | TextView user_name, user_mobile, tvExit,binding_state; |
34 | 39 | ||
@@ -49,6 +54,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -49,6 +54,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
49 | personinfo = view.findViewById(R.id.personinfo); | 54 | personinfo = view.findViewById(R.id.personinfo); |
50 | layout_order = view.findViewById(R.id.layout_order); | 55 | layout_order = view.findViewById(R.id.layout_order); |
51 | layout_orderDetail = view.findViewById(R.id.layout_orderDetail); | 56 | layout_orderDetail = view.findViewById(R.id.layout_orderDetail); |
57 | + layout_cache=view.findViewById(R.id.layout_cache); | ||
58 | + layout_cache.setOnClickListener(this); | ||
52 | childlayout.setOnClickListener(this); | 59 | childlayout.setOnClickListener(this); |
53 | personinfo.setOnClickListener(this); | 60 | personinfo.setOnClickListener(this); |
54 | layout_order.setOnClickListener(this); | 61 | layout_order.setOnClickListener(this); |
@@ -109,11 +116,42 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -109,11 +116,42 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
109 | case R.id.tvExit: | 116 | case R.id.tvExit: |
110 | clearUerinfo(); | 117 | clearUerinfo(); |
111 | break; | 118 | break; |
119 | + case R.id.layout_cache: | ||
120 | + clearMyCache(); | ||
121 | + break; | ||
112 | default: | 122 | default: |
113 | break; | 123 | break; |
114 | } | 124 | } |
115 | } | 125 | } |
116 | 126 | ||
127 | + private void clearMyCache() { | ||
128 | + | ||
129 | + AlertDialog.Builder builder=new AlertDialog.Builder(getActivity()); | ||
130 | + try { | ||
131 | + builder.setMessage("清理缓存"+CacheUtils.getCacheSize(getActivity())+"") | ||
132 | + .setPositiveButton("取消", new DialogInterface.OnClickListener() { | ||
133 | + @Override | ||
134 | + public void onClick(DialogInterface dialogInterface, int i) { | ||
135 | + dialogInterface.dismiss(); | ||
136 | + } | ||
137 | + }) | ||
138 | + .setNegativeButton("确定", new DialogInterface.OnClickListener() { | ||
139 | + @Override | ||
140 | + public void onClick(DialogInterface dialogInterface, int i) { | ||
141 | + try { | ||
142 | + CacheUtils.clearCache(getActivity()); | ||
143 | + } catch (Exception e) { | ||
144 | + e.printStackTrace(); | ||
145 | + } | ||
146 | + dialogInterface.dismiss(); | ||
147 | + } | ||
148 | + }); | ||
149 | + } catch (Exception e) { | ||
150 | + e.printStackTrace(); | ||
151 | + } | ||
152 | + builder.create().show(); | ||
153 | + } | ||
154 | + | ||
117 | private void clearUerinfo() { | 155 | private void clearUerinfo() { |
118 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); | 156 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); |
119 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); | 157 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); |
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
@@ -37,6 +37,8 @@ import com.shunzhi.parent.views.TextAndImgShowView; | @@ -37,6 +37,8 @@ import com.shunzhi.parent.views.TextAndImgShowView; | ||
37 | import java.util.ArrayList; | 37 | import java.util.ArrayList; |
38 | import java.util.List; | 38 | import java.util.List; |
39 | 39 | ||
40 | +import retrofit2.http.HEAD; | ||
41 | + | ||
40 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, | 42 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, |
41 | ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView { | 43 | ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView { |
42 | 44 | ||
@@ -49,12 +51,14 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -49,12 +51,14 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
49 | 51 | ||
50 | LinearLayout layout_control; | 52 | LinearLayout layout_control; |
51 | 53 | ||
54 | + | ||
52 | List<ChannelContextBean> myConsultBeanList = new ArrayList<>(); | 55 | List<ChannelContextBean> myConsultBeanList = new ArrayList<>(); |
53 | boolean first=true; | 56 | boolean first=true; |
54 | 57 | ||
55 | String channel = ""; | 58 | String channel = ""; |
56 | int pageIndex; | 59 | int pageIndex; |
57 | 60 | ||
61 | + | ||
58 | @Override | 62 | @Override |
59 | public int getLayoutId() { | 63 | public int getLayoutId() { |
60 | return R.layout.fragment_consult_one_level; | 64 | return R.layout.fragment_consult_one_level; |
@@ -89,7 +93,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -89,7 +93,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
89 | ToastUtils.showToast(channel); | 93 | ToastUtils.showToast(channel); |
90 | layout_control = view.findViewById(R.id.layout_control); | 94 | layout_control = view.findViewById(R.id.layout_control); |
91 | layout_control.measure(0, 0); | 95 | layout_control.measure(0, 0); |
92 | -// mPresenter.getTools(layout_control); | ||
93 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | 96 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
94 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | 97 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
95 | recyclerViewConsultOne.setLayoutManager(new LinearLayoutManager(getActivity())); | 98 | recyclerViewConsultOne.setLayoutManager(new LinearLayoutManager(getActivity())); |
@@ -116,25 +119,11 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -116,25 +119,11 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
116 | 119 | ||
117 | mPresenter.getBanners("3", AppContext.getInstance().district); | 120 | mPresenter.getBanners("3", AppContext.getInstance().district); |
118 | 121 | ||
119 | -// initRecyclerViewConsult(); | ||
120 | } | 122 | } |
121 | 123 | ||
122 | -// private void initRecyclerViewConsult() { | ||
123 | -// if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
124 | -// if (null == myConsultBeanList) myConsultBeanList = new ArrayList<>(); | ||
125 | -// else myConsultBeanList.clear(); | ||
126 | -// for (int i = 0; i < 12; i++) { | ||
127 | -// MyConsultBean myConsultBean = new MyConsultBean(); | ||
128 | -// myConsultBean.consultCounts = i + ""; | ||
129 | -// myConsultBean.consultContent = "咨询内容" + i; | ||
130 | -// myConsultBean.consultTitle = "咨询标题" + i; | ||
131 | -// myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
132 | -// myConsultBeanList.add(myConsultBean); | ||
133 | -// } | ||
134 | -// myConsultAdapter.addAll(myConsultBeanList); | ||
135 | -// recyclerViewConsultOne.setAdapter(myConsultAdapter); | ||
136 | -// | ||
137 | -// } | 124 | + public void showSearchContent(String keyword) { |
125 | + mPresenter.getInformationTopic(keyword, AppContext.getInstance().district, channel, "0", 1); | ||
126 | + } | ||
138 | 127 | ||
139 | @NonNull | 128 | @NonNull |
140 | @Override | 129 | @Override |
@@ -176,6 +165,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -176,6 +165,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
176 | 165 | ||
177 | @Override | 166 | @Override |
178 | public void showChannel(List<ChannelBean> list) { | 167 | public void showChannel(List<ChannelBean> list) { |
168 | + | ||
179 | if(first) { | 169 | if(first) { |
180 | for (int i = 0; i < list.size(); i++) { | 170 | for (int i = 0; i < list.size(); i++) { |
181 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | 171 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); |
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/fragment_mine.xml
@@ -268,6 +268,7 @@ | @@ -268,6 +268,7 @@ | ||
268 | android:background="@color/bottomline" /> | 268 | android:background="@color/bottomline" /> |
269 | 269 | ||
270 | <LinearLayout | 270 | <LinearLayout |
271 | + android:id="@+id/layout_cache" | ||
271 | android:layout_width="match_parent" | 272 | android:layout_width="match_parent" |
272 | android:layout_height="?android:actionBarSize" | 273 | android:layout_height="?android:actionBarSize" |
273 | android:gravity="center_vertical" | 274 | android:gravity="center_vertical" |
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 |
mvpsdk/src/main/java/com/share/mvpsdk/utils/CacheUtils.java
@@ -96,6 +96,11 @@ public class CacheUtils { | @@ -96,6 +96,11 @@ public class CacheUtils { | ||
96 | cleanCustomCache(filepath); | 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 | public static String getCacheSize(Context context) throws Exception { | 104 | public static String getCacheSize(Context context) throws Exception { |
100 | File file=new File("/data/data/"+ context.getPackageName()); | 105 | File file=new File("/data/data/"+ context.getPackageName()); |
101 | return getFormatSize(getFolderSize(file)); | 106 | return getFormatSize(getFolderSize(file)); |