Skip to content

TheLuckyCoder/Expandable-Card-View

Repository files navigation

Expandable CardView

API Download License

Sample Project

For an example: checkout Sample App Code in repository.

Quick Setup

1. Include library

Using Gradle

dependencies {
    implementation 'net.theluckycoder.expandablecardview:expandablecardview:1.2.0'
}

Using Maven

<dependency>
  <groupId>net.theluckycoder.expandablecardview</groupId>
  <artifactId>expandablecardview</artifactId>
  <version>1.2.0</version>
  <type>pom</type>
</dependency>

2. Usage

  • In XML Layout:
<net.theluckycoder.expandablecardview.ExpandableCardView
    android:id="@+id/card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:layout_marginBottom="8dp"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    app:title="Card Title"
    app:description="Card Description"
    app:expanded="true"
    app:expand_duration="300" />
  • In Kotlin Code:
val card = findViewById<ExpandableCardView>(R.id.card)
card.cardTitle = "Card with Action"
card.cardDescription = "An expandable card with an action button"
card.setAction("Action", View.OnClickListener {
    Toast.makeText(this, "Button Clicked", Toast.LENGTH_SHORT).show()
})

Documentation

You can find all the usable methods documented here

License

Copyright 2019 The Lucky Coder

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.