Skip to content

Instantly share code, notes, and snippets.

@amoozeshbebin
Created November 9, 2023 08:43
Show Gist options
  • Select an option

  • Save amoozeshbebin/25ba5c9decf4581120ceef6523c0b4fc to your computer and use it in GitHub Desktop.

Select an option

Save amoozeshbebin/25ba5c9decf4581120ceef6523c0b4fc to your computer and use it in GitHub Desktop.
neumorphism design card
dependencies:
implementation ("com.github.fornewid:neumorphism:0.3.2")
maven { url = uri("https://www.jitpack.io" ) }
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/maincolor"
tools:context=".MainActivity">
<soup.neumorphism.NeumorphCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="140dp"
android:padding="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:neumorph_backgroundColor="@color/background"
app:neumorph_shadowColorDark="@color/shadow_dark"
app:neumorph_shadowColorLight="@color/shadow_light"
app:neumorph_shadowElevation="5dp"
app:neumorph_shapeAppearance="@style/NeumorphismCard">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="15dp">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_launcher_foreground" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="25%"
android:textSize="17sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$159258"
android:textSize="21sp" />
</LinearLayout>
</LinearLayout>
</soup.neumorphism.NeumorphCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment