Browse Source

no message

master
lh 8 years ago
parent
commit
22698e1310
3 changed files with 39 additions and 7 deletions
  1. +4
    -4
      app/src/main/java/com/qhclh/ytzh/index/shangpin/InHouseAdapter.java
  2. +28
    -3
      app/src/main/java/com/qhclh/ytzh/index/shangpin/InHouseAllFragment.java
  3. +7
    -0
      app/src/main/res/layout/item_inhouse.xml

+ 4
- 4
app/src/main/java/com/qhclh/ytzh/index/shangpin/InHouseAdapter.java View File

@ -59,10 +59,10 @@ public class InHouseAdapter extends BaseAdapter {
viewHolder = (ViewHolder) view.getTag(); viewHolder = (ViewHolder) view.getTag();
} }
viewHolder.inhouse_pici.setText(message.getPici());
viewHolder.inhouse_yangzhichang.setText(message.getYangzhichang());
viewHolder.inhouse_riqi.setText(message.getRiqi());
viewHolder.inhouse_zhangtai.setText(message.getZhuangtai());
viewHolder.inhouse_pici.setText("批次:"+message.getPici());
viewHolder.inhouse_yangzhichang.setText("养殖场:"+message.getYangzhichang());
viewHolder.inhouse_riqi.setText("日期:"+message.getRiqi());
viewHolder.inhouse_zhangtai.setText("状态:"+message.getZhuangtai());
return view; return view;
} }


+ 28
- 3
app/src/main/java/com/qhclh/ytzh/index/shangpin/InHouseAllFragment.java View File

@ -1,5 +1,6 @@
package com.qhclh.ytzh.index.shangpin; package com.qhclh.ytzh.index.shangpin;
import android.support.v4.widget.SwipeRefreshLayout;
import android.widget.ListView; import android.widget.ListView;
import com.qhclh.ytzh.R; import com.qhclh.ytzh.R;
@ -7,6 +8,7 @@ import com.qhclh.ytzh.base.BaseFragment;
import com.qhclh.ytzh.bean.InhouseBean; import com.qhclh.ytzh.bean.InhouseBean;
import com.qhclh.ytzh.ui.RefreshLayout; import com.qhclh.ytzh.ui.RefreshLayout;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView; import butterknife.BindView;
@ -15,7 +17,7 @@ import butterknife.BindView;
* Created by 青花瓷 on 2017/12/28. * Created by 青花瓷 on 2017/12/28.
*/ */
public class InHouseAllFragment extends BaseFragment {
public class InHouseAllFragment extends BaseFragment implements RefreshLayout.OnLoadListener, SwipeRefreshLayout.OnRefreshListener {
@BindView(R.id.lv_inhouseall) @BindView(R.id.lv_inhouseall)
ListView lv_inhouseall; ListView lv_inhouseall;
@BindView(R.id.rfl_inhouseall) @BindView(R.id.rfl_inhouseall)
@ -24,7 +26,7 @@ public class InHouseAllFragment extends BaseFragment {
private List<InhouseBean> mList; private List<InhouseBean> mList;
private InHouseAdapter mAdapter; private InHouseAdapter mAdapter;
@Override @Override
protected int setLayout() { protected int setLayout() {
return R.layout.frag_inhouse_all; return R.layout.frag_inhouse_all;
@ -32,16 +34,39 @@ public class InHouseAllFragment extends BaseFragment {
@Override @Override
protected void initView() { protected void initView() {
rfl_inhouseall.setEnabled(false);
} }
@Override @Override
protected void initData() { protected void initData() {
mList = new ArrayList<>();
for (int i=0;i<5;i++){
mList.add(new InhouseBean(i,""+i,""+i,"2017/08/09","已审核"));
}
mAdapter = new InHouseAdapter(getActivity(),mList);
lv_inhouseall.setAdapter(mAdapter);
} }
@Override @Override
protected void initOper() { protected void initOper() {
rfl_inhouseall.setOnLoadListener(this);
rfl_inhouseall.setOnRefreshListener(this);
}
@Override
public void onLoad() {
rfl_inhouseall.postDelayed(new Runnable() {
@Override
public void run() {
rfl_inhouseall.setLoading(false);
}
},1000);
}
@Override
public void onRefresh() {
rfl_inhouseall.setRefreshing(false);
} }
} }

+ 7
- 0
app/src/main/res/layout/item_inhouse.xml View File

@ -6,6 +6,8 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:paddingTop="@dimen/dp_5"
android:paddingLeft="@dimen/dp_10"
android:id="@+id/inhouse_pici" android:id="@+id/inhouse_pici"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -13,6 +15,8 @@
android:textSize="@dimen/text_size_16" /> android:textSize="@dimen/text_size_16" />
<TextView <TextView
android:paddingTop="@dimen/dp_5"
android:paddingLeft="@dimen/dp_10"
android:id="@+id/inhouse_yangzhichang" android:id="@+id/inhouse_yangzhichang"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -20,6 +24,9 @@
android:textSize="@dimen/text_size_16" /> android:textSize="@dimen/text_size_16" />
<LinearLayout <LinearLayout
android:paddingTop="@dimen/dp_5"
android:paddingLeft="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">


Loading…
Cancel
Save