fornewid / neumorphism Goto Github PK
View Code? Open in Web Editor NEWTry to Neumorphism in Android (Just experimental!! π§ͺ)
Home Page: https://medium.com/@fornewid/neumorphism-in-android-9cf15e2122dc
License: Apache License 2.0
Try to Neumorphism in Android (Just experimental!! π§ͺ)
Home Page: https://medium.com/@fornewid/neumorphism-in-android-9cf15e2122dc
License: Apache License 2.0
Hi anyone, first thanks to the author for this library!
My question is as the title, I'm not sure how to achieve that effect and press and release a button
In the the picture that author attached has some kind of fade in and out on the light shadow
Version used:
com.github.fornewid:neumorphism:0.2.1
android api 23
XML:
<soup.neumorphism.NeumorphCardView android:id="@+id/neumorphCardView" style="@style/smallRoundedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/constraintLayout"/>
Style:
<style name="smallRoundedButton" parent="android:Widget"> <item name="android:padding">6dp</item> <item name="android:stateListAnimator">@animator/button_state_list_anim_neumorph</item> <item name="android:focusable">true</item> <item name="android:clickable">true</item> <item name="android:scaleType">center</item> <item name="neumorph_shadowElevation">4dp</item> <item name="neumorph_shadowColorLight">@color/lightShadow</item> <item name="neumorph_shadowColorDark">@color/darkShadow</item> <item name="neumorph_shapeType">flat</item> <item name="neumorph_shapeAppearance">@style/CustomShapeAppearance16</item> </style>
Logcat Error:
java.lang.OutOfMemoryError: Failed to allocate a 4759564 byte allocation with 634240 free bytes and 619KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:831) at android.graphics.Bitmap.createBitmap(Bitmap.java:808) at android.graphics.Bitmap.createBitmap(Bitmap.java:775) at soup.neumorphism.internal.blur.BlurProvider.blur(BlurProvider.kt:51) at soup.neumorphism.internal.blur.BlurProvider.blur(BlurProvider.kt:42) at soup.neumorphism.internal.blur.BlurProvider.blur$default(BlurProvider.kt:34) at soup.neumorphism.internal.shape.FlatShape$toBlurredBitmap$1.invoke(FlatShape.kt:92) at soup.neumorphism.internal.shape.FlatShape.toBlurredBitmap(FlatShape.kt:104) at soup.neumorphism.internal.shape.FlatShape.updateShadowBitmap(FlatShape.kt:84) at soup.neumorphism.NeumorphShapeDrawable.draw(NeumorphShapeDrawable.kt:283) at android.view.View.drawBackground(View.java:16370) at android.view.View.draw(View.java:16169) at android.view.View.draw(View.java:16090) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.draw(View.java:16181) at android.view.View.draw(View.java:16090) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1478) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16181) at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690) at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2728) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2642) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
its works fine in some newer android phone but when running on phone with android api 23 it will crash!!
how can i solve that?
i try to use normal card view and its works fine.
Light Source Direction Feature
Is there any feature, to specify the light source direction ?
For example: I want to change the direction of shadow, beneath my neumorphic widgets.
How do I do that in this library?
We can have some enum like:
LightSource.topLeft, LightSource.topRight, LightSource.top, bottom, right, left , etc. in order to specify the direction of light, and hence change the direction of shadow significantly.
Just like in title, i would like to be able to change corner radius on every type of shape :). I think your library is closest to being best one on Android. It misses some configuration additions. Maybe onTouch effects for buttons might be also a good idea (i didn't find on click effect while trying your lib out).
Hi, how can i have also normal Button and EditText features?
Version used: 0.2.0
Devices/Android versions reproduced on: Galaxy note 4
<soup.neumorphism.NeumorphCardView
android:layout_width="150dp"
android:layout_height="150dp"
app:neumorph_backgroundColor="@color/backColor"
app:neumorph_inset="12dp"
app:neumorph_shadowColorDark="@color/neu_card_dark"
app:neumorph_shadowColorLight="@color/neu_card_lighter"
app:neumorph_shadowElevation="4dp"
app:neumorph_shapeAppearance="@style/RectangleNeuCardViewForHomePage">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_stage" />
</soup.neumorphism.NeumorphCardView>
style:
<style name="RectangleNeuCardViewForHomePage">
<item name="cornerSizeBottomLeft">12dp</item>
<item name="cornerSizeBottomRight">12dp</item>
<item name="cornerSizeTopLeft">360dp</item>
<item name="cornerSizeTopRight">360dp</item>
</style>
i want to create this shape type (top corner different from bottom)
κ°μΈμ μΈ ν¬λ§μ΄μ§λ§ λΌλμ€ κ·Έλ£Ή λ²νΌλ μμμΌλ©΄ ν©λλ€ γ γ
μλλ‘μ΄λ μ€νλμ€ μ΄λ³΄μ΄μ§λ§ λ μ΄μμμ μΆκ°νλ©΄ μλλ‘μ΄λ μ€νλμ€μμ
μλ₯Όλ€μ΄ NeumorphImageButton λ₯Ό μΆκ°νλ©΄ μ€λ₯Έμͺ½μ λμμΈμ΄ 보μ¬μ§μ§ μκ³ κ°μλ¨Έμ μμ
λ§€μΌ νμΈνκ² λλ€μ..
Hi, is it normal that setText on NeumorphTextView during runtime, the shadow will not be redraw?
I'm not sure is it I'm doing it wrong or not.
<soup.neumorphism.NeumorphTextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:neumorph_shadowColorLight="?colorPrimary"
app:neumorph_shadowColorDark="?colorPrimaryDark"
app:neumorph_backgroundColor="?android:colorBackground"
android:textColor="?android:colorBackground"
android:text="10\n30"
app:layout_constraintTop_toTopOf="@id/some_view1"
app:layout_constraintBottom_toTopOf="@id/some_view2"
app:layout_constraintVertical_bias="0.25"
android:textSize="80sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
I would appreciate if you could resolve:
Edit Text in Neumorphism is available?
Version used:
Devices/Android versions reproduced on:
I would appreciate if you could attach:
Can we get an option to change radius of a widget? For example, I am using NeumorphImageButton and I would like to have a square button, but because this button has to be small, it becomes a circle when I make it below a certain size, and I can't seem to lower the radius to make it a rounded square.
μ μ¬μ§κ³Ό κ°μ΄ νκ³ μΆμλ° λΌμ΄λΈλ¬λ¦¬λ‘ νλ©΄ μ κ° νκ³ μνλ λ°©ν₯λλ‘ μμλλ€μ,,
μ μ¬μ§ μ²λΌ λ²νΌμ΄ λ¬λ€(?)λΌκ³ ννμ ν΄μΌνλ 건μ§,, νΉμ μ΄λ¬ν λ¬Έμ λ₯Ό μμ λ€λ©΄ ν΄κ²°λ°©λ²μ’ μλ €μ£Όμ€ μ μμκΉμ??
ꡬ체μ μ΄μ§ λͺ»ν μ§λ¬Έ μ£μ‘ν©λλ€..
StackTrace:
2020-08-28 15:36:26.484 2550-2550/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: soup.neumorphism.sample, PID: 2550
java.lang.RuntimeException: Unable to start activity ComponentInfo{soup.neumorphism.sample/soup.neumorphism.sample.MainActivity}: android.view.InflateException: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Error inflating class soup.neumorphism.NeumorphImageView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3555)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3707)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8016)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: android.view.InflateException: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Error inflating class soup.neumorphism.NeumorphImageView
Caused by: android.view.InflateException: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Error inflating class soup.neumorphism.NeumorphImageView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at soup.neumorphism.sample.MainActivity.onCreate(MainActivity.kt:12)
at android.app.Activity.performCreate(Activity.java:7957)
at android.app.Activity.performCreate(Activity.java:7946)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3530)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3707)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8016)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void soup.neumorphism.NeumorphShapeDrawable.setBackgroundDrawable(android.graphics.drawable.Drawable)' on a null object reference
2020-08-28 15:36:26.484 2550-2550/? E/AndroidRuntime: at soup.neumorphism.NeumorphImageView.setBackgroundDrawable(NeumorphImageView.kt:93)
at soup.neumorphism.NeumorphImageView.setBackground(NeumorphImageView.kt:89)
at android.view.View.<init>(View.java:6198)
at android.widget.ImageView.<init>(ImageView.java:193)
at android.widget.ImageView.<init>(ImageView.java:188)
at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:72)
at soup.neumorphism.NeumorphImageView.<init>(NeumorphImageView.kt:17)
at soup.neumorphism.NeumorphImageView.<init>(NeumorphImageView.kt:16)
at soup.neumorphism.NeumorphImageView.<init>(Unknown Source:8)
Problem: NeumorphImageView
is based on AppCompatImageView
and inside AppCompatImageView
's constructor, setBackgroundDrawable
is called before shapeDrawable
is initialized.
background = "#212121"
μ΄λ°μμΌλ‘ μ
νλ³ΌκΉνλλ° μ μ©μ΄ λμ§ μλ€μ ..
νΉμ λ°©λ² μμ λ€λ©΄ 곡μ λΆνλ립λλ€ ^^ !!
μλ
νμΈμ.
νΉμ ν₯νμ λ²νΌμ λ²νΌ ν°μΉ μ pressedν¨κ³Όλ₯Ό λ£μΌμ€ κ³νμ΄ μμΌμ κ°μ?
μ’μ ν루 λμΈμ!
I am trying to color of button with this but it is not working
<soup.neumorphism.NeumorphButton
android:id="@+id/button"
style="@style/Widget.Neumorph.Button"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginBottom="100dp"
android:text="Start Meditation"
android:background="#ff000"
app:layout_constraintBottom_toTopOf="@+id/button2"
app:layout_constraintEnd_toEndOf="@+id/button2"
app:layout_constraintStart_toStartOf="@+id/button2"
app:neumorph_shadowColorDark="#CCD1D9E6"
app:neumorph_shadowColorLight="#CCFFFFFF"
app:neumorph_shapeType="flat" />
Describe the request you'd like:
Use latest stable release.
Additional context:
https://developer.android.com/jetpack/androidx/releases/appcompat#version_120_3
I've tried
card.setBackgroundColor(ContextCompat.getColor(this,R
color.secondary))
but it is not working.
Version used:
Pixel 3 API29 & android 11
When adding a button with a different background color, we lose the light neumorphic shadow in the view. The dark one might be missing as well since when clicked the button does not seem to depress.
Added elevation to the widget which seems to somewhat fix the problem but now if you look closely the background of the view behind the neumorphic background does not respect the style set forth in the widget instance, and so we see unwanted edges behind the colored neumorphic background.
<soup.neumorphism.NeumorphButton
android:id="@+id/write_publish_button"
style="@style/Widget.Neumorph.Button"
android:layout_width="140dp"
android:layout_height="64dp"
android:layout_marginStart="12dp"
android:layout_marginTop="-12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:padding="12dp"
android:elevation="4dp"
android:background="@drawable/background_rounded_theme"
app:neumorph_shadowElevation="4dp"
android:text="Publish"
android:textColor="@color/default_text"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/write_entry_container"
app:layout_constraintVertical_bias=".6"
app:neumorph_backgroundColor="?attr/colorThemeWritingScreenMainDark"
app:neumorph_shadowColorDark="?attr/primaryColorDark"
app:neumorph_shadowColorLight="?attr/primaryColorLight"
app:neumorph_shapeAppearance="@style/NeuShapeCornerRound"
app:neumorph_shapeType="flat"
/>
<soup.neumorphism.NeumorphButton
android:id="@+id/write_save_button"
style="@style/Widget.Neumorph.Button"
android:layout_width="140dp"
android:layout_height="64dp"
android:layout_gravity="end"
android:layout_marginStart="12dp"
android:layout_marginTop="-12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:layout_weight="1"
android:gravity="center"
android:padding="12dp"
android:text="save"
android:textColor="?attr/TextColorMain"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/write_publish_button"
app:layout_constraintVertical_bias=".0"
app:neumorph_backgroundColor="?attr/primaryColor"
app:neumorph_shadowColorDark="?attr/primaryColorDark"
app:neumorph_shadowColorLight="?attr/primaryColorLight"
app:neumorph_shapeAppearance="@style/NeuShapeCornerRound"
app:neumorph_shapeType="flat"
/>
What if i want to use custom font using NeumorphButton ?
Right now i can't do that, or is there any support of doing this that i am missing?
Kindly reply.
Describe the request you'd like:
Request to add support for icons in NeumorphButton on either left or right and it would be amazing if we could add tint over them.
Additional context: NA
Describe the request you'd like:
A clear and concise description of what you want.
Additional context:
Add any other context or screenshots about the feature request here.
Sir It's working on MinSdk version 21
Can i have for MinSdk16??
Here is textview code i am using can you please correct it if there is any problem in code
<soup.neumorphism.NeumorphTextView
style="@style/Widget.Neumorph.TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"
android:textSize="30sp" />
and result it here
Describe the request you'd like:
Android has a benchmark tool to measure code performance, Jetpack Benchmark library.
I think, neumorphism performance is not good maybe.
So I wanna facts clearly.
RecyclerView with card view needs to be benchmarked by default.
Additional context:
<soup.neumorphism.NeumorphButton
android:id="@+id/btnNext"
android:layout_width="260dp"
android:layout_height="68dp"
android:layout_marginBottom="24dp"
android:text="test"
style="@style/TestButtonText"
android:gravity="center"
android:textAllCaps="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/startLine"
app:layout_constraintEnd_toStartOf="@id/endLine"
app:neumorph_shadowColorDark="@color/black"
app:neumorph_shadowColorLight="@color/transparent"
app:neumorph_backgroundColor="@color/red"
app:neumorph_shapeAppearance="@style/CustomTestShape"
app:neumorph_shapeType="pressed"
app:neumorph_shadowElevation="4dp"
/>
<style name="CustomTestShape">
<item name="neumorph_cornerFamily">rounded</item>
<item name="neumorph_cornerSize">34dp</item>
</style>
Version used:
Error in iport library in my project
version: 0.1.11.
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11.
Show Details
Affected Modules: app
I would like to use a library, but I am using this error when importing, makes many updates to the tools and android studio, nothing seems to solve
Version used: 0.3.0
Devices/Android versions reproduced on:
Android 10
Issues in Neumorph TextView
When there are more words than available width space in textview, shadows are not created in next lines except first line, only simple text is being shown in next lines.
When width is set to match_parent, stting gravity to centre or anything else does not align shadows as per gravity, it only aligns simple text, shadows remain at start.
Same is the case with setting padding, it doesn't move shadows.
I am not able to set gradient background to NeumorphCardView. Please give me example on how to do it.
Version used:
Devices/Android versions reproduced on: Bunch of emulators, Samsung S20+, Huawei Mate 10, Xiaomi Pocophone and some bunch of other phones (All the ones I tested on)
The issue is easily reproduced. Just put a FAB
or an ImageButton
inside a CardView
and click on it.
Also happens if the button is on a Dialog
or a ButtomSheet
I want to use <merge>
tag so I want to inherit from layout classes but they are final. NeumorphCardView in particular.
Describe the request you'd like:
If you add padding to increase neumorphism shadow and spacing,
it does not work on 'wrap_content'.
So it is better not to use padding
for both neumorphism shadow and padding
,
but add a separate property.
Maybe it would be nice if gap + padding
works as actual padding
.
<soup.neumorphism.NeumorphButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
Additional context:
Add any other context or screenshots about the feature request here.
Describe the request you'd like:
I create new sample of collection which has NeumorphCardView in viewHolder
Additional context:
This is issue, because when use NeumorphCardView in viewHolder collection lagging a lot.
THANK you very much for your great implementation of
this https://neumorphism.io/#723c3c
Playing with your source , i cannot get these two effects
Can you pls give me any direction , how i will get them ?
Thx a lot
<EditText
android:id="@+id/searchBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:autofillHints=""
android:drawableEnd="@android:drawable/ic_menu_search"
android:hint="@string/search"
android:inputType="textShortMessage"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<soup.neumorphism.NeumorphCardView
android:id="@+id/searchBySong"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp"
app:layout_constraintEnd_toStartOf="@+id/searchByPoster"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchBar">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTint="@color/yellowTextColor"
android:text="Option1"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/yellowTextColor" />
</soup.neumorphism.NeumorphCardView>
<soup.neumorphism.NeumorphCardView
android:id="@+id/searchByPoster"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/searchBySong"
app:layout_constraintTop_toBottomOf="@+id/searchBar">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTint="@color/redTextColor"
android:text="Option2"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/redTextColor" />
</soup.neumorphism.NeumorphCardView>
</LinearLayout>
Describe the request you'd like:
Additional context:
Describe the request you'd like:
A clear and concise description of what you want.
Additional context:
Add any other context or screenshots about the feature request here.
RecyclerView is configured correctly: only a few ViewHolders are created, therefore views shouldn't be recreated.
My item view consists of TextView within NeumorphCardView.
<?xml version="1.0" encoding="utf-8"?>
<soup.neumorphism.NeumorphCardView 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="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="-3.1dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="-3.1dp"
app:neumorph_shadowColorDark="?attr/neumorphDarkColor"
app:neumorph_shadowColorLight="?attr/neumorphLightColor"
app:neumorph_shadowElevation="4dp"
app:neumorph_shapeAppearance="@style/NeumorphRounded5dp"
app:neumorph_shapeType="flat">
<TextView
android:id="@+id/itemGroupText"
style="@style/Button.Cancel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="start"
android:padding="16dp"
android:textSize="16sp"
tools:text="Group 1" />
</soup.neumorphism.NeumorphCardView>
Maybe issue is due to dirty: Boolean
variable in NeumorphShapeDrawable. It could become true for some reason when it is used in RecyclerView. I think so because profiler says that Shape.updateShadowBitmap() takes a lot of time.
Hey! Can you please suggest me or integrate in this project a way to add background xmls to NeumorphCardView? I want to show a gradient in a view but currently I can only fill a single color into it.
Thanks
Thanks for such a great library, i am working on app that does not need to support dark mood. There is no such option in this library
Version used: 0.2.1
Devices/Android versions reproduced on: Android 10
When i try to set different text from java class, only previously set text(in xml) shadow & elevation shows in layout with new text.
for examaple,
suppose, in xml, "Hello World" text has been set in a soup.neumorphism.NeumorphTextView -> at this stage everything looks good.
then when i change this text to a new one from java class, suppose "Hello There!" -> shadow and elevation style remains the same of "Hello World" but text changes to new one "Hello There!". This means neumorphic effect of text "Hello World" remains there even if i changed the text and new neumorphic effect of text "Hello There!" does not drawn. it looks like visible text is different from neumorphic text in background.
There are number of issues in soup.neumorphism.NeumorphTextView:
All the above issues makes it ugly when text is more than available screen space, if text is not set in xml then it does not draw neumorphic effect even if text is set from java class.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.