|
@ -31,6 +31,7 @@ import androidx.activity.OnBackPressedDispatcher; |
|
|
import androidx.annotation.NonNull; |
|
|
import androidx.annotation.NonNull; |
|
|
import androidx.annotation.Nullable; |
|
|
import androidx.annotation.Nullable; |
|
|
import androidx.appcompat.app.ActionBar; |
|
|
import androidx.appcompat.app.ActionBar; |
|
|
|
|
|
import androidx.appcompat.view.menu.ActionMenuItemView; |
|
|
import androidx.core.content.ContextCompat; |
|
|
import androidx.core.content.ContextCompat; |
|
|
import androidx.core.view.ViewCompat; |
|
|
import androidx.core.view.ViewCompat; |
|
|
import androidx.core.view.WindowInsetsAnimationCompat; |
|
|
import androidx.core.view.WindowInsetsAnimationCompat; |
|
@ -56,6 +57,7 @@ import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat; |
|
|
|
|
|
|
|
|
import com.google.android.material.badge.BadgeDrawable; |
|
|
import com.google.android.material.badge.BadgeDrawable; |
|
|
import com.google.android.material.badge.BadgeUtils; |
|
|
import com.google.android.material.badge.BadgeUtils; |
|
|
|
|
|
import com.google.android.material.internal.ToolbarUtils; |
|
|
import com.google.android.material.snackbar.Snackbar; |
|
|
import com.google.android.material.snackbar.Snackbar; |
|
|
import com.google.common.collect.ImmutableList; |
|
|
import com.google.common.collect.ImmutableList; |
|
|
|
|
|
|
|
@ -554,7 +556,11 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact |
|
|
} |
|
|
} |
|
|
isPendingRequestCountBadgeAttached = false; |
|
|
isPendingRequestCountBadgeAttached = false; |
|
|
if (pendingRequestCountBadgeDrawable != null) { |
|
|
if (pendingRequestCountBadgeDrawable != null) { |
|
|
BadgeUtils.detachBadgeDrawable(pendingRequestCountBadgeDrawable, fragmentActivity.getToolbar(), R.id.info); |
|
|
|
|
|
|
|
|
@SuppressLint("RestrictedApi") final ActionMenuItemView menuItemView = ToolbarUtils |
|
|
|
|
|
.getActionMenuItemView(fragmentActivity.getToolbar(), R.id.info); |
|
|
|
|
|
if (menuItemView != null) { |
|
|
|
|
|
BadgeUtils.detachBadgeDrawable(pendingRequestCountBadgeDrawable, fragmentActivity.getToolbar(), R.id.info); |
|
|
|
|
|
} |
|
|
pendingRequestCountBadgeDrawable = null; |
|
|
pendingRequestCountBadgeDrawable = null; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -838,7 +844,11 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact |
|
|
pendingRequestCountBadgeDrawable = BadgeDrawable.create(context); |
|
|
pendingRequestCountBadgeDrawable = BadgeDrawable.create(context); |
|
|
} |
|
|
} |
|
|
if (count == null || count == 0) { |
|
|
if (count == null || count == 0) { |
|
|
BadgeUtils.detachBadgeDrawable(pendingRequestCountBadgeDrawable, fragmentActivity.getToolbar(), R.id.info); |
|
|
|
|
|
|
|
|
@SuppressLint("RestrictedApi") final ActionMenuItemView menuItemView = ToolbarUtils |
|
|
|
|
|
.getActionMenuItemView(fragmentActivity.getToolbar(), R.id.info); |
|
|
|
|
|
if (menuItemView != null) { |
|
|
|
|
|
BadgeUtils.detachBadgeDrawable(pendingRequestCountBadgeDrawable, fragmentActivity.getToolbar(), R.id.info); |
|
|
|
|
|
} |
|
|
isPendingRequestCountBadgeAttached = false; |
|
|
isPendingRequestCountBadgeAttached = false; |
|
|
pendingRequestCountBadgeDrawable.setNumber(0); |
|
|
pendingRequestCountBadgeDrawable.setNumber(0); |
|
|
return; |
|
|
return; |
|
|