B4A Library: NiceBottomBar

Info
----
B4ALIBCONVERT (@knowmeid) Hamid
NiceBottomBar

Install (Additional Libraries folder):
  - NiceBottomBar.jar
  - nicebottombar-2.3.aar
  - NiceBottomBar.xml

If you installed an earlier build of this library, delete its old
files first. Leftover jars/aars define the same classes twice and
make the B4A compiler fail while dexing.

Do not add two converted libraries that share the same Java package
(example: SmoothBottomBar + NiceBottomBar both use me.ibrahimsn.lib).
Dex merge then fails with 'Type ... is defined multiple times'.
Use only one of them in the same B4A project.

Resolved by B4A itself (nothing to copy):
  - androidx.annotation:annotation
  - androidx.appcompat:appcompat
  - androidx.arch.core:core-common
  - androidx.asynclayoutinflater:asynclayoutinflater
  - androidx.collection:collection
  - androidx.coordinatorlayout:coordinatorlayout
  - androidx.core:core
  - androidx.cursoradapter:cursoradapter
  - androidx.customview:customview
  - androidx.documentfile:documentfile
  - androidx.drawerlayout:drawerlayout
  - androidx.fragment:fragment
  - androidx.interpolator:interpolator
  - androidx.legacy:legacy-support-core-ui
  - androidx.legacy:legacy-support-core-utils
  - androidx.lifecycle:lifecycle-common
  - androidx.lifecycle:lifecycle-livedata
  - androidx.lifecycle:lifecycle-runtime
  - androidx.lifecycle:lifecycle-viewmodel
  - androidx.loader:loader
  - androidx.localbroadcastmanager:localbroadcastmanager
  - androidx.print:print
  - androidx.slidingpanelayout:slidingpanelayout
  - androidx.swiperefreshlayout:swiperefreshlayout
  - androidx.vectordrawable:vectordrawable
  - androidx.vectordrawable:vectordrawable-animated
  - androidx.versionedparcelable:versionedparcelable
  - androidx.viewpager:viewpager
  - org.jetbrains.kotlin:kotlin-stdlib
  - org.jetbrains.kotlin:kotlin-stdlib-common
  - org.jetbrains.kotlin:kotlin-stdlib-jdk7
  - org.jetbrains:annotations

1. Copy ALL .jar/.aar and .xml files above into the same B4A additional libraries folder.
2. Libraries tab -> Refresh. Do this even if the library is already
   in the list: B4A keeps the previous .xml in memory, and a stale
   copy makes it skip dependencies without reporting anything.
3. Add the library to your project.

Wrapper compiled: YES

Project resources (res folder)
------------------------------
The library's own resources ship inside the .aar, so nothing has to be
copied for them to work. The res folder next to this file is a readable
copy: use it to look up attribute and style names.

Some native methods take a resource id, which B4A cannot produce. Put
the file in your own res folder, declare it, and look the id up by name:

    #AdditionalRes: ..\res, me.ibrahimsn.lib

    ' res\menu\bottom_nav.xml -> id at runtime
    Dim id As Int = v.ResourceId("menu", "bottom_nav")
    v.inflateMenu(id)

ResourceId returns 0 when the name does not exist, and passing 0 to a
native method raises a Resources.NotFoundException.

Usage
-----
NiceBottomBar is an Android view.

  From code:
    Dim v As NiceBottomBar
    v.Initialize("v")
    Activity.AddView(v, 0, 50%y, 100%x, 50dip)

  From the Designer:
    Add View -> CustomView, then set CustomType to NiceBottomBar.NiceBottomBar

    Sub v_ItemSelect(Arg1 As Int)
    End Sub
    Sub v_ItemReselect(Arg1 As Int)
    End Sub
    Sub v_ItemLongClick(Arg1 As Int)
    End Sub

BottomBarParser:
    Dim o As BottomBarParser
    o.Initialize    ' only if the class has an Initialize method

Required theme (Manifest Editor)
-------------------------------
This library uses AppCompat/Material views, which crash under B4A's
default theme. Add this to the Manifest Editor:

    SetApplicationAttribute(android:theme, "@style/B4ALibTheme")
    CreateResource(values, theme.xml,
    <resources>
        <style name="B4ALibTheme" parent="Theme.AppCompat.Light.NoActionBar"/>
    </resources>
    )


Sample code (copy below)
========================
===== COPY BELOW =====
Activity.Color = 0xFFE8EAF6
Dim bar As NiceBottomBar
bar.Initialize(Me, "nicebottombar")
Activity.AddView(bar, 0, 100%y - 70dip, 100%x, 70dip)

' Add tabs / styling here — see library README on GitHub.

Sub nicebottombar_ItemSelect(Arg1 As Int)
End Sub

Sub nicebottombar_ItemReselect(Arg1 As Int)
End Sub

Sub nicebottombar_ItemLongClick(Arg1 As Int)
End Sub
===== COPY ABOVE =====

Overloaded methods get a numeric suffix (setImage, setImage2, ...)
because B4A does not support overloading.

B4ALIBCONVERT (@knowmeid) Hamid
Copyright (c) B4ALIBCONVERT — All rights reserved.
تبدیل خودکار کتابخانه GitHub به B4A | Automatic GitHub-to-B4A library converter.

Generated by B4ALIBCONVERT.