use of com.google.android.material.badge.BadgeDrawable in project ScoreCounter by n-apps.
the class MainActivity method hideDiceBadge.
private void hideDiceBadge() {
BadgeDrawable badge = bottomNavigationBar.getBadge(R.id.dices);
if (badge != null) {
badge.setVisible(false);
badge.clearNumber();
}
}
use of com.google.android.material.badge.BadgeDrawable in project Hentoid by avluis.
the class QueueActivity method onQueueChanged.
private void onQueueChanged(List<QueueRecord> result) {
// Update queue tab
if (result.isEmpty())
queueTab.removeBadge();
else {
BadgeDrawable badge = queueTab.getOrCreateBadge();
badge.setVisible(true);
badge.setNumber(result.size());
}
}
use of com.google.android.material.badge.BadgeDrawable in project Hentoid by avluis.
the class BaseWebActivity method onSearchForExtraImagesSuccess.
private void onSearchForExtraImagesSuccess(@NonNull final Content storedContent, @NonNull final Content onlineContent, @NonNull final List<ImageFile> additionalImages) {
searchExtraImagesdisposable.dispose();
progressBar.setProgress(progressBar.getMax());
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgressTintList(ColorStateList.valueOf(getResources().getColor(R.color.green)));
if (null == currentContent || additionalImages.isEmpty())
return;
if (currentContent.getUrl().equalsIgnoreCase(onlineContent.getUrl()) || duplicateId == storedContent.getId()) {
// User hasn't left the book page since
// Retrieve the URLs of stored pages
Set<String> storedUrls = new HashSet<>();
if (storedContent.getImageFiles() != null) {
storedUrls.addAll(Stream.of(storedContent.getImageFiles()).filter(i -> ContentHelper.isInLibrary(i.getStatus())).map(ImageFile::getUrl).toList());
}
// Display the "download more" button only if extra images URLs aren't duplicates
List<ImageFile> additionalNonDownloadedImages = Stream.of(additionalImages).filterNot(i -> storedUrls.contains(i.getUrl())).toList();
if (!additionalNonDownloadedImages.isEmpty()) {
extraImages = additionalNonDownloadedImages;
setActionMode(ActionMode.DOWNLOAD_PLUS);
BadgeDrawable badge = bottomToolbar.getOrCreateBadge(R.id.web_menu_action);
badge.setNumber(additionalNonDownloadedImages.size());
}
}
}
use of com.google.android.material.badge.BadgeDrawable in project GreenHouse by utsanjan.
the class BottomNavigationItemView method onInitializeAccessibilityNodeInfo.
// android.view.View
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
BadgeDrawable badgeDrawable = this.badgeDrawable;
if (badgeDrawable != null && badgeDrawable.isVisible()) {
CharSequence customContentDescription = this.itemData.getTitle();
if (!TextUtils.isEmpty(this.itemData.getContentDescription())) {
customContentDescription = this.itemData.getContentDescription();
}
info.setContentDescription(((Object) customContentDescription) + ", " + ((Object) this.badgeDrawable.getContentDescription()));
}
}
use of com.google.android.material.badge.BadgeDrawable in project GreenHouse by utsanjan.
the class BottomNavigationMenuView method removeBadge.
/* JADX INFO: Access modifiers changed from: package-private */
public void removeBadge(int menuItemId) {
validateMenuItemId(menuItemId);
BadgeDrawable badgeDrawable = this.badgeDrawables.get(menuItemId);
BottomNavigationItemView itemView = findItemView(menuItemId);
if (itemView != null) {
itemView.removeBadge();
}
if (badgeDrawable != null) {
this.badgeDrawables.remove(menuItemId);
}
}
Aggregations