May 24, 2017 Replies: 43 In most cases AppCompat is no longer needed and will only make things more complicated. B4XPages example with dynamic menu: https://www.b4x.com/android/forum/threads/b4x-menu-badges.133301/ The project attached uses the powerful AppCompat library to replace the built-in ActionBar with a more robust ToolBar. The NavigationItemClick event is raised when the icon is clicked. You can set ToolbarHelper.ShowUpIndicator = True to show an up arrow instead. It will raise the same event. You can change the toolbar color in the manifest editor. Sliding side menu + dynamic menu items: https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/#post-509530 Example based on B4ADrawer: https://www.b4x.com/android/forum/threads/class-b4adrawer-sliding-drawer.97828/#post-616518 Edit: depending on your Android SDK version, you might get this error: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor; The solution is to add this line in the main activity: Code: Copy #AdditionalJar: androidx.arch.core:core-runtime Attachments upload_2017-5-24_12-18-26.png 7.3 KB · Views: 4,781 AppCompatExample.zip AppCompatExample.zip 9.9 KB · Views: 694 Last edited: Jun 23, 2023 Click to expand...
In most cases AppCompat is no longer needed and will only make things more complicated. B4XPages example with dynamic menu: https://www.b4x.com/android/forum/threads/b4x-menu-badges.133301/ The project attached uses the powerful AppCompat library to replace the built-in ActionBar with a more robust ToolBar. The NavigationItemClick event is raised when the icon is clicked. You can set ToolbarHelper.ShowUpIndicator = True to show an up arrow instead. It will raise the same event. You can change the toolbar color in the manifest editor. Sliding side menu + dynamic menu items: https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/#post-509530 Example based on B4ADrawer: https://www.b4x.com/android/forum/threads/class-b4adrawer-sliding-drawer.97828/#post-616518 Edit: depending on your Android SDK version, you might get this error: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor; The solution is to add this line in the main activity: Code: Copy #AdditionalJar: androidx.arch.core:core-runtime
Erel B4X founder Staff member Licensed User Longtime User May 24, 2017 #2 A simple solution based on jfeinstein10 SlidingMenu: https://www.b4x.com/android/forum/threads/jfeinstein10-slidingmenu-library.36482/#content Attachments AppCompatWithSlidingMenu.zip AppCompatWithSlidingMenu.zip 9.8 KB · Views: 5,259
A simple solution based on jfeinstein10 SlidingMenu: https://www.b4x.com/android/forum/threads/jfeinstein10-slidingmenu-library.36482/#content
vfafou Well-Known Member Licensed User Longtime User May 30, 2017 #3 Hello! When I try to compile, I'm getting the following error: Code: Copy B4A version: 7.01 Parsing code. (0.00s) Compiling code. (0.15s) Compiling layouts code. (0.02s) Organizing libraries. (0.00s) Generating R file. Error C:\Users\VF\Desktop\AppCompatWithSlidingMenu\AppCompat\Objects\bin\extra\res3\res\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'. C:\Users\VF\Desktop\AppCompatWithSlidingMenu\AppCompat\Objects\bin\extra\res3\res\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'. Any suggestion? Thank you in advance!
Hello! When I try to compile, I'm getting the following error: Code: Copy B4A version: 7.01 Parsing code. (0.00s) Compiling code. (0.15s) Compiling layouts code. (0.02s) Organizing libraries. (0.00s) Generating R file. Error C:\Users\VF\Desktop\AppCompatWithSlidingMenu\AppCompat\Objects\bin\extra\res3\res\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'. C:\Users\VF\Desktop\AppCompatWithSlidingMenu\AppCompat\Objects\bin\extra\res3\res\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'. Any suggestion? Thank you in advance!
DonManfred Expert Licensed User Longtime User May 31, 2017 #4 vfafou said: Any suggestion? Click to expand... I guess you are using an Android.jar from Api below 24... Use a more recent android.jar (25 as of today) and set it under Tools->Configure Paths
vfafou said: Any suggestion? Click to expand... I guess you are using an Android.jar from Api below 24... Use a more recent android.jar (25 as of today) and set it under Tools->Configure Paths
Erel B4X founder Staff member Licensed User Longtime User Jun 1, 2017 #5 The two examples were updated. An issue with the icon sizes is fixed (https://www.b4x.com/android/forum/t...r-constraint-icon-nav-size.80149/#post-507615).
The two examples were updated. An issue with the icon sizes is fixed (https://www.b4x.com/android/forum/t...r-constraint-icon-nav-size.80149/#post-507615).
Erel B4X founder Staff member Licensed User Longtime User Jun 8, 2017 #6 A new example that shows how to update or add menu items at runtime. Attachments AppCompatWithDynamicMenuAndBadge.zip AppCompatWithDynamicMenuAndBadge.zip 11.1 KB · Views: 6,752 Last edited: Jun 8, 2017
little3399 Active Member Licensed User Longtime User Jun 10, 2017 #9 AppCompatWithDynamicMenuAndBadge DEMO program, can't seem to run? Are there any requirements for the Android version? because it run once , it will go back to the os ...
AppCompatWithDynamicMenuAndBadge DEMO program, can't seem to run? Are there any requirements for the Android version? because it run once , it will go back to the os ...
woniol Active Member Licensed User Longtime User Jun 10, 2017 #11 Try it with the latest SlidingMenuWrapper 1.10 https://www.b4x.com/android/forum/attachments/slidingmenuwrapper-zip.51159/
Try it with the latest SlidingMenuWrapper 1.10 https://www.b4x.com/android/forum/attachments/slidingmenuwrapper-zip.51159/
Erel B4X founder Staff member Licensed User Longtime User Jun 11, 2017 #13 Now with a more colorful popup menu: The color is set in the manifest editor: Code: Copy <style name="ToolbarMenu" parent="Base.ThemeOverlay.AppCompat.ActionBar"> <item name="android:textColorPrimary">#fff</item> <item name="android:colorBackground">#0098FF</item> </style> And is set with this code: Code: Copy Dim jo As JavaObject = ACToolBarLight1 Dim xl As XmlLayoutBuilder jo.RunMethod("setPopupTheme", Array(xl.GetResourceId("style", "ToolbarMenu"))) Attachments AppCompatWithDynamicMenuAndBadge.zip AppCompatWithDynamicMenuAndBadge.zip 11.2 KB · Views: 4,344
Now with a more colorful popup menu: The color is set in the manifest editor: Code: Copy <style name="ToolbarMenu" parent="Base.ThemeOverlay.AppCompat.ActionBar"> <item name="android:textColorPrimary">#fff</item> <item name="android:colorBackground">#0098FF</item> </style> And is set with this code: Code: Copy Dim jo As JavaObject = ACToolBarLight1 Dim xl As XmlLayoutBuilder jo.RunMethod("setPopupTheme", Array(xl.GetResourceId("style", "ToolbarMenu")))
C Cassie Active Member Licensed User Longtime User Jun 21, 2017 #14 Hi Guys, any idea what could this error be "invalid resource directory name: C:\Users\Admin\Documents\Tutorials And Samples\B4a Samples\AppCompatWithDynamicMenuAndBadge\AppCompat\Objects\bin\extra\res2\res/values-b+sr+Latn" Thanks
Hi Guys, any idea what could this error be "invalid resource directory name: C:\Users\Admin\Documents\Tutorials And Samples\B4a Samples\AppCompatWithDynamicMenuAndBadge\AppCompat\Objects\bin\extra\res2\res/values-b+sr+Latn" Thanks
Erel B4X founder Staff member Licensed User Longtime User Jun 21, 2017 #16 Cassie said: values-b+sr+Latn Click to expand... This error is related to the Android build tools. You need to update to a newer version. You can use this manager: https://www.b4x.com/android/forum/t...ewer-versions-of-android-tools.80090/#content
Cassie said: values-b+sr+Latn Click to expand... This error is related to the Android build tools. You need to update to a newer version. You can use this manager: https://www.b4x.com/android/forum/t...ewer-versions-of-android-tools.80090/#content
C Cassie Active Member Licensed User Longtime User Jun 21, 2017 #17 Erel said: This error is related to the Android build tools. You need to update to a newer version. You can use this manager: https://www.b4x.com/android/forum/t...ewer-versions-of-android-tools.80090/#content Click to expand... I'm using the latest version of B4A Version 7.01.
Erel said: This error is related to the Android build tools. You need to update to a newer version. You can use this manager: https://www.b4x.com/android/forum/t...ewer-versions-of-android-tools.80090/#content Click to expand... I'm using the latest version of B4A Version 7.01.
C Cassie Active Member Licensed User Longtime User Jun 21, 2017 #18 DonManfred said: Which B4A Version are you using? Click to expand... I'm using the latest version of B4A Version 7.01.
DonManfred said: Which B4A Version are you using? Click to expand... I'm using the latest version of B4A Version 7.01.
lemonisdead Well-Known Member Licensed User Longtime User Jun 21, 2017 #19 Cassie said: I'm using the latest version of B4A Version 7.01. Click to expand... Not B4A but the Android SDK Build-Tools : https://developer.android.com/studio/index.html#command-tools For information : GUI SDK Manager https://www.b4x.com/android/forum/threads/gui-sdk-manager-for-newer-versions-of-android-tools.80090/
Cassie said: I'm using the latest version of B4A Version 7.01. Click to expand... Not B4A but the Android SDK Build-Tools : https://developer.android.com/studio/index.html#command-tools For information : GUI SDK Manager https://www.b4x.com/android/forum/threads/gui-sdk-manager-for-newer-versions-of-android-tools.80090/
DonManfred Expert Licensed User Longtime User Jun 21, 2017 #20 Cassie said: I'm using the latest version of B4A Version 7.01. Click to expand... Talking about B4A you are right. But Erel said that the issue is related to the installed Build-Tools. It should be a NEWER one than you are using. Install the newer 25.0.3. DEINSTALL all versions <25
Cassie said: I'm using the latest version of B4A Version 7.01. Click to expand... Talking about B4A you are right. But Erel said that the issue is related to the installed Build-Tools. It should be a NEWER one than you are using. Install the newer 25.0.3. DEINSTALL all versions <25