Android Question AppCompat ToolBar Icon

SNOUHyhQs2

Member
Licensed User
Longtime User
Im using this template: https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/

I want to show my app icon similar to this:
problem2.png


So i added this;
B4X:
ToolbarHelper.Icon = BitmapToBitmapDrawable(Application.Icon)   
'
ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow
ToolbarHelper.UpIndicatorDrawable = BitmapToBitmapDrawable(LoadBitmap(File.DirAssets, "hamburger.png"))

problem.png



Problem: the icon is too far from the UpIndicatorDrawable button. How do i fix this?
 

mberthe

Member
Licensed User
Longtime User
You can control the margins with this code:
B4X:
Dim jo As JavaObject = ACToolBarLight1
jo.RunMethod("setContentInsetStartWithNavigation", Array(5dip))
jo.RunMethod("setTitleMarginStart", Array(10dip))

Is there a identical solution for the built-in toolbar ?
 
Upvote 0
Top