提交 20bbf81a authored 作者: lgd's avatar lgd

1.添加时选择客户展示改为单排显示(Android)

上级 437ce76a
...@@ -62,7 +62,7 @@ public class MoneyAddClientActivity extends WorkToolBarActivity { ...@@ -62,7 +62,7 @@ public class MoneyAddClientActivity extends WorkToolBarActivity {
@Override @Override
protected void initData() { protected void initData() {
clientList = new ArrayList<>(); clientList = new ArrayList<>();
clientAdapter = new WorkContactsAdapter(R.layout.item_work_contacts, clientList); clientAdapter = new WorkContactsAdapter(R.layout.item_contacts_money_client, clientList,1);
clientAdapter.bindToRecyclerView(rvClient); clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient); clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.pageKey(); param = WorkUtils.pageKey();
......
...@@ -14,16 +14,25 @@ import java.util.List; ...@@ -14,16 +14,25 @@ import java.util.List;
*/ */
public class WorkContactsAdapter extends BaseQuickAdapter<ContactsBean, BaseViewHolder> { public class WorkContactsAdapter extends BaseQuickAdapter<ContactsBean, BaseViewHolder> {
int type;//1 回款選擇客戶 其他默认
public WorkContactsAdapter(int layoutResId, List data) { public WorkContactsAdapter(int layoutResId, List data) {
super(layoutResId, data); super(layoutResId, data);
} }
public WorkContactsAdapter(int layoutResId, List data, int type) {
super(layoutResId, data);
this.type = type;
}
@Override @Override
protected void convert(BaseViewHolder helper,ContactsBean item) { protected void convert(BaseViewHolder helper, ContactsBean item) {
if (type != 1) {
helper.setText(R.id.tv_address, item.getAddress());
helper.setText(R.id.tv_phone, item.getPhone());
}
helper.setText(R.id.tv_name, item.getName()); helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_address, item.getAddress());
helper.setText(R.id.tv_phone, item.getPhone());
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论