CRED-CLUB / synth-android

Synth is CRED's inbuilt library for using Neumorphic components in your app.
https://blog.cred.club/team-cred/design/world-meet-neumorphism-open-sourcing-our-ui-framework/
Apache License 2.0
1.01k stars 106 forks source link

ElevatedView background colour #6

Closed astrit-veliu closed 3 years ago

astrit-veliu commented 3 years ago

Issue

ElevatedView

The issue I'm facing is when i try to set a background colour to ElevatedView, somehow it gets the default color predefined SynthUtils.defaultBaseColor in SynthUtils. I'm trying to set the background dynamic based on device theme.

Note: The PitView background doesn't have this issue.

Layout

This is a part of my layout which contains the ElevatedView:

<androidx.constraintlayout.widget.ConstraintLayout  
  android:id="@+id/relativeHeader"  
  android:layout_width="0dp"  
  android:layout_height="wrap_content"  
  android:layout_marginTop="8dp"  
  android:clipChildren="false"  
  app:layout_constraintEnd_toEndOf="parent"  
  app:layout_constraintStart_toStartOf="parent"  
  app:layout_constraintTop_toTopOf="parent">  

 <club.cred.synth.views.ElevatedView  
  android:id="@+id/headerPitView"  
  android:layout_width="0dp"  
  android:layout_height="0dp"  
  android:layout_margin="18dp"  
  app:layout_constraintBottom_toBottomOf="parent"  
  app:layout_constraintEnd_toEndOf="parent"  
  app:layout_constraintStart_toStartOf="parent"  
  app:layout_constraintTop_toTopOf="parent"  
  app:neuCornerRadius="20dp"  
  app:pitColor="?attr/lightBackgroundColor" />

..................

I'm using this dependency in build.gradle file:

dependencies {  
  implementation 'club.cred.android:synth:1.0.0'  
}  

Expectation

astrit-veliu commented 3 years ago

the issue was using wrong attributes, app:neuPlatformColor="?attr/lightBackgroundColor" fixed the problem