Android Tutorial Material Design 3 - Using a ToolBar as ActionBar

frenkipi

Member
Licensed User
Longtime User
Hello guys, I have managed material design 2 to get to work, but now I am stucked with this example...
I don't know which folder or files do I have to use for

B4X:
#AdditionalRes: C:\Users\stm\Dropbox\Basic4Android\CustomLibsRes\b4a_appcompat, de.amberhome.objects.appcompat

Or is this path for a layout folder in project example?

Is this the path for appcompact library? Because I already have it in path configuration for additional libraries?

Thank you.
 

corwin42

Expert
Licensed User
Longtime User

As Erel said this is not needed anymore.

I'm currently updating the Material Design tutorials. 1+2 are updated for the latest B4A 6.0 and latest AppCompat 3.20 wrapper and the examples should work without problems. I hope that I will have Tutorial 3 (this one) ready tomorrow.

Note, that some properties for the Toolbar can now be set with the Designer (as "SetAsActionBar").
 

frenkipi

Member
Licensed User
Longtime User
Thank you all for your fast response.

On example project I am getting an error. I am using android SDK build tools rev 23.0.3, android support repository rev 35. What are you suggesting?



Regards!
 

corwin42

Expert
Licensed User
Longtime User
On example project I am getting an error. I am using android SDK build tools rev 23.0.3, android support repository rev 35. What are you suggesting?

Open the designer, load the layout file, save it again, retry.
 

JohnC

Expert
Licensed User
Longtime User

That worked great - thanks for responding quickly!
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
how to intercept event from the bitmap icon added with NavigationIconBitmap ?
thank you
 

corwin42

Expert
Licensed User
Longtime User
how to intercept event from the bitmap icon added with NavigationIconBitmap ?
thank you

If you have a menu added to your app you can use
B4X:
Sub Activity_ActionBarHomeClick

    
End Sub

If you don't have a Menu in your app you have to call ToolBar.InitMenuListener and use this event:
B4X:
Sub ToolBar_NavigationItemClick

End Sub
 

Lahksman

Active Member
Licensed User
Longtime User
If I'm not mistaken it's the following. Under point Misc in the first post.

You can use the ACActionBar object to control some ActionBar features like showing the "Up" indicator arrow.
B4X:
Dim ABHelper as ACActionBar

ABHelper.ShowUpIndicator = True
 

Roberto P.

Well-Known Member
Licensed User
Longtime User

Ok. Thanks your and Best regards
 

luke2012

Well-Known Member
Licensed User
Longtime User
Hi @corwin42. First of all my compliments for this wonderful and useful tutorial

I state that: "I like very much the look & feel of this actionbar"
But a have a couple of little question:

1)This is the only (available) solution to build a Material Design ActionBar in B4A ?
2) There is also a Navigation Drawer (material design) tutorial / solution ?

Thanks in advance for your reply!
 
Last edited:

corwin42

Expert
Licensed User
Longtime User
2) There is also a Navigation Drawer (material design) tutorial / solution ?
2) @corwin42 is working on a drawer. Don´t know whether of it´s actual state. Just read a few days ago he´s working on it...

The next version of the DesignSupport library will have a wrapper for the DrawerLayout and NavigationView. It will be totally conform with the material design guide (displays below (transparent) StatusBar but above ToolBar etc.)
For a Screenshot see here.

If I don't find any fatal bugs it will be released (end of) next week. Most work now is testing it with older Android Versions.
 

luke2012

Well-Known Member
Licensed User
Longtime User

Wow @corwin42 ! It's fantastic!
 

beeblomarv

Member
Licensed User
Longtime User






I am getting this error:


B4A version: 5.80
Parsing code. (0.00s)
Compiling code. (0.03s)
Compiling layouts code. (0.01s)
Generating R file. Error
res\values\themes.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
res\values\themes.xml:6: error: Error: No resource found that matches the given name: attr 'colorAccent'.
res\values\themes.xml:4: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
res\values\themes.xml:5: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
res\values\themes.xml:8: error: Error: No resource found that matches the given name: attr 'windowActionBar'.
res\values\themes.xml:9: error: Error: No resource found that matches the given name: attr 'windowActionModeOverlay'.
res\values\themes.xml:7: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…