Commit 0a3dbbab716b30134717ce770bc50d363bb0b0e1
1 parent
52c0a9d0
Exists in
yxb_dev
and in
1 other branch
no message
Showing
4 changed files
with
58 additions
and
22 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -300,6 +300,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -300,6 +300,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
300 | @Override | 300 | @Override |
301 | public void getCity(String name) { | 301 | public void getCity(String name) { |
302 | first = true; | 302 | first = true; |
303 | + contextList.clear(); | ||
303 | tvLocalAddress.setText(name.split(" ")[2]); | 304 | tvLocalAddress.setText(name.split(" ")[2]); |
304 | mPresenter.getBanners("2", name.split(" ")[2]); | 305 | mPresenter.getBanners("2", name.split(" ")[2]); |
305 | mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); | 306 | mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); |
@@ -310,6 +311,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -310,6 +311,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
310 | 311 | ||
311 | public void refresh() { | 312 | public void refresh() { |
312 | first = true; | 313 | first = true; |
314 | + contextList.clear(); | ||
313 | districtName=AppConfig.getAppConfig(AppContext.getContext()).get(AppConfig.DISTRICT); | 315 | districtName=AppConfig.getAppConfig(AppContext.getContext()).get(AppConfig.DISTRICT); |
314 | tvLocalAddress.setText(districtName); | 316 | tvLocalAddress.setText(districtName); |
315 | mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); | 317 | mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
1 | package com.shunzhi.parent.ui.fragment.consult; | 1 | package com.shunzhi.parent.ui.fragment.consult; |
2 | 2 | ||
3 | import android.os.Bundle; | 3 | import android.os.Bundle; |
4 | +import android.os.Handler; | ||
4 | import android.support.annotation.NonNull; | 5 | import android.support.annotation.NonNull; |
5 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
7 | +import android.support.v4.widget.SwipeRefreshLayout; | ||
6 | import android.support.v7.widget.LinearLayoutManager; | 8 | import android.support.v7.widget.LinearLayoutManager; |
7 | import android.support.v7.widget.RecyclerView; | 9 | import android.support.v7.widget.RecyclerView; |
8 | import android.text.TextUtils; | 10 | import android.text.TextUtils; |
@@ -40,17 +42,17 @@ import java.util.ArrayList; | @@ -40,17 +42,17 @@ import java.util.ArrayList; | ||
40 | import java.util.List; | 42 | import java.util.List; |
41 | 43 | ||
42 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, | 44 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, |
43 | - ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView { | ||
44 | - | ||
45 | - RecyclerView recyclerViewGrally; | ||
46 | - XRecyclerView recyclerViewConsultOne; | 45 | + ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView,SwipeRefreshLayout.OnRefreshListener { |
47 | 46 | ||
47 | + RecyclerView recyclerViewGrally,recyclerViewConsultOne; | ||
48 | MyGrallyAdapter myGrallyAdapter = null; | 48 | MyGrallyAdapter myGrallyAdapter = null; |
49 | 49 | ||
50 | MyConsultAdapter myConsultAdapter = null; | 50 | MyConsultAdapter myConsultAdapter = null; |
51 | 51 | ||
52 | LinearLayout layout_control; | 52 | LinearLayout layout_control; |
53 | 53 | ||
54 | + SwipeRefreshLayout swipeRefreshLayout; | ||
55 | + | ||
54 | 56 | ||
55 | List<ChannelContextBean> myConsultBeanList = new ArrayList<>(); | 57 | List<ChannelContextBean> myConsultBeanList = new ArrayList<>(); |
56 | 58 | ||
@@ -74,8 +76,15 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -74,8 +76,15 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
74 | layout_control.measure(0, 0); | 76 | layout_control.measure(0, 0); |
75 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | 77 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
76 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | 78 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
79 | + swipeRefreshLayout=view.findViewById(R.id.swipeRefreshLayout); | ||
80 | + | ||
81 | + swipeRefreshLayout.setOnRefreshListener(this); | ||
82 | + swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, | ||
83 | + android.R.color.holo_green_light, | ||
84 | + android.R.color.holo_orange_light, | ||
85 | + android.R.color.holo_red_light); | ||
77 | 86 | ||
78 | - recyclerViewConsultOne.setLayoutManager(new LinearLayoutManager(getActivity())); | 87 | + /*recyclerViewConsultOne.setLayoutManager(new LinearLayoutManager(getActivity())); |
79 | recyclerViewConsultOne.setLoadingListener(new XRecyclerView.LoadingListener() { | 88 | recyclerViewConsultOne.setLoadingListener(new XRecyclerView.LoadingListener() { |
80 | @Override | 89 | @Override |
81 | public void onRefresh() { | 90 | public void onRefresh() { |
@@ -93,7 +102,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -93,7 +102,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
93 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | 102 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); |
94 | recyclerViewConsultOne.refreshComplete(); | 103 | recyclerViewConsultOne.refreshComplete(); |
95 | } | 104 | } |
96 | - }); | 105 | + });*/ |
97 | pageIndex = 1; | 106 | pageIndex = 1; |
98 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | 107 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); |
99 | 108 | ||
@@ -188,6 +197,18 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -188,6 +197,18 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
188 | } | 197 | } |
189 | } | 198 | } |
190 | 199 | ||
200 | + @Override | ||
201 | + public void onRefresh() { | ||
202 | + new Handler().postDelayed(new Runnable() { | ||
203 | + @Override | ||
204 | + public void run() { | ||
205 | + swipeRefreshLayout.setRefreshing(false); | ||
206 | + myConsultBeanList.clear(); | ||
207 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, pageIndex); | ||
208 | + } | ||
209 | + },3000); | ||
210 | + } | ||
211 | + | ||
191 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { | 212 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { |
192 | @Override | 213 | @Override |
193 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { | 214 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { |
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
@@ -202,7 +202,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -202,7 +202,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
202 | } | 202 | } |
203 | 203 | ||
204 | private void showOrderPopu(){ | 204 | private void showOrderPopu(){ |
205 | - if (childBean.getCount() == 0) { | 205 | + if (null==childBean||childBean.getCount() == 0) { |
206 | final PopupWindow popupWindow = new PopupWindow(); | 206 | final PopupWindow popupWindow = new PopupWindow(); |
207 | popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); | 207 | popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); |
208 | popupWindow.setHeight(ViewGroup.LayoutParams.MATCH_PARENT); | 208 | popupWindow.setHeight(ViewGroup.LayoutParams.MATCH_PARENT); |
app/src/main/res/layout/fragment_consult_one_level.xml
@@ -2,26 +2,39 @@ | @@ -2,26 +2,39 @@ | ||
2 | xmlns:tools="http://schemas.android.com/tools" | 2 | xmlns:tools="http://schemas.android.com/tools" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
5 | - android:orientation="vertical" | ||
6 | android:background="@color/bgColor" | 5 | android:background="@color/bgColor" |
6 | + android:orientation="vertical" | ||
7 | tools:context="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment"> | 7 | tools:context="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment"> |
8 | 8 | ||
9 | - <android.support.v7.widget.RecyclerView | ||
10 | - android:id="@+id/recyclerViewGrally" | 9 | + <android.support.v4.widget.SwipeRefreshLayout |
10 | + android:id="@+id/swipeRefreshLayout" | ||
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | - android:layout_height="180dp" | ||
13 | - android:background="@color/bgColor" | ||
14 | - ></android.support.v7.widget.RecyclerView> | 12 | + android:layout_height="match_parent" |
13 | + android:visibility="visible"> | ||
14 | + <android.support.v4.widget.NestedScrollView | ||
15 | + android:layout_width="match_parent" | ||
16 | + android:layout_height="match_parent"> | ||
17 | + <LinearLayout | ||
18 | + android:layout_width="match_parent" | ||
19 | + android:layout_height="match_parent" | ||
20 | + android:orientation="vertical"> | ||
15 | 21 | ||
16 | - <include layout="@layout/layout_textandimgshow"/> | 22 | + <android.support.v7.widget.RecyclerView |
23 | + android:id="@+id/recyclerViewGrally" | ||
24 | + android:layout_width="match_parent" | ||
25 | + android:layout_height="180dp" | ||
26 | + android:background="@color/bgColor"></android.support.v7.widget.RecyclerView> | ||
17 | 27 | ||
18 | - <com.jcodecraeer.xrecyclerview.XRecyclerView | ||
19 | - android:layout_marginTop="@dimen/size_dp_10" | ||
20 | - android:layout_width="match_parent" | ||
21 | - android:layout_height="match_parent" | ||
22 | - android:layout_marginLeft="@dimen/size_dp_10" | ||
23 | - android:layout_marginRight="@dimen/size_dp_10" | ||
24 | - android:id="@+id/recyclerViewConsultOne" | ||
25 | - ></com.jcodecraeer.xrecyclerview.XRecyclerView> | 28 | + <include layout="@layout/layout_textandimgshow" /> |
26 | 29 | ||
30 | + <android.support.v7.widget.RecyclerView | ||
31 | + android:id="@+id/recyclerViewConsultOne" | ||
32 | + android:layout_width="match_parent" | ||
33 | + android:layout_height="match_parent" | ||
34 | + android:layout_marginLeft="@dimen/size_dp_10" | ||
35 | + android:layout_marginRight="@dimen/size_dp_10" | ||
36 | + android:layout_marginTop="@dimen/size_dp_10"></android.support.v7.widget.RecyclerView> | ||
37 | + </LinearLayout> | ||
38 | + </android.support.v4.widget.NestedScrollView> | ||
39 | + </android.support.v4.widget.SwipeRefreshLayout> | ||
27 | </LinearLayout> | 40 | </LinearLayout> |