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

1.修改消息样式

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