Comments (8)
Upgrade to V1.2.2 "added onOpenMenu and onCloseMenu event Listener to catch open and close event"...
dependencies {
compile 'com.mxn.soul:flowingdrawer-core:1.2.2'
compile 'com.nineoldandroids:library:2.4.0'
}
regards.
from flowingdrawer.
Hello
I made gradle day. I am new in android programming. The listener must be added to LeftDrawerLayout or at the fragment?
thank you in advance
from flowingdrawer.
From your MyMenuFragment
public void onOpenMenu(){
// Your code here
Toast.makeText(getActivity(), "onOpenMenu", Toast.LENGTH_SHORT).show();
}
public void onCloseMenu(){
// Your code here
Toast.makeText(getActivity(), "onCloseMenu", Toast.LENGTH_SHORT).show();
((MainActivity) getActivity()).closeMenu();
}
from flowingdrawer.
thanks very much bicho
from flowingdrawer.
Hi bicho ,
I come back again to you because I block me for several days.
I have a class in which Jeu.java is the flowingDrawer (15 elements) and a variable static int ' cpt ' . So I 'd like to know how to change the icon of an element of the menu according to the value of ' cpt ' since the method of onOpenMenu MyMenuFragment ?
For example if cpt = 4 when opening the menu is the icon of the element that will change the menu 4 .
I hope I 'm not too thank you in advance.
I'm french so I made a translation of this message on google translation .
from flowingdrawer.
Hi @moudjames23 , i'm from Mexico :D
Try this...
public class MyMenuFragment extends MenuFragment {
private ImageView ivMenuUserProfilePhoto;
Menu menuNav; // Declaring menuNav from Menu
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_menu, container, false);
NavigationView navigationView = (NavigationView) view.findViewById(R.id.vNavigation);
menuNav = navigationView.getMenu(); // assing menu items to menuNav
ivMenuUserProfilePhoto = (ImageView) navigationView.getHeaderView(0).findViewById(R.id.ivMenuUserProfilePhoto);
setupHeader();
return setupReveal(view) ;
}
private void setupHeader() {
int avatarSize = getResources().getDimensionPixelSize(R.dimen.global_menu_avatar_size);
String profilePhoto = getResources().getString(R.string.user_profile_photo);
Picasso.with(getActivity())
.load(profilePhoto)
.placeholder(R.drawable.img_circle_placeholder)
.resize(avatarSize, avatarSize)
.centerCrop()
.transform(new CircleTransformation())
.into(ivMenuUserProfilePhoto);
}
public void onOpenMenu() {
Toast.makeText(getActivity(), "onOpenMenu", Toast.LENGTH_SHORT).show();
changeIcon(this.menuNav); // sending all items menu
}
public void onCloseMenu(){
Toast.makeText(getActivity(), "onCloseMenu", Toast.LENGTH_SHORT).show();
}
public void changeIcon(Menu menuNav){
// Your code here...
// For example changing title and icon to "feed item"
MenuItem feed= menuNav.findItem(R.id.menu_feed);
feed.setTitle("bla");
feed.setIcon(R.drawable.ic_heart_small_blue);
}
}
from flowingdrawer.
hello bicho ,
Thank you so much it take to wonder.
sorry I delayed you're a bit stuck with the controls at the high school .
thank you very much
from flowingdrawer.
Your welcome!!! :D please close the issue.
from flowingdrawer.
Related Issues (20)
- Show/Hide via code HOT 1
- What kind of methods to use?
- The RTL HOT 2
- How to add items in FlowingDrawer dynamically?
- issue when changing locale HOT 1
- Android P devices HOT 6
- java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed HOT 5
- 侧滑阴影
- Failed to run on Android P HOT 1
- code is clean but app crash when running HOT 1
- java.lang.OutOfMemoryError: com.mxn.soul.flowingdrawer_core.BuildLayerFrameLayout.dispatchDraw
- App crash HOT 3
- header divider not showing on right most part, on flowing view
- header divider not showing on right most part, on flowing view HOT 1
- Invalid Region.Op - only INTERSECT and DIFFERENCE HOT 2
- how use custom attributes, edMenuBackground?
- This should be in MIT Licensed in Anroid
- FlowinMenuLayout overlaped with NavigationBar
- Swipe drawer
- FlowingDrawer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flowingdrawer.