Browse Source

增加消息未读小红点

developer
lh 8 years ago
parent
commit
dd57574412
4 changed files with 14 additions and 1 deletions
  1. +3
    -0
      app/src/main/java/com/qhclh/ytzh/index/NewsAdapter.java
  2. +1
    -0
      app/src/main/res/layout/fragment_index.xml
  3. +9
    -1
      app/src/main/res/layout/item_index.xml
  4. +1
    -0
      app/src/main/res/values/colors.xml

+ 3
- 0
app/src/main/java/com/qhclh/ytzh/index/NewsAdapter.java View File

@ -56,6 +56,7 @@ public class NewsAdapter extends BaseAdapter {
viewHolder.item_index_title = view.findViewById(R.id.item_index_title);
viewHolder.item_index_content = view.findViewById(R.id.item_index_content);
viewHolder.item_index_time = view.findViewById(R.id.item_index_time);
viewHolder.item_index_red = view.findViewById(R.id.item_index_red);
view.setTag(viewHolder);
}else {
@ -70,6 +71,7 @@ public class NewsAdapter extends BaseAdapter {
viewHolder.item_index_title.setText(message.getTitle());
viewHolder.item_index_content.setText(message.getContent());
viewHolder.item_index_time.setText(message.getTime());
viewHolder.item_index_red.setVisibility(View.GONE);
return view;
}
@ -79,5 +81,6 @@ public class NewsAdapter extends BaseAdapter {
private TextView item_index_title;
private TextView item_index_content;
private TextView item_index_time;
private TextView item_index_red;
}
}

+ 1
- 0
app/src/main/res/layout/fragment_index.xml View File

@ -8,6 +8,7 @@
android:id="@+id/lv_index"
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:scrollbars="none"
android:layout_height="wrap_content">
</ListView>


+ 9
- 1
app/src/main/res/layout/item_index.xml View File

@ -47,8 +47,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_5"
android:textColor="@color/grey888888"
android:textSize="@dimen/text_size_16" />
<TextView
android:id="@+id/item_index_red"
android:layout_width="@dimen/dp_8"
android:layout_height="@dimen/dp_8"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:background="@drawable/shape_red" />
</LinearLayout>

+ 1
- 0
app/src/main/res/values/colors.xml View File

@ -25,6 +25,7 @@
<color name="greydbdbdb">#dbdbdb</color>
<color name="greycacaca">#cacaca</color>
<color name="black303030">#303030</color>
<color name="redd92828">#d92828</color>
</resources>

Loading…
Cancel
Save