Shmuel
Shmuel

Reputation: 3916

Android - Cards UI framework

I'm using the framework from here - cardsui

How can I add a share button to the top of the cards. I've implemented it in the xml with an on click method, but the app crashes when I press it and says that the method doesn't exist (yes, I added the method to the main java file. also to the card.java file but still the app crashes...).

Has anyone used this framework and encountered this?

Thank you

Upvotes: 1

Views: 9180

Answers (2)

Dionisis K.
Dionisis K.

Reputation: 171

You might want to check this addon for CardsUI: https://github.com/Androguide/cardsui-for-android

As developer wrote:

The Google Play cards come with more customization parameters than the other regular cards, those parameters include :

  • Title (String)
  • Description (String)
  • Stripe color (String)
  • Title Color (String)
  • Enable an overflow menu on the card. It's not finished yet, I still need to implement the popup menu when clicked (Boolean)
  • Enable touch feedback on click or disable it (Boolean)

If you replace the overflow menu with buttons, at least you get a boolean and then handle the actions accordingly.

Upvotes: 3

Booger
Booger

Reputation: 18725

I wonder if you should just use a simple ListView, and apply a custom background to your adapter to give it the card UI. Then you are just using a simple ListView (with no additional framework - ie. just standard Android UI).

I describe how I did this in the following SO answer: How to create Google + cards UI in a list view?

I would guess that you ARE able to add an onClickListener to the component of your card, as this is pretty standard Android (chances are the Framework you are using DOES support this). Don't know your specific issue unless you post more code.

Upvotes: 0

Related Questions