mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-26 16:04:07 +08:00
Hide notification count when no notification available (#1258)
Closes #1251 Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1258 Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
parent
9c7fdccd26
commit
959049891c
@ -874,11 +874,24 @@ public class MainActivity extends BaseActivity
|
|||||||
if (response.code() == 200) {
|
if (response.code() == 200) {
|
||||||
|
|
||||||
assert notificationCount != null;
|
assert notificationCount != null;
|
||||||
notificationCounter =
|
if (notificationCount.getNew() > 0) {
|
||||||
navNotifications
|
|
||||||
.getActionView()
|
navNotifications
|
||||||
.findViewById(R.id.counterBadgeNotification);
|
.getActionView()
|
||||||
notificationCounter.setText(String.valueOf(notificationCount.getNew()));
|
.findViewById(R.id.counterBadgeNotification)
|
||||||
|
.setVisibility(View.VISIBLE);
|
||||||
|
notificationCounter =
|
||||||
|
navNotifications
|
||||||
|
.getActionView()
|
||||||
|
.findViewById(R.id.counterBadgeNotification);
|
||||||
|
notificationCounter.setText(
|
||||||
|
String.valueOf(notificationCount.getNew()));
|
||||||
|
} else {
|
||||||
|
navNotifications
|
||||||
|
.getActionView()
|
||||||
|
.findViewById(R.id.counterBadgeNotification)
|
||||||
|
.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
android:paddingStart="@dimen/dimen4dp"
|
android:paddingStart="@dimen/dimen4dp"
|
||||||
android:paddingEnd="@dimen/dimen4dp"
|
android:paddingEnd="@dimen/dimen4dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="@color/colorWhite"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="@dimen/dimen12sp"/>
|
android:textSize="@dimen/dimen12sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user