SNOUHyhQs2 Member Licensed User Longtime User Jun 19, 2017 #1 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: So i added this; Code: Copy 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: the icon is too far from the UpIndicatorDrawable button. How do i fix this?
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: So i added this; Code: Copy 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: the icon is too far from the UpIndicatorDrawable button. How do i fix this?
Erel B4X founder Staff member Licensed User Longtime User Jun 19, 2017 #2 You can control the margins with this code: Code: Copy Dim jo As JavaObject = ACToolBarLight1 jo.RunMethod("setContentInsetStartWithNavigation", Array(5dip)) jo.RunMethod("setTitleMarginStart", Array(10dip)) Upvote 0
You can control the margins with this code: Code: Copy Dim jo As JavaObject = ACToolBarLight1 jo.RunMethod("setContentInsetStartWithNavigation", Array(5dip)) jo.RunMethod("setTitleMarginStart", Array(10dip))
M mberthe Member Licensed User Longtime User Jul 9, 2017 #4 Erel said: You can control the margins with this code: Code: Copy Dim jo As JavaObject = ACToolBarLight1 jo.RunMethod("setContentInsetStartWithNavigation", Array(5dip)) jo.RunMethod("setTitleMarginStart", Array(10dip)) Click to expand... Is there a identical solution for the built-in toolbar ? Upvote 0
Erel said: You can control the margins with this code: Code: Copy Dim jo As JavaObject = ACToolBarLight1 jo.RunMethod("setContentInsetStartWithNavigation", Array(5dip)) jo.RunMethod("setTitleMarginStart", Array(10dip)) Click to expand... Is there a identical solution for the built-in toolbar ?
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2017 #5 I don't think so. I recommend you to switch to ACToolBar if you need more customization. Upvote 0