ExpandableCardView icon indicating copy to clipboard operation
ExpandableCardView copied to clipboard

Custom Attribute Background Color of Card and Title

Open anggaku opened this issue 6 years ago • 7 comments

Can I change the title and background color of the Card in ExpandableCardView? Thank you

anggaku avatar Jul 29 '18 01:07 anggaku

HI @AleSpero Thanks for your great library . I have same problem . is there any way change header section's background/text color ? 02

navidphoenix avatar Jul 30 '18 05:07 navidphoenix

Hello,

Thank you for choosing this library and sorry for the late reply,

I will add soon methods to change the card background. In the meantime, you can change che background in this way:

val myCard = findViewById(R.id.myCard)

myCard.findViewById(R.id.card).setBackground() //Or size, or radius, or everything you like.

Inside the ExpandableCardView there's a CardView whose identifier is R.id.card. You can get that specific view using findViewByid and then change the background.

The same applies to the header: inside the ExpandableCardView there's a linearlayout whose id is R.id.header. You can safely use that to change anything you want.

PS: If you want your app to be featured in the readme, please ask :)

Thank you!

Alessandro

AleSpero avatar Aug 07 '18 19:08 AleSpero

im unable to define val myCard = findViewById(R.id.myCard) please help

chetanupare avatar Oct 05 '18 09:10 chetanupare

Check the id of your card. Check if the id myCard is correct for you.

Alternatively, you can change the background in the xml file. In, expandable_cardview.xml file, you can do something like:

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/card" android:layout_width="match_parent" android:layout_height="wrap_content" app:cardBackgroundColor="@android:color/darker_gray">

<LinearLayout>   
</LinearLayout>

</android.support.v7.widget.CardView>

shubham08gupta avatar Oct 08 '18 09:10 shubham08gupta

Thanks brother.

On Mon, Oct 8, 2018 at 3:05 PM Shubham [email protected] wrote:

Check the id of your card. Check if the id myCard is correct for you.

Alternatively, you can change the background in the xml file. In, expandable_cardview.xml file, you can do something like:

<android.support.v7.widget.CardView xmlns:android=" http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/card" android:layout_width="match_parent" android:layout_height="wrap_content" app:cardBackgroundColor="@android https://github.com/android :color/darker_gray">

</android.support.v7.widget.CardView>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AleSpero/ExpandableCardView/issues/13#issuecomment-427773381, or mute the thread https://github.com/notifications/unsubscribe-auth/Alz2-lP7hdDOlj-aYXK5UpywBLz_qaYnks5uixxbgaJpZM4VlPrw .

chetanupare avatar Oct 08 '18 18:10 chetanupare

How can I change the title and arrow's color? And how can i hide the arrow icon if possible? Thankyou

frazaslam avatar Nov 27 '19 07:11 frazaslam

cannot change the size of title

HarshnilWalde avatar Oct 24 '22 08:10 HarshnilWalde