Skip to content

Commit 431ac10

Browse files
improvement padding badge total profile
1 parent b7d62f2 commit 431ac10

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

V2rayNG/app/src/main/java/com/v2ray/ang/ui/MainActivity.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,10 @@ class MainActivity : HelperBaseActivity(),
429429
if (count > 0) {
430430
badge.text = if (count > 99) "99+" else count.toString()
431431
badge.visibility = View.VISIBLE
432-
(badge.layoutParams as? android.view.ViewGroup.MarginLayoutParams)?.marginStart =
433-
(6 * resources.displayMetrics.density).toInt()
434432
} else {
435433
badge.visibility = View.GONE
436-
(badge.layoutParams as? android.view.ViewGroup.MarginLayoutParams)?.marginStart = 0
437434
}
438-
badge.requestLayout()
435+
badge.post { badge.requestLayout() }
439436
}
440437

441438
private fun applyTabSelectedStyle(

V2rayNG/app/src/main/res/layout/item_tab_group.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
android:id="@+id/tab_badge"
1818
android:layout_width="wrap_content"
1919
android:layout_height="wrap_content"
20+
android:layout_marginStart="6dp"
2021
android:paddingStart="7dp"
2122
android:paddingEnd="7dp"
2223
android:paddingTop="2dp"

0 commit comments

Comments
 (0)