B4A Library SpaceNavigation

This is a wrap for this Github project.

Requirements:
- B4A 6+
- Your App must be ready for AppCompat 3.20+
- DesignSupport lib 2.0+

SpaceNavigation
Author:
DonManfred (wrapper)
Version: 1
  • SpaceItem
    Methods:
    • Initialize (itemName As String, Icon As String)
    • IsInitialized As Boolean
    Properties:
    • ItemIcon As Int
    • ItemName As String
  • SpaceNavigationView
    Events:
    • onCentreButtonClick ( As )
    • onItemClick (index as Int As , text As String)
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • 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)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • addSpaceItem (spaceItem As SpaceItem)
      Add space item to navigation
      spaceItem: item to add
    • changeBadgeTextAtIndex (badgeIndex As Int, badgeText As Int)
      Change badge text at index
      badgeIndex: target index
      badgeText: badge count text to change
    • changeCurrentItem (indexToChange As Int)
      Change current selected item to given index
      indexToChange: given index
    • hideAllBadges
      Hiding all available badges
    • hideBudgeAtIndex (index As Int)
      Hide badge at index
      index: badge index
    • initWithSaveInstanceState (savedInstanceState As Bundle)
      Initialization with savedInstanceState to save current selected
      position and current budges
      savedInstanceState: bundle to saveInstance
    • onSaveInstanceState (outState As Bundle)
      Save budges and current position
      outState: bundle to saveInstance
    • showBadgeAtIndex (itemIndex As Int, badgeText As Int, badgeColor As Int)
      Show badge at index
      itemIndex: index
      badgeText: badge count text
    • showIconOnly
      Show only icon in item
    • showTextOnly
      Show only text in item
    Properties:
    • ActiveSpaceItemColor As Int [write only]
      Set active item text color
    • Background As Drawable
    • CentreButtonColor As Int [write only]
      Set centre circle button background color
    • CentreButtonIcon As String [write only]
      Set centre button icon
    • Color As Int [write only]
    • Enabled As Boolean
    • Font As Typeface [write only]
      Set custom font for space item textView
    • Height As Int
    • InActiveSpaceItemColor As Int [write only]
      Set inactive item text color
    • Left As Int
    • Parent As Object [read only]
    • SpaceBackgroundColor As Int [write only]
      Set main background color
    • SpaceItemIconSize As Int [write only]
      Set item icon size
    • SpaceItemIconSizeInOnlyIconMode As Int [write only]
      Set item icon size if showIconOnly() called
    • SpaceItemTextSize As Int [write only]
      Set item text size
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int

gif1.gif
gif2.gif
mainGif.gif
screen1.png
screen2.png

gif1.gif

gif2.gif

mainGif.gif

screen1.png

screen2.png
 

Attachments

  • SpaceNavigationEx.zip
    13.6 KB · Views: 849
  • SpaceNavigationV1.0.zip
    40.2 KB · Views: 615
  • SpaceNavigationV1.3.zip
    45.1 KB · Views: 923
Last edited:

scsjc

Well-Known Member
Licensed User
Longtime User
Hello Don Manfred,
i try run the demo, but always have this result:

B4X:
** Activity (main) Pause, UserClosed = false **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: android.support.design.widget.FloatingActionButton
    at com.luseen.spacenavigation.SpaceNavigationView.onSizeChanged(SpaceNavigationView.java:231)
    at android.view.View.sizeChange(View.java:14932)
    at android.view.View.setFrame(View.java:14905)
    at android.view.View.layout(View.java:14813)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at anywheresoftware.b4a.BALayout.onLayout(BALayout.java:43)
    at android.view.View.layout(View.java:14817)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
    at android.view.View.layout(View.java:14817)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:433)
    at android.view.View.layout(View.java:14817)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
    at android.view.View.layout(View.java:14817)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
    at android.view.View.layout(View.java:14817)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
    at android.view.View.layout(View.java:14817)
    at android.view.ViewGroup.layout(ViewGroup.java:4631)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
    at android.view.Choreographer.doCallbacks(Choreographer.java:574)
    at android.view.Choreographer.doFrame(Choreographer.java:544)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    at dalvik.system.NativeStart.main(Native Method)
 

scsjc

Well-Known Member
Licensed User
Longtime User
and SDK 33 or >
33 ??????? .... 23 no?

i try all and i don't know where are the problem.

DonManfred tell about : And you need to have the google maven repository installed. See Info thread for b4a 6 ... and i don't know what i to do ... :(
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
33 ??????? .... 23 no?

i try all and i don't know where are the problem.

DonManfred tell about : And you need to have the google maven repository installed. See Info thread for b4a 6 ... and i don't know what i to do ... :(

Look DesignSupport lib 2 need:

  1. Install/Update "Android Support Repository" with the SDK Manager. Use at least support repository 33.

upload_2016-8-22_10-18-9.png
 

fredo

Well-Known Member
Licensed User
Longtime User
After replacing all three files from V 1.3 I experienced the following.

The longclick events on centrebutton or spaceitem are throwing the following errors:
B4X:
lib: NOTFOUND 'spacenavigationview1_oncentrebuttonlongclick
lib: NOTFOUND 'spacenavigationview1_onitemlongclick

Also the following properties are not available:
  • changeItemTextAtPosition
  • changeItemIconAtPosition
  • changeCenterButtonIcon
  • setCentreButtonRippleColor
  • changeSpaceBackgroundColor
Anything I'm doing wrong?
 

DonManfred

Expert
Licensed User
Longtime User
lib: NOTFOUND 'spacenavigationview1_oncentrebuttonlongclick
lib: NOTFOUND 'spacenavigationview1_onitemlongclick
You need to add the event-subs
Also the following properties are not available:
It was not listed on the versionhistory... Only three points.... I did not compare the versions.... I looked at history and added what i found in there
 
Top