jmartinesp / GoogleNavigationDrawerMenu

Android Library for a DrawerLayout similar to the one in Google Apps
270 stars 76 forks source link

Layout designer error #14

Closed yoavst closed 10 years ago

yoavst commented 10 years ago

The following classes could not be instantiated: - org.arasthel.googlenavdrawermenu.views.GoogleNavigationDrawer (Open Class, Show Exception) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.UnsupportedOperationException   at android.content.res.BridgeResources.obtainTypedArray(BridgeResources.java:318)   at org.arasthel.googlenavdrawermenu.views.GoogleNavigationDrawer.configureWithTypedArray(GoogleNavigationDrawer.java:231)   at org.arasthel.googlenavdrawermenu.views.GoogleNavigationDrawer.(GoogleNavigationDrawer.java:89)   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)   at android.view.LayoutInflater.inflate(LayoutInflater.java:469)   at android.view.LayoutInflater.inflate(LayoutInflater.java:373)"

I think you should do nothing if it is View.isInEditMode()

jmartinesp commented 10 years ago

Fixed in commit ef857b9183a0405adcf77b1721ca312674ed8cd4.

yoavst commented 10 years ago

Did you update maven repo?

java.lang.NullPointerException at org.arasthel.googlenavdrawermenu.adapters.GoogleNavigationDrawerAdapter.getView(GoogleNavigationDrawerAdapter.java:146) at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220) at android.widget.AbsListView.obtainView(AbsListView.java:2263) at android.widget.ListView.makeAndAddView(ListView.java:1790) at android.widget.ListView.fillDown(ListView.java:691) at android.widget.ListView.fillFromTop(ListView.java:752) at android.widget.ListView.layoutChildren(ListView.java:1630) at android.widget.AbsListView.onLayout(AbsListView.java:2091) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:767) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:528) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:338) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332) at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:555) at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:544) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932) at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:544) at com.android.tools.idea.rendering.RenderService.render(RenderService.java:671) at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:483) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310) at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) at com.intellij.util.Alarm$Request$1.run(Alarm.java:327) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

jmartinesp commented 10 years ago

I forgot to put an exception for header and footer, too. I'll fix it ASAP.

jmartinesp commented 10 years ago

I think I fixed it, but I can't reproduce the error so I can't be sure about it. Are you using the XML version? With a header view?

yoavst commented 10 years ago

See https://github.com/yoavst/ohelshem

jmartinesp commented 10 years ago

I added if(!isInEditMode()) to the header and footer loading, so that should fix the bug.

Could you confirm this?

yoavst commented 10 years ago

Didn't fixed. I made a gradle sync before.

jmartinesp commented 10 years ago

Are you building the library or using gradle from maven? If it's the last, version 1.1.2 probably didn't make it to maven central repositories yet.

yoavst commented 10 years ago

from maven

jmartinesp commented 10 years ago

Could you rebuild your project now? It will load the new library version and we can see if it's fixed.

yoavst commented 10 years ago

I'm with 1.1.2 but same error.