Android Tutorial Material Design 4 - Modifyable and advanced Menu

miguelconde

Member
Licensed User
Longtime User
 

corwin42

Expert
Licensed User
Longtime User
How can deselect the click option ???
Thanks !!!
Your question seems to be related to the NavigationDrawer of the DesignSupport library. Please move your question to the DesignSupport library thread or open a new thread in the questions forum.
 

scsjc

Well-Known Member
Licensed User
Longtime User
Your question seems to be related to the NavigationDrawer of the DesignSupport library. Please move your question to the DesignSupport library thread or open a new thread in the questions forum.
thanks
 

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello @corwin42,
I am working on a project using appcompat (and a navigation drawer). App theme is an appcompat theme. I can't figure out why my custom toolbar does not have elevation any more. I think at the very beginning my app had toolbar bar elevetion. Now does not.
p.s.1 setElevation does not work, neither in designer.
Thank you for your time.
 

JohnC

Expert
Licensed User
Longtime User
What version of Android does the device have that doesn't show Elevation?

Android 5+ is needed to show the shadow/elevation.
 

yiankos1

Well-Known Member
Licensed User
Longtime User
What version of Android does the device have that doesn't show Elevation?

Android 5+ is needed to show the shadow/elevation.
Of course my friend, i know basics!
As i tried everything, this one fixed toolbar elevation: "Additionally you should disable the Background color in the properties.".
 

desof

Well-Known Member
Licensed User
Longtime User
Congratulations is a very good material contributed here!
And he was able to run all the examples successfully.
Is there any small example that makes use of Material motion?
 

desof

Well-Known Member
Licensed User
Longtime User
The Tabs ! create un material design here photo un shape wellow.
sorry my english ..
 

corwin42

Expert
Licensed User
Longtime User

AscySoft

Active Member
Licensed User
Longtime User
It is possible to use this type of menu "ACMenu" on any element (item) in CustomListView (lets say a 3 dot button)?
For example, "onclick_event" this material style menu will display some (different) actions, kind of "context menu" in Windows!
 

corwin42

Expert
Licensed User
Longtime User
It is possible to use this type of menu "ACMenu" on any element (item) in CustomListView (lets say a 3 dot button)?
For example, "onclick_event" this material style menu will display some (different) actions, kind of "context menu" in Windows!

Yes, sort of. You can use ACActionMenu of the AppCompat library for this.
Add ACActionMenu to your layout or add it by code (this will create the three dots item). Then use ACActionMenu1.Menu.Add() to add menu items.
 

MichalK73

Well-Known Member
Licensed User
Longtime User
Hmm. Seems to be a problem of the ToolBar that it kills the Activity_ActionBarHomeClick event when there is no menu at all.

Workaround:

Call ToolBar.InitMenuListener and then use the ToolBar_NavigationItemClick event.


I solved the problem as follows.
I added an empty invisible icon for the ToolBar (Private ToolBar As ACToolBarLight).
Then the function will work 'Activity_ActionBarHomeClick'
For me it looks like this:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("form_main")
    NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)
    NavDrawer.InitDrawerToggle
    ToolBar.InitMenuListener
    Activity.AddMenuItem3("  ","puste",Null,True)
    ToolBar.Color=AC.GetThemeAttribute("colorPrimary")
...
...
...
Now work listening ToolBar
B4X:
Sub puste_Click
    Return
End Sub

Sub Activity_ActionBarHomeClick
    NavDrawer.OpenDrawer
End Sub

If you're not using ToolBar you can get around as follows:
B4X:
Sub Activity_Touch (Action As Int, X As Float, Y As Float)
    If Action=0 Then
        If (X<60dip) And (Y<60dip) Then NavDrawer.OpenDrawer
    End If
End Sub

It works perfectly.
 

corwin42

Expert
Licensed User
Longtime User
I solved the problem as follows.
I added an empty invisible icon for the ToolBar (Private ToolBar As ACToolBarLight).
Then the function will work 'Activity_ActionBarHomeClick'
For me it looks like this:
[...]

Looks like a dirty hack.

You should use

B4X:
ToolBar.InitMenuListener

and use the ToolBar_NavigationItemClick event.
 

MichalK73

Well-Known Member
Licensed User
Longtime User
Sorry but it does not work, if ActionMenu is empty.
That's why I had to use dirty hack to create a blank icon (no menu) to 'ToolBar.InitMenuListener' began to work.
 

corwin42

Expert
Licensed User
Longtime User
Sorry but it does not work, if ActionMenu is empty.
That's why I had to use dirty hack to create a blank icon (no menu) to 'ToolBar.InitMenuListener' began to work.
Can you post an example project where it does not work ?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…