Commit 9d07eb7d6d0ea4986e95e53163ff3980956b9a4b

Authored by 陶汉栋
1 parent f552dcac

no message

app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
@@ -25,6 +25,7 @@ import com.shunzhi.parent.bean.GrallyBean; @@ -25,6 +25,7 @@ import com.shunzhi.parent.bean.GrallyBean;
25 import com.shunzhi.parent.bean.MyConsultBean; 25 import com.shunzhi.parent.bean.MyConsultBean;
26 import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; 26 import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract;
27 import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; 27 import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter;
  28 +
28 import java.util.ArrayList; 29 import java.util.ArrayList;
29 import java.util.List; 30 import java.util.List;
30 31
@@ -42,7 +43,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon @@ -42,7 +43,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon
42 43
43 LinearLayout layout_control; 44 LinearLayout layout_control;
44 45
45 - List<MyConsultBean> myConsultBeanList=null; 46 + List<MyConsultBean> myConsultBeanList = null;
46 47
47 @Override 48 @Override
48 public int getLayoutId() { 49 public int getLayoutId() {
@@ -66,7 +67,17 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment&lt;ConsultOneCon @@ -66,7 +67,17 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment&lt;ConsultOneCon
66 if (null == myGrallyAdapter) myGrallyAdapter = new MyGrallyAdapter(); 67 if (null == myGrallyAdapter) myGrallyAdapter = new MyGrallyAdapter();
67 myGrallyAdapter.addAll(grallyBeanList); 68 myGrallyAdapter.addAll(grallyBeanList);
68 recyclerViewGrally.setAdapter(myGrallyAdapter); 69 recyclerViewGrally.setAdapter(myGrallyAdapter);
  70 + recyclerViewGrally.addOnScrollListener(new RecyclerView.OnScrollListener() {
  71 + @Override
  72 + public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
  73 + super.onScrollStateChanged(recyclerView, newState);
  74 + }
69 75
  76 + @Override
  77 + public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
  78 + super.onScrolled(recyclerView, dx, dy);
  79 + }
  80 + });
70 81
71 } 82 }
72 83
@@ -85,7 +96,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment&lt;ConsultOneCon @@ -85,7 +96,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment&lt;ConsultOneCon
85 96
86 private void initRecyclerViewConsult() { 97 private void initRecyclerViewConsult() {
87 if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); 98 if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity());
88 - if (null==myConsultBeanList)myConsultBeanList=new ArrayList<>(); 99 + if (null == myConsultBeanList) myConsultBeanList = new ArrayList<>();
89 else myConsultBeanList.clear(); 100 else myConsultBeanList.clear();
90 for (int i = 0; i < 12; i++) { 101 for (int i = 0; i < 12; i++) {
91 MyConsultBean myConsultBean = new MyConsultBean(); 102 MyConsultBean myConsultBean = new MyConsultBean();
@@ -144,7 +155,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment&lt;ConsultOneCon @@ -144,7 +155,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment&lt;ConsultOneCon
144 tv_grally_title = itemView.findViewById(R.id.tv_grally_title); 155 tv_grally_title = itemView.findViewById(R.id.tv_grally_title);
145 frame_root = itemView.findViewById(R.id.frame_root); 156 frame_root = itemView.findViewById(R.id.frame_root);
146 FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(-1, -1); 157 FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(-1, -1);
147 - params.width = DisplayUtils.getScreenWidthPixels(getActivity()) - 40; 158 + params.width = DisplayUtils.getScreenWidthPixels(getActivity()) - 100;
  159 + params.setMargins(10, 0, 10, 0);
148 frame_root.setLayoutParams(params); 160 frame_root.setLayoutParams(params);
149 } 161 }
150 162
app/src/main/res/layout/item_grally.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 - android:layout_width="match_parent" 3 + android:layout_width="wrap_content"
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 android:layout_margin="@dimen/size_dp_10" 5 android:layout_margin="@dimen/size_dp_10"
6 android:id="@+id/frame_root" 6 android:id="@+id/frame_root"