Revert "feat(tabs/notifications): add unread badge"

This reverts commit 4ecd525f
This commit is contained in:
LucasGGamerM 2023-03-21 19:47:51 -03:00
parent 898fbcc52b
commit 1680c635dc
2 changed files with 0 additions and 31 deletions

View File

@ -124,23 +124,6 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
Account self=AccountSessionManager.getInstance().getAccount(accountID).self;
ViewImageLoader.load(tabBarAvatar, null, new UrlImageLoaderRequest(self.avatar, V.dp(28), V.dp(28)));
notificationTabIcon=content.findViewById(R.id.tab_notifications);
AccountSessionManager.getInstance()
.getAccount(accountID).getCacheController()
.getNotifications(null, 1, false, false, true, new Callback<>() {
@Override
public void onSuccess(PaginatedResponse<List<Notification>> result) {
notificationBadged = result.items.get(0).createdAt.isAfter(Instant.ofEpochMilli(GlobalUserPreferences.lastNotificationOpenedTime));
setNotificationBadge();
}
@Override
public void onError(ErrorResponse error) {
error.showToast(getContext());
}
});
if(savedInstanceState==null){
getChildFragmentManager().beginTransaction()
.add(R.id.fragment_wrap, homeTabFragment)
@ -368,8 +351,4 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
// getChildFragmentManager().putFragment(outState, "notificationsFragment", notificationsFragment);
// getChildFragmentManager().putFragment(outState, "profileFragment", profileFragment);
}
private void setNotificationBadge() {
notificationTabIcon.setImageDrawable(getContext().getDrawable(notificationBadged ? R.drawable.ic_notifications_tab_badged : R.drawable.ic_fluent_alert_28_selector));
}
}

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_fluent_alert_28_selector" android:left="2dp" android:right="2dp" android:top="2dp" android:bottom="2dp"/>
<item android:width="14dp" android:height="14dp" android:gravity="top|right">
<shape android:shape="oval">
<stroke android:color="?android:colorPrimary" android:width="2dp"/>
<solid android:color="?android:colorAccent"/>
</shape>
</item>
</layer-list>