Comments (9)
Yeah, this isn't supported at the moment. I'll see if I can come up with a good approach for how to handle this.
from android-menudrawer.
Hi,
I have exactly the same error in my application.
Is there a dirty workaround available now, until you find a beautiful solution?
As the issue is a saved state, is there a way to reset it to be like I am launching the application in the new state (portrait or landscape)? I don't use onRestore in my activity and I see the issue is there.
I just removed all the code I used in my application to manage the landscape (which disables the code menu drawer and replace it by a classical listview) because I believed the update would implement a working version of the landscape mode (static mode).
Anyway thank you for the library.
Regards
from android-menudrawer.
Can you check if the changes I pushed to the dev branch solves this?
from android-menudrawer.
Thank you for your rapidity !
It is working great on my application.
from android-menudrawer.
I noticed a little bug.
When I launch the app in landscape (with the statically opened menudrawer) or if I rotate, the little triangle to show the selected item in the meny doesn't appear.
This is my init:
private void initializeSidebar(Bundle inState) {
if (inState != null) {
mActivePosition = inState.getInt(STATE_ACTIVE_POSITION);
}
mMenuDrawer = MenuDrawer.attach(this, MenuDrawer.MENU_DRAG_CONTENT, Position.LEFT, !portrait);
mMenuDrawer.setContentView(R.layout.main);
List<Item> items = new ArrayList<Item>();
for (ActionChoice current : ActionChoice.values()) {
items.add(new Item(current.toText(), current.getIcon()));
}
MenuListView mList = new MenuListView(this);
mList.setTopShadow(true);
mAdapter = new MenuAdapter(MainActivity.this, items, mActivePosition, mMenuDrawer);
mList.setAdapter(mAdapter);
mList.setOnItemClickListener(mItemClickListener);
mList.setOnScrollChangedListener(new MenuListView.OnScrollChangedListener() {
@Override
public void onScrollChanged() {
mMenuDrawer.invalidate();
}
});
mMenuDrawer.setMenuView(mList);
mMenuDrawer.setDropShadowSize(InterfaceFunctions.convertDpToPixel(4, this));
}
from android-menudrawer.
You have to call MenuDrawer#setActiveView(...)
for the indicator to show.
from android-menudrawer.
Thank you! I forgot to disable another isPortrait() check I used before the library update.
I am now doing like that:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
Object item = getItem(position);
if (item instanceof Category) {
if (v == null) {
v = mContext.getLayoutInflater().inflate(R.layout.md__category, parent, false);
}
((TextView) v).setText(((Category) item).mTitle);
} else {
if (v == null) {
v = mContext.getLayoutInflater().inflate(R.layout.md__item, parent, false);
}
TextView tv = (TextView) v;
...
}
v.setTag(R.id.mdActiveViewPosition, position);
if (position == mActivePosition) {
try {
//TODO search why it crashes here!
mMenuDrawer.setActiveView(v, position);
} catch (Exception e) {
e.printStackTrace();
}
...
}
I noticed that sometimes (with the old library version of course) my users have some crashes on the setActiveView().
As it doesn't happen a lot (like one time per week) and I have several thousands of users, I thought it was not important. But now I am reworking on this part, I take the chance to tell you about it.
Unfortunately I don't find the logs... But may the way I am doing it (in getView) is a bad practice?
from android-menudrawer.
With ListView you have to set the active view in getView() since the view for the position can potentially change every time it's shown.
Next time it crashes, feel free to open a new issue.
from android-menudrawer.
Hi.. How to set the First List Item as Default when launch the Application? when i use list.performItemClick(), i am getting errors. Pls Help me to resolve this. Thank you.
from android-menudrawer.
Related Issues (20)
- Left menu over the action bar HOT 1
- menudrawer with Toolbar HOT 1
- the right side overlaydrawer could not drag freely as left side.
- Menu drawer toggle events HOT 1
- I wonder how can I do menudrawer to not be animated at activity starting time.
- why it's deprecated? HOT 5
- Can't use library using gradle HOT 1
- StackOverflow Issue
- FloatMath has been removed in API 23 HOT 2
- Can I draw the menu with a button click HOT 1
- issue on drawer item click
- drawer item one is to show and another hide
- Noclass definition found
- Use menudrawer across multiple activities
- how to disable open by dragging the edge?
- some think bug on aapt2 HOT 1
- java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1c HOT 7
- How to remove MenuDrawer from my rootView
- Menudrawer left menu Crash just in android API 16 & 17
- Crashed!!! java.lang.UnsupportedOperationException: Can't convert value at index 2 to dimension: type=0x3
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 android-menudrawer.