提交 e7017a05 authored 作者: lgd's avatar lgd

1.修改消息样式

上级 7b6753a4
...@@ -132,7 +132,7 @@ public class MsgBean { ...@@ -132,7 +132,7 @@ public class MsgBean {
private Object userNickName; private Object userNickName;
private String noticeType; private String noticeType;
private String title; private String title;
private Object content; private String content;
public int getCreatedBy() { public int getCreatedBy() {
return createdBy; return createdBy;
...@@ -310,11 +310,11 @@ public class MsgBean { ...@@ -310,11 +310,11 @@ public class MsgBean {
this.title = title; this.title = title;
} }
public Object getContent() { public String getContent() {
return content; return content;
} }
public void setContent(Object content) { public void setContent(String content) {
this.content = content; this.content = content;
} }
} }
......
...@@ -27,6 +27,7 @@ public class MsgAdapter extends BaseQuickAdapter<MsgBean.RecordsBean, BaseViewHo ...@@ -27,6 +27,7 @@ public class MsgAdapter extends BaseQuickAdapter<MsgBean.RecordsBean, BaseViewHo
protected void convert(BaseViewHolder helper, MsgBean.RecordsBean item) { protected void convert(BaseViewHolder helper, MsgBean.RecordsBean item) {
helper.setText(R.id.tv_time, item.getCreatedTime()); helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_title, item.getTitle()); helper.setText(R.id.tv_title, item.getTitle());
helper.setText(R.id.tv_content, item.getContent());
} }
} }
...@@ -35,7 +35,7 @@ public class MsgFragment extends WorkBaseFg { ...@@ -35,7 +35,7 @@ public class MsgFragment extends WorkBaseFg {
ViewPager vpData; ViewPager vpData;
private String tab[] = { private String tab[] = {
"BAT消息", "MES消息"}; "BAT消息", "MES消息"};
private String order[] = { private String type[] = {
"0", "1"}; "0", "1"};
@Override @Override
...@@ -50,9 +50,9 @@ public class MsgFragment extends WorkBaseFg { ...@@ -50,9 +50,9 @@ public class MsgFragment extends WorkBaseFg {
FragmentManager sfm = getChildFragmentManager(); FragmentManager sfm = getChildFragmentManager();
List<Fragment> data = new ArrayList<>(); List<Fragment> data = new ArrayList<>();
for (int i = 0; i < tab.length; i++) { for (int i = 0; i < tab.length; i++) {
MsgDetailFragment saleFragment = new MsgDetailFragment(); MsgListFragment saleFragment = new MsgListFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("state", order[i]); bundle.putString("type", type[i]);
saleFragment.setArguments(bundle); saleFragment.setArguments(bundle);
data.add(saleFragment); data.add(saleFragment);
} }
......
...@@ -55,7 +55,6 @@ public class MsgListFragment extends WorkBaseFg { ...@@ -55,7 +55,6 @@ public class MsgListFragment extends WorkBaseFg {
private MsgAdapter dataAdapter; private MsgAdapter dataAdapter;
private List<MsgBean.RecordsBean> dataList; private List<MsgBean.RecordsBean> dataList;
private String type; private String type;
private String state;
@Override @Override
protected void initView() { protected void initView() {
...@@ -69,12 +68,12 @@ public class MsgListFragment extends WorkBaseFg { ...@@ -69,12 +68,12 @@ public class MsgListFragment extends WorkBaseFg {
param = WorkUtils.pageKey(); param = WorkUtils.pageKey();
page = 1; page = 1;
param.put("current", page); param.put("current", page);
param.put("type", type); param.put("type", "");
dataList = new ArrayList<>(); dataList = new ArrayList<>();
dataAdapter = new MsgAdapter(R.layout.item_msg, dataList); dataAdapter = new MsgAdapter(R.layout.item_msg, dataList);
dataAdapter.bindToRecyclerView(rvData); dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData); dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
if (TextUtils.equals(state,"1")){ if (TextUtils.equals(type,"1")){
return; return;
} }
getData(); getData();
...@@ -86,8 +85,6 @@ public class MsgListFragment extends WorkBaseFg { ...@@ -86,8 +85,6 @@ public class MsgListFragment extends WorkBaseFg {
Bundle arguments = getArguments(); Bundle arguments = getArguments();
if (arguments != null) { if (arguments != null) {
type = arguments.getString("type"); type = arguments.getString("type");
state = arguments.getString("state");
} }
} }
...@@ -145,11 +142,11 @@ public class MsgListFragment extends WorkBaseFg { ...@@ -145,11 +142,11 @@ public class MsgListFragment extends WorkBaseFg {
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
msgRead(dataList.get(position).getId()); // msgRead(dataList.get(position).getId());
startActivity(MsgDetailActivity.class, "id", dataList.get(position).getId()+""); // startActivity(MsgDetailActivity.class, "id", dataList.get(position).getId()+"");
dataList.remove(position); // dataList.remove(position);
dataAdapter.notifyItemRemoved(position); // dataAdapter.notifyItemRemoved(position);
EventBus.getDefault().post(new MsgReadEvent()); // EventBus.getDefault().post(new MsgReadEvent());
} }
}); });
} }
......
...@@ -3,22 +3,45 @@ ...@@ -3,22 +3,45 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm" android:paddingHorizontal="20mm"
android:paddingVertical="10mm"> android:paddingVertical="10mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<View
android:layout_width="5mm"
android:layout_height="14mm"
android:background="#FFFBD249" />
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:ellipsize="end"
android:maxLines="1"
android:text="1111111" />
</LinearLayout>
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_content"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginLeft="15mm"
android:ellipsize="end" android:layout_marginTop="3mm"
android:maxLines="1" /> android:text="zz3333333z"
android:textColor="@color/flexible_text_sup" />
<TextView <TextView
android:id="@+id/tv_time" android:id="@+id/tv_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10mm" android:layout_gravity="right"
android:layout_marginTop="3mm"
android:text="zz3333333z" android:text="zz3333333z"
android:textColor="@color/flexible_text_sup" /> android:textColor="@color/flexible_text_sup" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论