dexafree / materiallist Goto Github PK
View Code? Open in Web Editor NEWAn Android library aimed to get the beautiful CardViews that Google shows at its official design specifications
An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications
Is there any way to sort the card items (asc or desc)? I cannot find a way to do so in the adapter
I have this message when try to compile project
Error:Failed to find: com.github.dexafree:materiallist:2.3.2
it works only for version 2.0.1
I get this
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.dexafree.materialList.view.MaterialListView.add(com.dexafree.materialList.model.Card)' on a null object reference
when trying to use it in a fragment. my code looks like this
mMaterialListView = (MaterialListView)view.findViewById(R.id.material_listview);
BasicImageButtonsCard card = new BasicImageButtonsCard(view.getContext());
card.setTitle("Your title");
// card.setSubtitle("My subtitle!");
card.setDescription("Your description");
// card.setButtonText("OKAY!");
mMaterialListView.add(card);
Whats the most efficient way of using multiple card view layouts in a recycler view? for example a WelcomeCard and a SmallImageCard in the same recycler view.
It seems to me that there's currently no way to add more cards to the CardList once we've set up a MaterialListViewAdapter
with our initial list of Cards.
I'd like to introduce new cards when the user interacts with my existing set of cards (e.g. clicks on one of the buttons or dismisses a card with the swipe gesture).
I'm currently integrating your MaterialList into my App. It is a nice work!
But now I think it would be very usefull to define some cards in a xml - with their attributes (background-color, text-color, etc). I think it would be a nice feature.
Please provide us with apk sample !!
thank you.
I got this error with this version. I cant compile.
Note: there were 19 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning:com.dexafree.materialList.model.BasicButtonsCard: can't find superclass or interface com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BasicImageButtonsCard: can't find superclass or interface com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BigImageButtonsCard: can't find superclass or interface com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BigImageCard: can't find superclass or interface com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.SmallImageCard: can't find superclass or interface com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.WelcomeCard: can't find superclass or interface com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BasicButtonsCard: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BasicImageButtonsCard: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BigImageButtonsCard: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.BigImageCard: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.CardList: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.GridItemView: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.SmallImageCard: can't find referenced class com.dexafree.materialList.model.Card
Warning:com.dexafree.materialList.model.WelcomeCard: can't find referenced class com.dexafree.materialList.model.Card
Warning:there were 21 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
:app:proguardDebug FAILED
Error:Execution failed for task ':app:proguardDebug'.
java.io.IOException: Please correct the above warnings first.
Hi, I'm facing an issue.. My gradle build is failing because of multiple dex files for libcoreanimation. I checked the iml file and it is showing libcoreanimation 3.1.0 is imported by both your project and sticky list headers.. I'm defining your project as a dependency in my gradle file. Please fix it or provide a way to quick fix I'm a bit short on time.
Google uses it in their Keep App (http://cdn.ndtv.com/tech/images/gadgets/google_keep_app_update.jpg). This would be very great to have. There is already a library for manuel sorting and reordering available (http://nhaarman.github.io/ListViewAnimations/).
Hi! I am using this awesome library and I am trying to mix with picasso, but I need a ImageView to do this, and I do not know how do it, I tried to inflate the layout but it does not work. So I wonder if could you tell me how can I mix them, maybe if there was a "getImageView()" or something could it be more easy.
Thanks you, so much!
I tried to set an empty view but it doesn't work. Only the empty view is visible, also if the list is not empty..
Is there anybody that could try it?
When I rotate my device I received the following Exception:
Process: de.fh.budgetkeeper.debug, PID: 1353
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.fh.budgetkeeper.debug/de.fh.budgetkeeper.ui.MainActivity}: java.lang.ClassCastException: android.widget.AbsListView$SavedState cannot be cast to com.etsy.android.grid.StaggeredGridView$GridListSavedState
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3738)
at android.app.ActivityThread.access$900(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: android.widget.AbsListView$SavedState cannot be cast to com.etsy.android.grid.StaggeredGridView$GridListSavedState
at com.etsy.android.grid.StaggeredGridView.onRestoreInstanceState(StaggeredGridView.java:1292)
at android.view.View.dispatchRestoreInstanceState(View.java:12799)
at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:2657)
at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:791)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2643)
at android.view.View.restoreHierarchyState(View.java:12777)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java:465)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:969)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1917)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:544)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5241)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3738)
at android.app.ActivityThread.access$900(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
It seems to come from the saving of the list (MaterialListView) SavedState which will be given to the grid (MaterialStaggeredGridView) and can not be converted to GridListSavedState....?
Hello,
I'm having some troubles in implementing a custom card in my project.
I tried to follow your guide here:
https://github.com/dexafree/MaterialList/wiki/Create-your-own-Cards
But when I define the ItemView class like this:
public class CustomCardItemView extends GridItemView
AndroidStudio tells me that it cannot resolve the symbol 'GridItemView'.
It simply doesn't recognize/find it.
How can I solve this problem?
Thanks very much in advance
java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
at java.util.ArrayList.get(ArrayList.java:310)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
at com.dexafree.materialList.controller.SwipeDismissListener.isCurrentItemDismissable(SwipeDismissListener.java:359)
at com.dexafree.materialList.controller.SwipeDismissListener.onTouch(SwipeDismissListener.java:197)
at android.view.View.dispatchTouchEvent(View.java:8382)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2158)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2314)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)
at android.app.Activity.dispatchTouchEvent(Activity.java:2739)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2275)
at android.view.View.dispatchPointerEvent(View.java:8578)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4021)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3887)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3578)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3635)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5701)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5675)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5646)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5791)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:143)
at android.os.Looper.loop(Looper.java:122)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Nati
Your material list is very impressive! I want to use it with gradle. But when I add the dependency to my gradle configuration and sync it, then I'll get the following error:
Error:(33, 9) Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@icon value=(@drawable/app_icon) from AndroidManifest.xml:33:9
is also present at com.github.dexafree:materiallist:1.0.3:13:9 value=(@drawable/ic_launcher)
Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:31:5 to override
I think you should remove the android:icon field from the manifest in your library.
Whenever I try to initiate a card it says not valid. Even the sample one's in your wiki. I am using gradle dependency with version 2.0.7. I saw earlier in your post that you told someone to use 2.0.1, since it could fix the card issue. It still didn't for me. Are we supposed to have 2 different gradle dependencies for cards and the actual library?
Would appreciate help!
Okay I see that you updated it, but none of the sample cards are appearing. In the README you say to import the module samplecards and compile. Where is that? I thought it was supposed to all be included in the library
Thanks!
PS. Really awesome work
Can i add load more features on List of cards ?!!?
I am encoutering exception when adding BigImageButtonsCard.
The tracestack for the same is:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toUpperCase()' on a null object reference
at com.dexafree.materialList.cards.view.BaseButtonsCardItemView.build(BaseButtonsCardItemView.java:37)
at com.dexafree.materialList.cards.view.BaseButtonsCardItemView.build(BaseButtonsCardItemView.java:15)
at com.dexafree.materialList.controller.MaterialListViewAdapter.getView(MaterialListViewAdapter.java:42)
at com.nhaarman.listviewanimations.BaseAdapterDecorator.getView(BaseAdapterDecorator.java:125)
at com.nhaarman.listviewanimations.appearance.AnimationAdapter.getView(AnimationAdapter.java:142)
at android.widget.AbsListView.obtainView(AbsListView.java:2344)
at android.widget.ListView.makeAndAddView(ListView.java:1864)
at android.widget.ListView.fillDown(ListView.java:698)
at android.widget.ListView.fillSpecific(ListView.java:1356)
at android.widget.ListView.layoutChildren(ListView.java:1651)
at android.widget.AbsListView.onLayout(AbsListView.java:2148)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:543)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:890)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2072)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1829)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatc
I am using following code for creating and placing the card:
public static Card getBigImageCard( final Context mContext) {
SimpleCard card = new BigImageButtonsCard(mContext);
card.setDescription("Some Description");
card.setTitle("SomeTitle");
final String url = "wwww.google.com"
// Code to get some drawable here
card.setDrawable(d);
((BigImageButtonsCard) card).setDividerVisible(true);
((BigImageButtonsCard)card).setLeftButtonText("Open");
((BigImageButtonsCard)card).setLeftButtonText("Dismiss");
((BigImageButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener() {
@Override
public void onButtonPressedListener(View view, Card card) {
Intent urlIntent = new Intent(mContext, WebViewingActivity.class);
urlIntent.putExtra("webUrl", url);
mContext.startActivity(urlIntent);
} });
card.setDismissible(true);
return card;
}
Then to add the card:
mListView.add(getBigImageCard( Activity.this );
The same code works for BigImage card (after removing the code for buttons & divider of-course.)
When I use BigImageCard the description text is white, when I use SmallImageCard then the title is white, so the text is not visible to the user.
Any fix?
After upgrading the library to 2.0.0
I am getting multiple dex libraries issue:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/nhaarman/listviewanimations/util/Swappable;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
I found a bug, when I try to run the sample app on my phone with Android 5.0 or higher the app crashes with the following exception:
01-02 20:25:00.409 4019-4019/com.dexafree.materiallistviewexample E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.dexafree.materiallistviewexample, PID: 4019
java.lang.NullPointerException: Attempt to invoke interface method 'void android.support.v7.widget.RoundRectDrawableWithShadow$RoundRectHelper.drawRoundRect(android.graphics.Canvas, android.graphics.RectF, float, android.graphics.Paint)' on a null object reference
at android.support.v7.widget.RoundRectDrawableWithShadow.draw(RoundRectDrawableWithShadow.java:204)
at android.support.v7.widget.MyRoundRectDrawableWithShadow.draw(MyRoundRectDrawableWithShadow.java:9)
at android.view.View.getDrawableRenderNode(View.java:15388)
at android.view.View.drawBackground(View.java:15339)
at android.view.View.draw(View.java:15105)
at android.widget.FrameLayout.draw(FrameLayout.java:592)
at android.view.View.updateDisplayListIfDirty(View.java:14048)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14043)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:2594)
at android.view.View.draw(View.java:15117)
at android.widget.AbsListView.draw(AbsListView.java:4083)
at android.view.View.updateDisplayListIfDirty(View.java:14048)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14043)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14043)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14043)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14043)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14043)
at android.view.View.getDisplayList(View.java:14071)
at android.view.View.draw(View.java:14838)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.draw(View.java:15117)
at android.widget.FrameLayout.draw(FrameLayout.java:592)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2595)
at android.view.View.updateDisplayListIfDirty(View.java:14048)
at android.view.View.getDisplayList(View.java:14071)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:266)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:272)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:311)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2492)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2337)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1968)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:
How fix it?
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
E:\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output E:\Android\Projects\TypicalNSK\app\build\intermediates\dex\debug --input-list=E:\Android\Projects\TypicalNSK\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/nineoldandroids/animation/Animator$AnimatorListener;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
Thanks.
17:14:53.374 [ERROR] [org.gradle.BuildExceptionReporter]
17:14:53.374 [ERROR] [org.gradle.BuildExceptionReporter] UNEXPECTED TOP-LEVEL EXCEPTION:
17:14:53.374 [ERROR] [org.gradle.BuildExceptionReporter] com.android.dex.DexException: Multiple dex files define Lcom/nhaarman/listviewanimations/util/Swappable;
17:14:53.374 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.command.dexer.Main.run(Main.java:246)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.command.dexer.Main.main(Main.java:215)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.dx.command.Main.main(Main.java:106)
17:14:53.375 [ERROR] [org.gradle.BuildExceptionReporter]
I've seen your library on Reddit and decided to give it a try.
I used the BigImageButtonsCard
and noticed that there's no image displayed. Code snippet:
BigImageButtonsCard card = new BigImageButtonsCard();
card.setBitmap(R.drawable.test);
Using the following code instead worked pretty nicely:
Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.test);
card.setBitmap(b);
I identified the problem in the Card.java class. Resources.getSystem()
only provides access to system resources. We need a handle on the application's context to fetch application resources. See Resources (Android Documentation).
Best regards,
Olli
I am using 2.0.1 version of your the library and have encountered a very strange behaviour when adding welcome cards.
I am creating a new welcome card using:
SimpleCard card;
card = new WelcomeCard(this);
card.setTitle("Welcome!");
card.setDescription("If you're a new user, we recommend you take the tutorial.");
((WelcomeCard) card).setSubtitle("Take a quick tour ?");
((WelcomeCard) card).setButtonText("Okay!");
((WelcomeCard) card).setBackgroundColorRes(R.color.primary);
((WelcomeCard) card).setDividerColor(getResources().getColor(R.color.primary_dark));
((WelcomeCard) card).setDescriptionColor(getResources().getColor(R.color.icons));
card.setDismissible(true);
((WelcomeCard) card).setOnButtonPressedListener(new OnButtonPressListener() {
@Override
public void onButtonPressedListener(View view, Card card) {
card.dismiss();
Toast.makeText(MainActivity.this,"Coming Soon", Toast.LENGTH_LONG).show();
}
});
I am adding it to mListView using:
mListView.add(card);
Very strangely,
How can I set onscrolllistner and how to set onitemclicklistner for the entire card? Please help. I would like to hide the toolbar with the help of onscroll listener and I want an activity to be opened by clicking anywhere on the card.
How to set onscrolllistener and onitemclicklistner please help..
dimen name="card_corner_radius"
Changing this property no longer has any affect on cards. I wondered if it was intentional or if it will be fixed?
Hi dexafree i'm using your nice library and i am missing the onitemclick listener.
Is there a way to implement it ou it is plan for the next release ?
looking forward to hearing from you.
regards,
The adapter has a method to remove a card by passing the card to it, but there is no way to get a reference to a card by passing a card to it. So I can remove a card by calling
mListView.getMaterialListViewAdapter().remove(card)
but not get a reference to it, by calling
mListView.getMaterialListViewAdapter().get(card)
or
mListView.getMaterialListViewAdapter().getItem(card)
I want to modify a card's description from another function, after the card has been added to the listview
Hello, thanks for this great library.
I would like to request some help. I've followed the steps, but I still can't add the card to the Material List.
I've added the "compile 'com.github.dexafree:materiallist:2.3.0'" to dependencies.
and also this error while in the preview page.
how to solve?
thanks.
I am facing sensitivity issues regarding swipe to dismiss feature. Often while scrolling, I accidentally dismiss a card just by touching the card. The dismiss feature appears to be very sensitive to touch.
Is there a way to reduce sensitivity of of swipe to dismiss in Material List view ?
There is no way to get the index of the card in the OnButtonPressListener. I am programmatically adding cards and creating OnButtonPressListener for each using a for loop and I need to know the index of the card so I can fire the appropriate code depending on which card's buttons were pressed
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not resolve com.github.dexafree:materialList:2.0.3.
Required by:
SmartHome+:app:unspecified > com.github.dexafree:materiallist:2.0.3
> inconsistent module metadata found. Descriptor: com.github.dexafree:materiallist:2.0.3 Errors: bad module name: expected='materialList' found='materiallist'
Could not find com.android.support:cardview-v7:21.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/cardview-v7/21.0.0/cardview-v7-21.0.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/21.0.0/cardview-v7-21.0.0.jar
Required by:
SmartHome+:app:unspecified > com.github.dexafree:materiallist:2.0.3
Could not find com.android.support:appcompat-v7:21.0.3.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.3/appcompat-v7-21.0.3.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.3/appcompat-v7-21.0.3.jar
Required by:
SmartHome+:app:unspecified > com.github.dexafree:materiallist:2.0.3
When I try to remove the welcome card from the top of the adapter, my app crashes:
java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1 at java.util.ArrayList.get(ArrayList.java:310) at com.dexafree.materialList.MaterialListViewAdapter.getItem(MaterialListViewAdapter.java:78) at com.dexafree.materialList.view.MaterialListView$1.onDismiss(MaterialListView.java:88) at com.dexafree.materialList.controller.SwipeDismissListener$4.onAnimationEnd(SwipeDismissListener.java:311) at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034) at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43) at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:212) at android.app.ActivityThread.main(ActivityThread.java:5137) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) at dalvik.system.NativeStart.main(Native Method)
How I remove the card:
mListView.getMaterialListViewAdapter().remove(wc); mListView.getMaterialListViewAdapter().notifyDataSetChanged();
Hi,
I was recently making custom cards to be used with mListView. I found that serious performance issues if Text View Buttons (Left and Right) are replaced by actual buttons with icons. Frames drop while scrolling.
Has anyone else encountered same issue ? Is there a way around ?
In a scenario where cards are being used a templates for large amount of new content, it is important to have some identifier ID for each card instance apart from the just index position.
Though this small feature is relatively simple to add, but it has great utility.
When i import this into Eclipse, the project is broken with an xml issue on the material_basic_buttons.xml which says that the cardCornerRadius attribute does not exist?
I have created a new library project for materialLib
But when i am importing and running it in my project it shows
error inflating class android.support.v7.widget.cardview
and same for recyclerview
anybody please tell me how to solve this issue?
If there is no Card added yet, then an Exception is thrown from the SwipeDismissListener:
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
at com.dexafree.materialList.controller.SwipeDismissListener.onTouch(SwipeDismissListener.java:226)
at android.view.View.dispatchTouchEvent(View.java:8382)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2158)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2314)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)
at android.app.Activity.dispatchTouchEvent(Activity.java:2739)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2275)
at android.view.View.dispatchPointerEvent(View.java:8578)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4021)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3887)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3578)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3635)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5701)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5675)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5646)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5791)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java
On dismissing a BasicButtonsCard from a list. The left/right buttons disappears for the card that takes the place of the dismissed card.
Any solution for this?
I cannot find a way to animate the cards. I mean when they are loaded, there seems to be no way to animation individual cards, somewhat like in the Google Newsstand app, where cards fly upwards.
Any chance of adding support for animations?
OnButtonPressListener provides only a reference to TextView textView. So my question ist how to access the current card (and its metadata stored inside it) from within the Listener?
Is it good practice to declare a card instance final in order to access it from within the listener?
Example:
BasicButtonsCard card = new BasicButtonsCard();
card.setTitle(dataPojo.getTitle());
card.setDescription(dataPojo.getSource());
card.setLeftButtonText("Dislike");
card.setRightButtonText("Like");
card.setShowDivider(true);
card.setDismissible(true);
card.setOnLeftButtonPressedListener(new OnButtonPressListener() {
@Override
public void onButtonPressedListener(TextView textView) {
//Accessing "card" right here would only be possible if it was declared 'final'
restClient.postUpdate("Dismiss", card.getTitle());
card.dismiss();
}
});
materialListView.add(card);
For me it would be great if onButtonPressListener would also provide access to the card like
onButtonPressedListener(TextView textView, Card currentCard)
this method return -1 , so i got this error
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.xxx.xxx/xxx.ui.MainActivity}: java.lang.IllegalArgumentException: Can't have a viewTypeCount < 1
i don't know why...
mListView.setOnDismissCallback(new OnDismissCallback())
This function can not work.
Shouldn't the sample cards also be able to import via gradle into the own project?
import 'com.github.dexafree:materiallist-cards:x.x.x'
I was wondering how could one tinker with few properties of the cards, such as margin and padding, depth etc. without having to create custom card.
I tried to change divided length for Material list view but it didn't work.
In addition to this, it would be wonderful if a Progress bar indicator option could be given for each card.
Thanks
I've read the Material Design documentation and noticed that Google uses a slight divider between the content of a card and the supplemental actions. Here are some examples from the guidelines.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.