B4A Library JSDevLightNavTabBar - Navigation tab bar with colorful interactions

NavigationTabBar - Navigation tab bar with colorful interactions.

Wrap of: https://github.com/DevLight-Mobile-Agency/NavigationTabBar

Sharing to you guys "as-is".

You can handle the tab select/change with 'OnStartTabSelected' OR 'OnEndTabSelected' event.

ViewPager like AHViewPager is supported.
Designer Custom View Supported



JSDevLightNavTabBar
Version:
0.2
  • JSDevLightNavTabBar
    Events:
    • OnEndTabSelected (model As JSDevLightNavTabBarModel, index As Int)
    • OnStartTabSelected (model As JSDevLightNavTabBarModel, index As Int)
    Fields:
    • BADGE_GRAVITY_BOTTOM As Int
      The Constant BADGE_GRAVITY_BOTTOM.
    • BADGE_GRAVITY_TOP As Int
      The Constant BADGE_GRAVITY_TOP.
    • BADGE_POSITION_CENTER As Int
      The Constant BADGE_POSITION_CENTER.
    • BADGE_POSITION_LEFT As Int
      The Constant BADGE_POSITION_LEFT.
    • BADGE_POSITION_RIGHT As Int
      The Constant BADGE_POSITION_RIGHT.
    • TITLE_MODE_ACTIVE As Int
      The Constant TITLE_MODE_ACTIVE.
    • TITLE_MODE_ALL As Int
      The Constant TITLE_MODE_ALL.
    Methods:
    • AddModel (model As JSDevLightNavTabBarModel)
      Adds the model.
      model: the model
    • BringToFront
    • Deselect
      Deselect.
    • GetModels As List
      Gets the models.
      Return type: @return:the list
    • Hide
      Hide.
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetModels
      Call this after adding models.
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • Show
      Show.
    • innerInitialize (eventName As String, keepOldObject As Boolean)
    Properties:
    • ActiveColor As Int
      Gets the active color.
    • AnimationDuration As Int
      Gets the animation duration.
    • Background As Drawable
    • BadgeBgColor As Int
      Gets the badge bg color.
    • BadgeGravity As Int
      Gets the badge gravity.
    • BadgeMargin As Float [read only]
      Gets the badge margin.
    • BadgePosition As Int
      Gets the badge position.
    • BadgeSize As Float
      Gets the badge size.
    • BadgeTitleColor As Int
      Gets the badge title color.
    • BarHeight As Float [read only]
      Gets the bar height.
    • BehaviorEnabled As Boolean [write only]
      Sets the behavior enabled.
    • BgColor As Int
      Gets the bg color.
    • Color As Int [write only]
    • CornersRadius As Float
      Gets the corners radius.
    • Enabled As Boolean
    • Height As Int
    • IconSizeFraction As Float
      Gets the icon size fraction.
    • InactiveColor As Int
      Gets the inactive color.
    • IsBadgeUseTypeface As Boolean
      Gets the checks if is badge use typeface.
    • IsBadged As Boolean
      Gets the checks if is badged.
    • IsBehaviorEnabled As Boolean [read only]
      Gets the checks if is behavior enabled.
    • IsScaled As Boolean
      Gets the checks if is scaled.
    • IsSwiped As Boolean
      Gets the checks if is swiped.
    • IsTinted As Boolean
      Gets the checks if is tinted.
    • IsTitled As Boolean
      Gets the checks if is titled.
    • Left As Int
    • ModelIndex As Int
      Gets the model index (active model).
    • Parent As Object [read only]
    • Tag As Object
    • TitleMode As Int
      Gets the title mode.
    • TitleSize As Float
      Gets the title size.
    • Top As Int
    • Typeface As Typeface
      Gets the typeface.
    • ViewPager As Object [write only]
      Sets the view pager.
    • Visible As Boolean
    • Width As Int
  • JSDevLightNavTabBarModel
    Methods:
    • HideBadge
    • Initialize (icon As Drawable, color As Int)
    • Initialize2 (builder As ModelBuilder) As ModelBuilder
    • IsInitialized As Boolean
    • ShowBadge
    • ToggleBadge
    • UpdateBadgeTitle (badgeTitle As String)
    Properties:
    • BadgeTitle As String
    • Color As Int
    • IsBadgeShowed As Boolean [read only]
    • Title As String
  • JSDevLightNavTabBarModelBuilder
    Methods:
    • Initialize (icon As Drawable, color As Int) As ModelBuilder
    • IsInitialized As Boolean
    • badgeTitle (title As String) As ModelBuilder
    • build As Model
    • selectedIcon (icon As Drawable) As ModelBuilder
    • title (title As String) As ModelBuilder

B4X:
    ' Initialize TabBar and add it to activity
    Dim navigationTabBar As JSDevLightNavTabBar
    navigationTabBar.Initialize("")
    Activity.AddView(navigationTabBar, 0dip, 0dip, 100%x, 56dip)

    ' Create Models (tabs), use BitmapDrawable for the icons
    Dim bd1 As BitmapDrawable
    bd1.Initialize(LoadBitmap(File.DirAssets, "Novel_48px.png"))
    Dim model1 As JSDevLightNavTabBarModel
    model1.Initialize(bd1, 0xFFDE5853)
    model1.Title = "Heart"
    model1.BadgeTitle = "NTB"
    navigationTabBar.AddModel(model1)    ' Add model to TabBar

    Dim bd2 As BitmapDrawable
    bd2.Initialize(LoadBitmap(File.DirAssets, "Trophy_48px.png"))
    Dim model2 As JSDevLightNavTabBarModel
    model2.Initialize(bd2, 0xFFF7B970)
    model2.Title = "Cup"
    model2.BadgeTitle = "with"
    navigationTabBar.AddModel(model2) ' Add model to TabBar

    ' Finalize models (tabs) by calling SetModels function
    navigationTabBar.SetModels

Required Files (Android Support Files):
1. android-support-design.jar - you can find it in your android sdk folder \extras\android\support\design\libs
2. android-support-v4.jar - you can find it in your android sdk folder \extras\android\support\v4

or download it here:
https://1drv.ms/u/s!AnoRJRCkdtqih1J7fxXzapABgmRG

All jar, aar files will go to your Additional Library Folder.

Library files and Example project are attached.
 

Attachments

  • Devlight - NavigationTabBar_r1.zip
    68.3 KB · Views: 489
  • Devlight - NavigationTabBar_r1_ex.zip
    11.8 KB · Views: 518
  • Devlight - NavigationTabBar_r2.zip
    68.7 KB · Views: 542
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…