Search in sources :

Example 1 with DotIndicatorOptions

use of com.reactnativenavigation.options.DotIndicatorOptions in project react-native-navigation by wix.

the class BottomTabPresenter method mergeDotIndicator.

private void mergeDotIndicator(int index, DotIndicatorOptions dotIndicator) {
    if (bottomTabs == null)
        return;
    AHNotification.Builder builder = new AHNotification.Builder();
    if (dotIndicator.color.hasValue())
        builder.setBackgroundColor(dotIndicator.color.get());
    builder.setSize(dotIndicator.visible.isFalse() ? 0 : dotIndicator.size.get(defaultDotIndicatorSize));
    if (dotIndicator.animate.hasValue())
        builder.animate(dotIndicator.animate.get());
    AHNotification notification = builder.build();
    if (notification.hasValue())
        bottomTabs.perform(bottomTabs -> bottomTabs.setNotification(notification, index));
}
Also used : Typeface(android.graphics.Typeface) ViewController(com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController) Context(android.content.Context) BottomTabOptions(com.reactnativenavigation.options.BottomTabOptions) ImageLoadingListenerAdapter(com.reactnativenavigation.utils.ImageLoadingListenerAdapter) ImageLoader(com.reactnativenavigation.utils.ImageLoader) LateInit(com.reactnativenavigation.utils.LateInit) CollectionUtils.forEach(com.reactnativenavigation.utils.CollectionUtils.forEach) NonNull(androidx.annotation.NonNull) BottomTabs(com.reactnativenavigation.views.bottomtabs.BottomTabs) Drawable(android.graphics.drawable.Drawable) DotIndicatorOptions(com.reactnativenavigation.options.DotIndicatorOptions) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) List(java.util.List) AHNotification(com.aurelhubert.ahbottomnavigation.notification.AHNotification) UiUtils.dpToPx(com.reactnativenavigation.utils.UiUtils.dpToPx) Options(com.reactnativenavigation.options.Options) TypefaceLoader(com.reactnativenavigation.options.parsers.TypefaceLoader) AHTextView(com.aurelhubert.ahbottomnavigation.AHTextView) AHNotification(com.aurelhubert.ahbottomnavigation.notification.AHNotification)

Aggregations

Context (android.content.Context)1 Typeface (android.graphics.Typeface)1 Drawable (android.graphics.drawable.Drawable)1 NonNull (androidx.annotation.NonNull)1 AHTextView (com.aurelhubert.ahbottomnavigation.AHTextView)1 AHNotification (com.aurelhubert.ahbottomnavigation.notification.AHNotification)1 BottomTabOptions (com.reactnativenavigation.options.BottomTabOptions)1 DotIndicatorOptions (com.reactnativenavigation.options.DotIndicatorOptions)1 Options (com.reactnativenavigation.options.Options)1 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)1 TypefaceLoader (com.reactnativenavigation.options.parsers.TypefaceLoader)1 CollectionUtils.forEach (com.reactnativenavigation.utils.CollectionUtils.forEach)1 ImageLoader (com.reactnativenavigation.utils.ImageLoader)1 ImageLoadingListenerAdapter (com.reactnativenavigation.utils.ImageLoadingListenerAdapter)1 LateInit (com.reactnativenavigation.utils.LateInit)1 UiUtils.dpToPx (com.reactnativenavigation.utils.UiUtils.dpToPx)1 ViewController (com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController)1 BottomTabs (com.reactnativenavigation.views.bottomtabs.BottomTabs)1 List (java.util.List)1