修改消息红点

This commit is contained in:
ningwenqiang 2024-11-07 15:55:22 +08:00
parent 3ece1d2568
commit 60bc80e586
13 changed files with 15 additions and 8 deletions

View File

@ -25,6 +25,7 @@
android:gravity="center" android:gravity="center"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:paddingBottom="5dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:text="@string/loading" android:text="@string/loading"

View File

@ -1544,12 +1544,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
messageNumber = event.getNumber(); messageNumber = event.getNumber();
if (event.getNumber() > 0) { if (event.getNumber() > 0) {
v_table_redpoint.setVisibility(View.VISIBLE); v_table_redpoint.setVisibility(View.VISIBLE);
if (event.getNumber() > 99) { if (event.getNumber()>9){
v_table_redpoint.setText("99+"); v_table_redpoint.setBackgroundResource(R.mipmap.ic_yola_msg_red2);
} else { if (event.getNumber() > 99) {
v_table_redpoint.setText("99+");
}else{
v_table_redpoint.setText(event.getNumber() + "");
}
}else {
v_table_redpoint.setBackgroundResource(R.mipmap.ic_yola_msg_red1);
v_table_redpoint.setText(event.getNumber() + ""); v_table_redpoint.setText(event.getNumber() + "");
} }
} else { } else {
v_table_redpoint.setVisibility(View.GONE); v_table_redpoint.setVisibility(View.GONE);
v_table_redpoint.setText(""); v_table_redpoint.setText("");

View File

@ -105,12 +105,13 @@
<TextView <TextView
android:id="@+id/v_table_redpoint" android:id="@+id/v_table_redpoint"
android:layout_width="8dp" android:layout_width="wrap_content"
android:layout_height="8dp" android:layout_height="wrap_content"
android:background="@drawable/background_ff5075" android:background="@mipmap/ic_yola_msg_red2"
android:gravity="center" android:gravity="center"
tools:text="12"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="10dp" android:textSize="8sp"
android:visibility="visible" android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B